Subversion Repositories Scribus

Rev

Rev 5504 | Rev 5512 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
1641 cbradney 7
#ifndef PREFS_H
8
#define PREFS_H
9
 
10
#include <qdialog.h>
11
#include <qbuttongroup.h>
12
#include <qcombobox.h>
13
#include <qgroupbox.h>
14
#include <qlabel.h>
15
#include <qpushbutton.h>
16
#include <qradiobutton.h>
17
#include <qspinbox.h>
18
#include <qwidget.h>
19
#include <qlayout.h>
20
#include <qtoolbutton.h>
21
#include <qframe.h>
22
#include <qcheckbox.h>
23
#include <qwidgetstack.h>
24
#include <qpixmap.h>
25
#include <qslider.h>
26
#include <qlineedit.h>
27
#include <qfiledialog.h>
28
 
29
class QListView;
30
 
2969 craig 31
#include "scribusapi.h"
1641 cbradney 32
#include "scribusstructs.h"
33
 
34
#include "mspinbox.h"
35
#include "scribus.h"
36
#include "prefsdialogbase.h"
37
class TabTypograpy;
38
class HySettings;
39
class CMSPrefs;
5352 cbradney 40
//class KeyManager;
1641 cbradney 41
class TabGuides;
42
class TabTools;
43
class TabCheckDoc;
44
class TabPDFOptions;
45
class FontPrefs;
46
class DocumentItemAttributes;
1701 cbradney 47
class TOCIndexPrefs;
2769 fschmid 48
class MarginWidget;
2834 cbradney 49
class PrefsManager;
2901 fschmid 50
class PageLayouts;
5326 cbradney 51
class TabExternalToolsWidget;
5352 cbradney 52
class TabKeyboardShortcutsWidget;
1641 cbradney 53
 
54
#include "langmgr.h"
55
 
