Subversion Repositories Scribus

Rev

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