2969 craig 56
class SCRIBUS_API Preferences : public PrefsDialogBase
1641 cbradney 57
{
58
        Q_OBJECT
59
 
60
public:
4645 subik 61
 
62
        /*!
63
        \author Franz Schmid
64
        \brief Constructor for Preferences dialog box
65
        \param parent QWidget pointer to parent window
66
        */
2834 cbradney 67
        Preferences( QWidget* parent);
4645 subik 68
        ~Preferences(){};
69
        /*!
70
        \author Franz Schmid
71
        \brief Preferences (Display, Display Size). Draws ruler depending on scaling factor
72
        */
2873 cbradney 73
        void drawRuler();
74
        void updatePreferences();
1641 cbradney 75
 
76
        QString prefsPageSizeName;
77
        //const QString getSelectedGUILang( void );
78
        QString selectedGUILang;
79
 
2873 cbradney 80
 
5507 subik 81
        QWidget* tabGeneral;
1641 cbradney 82
        QLabel* TextLabel1_2;
5507 subik 83
        QSpinBox* wheelJumpSpin;
1641 cbradney 84
        QSpinBox* Recen;
85
        QButtonGroup* ButtonGroup1;
86
        QLabel* guiLangLabel;
87
        QLabel* TextGstil;
88
        QLabel* TextGstil2;
3940 tsoots 89
        QLabel* TextGstil3;
1641 cbradney 90
        QSpinBox* GFsize;
3940 tsoots 91
        QSpinBox* GTFsize;
1641 cbradney 92
        QComboBox* guiLangCombo;
93
        QComboBox* GUICombo;
5507 subik 94
        QComboBox* unitCombo;
5342 cbradney 95
        QCheckBox* showSplashCheckBox;
96
        QLabel* showSplashLabel;
1641 cbradney 97
        QLabel* unitComboText;
98
        QGroupBox* GroupBox200;
99
        QLabel* PfadText;
100
        QLineEdit* Docs;
101
        QToolButton* FileC;
102
        QLabel* PfadText2;
103
        QLineEdit* ProPfad;
104
        QToolButton* FileC2;
105
        QLabel* PfadText3;
106
        QLineEdit* ScriptPfad;
107
        QToolButton* FileC3;
108
        QLabel* PfadText4;
2093 cbradney 109
        QLineEdit* DocumentTemplateDir;
1641 cbradney 110
        QToolButton* FileC4;
111
 
112
        TabGuides* tabGuides;
113
 
114
        QLabel* TextLabel4c;
115
 
116
        TabTypograpy* tabTypo;
117
 
118
        QWidget* tabView;
119
        QButtonGroup* pageBackground;
120
        QLabel* textLabel9;
121
        QCheckBox* checkLink;
122
        QCheckBox* checkFrame;
123
        QCheckBox* checkPictures;
2353 fschmid 124
        QCheckBox* checkControl;
2863 fschmid 125
        QCheckBox* checkRuler;
1641 cbradney 126
        QPushButton* backColor;
127
        QCheckBox* checkUnprintable;
128
        QGroupBox* groupScratch;
129
        MSpinBox* topScratch;
130
        MSpinBox* bottomScratch;
131
        MSpinBox* leftScratch;
132
        MSpinBox* rightScratch;
133
        QLabel* TextLabel7s;
134
        QLabel* TextLabel5s;
135
        QLabel* Linkss;
136
        QLabel* Rechtss;
2872 fschmid 137
        QGroupBox* groupGap;
138
        MSpinBox* gapVertical;
139
        MSpinBox* gapHorizontal;
140
        QLabel* TextLabel5sg;
141
        QLabel* TextLabel7sg;
1641 cbradney 142
 
143
        TabTools* tabTools;
144
 
145
        HySettings* tabHyphenator;
146
        FontPrefs* tabFonts;
147
        TabCheckDoc* tabDocChecker;
148
        CMSPrefs* tabColorManagement;
149
        TabPDFOptions* tabPDF;
150
        DocumentItemAttributes* tabDefaultItemAttributes;
1701 cbradney 151
        TOCIndexPrefs* tabDefaultTOCIndexPrefs;
5326 cbradney 152
        TabExternalToolsWidget* tabExtTools;
5352 cbradney 153
        TabKeyboardShortcutsWidget* tabKeyboardShortcuts;
154
//      KeyManager* tabKeys;
1641 cbradney 155
 
4649 fschmid 156
/*      QLabel* textLabelP;
1641 cbradney 157
        QWidget* tab_5;
158
        QGroupBox* preview;
159
        QComboBox* PreviewSize;
4649 fschmid 160
*/
5507 subik 161
        QWidget* tabDocument;
1641 cbradney 162
        QButtonGroup* GroupSize;
163
        QLabel* GZText2;
4555 cbradney 164
        QComboBox* pageSizeComboBox;
165
        QComboBox* pageOrientationComboBox;
1641 cbradney 166
        QLabel* GZText1;
167
        QLabel* GZText3;
168
        QLabel* GZText4;
169
        MSpinBox* pageWidth;
170
        MSpinBox* pageHeight;
2901 fschmid 171
        PageLayouts* docLayout;
2769 fschmid 172
        MarginWidget* GroupRand;
1641 cbradney 173
        QGroupBox* GroupAS;
174
        QLabel* ASText;
175
        QSpinBox* ASTime;
176
        QGroupBox* urGroup;
177
        QLabel* urLabel;
178
        QSpinBox* urSpinBox;
179
        QGroupBox* CaliGroup;
180
        QLabel* CaliText;
181
        QLabel* CaliRuler;
182
        QSlider* CaliSlider;
183
        QLabel* CaliAnz;
5326 cbradney 184
        /*QWidget* ExtTool;
2925 cbradney 185
        QGroupBox* ghostscriptGroup;
186
        QLabel* ghostscriptLabel;
187
        QLineEdit* ghostscriptLineEdit;
188
        QToolButton* ghostscriptChangeButton;
1641 cbradney 189
        QCheckBox* GSantiText;
190
        QCheckBox* GSantiGraph;
2703 fschmid 191
        QSpinBox* GSResolution;
192
        QLabel* GSResText;
2925 cbradney 193
        QGroupBox* groupImageEditor;
194
        QLabel* imageEditorLabel;
195
        QLineEdit* imageEditorLineEdit;
5326 cbradney 196
        QToolButton* imageEditorChangeButton;*/
5507 subik 197
        QWidget* tabMiscellaneous;
4649 fschmid 198
//      QGroupBox* groupPrint;
199
//      QCheckBox* ClipMarg;
200
//      QCheckBox* DoGCR;
1641 cbradney 201
        QCheckBox* AskForSubs;
2263 fschmid 202
        QCheckBox* stylePreview;
2833 fschmid 203
        QCheckBox* startUpDialog;
4645 subik 204
        //! \brief lorem ipsum
2784 subik 205
        QGroupBox* groupLI;
206
        QCheckBox* useStandardLI;
207
        QSpinBox* paragraphsLI;
208
        QLabel* paraLabelLI;
1641 cbradney 209
 
1790 cbradney 210
        double unitRatio;
1641 cbradney 211
        double PFactor;
212
        double Pagebr;
213
        double Pageho;
2901 fschmid 214
        int choosenLayout;
1641 cbradney 215
        int docUnitIndex;
216
        double DisScale;
4026 craig 217
        ScribusMainWindow *ap;
1641 cbradney 218
        QColor colorPaper;
219
 
3213 craig 220
signals:
4645 subik 221
        /// \brief Panels listen to this and save their changes when they get it.
3213 craig 222
        void accepted();
1641 cbradney 223
 
224
public slots:
4645 subik 225
        /// \brief Overridden to emit accepted(), which plugin panels use
3213 craig 226
        void accept();
227
 
4645 subik 228
        /*!
229
        \author Franz Schmid
230
        \brief Runs QFileDialog to get Preferences (General) Path to Documents directory
231
        */
1641 cbradney 232
        void changeDocs();
4645 subik 233
        /*!
234
        \author Franz Schmid
235
        \brief Runs QFileDialog to get Preferences (General) Path to Colour Profiles directory
236
        */
1641 cbradney 237
        void changeProfs();
4645 subik 238
        /*!
239
        \author Franz Schmid
240
        \brief Runs QFileDialog to get Preferences (General) Path to Scripts directory
241
        */
1641 cbradney 242
        void changeScripts();
4645 subik 243
        /*!
244
        \author Riku Leino
245
        \brief Runs QFileDialog to get Preferences (General) Path to Document Templates directory
246
        */
2093 cbradney 247
        void changeDocumentTemplates();
5326 cbradney 248
        /*
4645 subik 249
        \author Craig Bradney
250
        \brief Runs QFileDialog to get Preferences Path to Ghostscript
5326 cbradney 251
 
2925 cbradney 252
        void changeGhostscript();
5326 cbradney 253
 
4645 subik 254
        \author Craig Bradney
255
        \brief Runs QFileDialog to get Preferences Path to Image Editor
5326 cbradney 256
 
257
        void changeImageEditor();
4645 subik 258
        */
259
        /*!
260
        \author Franz Schmid
261
        \brief Preferences ([dox?], [dox?]), Sets Paper color [dox?]
262
        */
2925 cbradney 263
        virtual void changePaperColor();
264
 
4645 subik 265
        /*!
266
        \author Franz Schmid
267
        \brief Preferences (Document / Page Size), switches default between Facing Pages and swaps text labels for margin guides
268
         */
2901 fschmid 269
        void setDS(int layout);
4645 subik 270
        /*!
271
        \author Franz Schmid
272
        \brief Preferences (Document / Page Size), sets Page width values
273
        \param v Width value
274
        */
1641 cbradney 275
        void setPageWidth(int v);
4645 subik 276
        /*!
277
        \author Franz Schmid
278
        \brief Preferences (Document / Page Size), sets Page height values
279
        \param v Height value
280
        */
1641 cbradney 281
        void setPageHeight(int v);
2923 fschmid 282
        void setPageSize();
4645 subik 283
        /*!
284
        \author Franz Schmid
285
        \brief Preferences (Document / Page Size), sets Page size values. Connects signals for setting page dimensions.
286
        \param gr Standard page size value (eg A4)
287
        */
288
        void setSize(const QString &gr);
289
        /*!
290
        \author Franz Schmid
291
        \brief Preferences (Document / Page Size), sets Page orientation value and page dimensions
292
        \param ori Orientation value
293
        */
1641 cbradney 294
        void setOrien(int ori);
4645 subik 295
        /*!
296
        \author Franz Schmid
297
        \brief Preferences (General, Units). Sets scaling factors and units descriptions when default units are changed. Updates preference values
298
        */
1641 cbradney 299
        void unitChange();
4645 subik 300
        /*!
301
        \author Franz Schmid
302
        \brief Preferences (Display, Display Size). Sets Scale for ruler scale
303
        */
1641 cbradney 304
        void setDisScale();
305
        void switchCMS(bool enable);
306
 
3213 craig 307
protected:
2925 cbradney 308
 
3213 craig 309
        // Scans plugins for those that want to add a prefs widget and
310
        // hooks them up to the dialog.
311
        void addPlugins();
2925 cbradney 312
 
313
        QHBoxLayout* groupImageEditorLayout;
314
        QVBoxLayout* groupGhostScriptLayout;
315
        QHBoxLayout* ghostscriptLayout;
316
 
1641 cbradney 317
        QGridLayout* tabLayout;
318
        QGridLayout* ButtonGroup1Layout;
319
        QGridLayout* GroupBox200Layout;
4649 fschmid 320
//      QGridLayout* tabLayout_5;
321
//      QHBoxLayout* previewLayout;
1641 cbradney 322
        QHBoxLayout* Layout3;
323
        QHBoxLayout* tabLayout_7;
324
        QVBoxLayout* Layout21;
325
        QVBoxLayout* GroupSizeLayout;
326
        QGridLayout* Layout6;
327
        QHBoxLayout* Layout5_2;
3389 fschmid 328
        QHBoxLayout* GroupASLayout;
1641 cbradney 329
        QVBoxLayout* CaliGroupLayout;
330
        QHBoxLayout* layout15ca;
331
        QVBoxLayout* ExtToolLayout;
2925 cbradney 332
 
333
 
2703 fschmid 334
        QHBoxLayout* GSlayout2;
1641 cbradney 335
        QVBoxLayout* MiscLayout;
4649 fschmid 336
//      QVBoxLayout* groupPrintLayout;
337
        //! layout of the lorem ipsum group
2784 subik 338
        QVBoxLayout* groupLILayout;
1641 cbradney 339
        QVBoxLayout* tabViewLayout;
2872 fschmid 340
        QGridLayout* pageBackgroundLayout;
1641 cbradney 341
        QHBoxLayout* layout10;
342
        QHBoxLayout* groupScratchLayout;
343
        QGridLayout* Layout4s;
2872 fschmid 344
        QHBoxLayout* groupGapLayout;
345
        QGridLayout* layout4sg;
2901 fschmid 346
        QHBoxLayout* dsLayout4p;
347
        QVBoxLayout* dsLayout4pv;
2784 subik 348
 
1701 cbradney 349
        QStringList defaultAttributesList;
1641 cbradney 350
 
3213 craig 351
        LanguageManager langMgr;
352
        PrefsManager* prefsManager;
4555 cbradney 353
        //Replace with commonstrings when translators have that one done.
354
        QString customText, customTextTR;
3213 craig 355
 
5507 subik 356
        //! \brief Setup the GUI widgets by values taken from PrefsManager.
357
        void restoreDefaults();
358
 
1701 cbradney 359
protected slots:
360
        virtual void setTOCIndexData(QWidget *widgetToShow);
1641 cbradney 361
        void setSelectedGUILang( const QString &newLang );
362
        void setActionHistoryLength();
5504 subik 363
        virtual void applyChangesButton_clicked();
5507 subik 364
        virtual void backToDefaults_clicked();
1641 cbradney 365
};
366
 
367
#endif // PREFS_H