Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
1641 cbradney 1
#include "prefs.h"
2
#include "prefs.moc"
3
#include "keymanager.h"
4
#include "scribusdoc.h"
5
#include "scribusstructs.h"
6
#include <qfont.h>
7
#include <qcolordialog.h>
8
#include <qcombobox.h>
9
#include <qcolor.h>
10
#include <qstringlist.h>
11
#include <qstylefactory.h>
12
#include <qpointarray.h>
13
#include <qpainter.h>
14
#include <qrect.h>
15
#include <qstring.h>
16
#include <qwmatrix.h>
17
#include <cmath>
18
#include "units.h"
19
#include "langmgr.h"
20
#include "tabtypography.h"
21
#include "tabguides.h"
22
#include "hysettings.h"
23
#include "cmsprefs.h"
24
#include "keymanager.h"
25
#include "tabtools.h"
26
#include "undomanager.h"
27
#include "tabcheckdoc.h"
28
#include "tabpdfoptions.h"
29
#include "fontprefs.h"
30
#include "units.h"
31
#include "pluginmanager.h"
32
#include "pagesize.h"
33
#include "docitemattrprefs.h"
1701 cbradney 34
#include "tocindexprefs.h"
1641 cbradney 35
 
36
using namespace std;
37
 
38
extern QPixmap loadIcon(QString nam);
39
extern bool CMSavail;
40
extern ProfilesL InputProfiles;
41
extern ScribusApp *ScApp;
42
 
43
/*!
44
 \fn Preferences::Preferences( QWidget* parent, ApplicationPrefs *prefsData)
45
 \author Franz Schmid
46
 \date
47
 \brief Constructor for Preferences dialog box
48
 \param parent QWidget pointer to parent window
49
 \param prefsData ApplicationPrefs * struct
50
 \retval Preferences dialog
51
 */
52
Preferences::Preferences( QWidget* parent, ApplicationPrefs *prefsData) : PrefsDialogBase( parent )
53
{
54
        int decimals;
55
        ap = (ScribusApp*)parent;
56
        docUnitIndex = prefsData->docUnitIndex;
1790 cbradney 57
        unitRatio = unitGetRatioFromIndex(docUnitIndex);
1641 cbradney 58
        decimals = unitGetPrecisionFromIndex(docUnitIndex);
59
 
60
        DisScale = prefsData->DisScale;
61
        setCaption( tr( "Preferences" ) );
62
 
63
        tab = new QWidget( prefsWidgets, "tab" );
64
        tabLayout = new QGridLayout( tab );
65
        tabLayout->setSpacing( 6 );
66
        tabLayout->setMargin( 10 );
67
        tabLayout->setAlignment( Qt::AlignTop );
68
 
69
        // GUI Group
70
        ButtonGroup1 = new QButtonGroup( tr( "GUI" ), tab, "ButtonGroup1" );
71
        ButtonGroup1->setColumnLayout(0, Qt::Vertical );
72
        ButtonGroup1->layout()->setSpacing( 0 );
73
        ButtonGroup1->layout()->setMargin( 0 );
74
        ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
75
        ButtonGroup1Layout->setAlignment( Qt::AlignTop );
76
        ButtonGroup1Layout->setSpacing( 6 );
77
        ButtonGroup1Layout->setMargin( 10 );
78
 
79
        langMgr.init();
80
        QStringList languageList;
81
        langMgr.fillInstalledStringList(&languageList, true);
82
        languageList.sort();
83
        guiLangCombo = new QComboBox( false, ButtonGroup1, "guiLangCombo");
84
        guiLangCombo->insertStringList( languageList );
85
        guiLangCombo->setCurrentText(langMgr.getLangFromAbbrev(prefsData->guiLanguage));
86
        selectedGUILang=prefsData->guiLanguage;
87
        guiLangLabel = new QLabel(guiLangCombo, tr("&Language:"), ButtonGroup1, "guiLangLabel");
88
        ButtonGroup1Layout->addWidget( guiLangLabel, 0, 0 );
89
        ButtonGroup1Layout->addWidget( guiLangCombo, 0, 1, Qt::AlignLeft );
90
 
91
        GUICombo = new QComboBox( true, ButtonGroup1, "GUICombo" );
92
        QStringList STtest;
93
        STtest = QStyleFactory::keys();
94
        for (uint stt = 0; stt < STtest.count(); ++stt)
95
                GUICombo->insertItem(STtest[stt]);
96
        GUICombo->setEditable(false);
97
        GUICombo->setCurrentText(prefsData->GUI);
98
        TextGstil = new QLabel(GUICombo, tr("&Theme:"), ButtonGroup1, "dd");
99
        ButtonGroup1Layout->addWidget( TextGstil, 1, 0 );
100
        ButtonGroup1Layout->addWidget( GUICombo, 1, 1, Qt::AlignLeft );
101
 
1790 cbradney 102
        GFsize = new QSpinBox(8, 22, 1, ButtonGroup1, "gfs" );
1641 cbradney 103
        GFsize->setSuffix( tr( " pt" ) );
104
        GFsize->setValue( prefsData->AppFontSize );
105
        TextGstil2 = new QLabel(GFsize, tr("&Font Size:"), ButtonGroup1, "dd");
106
        ButtonGroup1Layout->addWidget( TextGstil2, 2, 0 );
107
        ButtonGroup1Layout->addWidget( GFsize, 2, 1, Qt::AlignLeft );
1790 cbradney 108
        SpinBox3 = new QSpinBox( 0, 1000, 10, ButtonGroup1, "SpinBox3" );
1641 cbradney 109
        SpinBox3->setValue( prefsData->Wheelval );
110
        TextLabel1_2 = new QLabel( SpinBox3, tr( "&Wheel Jump:" ), ButtonGroup1, "TextLabel1_2" );
111
        ButtonGroup1Layout->addWidget( TextLabel1_2, 3, 0 );
112
        ButtonGroup1Layout->addWidget( SpinBox3, 3, 1, Qt::AlignLeft );
1790 cbradney 113
        Recen = new QSpinBox( 1, 30, 1, ButtonGroup1, "Recen" );
1641 cbradney 114
        Recen->setValue( prefsData->RecentDCount );
115
        TextLabel4c = new QLabel( Recen, tr( "&Recent Documents:" ), ButtonGroup1, "TextLabel4c" );
116
        ButtonGroup1Layout->addWidget( TextLabel4c, 4, 0);
117
        ButtonGroup1Layout->addWidget( Recen, 4, 1, Qt::AlignLeft );
118
        tabLayout->addWidget( ButtonGroup1, 0, 0 );
119
 
120
        GroupBox200 = new QGroupBox( tr( "Paths" ), tab, "GroupBox200" );
121
        GroupBox200->setColumnLayout(0, Qt::Horizontal );
122
        GroupBox200->layout()->setSpacing( 0 );
123
        GroupBox200->layout()->setMargin( 0 );
124
        GroupBox200Layout = new QGridLayout( GroupBox200->layout() );
125
        GroupBox200Layout->setAlignment( Qt::AlignTop );
126
        GroupBox200Layout->setSpacing( 0 );
127
        GroupBox200Layout->setMargin( 5 );
128
 
129
        Docs = new QLineEdit( GroupBox200, "Datei" );
130
        Docs->setMinimumSize( QSize( 268, 22 ) );
131
        Docs->setText(prefsData->DocDir);
132
        PfadText = new QLabel( Docs, tr("&Documents:"), GroupBox200, "Pfadtext" );
133
        FileC = new QToolButton( GroupBox200, "FileC" );
134
        FileC->setMinimumSize( QSize( 88, 24 ) );
135
        FileC->setText( tr( "&Change..." ) );
136
        GroupBox200Layout->addWidget( PfadText, 0, 0 );
137
        GroupBox200Layout->addWidget( Docs, 0, 1 );
138
        GroupBox200Layout->addWidget( FileC, 0, 2 );
139
 
140
        ProPfad = new QLineEdit( GroupBox200, "Datei1" );
141
        ProPfad->setMinimumSize( QSize( 268, 22 ) );
142
        ProPfad->setText(prefsData->ProfileDir);
143
        PfadText2 = new QLabel( ProPfad, tr("&ICC Profiles:"), GroupBox200, "Pfadtext1" );
144
        FileC2 = new QToolButton( GroupBox200, "FileC1" );
145
        FileC2->setMinimumSize( QSize( 88, 24 ) );
146
        FileC2->setText( tr( "C&hange..." ) );
147
        GroupBox200Layout->addWidget( PfadText2, 1, 0 );
148
        GroupBox200Layout->addWidget( ProPfad, 1, 1 );
149
        GroupBox200Layout->addWidget( FileC2, 1, 2 );
150
 
151
        ScriptPfad = new QLineEdit( GroupBox200, "Datei1" );
152
        ScriptPfad->setMinimumSize( QSize( 268, 22 ) );
153
        ScriptPfad->setText(prefsData->ScriptDir);
154
        PfadText3 = new QLabel( ScriptPfad, tr("&Scripts:"), GroupBox200, "Pfadtext1" );
155
        FileC3 = new QToolButton( GroupBox200, "FileC3" );
156
        FileC3->setMinimumSize( QSize( 88, 24 ) );
157
        FileC3->setText( tr( "Ch&ange..." ) );
158
        GroupBox200Layout->addWidget( PfadText3, 2, 0 );
159
        GroupBox200Layout->addWidget( ScriptPfad, 2, 1 );
160
        GroupBox200Layout->addWidget( FileC3, 2, 2 );
161
 
162
        TemplateDir = new QLineEdit( GroupBox200, "Datei1" );
163
        TemplateDir->setMinimumSize( QSize( 268, 22 ) );
164
        TemplateDir->setText(prefsData->TemplateDir);
165
        PfadText4 = new QLabel( TemplateDir, tr("T&emplates:"), GroupBox200, "Pfadtext1" );
166
        FileC4 = new QToolButton( GroupBox200, "FileC4" );
167
        FileC4->setMinimumSize( QSize( 88, 24 ) );
168
        FileC4->setText( tr( "Cha&nge..." ) );
169
        GroupBox200Layout->addWidget( PfadText4, 3, 0 );
170
        GroupBox200Layout->addWidget( TemplateDir, 3, 1 );
171
        GroupBox200Layout->addWidget( FileC4, 3, 2 );
172
        tabLayout->addWidget( GroupBox200, 1, 0 );
173
        addItem( tr("General"), loadIcon("AppIcon.png"), tab);
174
 
175
        tab_7 = new QWidget( prefsWidgets, "tab_7" );
176
        tabLayout_7 = new QHBoxLayout( tab_7, 11, 6, "tabLayout_7");
177
        Layout21 = new QVBoxLayout( 0, 0, 6, "Layout21");
178
        GroupSize = new QButtonGroup( tr( "Page Size" ), tab_7, "GroupSize" );
179
        GroupSize->setColumnLayout(0, Qt::Vertical );
180
        GroupSize->layout()->setSpacing( 6 );
181
        GroupSize->layout()->setMargin( 10 );
182
        GroupSizeLayout = new QVBoxLayout( GroupSize->layout() );
183
        GroupSizeLayout->setAlignment( Qt::AlignTop );
184
        Layout6 = new QGridLayout( 0, 1, 1, 0, 6, "Layout6");
185
 
186
        GZComboF = new QComboBox( true, GroupSize, "GZComboF" );
187
        /*
188
        const QString ar_size[] =
189
            {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3",
190
             "B4", "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", tr("Executive"),
191
             tr("Folio"), tr("Ledger"), tr("Legal"), tr("Letter"), tr("Tabloid")
192
            };
193
        size_t ar_s = sizeof(ar_size) / sizeof(*ar_size);
194
        for (uint s = 0; s < ar_s; ++s)
195
                GZComboF->insertItem(ar_size[s]);
196
        */
197
 
198
        PageSize *ps=new PageSize(prefsData->pageSize);
199
        GZComboF->insertStringList(ps->getTrPageSizeList());
200
        GZComboF->insertItem( tr( "Custom" ) );
201
        GZComboF->setEditable(false);
202
 
203
        QStringList pageSizes=ps->getPageSizeList();
204
        int sizeIndex=pageSizes.findIndex(ps->getPageText());
205
        if (sizeIndex!=-1)
206
                GZComboF->setCurrentItem(sizeIndex);
207
        else
208
                GZComboF->setCurrentItem(GZComboF->count()-1);
209
        GZText1 = new QLabel( GZComboF, tr( "&Size:" ), GroupSize, "GZText1" );
210
        Layout6->addWidget( GZText1, 0, 0 );
211
        Layout6->addWidget( GZComboF, 0, 1 );
212
 
213
        GZComboO = new QComboBox( true, GroupSize, "GZComboO" );
214
        GZComboO->insertItem( tr( "Portrait" ) );
215
        GZComboO->insertItem( tr( "Landscape" ) );
216
        GZComboO->setEditable(false);
217
        GZComboO->setCurrentItem(prefsData->pageOrientation);
218
        GZText2 = new QLabel( GZComboO, tr( "Orie&ntation:" ), GroupSize, "GZText2" );
219
        Layout6->addWidget( GZText2, 1, 0 );
220
        Layout6->addWidget( GZComboO, 1, 1 );
221
        UnitCombo = new QComboBox( true, GroupSize, "UnitCombo" );
222
        UnitCombo->insertStringList(unitGetTextUnitList());
223
        UnitCombo->setEditable(false);
224
        UnitCombo->setCurrentItem(prefsData->docUnitIndex);
225
        unitComboText = new QLabel( UnitCombo, tr( "Units:" ), GroupSize, "unitComboText" );
226
        Layout6->addWidget( unitComboText, 2, 0 );
227
        Layout6->addWidget( UnitCombo, 2, 1 );
228
 
229
        GroupSizeLayout->addLayout( Layout6 );
230
 
231
        Layout5_2 = new QHBoxLayout( 0, 0, 6, "Layout5_2");
232
 
233
        pageWidth = new MSpinBox( 1, 10000, GroupSize, decimals );
234
        pageWidth->setEnabled( false );
235
        pageWidth->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 236
        pageWidth->setValue(prefsData->PageWidth * unitRatio);
1641 cbradney 237
        GZText3 = new QLabel( pageWidth, tr( "&Width:" ), GroupSize, "GZText3" );
238
        Layout5_2->addWidget( GZText3 );
239
        Layout5_2->addWidget( pageWidth );
240
 
241
        pageHeight = new MSpinBox( 1, 10000, GroupSize, decimals );
242
        pageHeight->setEnabled( false );
243
        pageHeight->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 244
        pageHeight->setValue(prefsData->PageHeight * unitRatio);
1641 cbradney 245
        GZText4 = new QLabel( pageHeight, tr( "&Height:" ), GroupSize, "GZText4" );
246
        Layout5_2->addWidget( GZText4 );
247
        Layout5_2->addWidget( pageHeight );
248
 
249
        GroupSizeLayout->addLayout( Layout5_2 );
250
 
251
        Layout8 = new QHBoxLayout( 0, 0, 6, "Layout8");
252
 
253
        facingPages = new QCheckBox( tr( "&Facing Pages" ), GroupSize, "facingPages" );
254
        facingPages->setChecked(prefsData->FacingPages);
255
        Layout8->addWidget( facingPages );
256
 
257
        Linkszuerst = new QCheckBox( tr( "Left &Page First" ), GroupSize, "Linkszuerst" );
258
        Linkszuerst->setChecked(prefsData->LeftPageFirst);
259
        if (!facingPages->isChecked())
260
                Linkszuerst->setEnabled(false);
261
        Layout8->addWidget( Linkszuerst );
262
        GroupSizeLayout->addLayout( Layout8 );
263
        Layout21->addWidget( GroupSize );
264
 
265
        GroupRand = new QGroupBox( tr( "Margin Guides" ), tab_7, "GroupRand" );
266
        GroupRand->setColumnLayout(0, Qt::Vertical );
267
        GroupRand->layout()->setSpacing( 5 );
268
        GroupRand->layout()->setMargin( 10 );
269
        GroupRandLayout = new QGridLayout( GroupRand->layout() );
270
        GroupRandLayout->setAlignment( Qt::AlignTop );
271
 
272
        TopR = new MSpinBox( 0, 1000, GroupRand, decimals );
273
        TopR->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 274
        TopR->setValue(prefsData->RandOben * unitRatio);
1641 cbradney 275
        RandT = prefsData->RandOben;
276
        GroupRandLayout->addWidget( TopR, 0, 1 );
277
        BottomR = new MSpinBox( 0, 1000, GroupRand, decimals );
278
        BottomR->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 279
        BottomR->setValue(prefsData->RandUnten * unitRatio);
1641 cbradney 280
        RandB = prefsData->RandUnten;
281
        GroupRandLayout->addWidget( BottomR, 1, 1 );
282
        RightR = new MSpinBox( 0, 1000, GroupRand, decimals );
283
        RightR->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 284
        RightR->setValue(prefsData->RandRechts * unitRatio);
1641 cbradney 285
        RandR = prefsData->RandRechts;
286
        GroupRandLayout->addWidget( RightR, 1, 3 );
287
        LeftR = new MSpinBox( 0, 1000, GroupRand, decimals );
288
        LeftR->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 289
        LeftR->setValue(prefsData->RandLinks * unitRatio);
1641 cbradney 290
        RandL = prefsData->RandLinks;
291
        GroupRandLayout->addWidget( LeftR, 0, 3 );
292
 
293
        GRText2 = new QLabel( BottomR, tr( "&Bottom:" ), GroupRand, "GRText2" );
294
        GroupRandLayout->addWidget( GRText2, 1, 0 );
295
        GRText1 = new QLabel( TopR, tr( "&Top:" ), GroupRand, "GRText1" );
296
        GroupRandLayout->addWidget( GRText1, 0, 0 );
297
        GRText4 = new QLabel( RightR, tr( "&Right:" ), GroupRand, "GRText4" );
298
        GroupRandLayout->addWidget( GRText4, 1, 2 );
299
        GRText3 = new QLabel( LeftR, tr( "&Left:" ), GroupRand, "GRText3" );
300
        GroupRandLayout->addWidget( GRText3, 0, 2 );
301
 
302
        Layout21->addWidget( GroupRand );
303
        QBoxLayout *asurLayout = new QHBoxLayout( 0, 0, 6, "asurLayout");
304
 
305
        GroupAS = new QGroupBox( tr( "Autosave" ), tab_7, "GroupAS" );
306
        GroupAS->setColumnLayout(0, Qt::Vertical );
307
        GroupAS->layout()->setSpacing( 5 );
308
        GroupAS->layout()->setMargin( 10 );
309
        GroupASLayout = new QGridLayout( GroupAS->layout() );
310
        GroupASLayout->setAlignment( Qt::AlignTop );
311
        ASon = new QCheckBox( tr( "&Enabled" ), GroupAS, "Enable Autosave" );
312
        ASon->setChecked(prefsData->AutoSave);
313
        GroupASLayout->addMultiCellWidget( ASon, 0, 0, 0, 1 );
314
        ASTime = new QSpinBox( GroupAS, "Time" );
315
        ASTime->setMaxValue( 60 );
316
        ASTime->setMinValue( 1 );
317
        ASTime->setSuffix( " " + tr("min") );
318
        ASTime->setValue(prefsData->AutoSaveTime / 1000 / 60);
319
        ASText = new QLabel( ASTime, tr( "&Interval:" ), GroupAS, "ASText" );
320
        GroupASLayout->addWidget( ASText, 1, 0 );
321
        GroupASLayout->addWidget( ASTime, 1, 1 );
322
        asurLayout->addWidget(GroupAS);
323
 
324
        urGroup = new QGroupBox(tr("Undo/Redo"), tab_7, "urGroup");
325
        urGroup->setColumnLayout(0, Qt::Vertical);
326
        urGroup->layout()->setSpacing(5);
327
        urGroup->layout()->setMargin(10);
328
        QGridLayout *urGroupLayout = new QGridLayout(urGroup->layout());
329
        urGroupLayout->setAlignment(Qt::AlignTop);
330
        urSpinBox = new QSpinBox(urGroup, "urSpinBox");
331
        urSpinBox->setMinValue(0);
332
        urSpinBox->setMaxValue(1000);
333
        int urSBValue = UndoManager::instance()->getHistoryLength();
334
        if (urSBValue == -1)
335
                urSpinBox->setEnabled(false);
336
        else
337
                urSpinBox->setValue(urSBValue);
338
        urLabel = new QLabel(urSpinBox, tr("Action history length"), urGroup, "urLabel");
339
        urGroupLayout->addWidget(urLabel, 0, 0);
340
        urGroupLayout->addWidget(urSpinBox, 0, 1);
341
        asurLayout->addWidget(urGroup);
342
        Layout21->addLayout(asurLayout);
343
 
344
        tabLayout_7->addLayout( Layout21 );
345
        addItem( tr("Document"), loadIcon("page.png"), tab_7);
346
 
1790 cbradney 347
        tabGuides = new TabGuides(prefsWidgets, &prefsData->guidesSettings, &prefsData->typographicSetttings, docUnitIndex);
1641 cbradney 348
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
349
        tabTypo = new TabTypograpy(  prefsWidgets, &prefsData->typographicSetttings);
350
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
1790 cbradney 351
        tabTools = new TabTools(  prefsWidgets, &prefsData->toolSettings, docUnitIndex, 0);
1641 cbradney 352
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
353
 
354
        tabHyphenator = new HySettings(prefsWidgets, &ap->LangTransl);
355
        tabHyphenator->verbose->setChecked(!prefsData->Automatic);
356
        tabHyphenator->input->setChecked(prefsData->AutoCheck);
357
        tabHyphenator->language->setCurrentText(ap->LangTransl[prefsData->Language]);
358
        tabHyphenator->wordLen->setValue(prefsData->MinWordLen);
359
        tabHyphenator->maxCount->setValue(prefsData->HyCount);
360
        addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator);
361
 
362
        tabFonts = new FontPrefs(  prefsWidgets, ap->Prefs.AvailFonts, false, prefsData, ap->PrefsPfad, 0);
363
        addItem( tr("Fonts"), loadIcon("font.png"), tabFonts);
364
 
365
        tabDocChecker = new TabCheckDoc(  prefsWidgets, prefsData->checkerProfiles, prefsData->curCheckProfile);
1642 cbradney 366
        addItem( tr("Document Checker"), loadIcon("checkdoc.png"), tabDocChecker);
1641 cbradney 367
 
368
        if (CMSavail)
369
        {
370
                tabColorManagement = new CMSPrefs(prefsWidgets, &prefsData->DCMSset, &InputProfiles, &ap->PrinterProfiles, &ap->MonitorProfiles);
371
                addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
372
        }
373
        QMap<QString,QFont> DocFonts;
374
        DocFonts.clear();
375
        tabPDF = new TabPDFOptions( prefsWidgets,
376
                                                                &prefsData->PDF_Options,
377
                                                                ap->Prefs.AvailFonts,
378
                                                                &ap->PDFXProfiles,
379
                                                                DocFonts,
380
                                                                prefsData->PDF_Options.PresentVals,
1790 cbradney 381
                                                                docUnitIndex,
1641 cbradney 382
                                                                prefsData->PageHeight,
383
                                                                prefsData->PageWidth,
384
 
385
        addItem( tr("PDF Export"), loadIcon("acroread.png"), tabPDF);
1644 cbradney 386
 
1641 cbradney 387
        tabDefaultItemAttributes = new DocumentItemAttributes( prefsWidgets);
1701 cbradney 388
        defaultAttributesList=tabDefaultItemAttributes->getDocAttributesNames();
1641 cbradney 389
        tabDefaultItemAttributes->setup(&prefsData->defaultItemAttributes);
390
        addItem( tr("Document Item Attributes"), loadIcon("docattributes.png"), tabDefaultItemAttributes);
1701 cbradney 391
 
392
        tabDefaultTOCIndexPrefs = new TOCIndexPrefs( prefsWidgets );
393
        tabDefaultTOCIndexPrefs->setupItemAttrs( defaultAttributesList );
394
        tabDefaultTOCIndexPrefs->setup(&prefsData->defaultToCSetups, NULL);
395
        connect( prefsWidgets, SIGNAL(aboutToShow(QWidget *)), this, SLOT(setTOCIndexData(QWidget *)));
396
        addItem( tr("Table of Contents and Indexes"), loadIcon("tabtocindex.png"), tabDefaultTOCIndexPrefs);
1644 cbradney 397
 
1701 cbradney 398
 
1641 cbradney 399
        tabKeys = new KeyManager(prefsWidgets, prefsData->KeyActions);
400
        addItem( tr("Keyboard Shortcuts"), loadIcon("key_bindings.png"), tabKeys);
401
 
402
        tab_5 = new QWidget( prefsWidgets, "tab_5" );
403
        tabLayout_5 = new QGridLayout( tab_5 );
404
        tabLayout_5->setSpacing( 6 );
405
        tabLayout_5->setMargin( 11 );
406
        saving = new QGroupBox( tr( "Other Options" ), tab_5, "Saving" );
407
        saving->setColumnLayout(0, Qt::Vertical );
408
        saving->layout()->setSpacing( 0 );
409
        saving->layout()->setMargin( 0 );
410
        savingLayout = new QHBoxLayout( saving->layout() );
411
        savingLayout->setAlignment( Qt::AlignTop );
412
        savingLayout->setSpacing( 6 );
413
        savingLayout->setMargin( 25 );
414
        SaveAtQuit = new QCheckBox( tr( "Sa&ve Contents on Changes" ), saving, "SaveAtQuit" );
415
        SaveAtQuit->setChecked(prefsData->SaveAtQ);
416
        savingLayout->addWidget( SaveAtQuit );
417
        tabLayout_5->addWidget( saving, 1, 0 );
418
        preview = new QGroupBox( tr( "Preview" ), tab_5, "Preview" );
419
        preview->setColumnLayout(0, Qt::Vertical );
420
        preview->layout()->setSpacing( 0 );
421
        preview->layout()->setMargin( 0 );
422
        previewLayout = new QHBoxLayout( preview->layout() );
423
        previewLayout->setAlignment( Qt::AlignTop );
424
        previewLayout->setSpacing( 10 );
425
        previewLayout->setMargin( 24 );
426
        PreviewSize = new QComboBox( true, preview, "PreviewSize" );
427
        PreviewSize->insertItem( tr( "Small" ) );
428
        PreviewSize->insertItem( tr( "Medium" ) );
429
        PreviewSize->insertItem( tr( "Large" ) );
430
        PreviewSize->setEditable(false);
431
        int sci = prefsData->PSize == 40 ? 0 : prefsData->PSize == 60 ? 1 : 2;
432
        PreviewSize->setCurrentItem(sci);
433
        textLabelP = new QLabel( PreviewSize, tr( "&Size:" ), preview, "TextLabel1_3" );
434
        previewLayout->addWidget( textLabelP );
435
        previewLayout->addWidget( PreviewSize );
436
        tabLayout_5->addWidget( preview, 0, 0 );
437
        addItem(  tr("Scrapbook"), loadIcon("scrap.png"), tab_5);
438
 
439
        tabView = new QWidget( prefsWidgets, "tabView" );
440
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
441
        tabViewLayout->setAlignment( Qt::AlignTop );
442
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
443
        pageBackground->setTitle( tr( "Page Display" ) );
444
        pageBackground->setColumnLayout(0, Qt::Vertical );
445
        pageBackground->layout()->setSpacing( 5 );
446
        pageBackground->layout()->setMargin( 10 );
447
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
448
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
449
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
450
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
451
        textLabel9->setText( tr( "Color:" ) );
452
        layout10->addWidget( textLabel9 );
453
        backColor = new QPushButton( pageBackground, "backColor" );
454
        backColor->setMinimumSize( QSize( 60, 20 ) );
455
        backColor->setMaximumSize( QSize( 60, 20 ) );
456
        backColor->setFlat( false );
457
        backColor->setAutoDefault( false );
458
        QPixmap pm5 = QPixmap(54, 14);
459
        pm5.fill(prefsData->DpapColor);
460
        colorPaper = prefsData->DpapColor;
461
        backColor->setPixmap(pm5);
462
        backColor->setText( QString::null );
463
        layout10->addWidget( backColor );
464
        QSpacerItem* spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
465
        layout10->addItem( spacer3 );
466
        pageBackgroundLayout->addLayout( layout10 );
467
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
468
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
469
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
470
        checkUnprintable->setChecked( prefsData->marginColored );
471
        pageBackgroundLayout->addWidget( checkUnprintable );
472
        checkPictures = new QCheckBox( pageBackground, "checkPictures" );
473
        checkPictures->setText( tr( "Show Pictures" ) );
474
        checkPictures->setChecked(prefsData->guidesSettings.showPic);
475
        pageBackgroundLayout->addWidget( checkPictures );
476
        checkLink = new QCheckBox( pageBackground, "checkLink" );
477
        checkLink->setText( tr( "Show Text Chains" ) );
478
        checkLink->setChecked(prefsData->guidesSettings.linkShown);
479
        pageBackgroundLayout->addWidget( checkLink );
480
        checkFrame = new QCheckBox( pageBackground, "checkFrame" );
481
        checkFrame->setText( tr( "Show Frames" ) );
482
        checkFrame->setChecked(prefsData->guidesSettings.framesShown);
483
        pageBackgroundLayout->addWidget( checkFrame );
484
        tabViewLayout->addWidget( pageBackground );
485
 
486
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
487
        groupScratch->setTitle( tr( "Scratch Space" ) );
488
        groupScratch->setColumnLayout(0, Qt::Vertical );
489
        groupScratch->layout()->setSpacing( 0 );
490
        groupScratch->layout()->setMargin( 0 );
491
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
492
        groupScratchLayout->setAlignment( Qt::AlignTop );
493
        groupScratchLayout->setSpacing( 0 );
494
        groupScratchLayout->setMargin( 10 );
495
        Layout4s = new QGridLayout;
496
        Layout4s->setSpacing( 6 );
497
        Layout4s->setMargin( 0 );
498
        topScratch = new MSpinBox( groupScratch, 4 );
499
        topScratch->setDecimals( decimals );
500
        topScratch->setMaxValue(1000);
1790 cbradney 501
        topScratch->setValue(prefsData->ScratchTop * unitRatio);
1641 cbradney 502
        Layout4s->addWidget( topScratch, 0, 1 );
503
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
504
        Layout4s->addWidget( TextLabel5s, 0, 0 );
505
        leftScratch = new MSpinBox( groupScratch, 4 );
506
        leftScratch->setDecimals( decimals );
507
        leftScratch->setMaxValue(1000);
1790 cbradney 508
        leftScratch->setValue(prefsData->ScratchLeft * unitRatio);
1641 cbradney 509
        Layout4s->addWidget( leftScratch, 0, 3 );
510
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
511
        Layout4s->addWidget( Linkss, 0, 2 );
512
        bottomScratch = new MSpinBox( groupScratch, 4 );
513
        bottomScratch->setDecimals( decimals );
514
        bottomScratch->setMaxValue(1000);
1790 cbradney 515
        bottomScratch->setValue(prefsData->ScratchBottom * unitRatio);
1641 cbradney 516
        Layout4s->addWidget( bottomScratch, 1, 1 );
517
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
518
        Layout4s->addWidget( TextLabel7s, 1, 0 );
519
        rightScratch = new MSpinBox( groupScratch, 4 );
520
        rightScratch->setDecimals( decimals );
521
        rightScratch->setMaxValue(1000);
1790 cbradney 522
        rightScratch->setValue(prefsData->ScratchRight * unitRatio);
1641 cbradney 523
        Layout4s->addWidget( rightScratch, 1, 3 );
524
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
525
        Layout4s->addWidget( Rechtss, 1, 2 );
526
        groupScratchLayout->addLayout( Layout4s );
527
        tabViewLayout->addWidget( groupScratch );
528
 
529
        CaliGroup = new QGroupBox( tr( "&Adjust Display Size" ), tabView, "CaliGroup" );
530
        CaliGroup->setColumnLayout(0, Qt::Vertical );
531
        CaliGroup->layout()->setSpacing( 6 );
532
        CaliGroup->layout()->setMargin( 11 );
533
        CaliGroupLayout = new QVBoxLayout( CaliGroup->layout() );
534
        CaliGroupLayout->setAlignment( Qt::AlignTop );
535
        CaliText = new QLabel( tr( "To adjust the display drag the ruler below with the Slider." ), CaliGroup, "CaliText" );
536
        CaliGroupLayout->addWidget( CaliText );
537
        CaliRuler = new QLabel( CaliGroup, "CaliRuler" );
538
        CaliRuler->setMinimumSize( QSize( 20, 20 ) );
539
        drawRuler();
540
        CaliRuler->setFrameShape( QLabel::Box );
541
        CaliRuler->setFrameShadow( QLabel::Sunken );
542
        CaliRuler->setScaledContents( false );
543
        CaliGroupLayout->addWidget( CaliRuler );
544
        layout15ca = new QHBoxLayout( 0, 0, 6, "layout15");
545
        CaliSlider = new QSlider( CaliGroup, "CaliSlider" );
546
        CaliSlider->setMinValue( -100 );
547
        CaliSlider->setMaxValue( 100 );
548
        CaliSlider->setValue(static_cast<int>(100 * DisScale)-100);
549
        CaliSlider->setOrientation( QSlider::Horizontal );
550
        CaliSlider->setTickmarks( QSlider::Right );
551
        CaliSlider->setTickInterval( 10 );
552
        CaliText->setBuddy(CaliGroup);
553
        layout15ca->addWidget( CaliSlider );
554
        CaliAnz = new QLabel( CaliGroup, "CaliAnz" );
555
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
556
        layout15ca->addWidget( CaliAnz );
557
        CaliGroupLayout->addLayout( layout15ca );
558
        tabViewLayout->addWidget( CaliGroup );
559
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
560
 
561
        ExtTool = new QWidget( prefsWidgets, "ExtTool" );
562
        ExtToolLayout = new QVBoxLayout( ExtTool, 11, 6, "ExtToolLayout");
563
        ExtToolLayout->setAlignment( Qt::AlignTop );
564
        groupGS = new QGroupBox( tr( "Postscript Interpreter" ), ExtTool, "groupGS" );
565
        groupGS->setColumnLayout(0, Qt::Vertical );
566
        groupGS->layout()->setSpacing( 6 );
567
        groupGS->layout()->setMargin( 10 );
568
        groupGSLayout = new QVBoxLayout( groupGS->layout() );
569
        groupGSLayout->setAlignment( Qt::AlignTop );
570
        GSlayout = new QHBoxLayout( 0, 0, 6, "GSlayout");
571
        GSName = new QLineEdit( groupGS, "GSName" );
572
        GSName->setText(prefsData->gs_exe);
573
        GSText = new QLabel( GSName, tr( "&Name of Executable:" ), groupGS, "GSText" );
574
        GSlayout->addWidget( GSText );
575
        GSlayout->addWidget( GSName );
576
        groupGSLayout->addLayout( GSlayout );
577
        GSantiText = new QCheckBox( tr( "Antialias &Text" ), groupGS, "GSantiText" );
578
        GSantiText->setChecked(prefsData->gs_AntiAliasText);
579
        groupGSLayout->addWidget( GSantiText );
580
        GSantiGraph = new QCheckBox( tr( "Antialias &Graphics" ), groupGS, "GSantiGraph" );
581
        GSantiGraph->setChecked(prefsData->gs_AntiAliasGraphics);
582
        groupGSLayout->addWidget( GSantiGraph );
583
        ExtToolLayout->addWidget( groupGS );
584
        groupGimp = new QGroupBox( tr( "Image Processing Tool" ), ExtTool, "groupGimp" );
585
        groupGimp->setColumnLayout(0, Qt::Vertical );
586
        groupGimp->layout()->setSpacing( 6 );
587
        groupGimp->layout()->setMargin( 10 );
588
        groupGimpLayout = new QHBoxLayout( groupGimp->layout() );
589
        groupGimpLayout->setAlignment( Qt::AlignTop );
590
        GimpName = new QLineEdit( groupGimp, "GimpName" );
591
        GimpName->setText(prefsData->gimp_exe);
592
        GimpText = new QLabel( GimpName, tr( "Name of &Executable:" ), groupGimp, "GimpText" );
593
        groupGimpLayout->addWidget( GimpText );
594
        groupGimpLayout->addWidget( GimpName );
595
        ExtToolLayout->addWidget( groupGimp );
596
        QSpacerItem* spacer_gs = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
597
        ExtToolLayout->addItem( spacer_gs );
598
        addItem(  tr("External Tools."), loadIcon("misc.png"), ExtTool);
599
 
600
        Misc = new QWidget( prefsWidgets, "Misc" );
601
        MiscLayout = new QVBoxLayout( Misc, 10, 5, "MiscLayout");
602
        MiscLayout->setAlignment( Qt::AlignTop );
603
        groupPrint = new QGroupBox( tr( "Printing" ), Misc, "groupPrint" );
604
        groupPrint->setColumnLayout(0, Qt::Vertical );
605
        groupPrint->layout()->setSpacing( 10 );
606
        groupPrint->layout()->setMargin( 10 );
607
        groupPrintLayout = new QVBoxLayout( groupPrint->layout() );
608
        groupPrintLayout->setAlignment( Qt::AlignTop );
609
        ClipMarg = new QCheckBox( tr( "Clip to Page &Margins" ), groupPrint, "ClipMarg" );
610
        ClipMarg->setChecked(prefsData->ClipMargin);
611
        groupPrintLayout->addWidget( ClipMarg );
612
        DoGCR = new QCheckBox( tr( "Apply &Under Color Removal" ), groupPrint, "ClipMarg" );
613
        DoGCR->setChecked(prefsData->GCRMode);
614
        groupPrintLayout->addWidget( DoGCR );
615
        MiscLayout->addWidget( groupPrint );
616
        AskForSubs = new QCheckBox( tr( "Always ask before Fonts are replaced when loading a Document" ), Misc, "askforSubs" );
617
        AskForSubs->setChecked(prefsData->askBeforeSubstituite);
618
        MiscLayout->addWidget( AskForSubs );
619
        QSpacerItem* spacer_3m = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
620
        MiscLayout->addItem( spacer_3m );
621
        addItem(  tr("Misc."), loadIcon("misc.png"), Misc);
622
 
623
        // plugin manager. pv.
624
        pluginManagerWidget = new QWidget(prefsWidgets, "pluginManagerWidget");
625
        pluginMainLayout = new QVBoxLayout( pluginManagerWidget, 10, 5, "pluginMainLayout");
626
        pluginMainLayout->setAlignment( Qt::AlignTop );
627
        plugGroupBox = new QGroupBox(tr("Plugin Manager"), pluginManagerWidget, "plugGroupBox");
628
        plugGroupBox->setColumnLayout(0, Qt::Vertical);
629
        plugGroupBox->layout()->setSpacing(6);
630
        plugGroupBox->layout()->setMargin(11);
631
        plugGroupBoxLayout = new QGridLayout( plugGroupBox->layout() );
632
        plugGroupBoxLayout->setAlignment(Qt::AlignTop);
633
        plugLayout1 = new QVBoxLayout( 0, 0, 6, "plugLayout1");
634
        pluginsList = new QListView(plugGroupBox, "pluginsList");
635
        pluginsList->setAllColumnsShowFocus(true);
636
        pluginsList->setShowSortIndicator(true);
637
        pluginsList->addColumn(tr("Plugin"));
638
        pluginsList->setColumnWidthMode(0, QListView::Maximum);
639
        pluginsList->addColumn(tr("How to run"));
640
        pluginsList->setColumnWidthMode(1, QListView::Maximum);
641
        pluginsList->addColumn(tr("Type"));
642
        pluginsList->setColumnWidthMode(2, QListView::Maximum);
643
        pluginsList->addColumn(tr("Load it?"));
644
        pluginsList->setColumnWidthMode(3, QListView::Maximum);
645
        pluginsList->addColumn(tr("Plugin ID"));
646
        pluginsList->setColumnWidthMode(4, QListView::Maximum);
647
        pluginsList->addColumn(tr("File"));
648
        pluginsList->setColumnWidthMode(5, QListView::Maximum);
649
        for (QMap<int,PluginManager::PluginData>::Iterator it = ap->pluginManager->pluginMap.begin(); it != ap->pluginManager->pluginMap.end(); ++it)
650
        {
651
                QListViewItem *plugItem = new QListViewItem(pluginsList);
652
                plugItem->setText(0, (*it).name.replace('&', "").replace("...", "")); // name
653
                plugItem->setText(1, QString("%1 %2").arg((*it).actMenu).arg((*it).actMenuAfterName)); // menu path
654
                plugItem->setText(2, ap->pluginManager->getPluginType((*it).type)); // type
655
                // load at start?
656
                plugItem->setPixmap(3, (*it).loadPlugin ? loadIcon("ok.png") : loadIcon("DateiClos16.png"));
657
                plugItem->setText(3, (*it).loadPlugin ? tr("Yes") : tr("No"));
658
                plugItem->setText(4, QString("%1").arg(it.key())); // id for developers
659
                plugItem->setText(5, (*it).pluginFile); // file for developers
660
        }
661
        plugLayout1->addWidget(pluginsList);
662
        pluginWarning = new QLabel(plugGroupBox);
663
        pluginWarning->setText("<qt>" + tr("You need to restart the application to promote the changes.") + "</qt>");
664
        plugLayout1->addWidget(pluginWarning);
665
        plugGroupBoxLayout->addLayout(plugLayout1, 0, 0);
666
        pluginMainLayout->addWidget(plugGroupBox);
667
        addItem(tr("Plugins"), loadIcon("plugins.png"), pluginManagerWidget);
668
 
669
        setDS();
670
        //tab order
671
        QWidget::setTabOrder( GFsize, SpinBox3 );
672
        QWidget::setTabOrder( SpinBox3, UnitCombo );
673
        QWidget::setTabOrder( UnitCombo, Recen );
674
        QWidget::setTabOrder( Recen, Docs );
675
        QWidget::setTabOrder( Docs, FileC );
676
        QWidget::setTabOrder( FileC, ProPfad );
677
        QWidget::setTabOrder( ProPfad, FileC2  );
678
        QWidget::setTabOrder( FileC2, ScriptPfad );
679
        QWidget::setTabOrder( ScriptPfad, FileC3 );
680
        QWidget::setTabOrder( FileC3, TemplateDir );
681
        QWidget::setTabOrder( TemplateDir, FileC4 );
682
 
683
 
684
        QWidget::setTabOrder( TopR, BottomR );
685
        QWidget::setTabOrder( BottomR, LeftR );
686
        QWidget::setTabOrder( LeftR, RightR );
687
 
688
        QWidget::setTabOrder( PreviewSize, SaveAtQuit );
689
 
690
        QToolTip::add( checkLink, tr("Turns the of linked frames on or off"));
691
        QToolTip::add( checkFrame, tr("Turns the display of frames on or off"));
692
        QToolTip::add( checkPictures, tr("Turns the display of pictures on or off"));
693
        QToolTip::add( guiLangCombo, tr( "Select your default language for Scribus to run with.\nLeave this blank to choose based on environment variables.\nYou can still override this by passing a command line option when starting Scribus" ) );
694
        QToolTip::add( GUICombo, tr( "Choose the default window decoration and looks.\nScribus inherits any available KDE or Qt themes" ) );
695
        QToolTip::add( GFsize, tr( "Default font size for the menus and windows" ) );
696
        QToolTip::add( UnitCombo, tr( "Default unit of measurement for document editing" ) );
697
        QToolTip::add( SpinBox3, tr( "Number of lines Scribus will scroll for each move of the mouse wheel" ) );
698
        QToolTip::add( Recen, tr( "Number of recently edited documents to show in the File menu" ) );
699
        QToolTip::add( Docs, tr( "Default documents directory" ) );
700
        QToolTip::add( ProPfad, tr( "Default ICC profiles directory" ) );
701
        QToolTip::add( ScriptPfad, tr( "Default Scripter scripts directory" ) );
702
        QToolTip::add( TemplateDir, tr( "Additional Directory for Document Templates" ) );
703
 
704
        QToolTip::add( GZComboF, tr( "Default page size, either a standard size or a custom size" ) );
705
        QToolTip::add( GZComboO, tr( "Default orientation of document pages" ) );
706
        QToolTip::add( pageWidth, tr( "Width of document pages, editable if you have chosen a custom page size" ) );
707
        QToolTip::add( pageHeight, tr( "Height of document pages, editable if you have chosen a custom page size" ) );
708
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
709
        QToolTip::add( Linkszuerst, tr( "Make the first page the left page of a document" ) );
710
        QToolTip::add( TopR, tr( "Distance between the top margin guide and the edge of the page" ) );
711
        QToolTip::add( BottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
712
        QToolTip::add( LeftR, tr( "Distance between the left margin guide and the edge of the page.\nIf Facing Pages is selected, this margin space can be used to achieve the correct margins for binding" ) );
713
        QToolTip::add( RightR, tr( "Distance between the right margin guide and the edge of the page.\nIf Facing Pages is selected, this margin space can be used to achieve the correct margins for binding" ) );
714
        QToolTip::add( ASon, tr( "When enabled, Scribus saves a backup copy of your file with the .bak extension\neach time the time period elapses" ) );
715
        QToolTip::add( ASTime, tr( "Time period between saving automatically" ) );
716
 
717
        QToolTip::add( urSpinBox, tr("Set the length of the action history in steps.\nIf set to 0 infinite amount of actions will be stored."));
718
 
719
        QToolTip::add( PreviewSize, tr( "Choose the size of the preview in the scrapbook palette" ) );
720
        QToolTip::add( SaveAtQuit, tr( "Save the scrapbook contents everytime after a change" ) );
721
 
722
        QToolTip::add( backColor, tr( "Color for paper" ) );
723
        QToolTip::add( checkUnprintable, tr( "Mask the area outside the margins in the margin color" ) );
724
        QToolTip::add( CaliSlider, tr( "Set the default zoom level" ) );
725
 
726
        QToolTip::add( GSName, tr( "Filesystem location for the Ghostscript interpreter" ) );
727
        QToolTip::add( GSantiText, tr( "Antialias text for EPS and PDF onscreen rendering" ) );
728
        QToolTip::add( GSantiGraph, tr( "Antialias graphics for EPS and PDF onscreen rendering" ) );
729
        QToolTip::add( GimpName, tr( "Filesystem location for graphics editor" ) );
730
 
731
        QToolTip::add( ClipMarg, tr( "Do not show objects outside the margins on the printed page or exported file" ) );
732
        QToolTip::add( DoGCR, tr( "A way of switching off some of the gray shades which are composed\n"
733
                                          "of cyan, yellow and magenta and using black instead.\n"
734
                                          "UCR most affects parts of images which are neutral and/or dark tones\n"
735
                                          "which are close to the gray. Use of this may improve printing some images\n"
736
                                          "and some experimentation and testing is need on a case by case basis.\n"
737
                                          "UCR reduces the possibility of over saturation with CMY inks." ) );
738
 
739
        // signals and slots connections
740
        connect( guiLangCombo, SIGNAL( activated( const QString & ) ), this, SLOT( setSelectedGUILang( const QString & ) ) );
741
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
742
        connect(UnitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
743
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
744
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
745
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
746
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
747
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
748
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
749
        connect(GZComboO, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
750
        connect(GZComboF, SIGNAL(activated(const QString &)), this, SLOT(setSize(const QString &)));
751
        connect(facingPages, SIGNAL(clicked()), this, SLOT(setDS()));
752
        connect(FileC, SIGNAL(clicked()), this, SLOT(changeDocs()));
753
        connect(FileC2, SIGNAL(clicked()), this, SLOT(changeProfs()));
754
        connect(FileC3, SIGNAL(clicked()), this, SLOT(changeScripts()));
755
        connect(FileC4, SIGNAL(clicked()), this, SLOT(changeTemplates()));
756
        connect(CaliSlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
757
        connect(buttonOk, SIGNAL(clicked()), this, SLOT(setActionHistoryLength()));
758
        connect(pluginsList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)),
759
                        this, SLOT(changePluginLoad(QListViewItem *, const QPoint &, int)));
760
        if (CMSavail)
761
                connect(tabColorManagement, SIGNAL(cmsOn(bool )), this, SLOT(switchCMS(bool )));
762
 
763
        setSize(prefsData->pageSize);
764
        setOrien(prefsData->pageOrientation);
765
 
1790 cbradney 766
        pageWidth->setValue(prefsData->PageWidth * unitRatio);
767
        pageHeight->setValue(prefsData->PageHeight * unitRatio);
1641 cbradney 768
 
1790 cbradney 769
        //unitChange();
1641 cbradney 770
 
771
        prefsWidgets->raiseWidget(0);
772
        resize( minimumSizeHint() );
773
        arrangeIcons();
1828 fschmid 774
        backToDefaults->hide();
1641 cbradney 775
        clearWState( WState_Polished );
776
}
777
 
778
/*!
779
 \fn Preferences::~Preferences
780
 \author Franz Schmid
781
 \date
782
 \brief Destructor for Preferences dialog box
783
 \param None
784
 \retval None
785
 */
786
Preferences::~Preferences()
787
{
788
        // no need to delete child widgets, Qt does it all for us
789
}
790
 
791
 
792
/*!
793
 \fn void Preferences::ChangeDocs()
794
 \author Franz Schmid
795
 \date
796
 \brief Runs QFileDialog to get Preferences (General) Path to Documents directory
797
 \param None
798
 \retval None
799
 */
800
void Preferences::changeDocs()
801
{
802
        QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
803
        if (s != "")
804
                Docs->setText(s);
805
}
806
 
807
/*!
808
 \fn void Preferences::ChangeProfs()
809
 \author Franz Schmid
810
 \date
811
 \brief Runs QFileDialog to get Preferences (General) Path to Colour Profiles directory
812
 \param None
813
 \retval None
814
 */
815
void Preferences::changeProfs()
816
{
817
        QString s = QFileDialog::getExistingDirectory(ProPfad->text(), this, "d", tr("Choose a Directory"), true);
818
        if (s != "")
819
                ProPfad->setText(s);
820
}
821
 
822
/*!
823
 \fn void Preferences::ChangeScripts()
824
 \author Franz Schmid
825
 \date
826
 \brief Runs QFileDialog to get Preferences (General) Path to Scripts directory
827
 \param None
828
 \retval None
829
 */
830
void Preferences::changeScripts()
831
{
832
        QString s = QFileDialog::getExistingDirectory(ScriptPfad->text(), this, "d", tr("Choose a Directory"), true);
833
        if (s != "")
834
                ScriptPfad->setText(s);
835
}
836
 
837
/*!
838
 \fn void Preferences::ChangeTemplates()
839
 \author Riku Leino
840
 \date
841
 \brief Runs QFileDialog to get Preferences (General) Path to Templates directory
842
 \param None
843
 \retval None
844
 */
845
void Preferences::changeTemplates()
846
{
847
        QString s = QFileDialog::getExistingDirectory(TemplateDir->text(), this, "d", tr("Choose a Directory"), true);
848
        if (s != "")
849
                TemplateDir->setText(s);
850
}
851
 
852
/*!
853
 \fn void Preferences::setDS()
854
 \author Franz Schmid
855
 \date
856
 \brief Preferences (Document / Page Size), switches default between Facing Pages and swaps text labels for margin guides
857
 \param None
858
 \retval None
859
 */
860
void Preferences::setDS()
861
{
862
        bool m = facingPages->isChecked() ? true : false;
863
        GRText3->setText(m == true ? tr( "&Inside:" ) : tr( "&Left:" ));
864
        GRText4->setText(m == true ? tr( "O&utside:" ) : tr( "&Right:" ));
865
        Linkszuerst->setEnabled(m);
866
        if (m == false)
867
                Linkszuerst->setChecked(false);
868
}
869
 
870
/*!
871
 \fn void Preferences::setPageWidth(int v)
872
 \author Franz Schmid
873
 \date
874
 \brief Preferences (Document / Page Size), sets Page width values
875
 \param v Width value
876
 \retval None
877
 */
878
void Preferences::setPageWidth(int)
879
{
1790 cbradney 880
        Pagebr = pageWidth->value() / unitRatio;
1641 cbradney 881
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
882
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
883
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
884
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
885
}
886
 
887
/*!
888
 \fn void Preferences::setPageHeight(int v)
889
 \author Franz Schmid
890
 \date
891
 \brief Preferences (Document / Page Size), sets Page height values
892
 \param v Height value
893
 \retval None
894
 */
895
void Preferences::setPageHeight(int)
896
{
1790 cbradney 897
        Pageho = pageHeight->value() / unitRatio;
1641 cbradney 898
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
899
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
900
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
901
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
902
}
903
 
904
/*!
905
 \fn void Preferences::setTop(int v)
906
 \author Franz Schmid
907
 \date
908
 \brief Preferences (Document / Page Size), sets Page top values
909
 \param v Top value
910
 \retval None
911
 */
912
void Preferences::setTop(int)
913
{
1790 cbradney 914
        RandT = TopR->value() / unitRatio;
1641 cbradney 915
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
916
}
917
 
918
/*!
919
 \fn void Preferences::setBottom(int v)
920
 \author Franz Schmid
921
 \date
922
 \brief Preferences (Document / Page Size), sets Page bottom values
923
 \param v Bottom value
924
 \retval None
925
 */
926
void Preferences::setBottom(int)
927
{
1790 cbradney 928
        RandB = BottomR->value() / unitRatio;
1641 cbradney 929
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
930
}
931
 
932
/*!
933
 \fn void Preferences::setLeft(int v)
934
 \author Franz Schmid
935
 \date
936
 \brief Preferences (Document / Page Size), sets Page left values
937
 \param v Top value
938
 \retval None
939
 */
940
void Preferences::setLeft(int)
941
{
1790 cbradney 942
        RandL = LeftR->value() / unitRatio;
1641 cbradney 943
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
944
}
945
 
946
/*!
947
 \fn void Preferences::setRight(int v)
948
 \author Franz Schmid
949
 \date
950
 \brief Preferences (Document / Page Size), sets Page right values
951
 \param v Right value
952
 \retval None
953
 */
954
void Preferences::setRight(int)
955
{
1790 cbradney 956
        RandR = RightR->value() / unitRatio;
1641 cbradney 957
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
958
}
959
 
960
/*!
961
 \fn void Preferences::setSize(QString gr)
962
 \author Franz Schmid
963
 \date
964
 \brief Preferences (Document / Page Size), sets Page size values. Connects signals for setting page dimensions.
965
 \param gr Standard page size value (eg A4)
966
 \retval None
967
 */
968
void Preferences::setSize(const QString & gr)
969
{
1790 cbradney 970
        Pagebr = pageWidth->value() / unitRatio;
971
        Pageho = pageHeight->value() / unitRatio;
1641 cbradney 972
        pageWidth->setEnabled(false);
973
        pageHeight->setEnabled(false);
974
        PageSize *ps2=new PageSize(gr);
975
 
976
        prefsPageSizeName=ps2->getPageName();
977
        if (gr==tr("Custom"))
978
        {
979
                pageWidth->setEnabled(true);
980
                pageHeight->setEnabled(true);
981
        }
982
        else
983
        {
984
                Pagebr = ps2->getPageWidth();
985
                Pageho = ps2->getPageHeight();
986
        }
987
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
988
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1790 cbradney 989
        pageWidth->setValue(Pagebr * unitRatio);
990
        pageHeight->setValue(Pageho * unitRatio);
1641 cbradney 991
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
992
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
993
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
994
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
995
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
996
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
997
}
998
 
999
/*!
1000
 \fn void Preferences::setOrien(int ori)
1001
 \author Franz Schmid
1002
 \date
1003
 \brief Preferences (Document / Page Size), sets Page orientation value and page dimensions
1004
 \param ori Orientation value
1005
 \retval None
1006
 */
1007
void Preferences::setOrien(int ori)
1008
{
1009
        double br;
1010
        setSize(GZComboF->currentText());
1011
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1012
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1013
        if (ori == 0)
1014
        {
1015
                //if (GZComboF->currentItem() == 30)
1016
                if (GZComboF->currentText() == tr("Custom"))
1017
                {
1018
                        br = pageWidth->value();
1019
                        pageWidth->setValue(pageHeight->value());
1020
                        pageHeight->setValue(br);
1021
                }
1022
        }
1023
        else
1024
        {
1025
                br = pageWidth->value();
1026
                pageWidth->setValue(pageHeight->value());
1027
                pageHeight->setValue(br);
1028
        }
1029
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1030
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1031
}
1032
 
1033
/*!
1034
 \fn void Preferences::changePaperColor()
1035
 \author Franz Schmid
1036
 \date
1037
 \brief Preferences ([dox?], [dox?]), Sets Paper color [dox?]
1038
 \param None
1039
 \retval None
1040
 */
1041
void Preferences::changePaperColor()
1042
{
1043
        QColor neu = QColor();
1044
        neu = QColorDialog::getColor(colorPaper, this);
1045
        if (neu.isValid())
1046
        {
1047
                QPixmap pm = QPixmap(54, 14);
1048
                pm.fill(neu);
1049
                colorPaper = neu;
1050
                backColor->setPixmap(pm);
1051
        }
1052
}
1053
 
1054
/*!
1055
 \fn void Preferences::UnitChange()
1056
 \author Franz Schmid
1057
 \date
1058
 \brief Preferences (General, Units). Sets scaling factors and units descriptions when default units are changed. Updates preference values
1059
 \param None
1060
 \retval None
1061
 */
1062
void Preferences::unitChange()
1063
{
1064
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1065
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1066
        disconnect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1067
        disconnect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1068
        disconnect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1069
        disconnect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1070
        int decimals;
1790 cbradney 1071
        double oldUnitRatio = unitRatio;
1641 cbradney 1072
        double oldMin, oldMax, oldB, oldBM, oldH, oldHM, val;
1073
        pageWidth->getValues(&oldB, &oldBM, &decimals, &val);
1790 cbradney 1074
        oldB /= oldUnitRatio;
1075
        oldBM /= oldUnitRatio;
1641 cbradney 1076
        pageHeight->getValues(&oldH, &oldHM, &decimals, &val);
1790 cbradney 1077
        oldH /= oldUnitRatio;
1078
        oldHM /= oldUnitRatio;
1641 cbradney 1079
        QString einh;
1080
        docUnitIndex = UnitCombo->currentItem();
1790 cbradney 1081
        unitRatio = unitGetRatioFromIndex(docUnitIndex);
1641 cbradney 1082
        decimals = unitGetDecimalsFromIndex(docUnitIndex);
1083
        einh = unitGetSuffixFromIndex(docUnitIndex);
1084
 
1085
        pageWidth->setSuffix(einh);
1086
        pageHeight->setSuffix(einh);
1087
        TopR->setSuffix(einh);
1088
        BottomR->setSuffix(einh);
1089
        LeftR->setSuffix(einh);
1090
        RightR->setSuffix(einh);
1091
        tabGuides->minorSpace->setSuffix(einh);
1092
        tabGuides->majorSpace->setSuffix(einh);
1093
        tabGuides->snapDistance->setSuffix(einh);
1094
        tabGuides->baseGrid->setSuffix(einh);
1095
        tabGuides->baseOffset->setSuffix(einh);
1096
        tabTools->gapText->setSuffix(einh);
1097
        topScratch->setSuffix(einh);
1098
        bottomScratch->setSuffix(einh);
1099
        leftScratch->setSuffix(einh);
1100
        rightScratch->setSuffix(einh);
1101
        tabPDF->BleedBottom->setSuffix(einh);
1102
        tabPDF->BleedTop->setSuffix(einh);
1103
        tabPDF->BleedRight->setSuffix(einh);
1104
        tabPDF->BleedLeft->setSuffix(einh);
1790 cbradney 1105
        pageWidth->setValues(oldB * unitRatio, oldBM * unitRatio, decimals, Pagebr * unitRatio);
1106
        pageHeight->setValues(oldH * unitRatio, oldHM * unitRatio, decimals, Pageho * unitRatio);
1107
        TopR->setValues(0, pageHeight->value() - RandB * unitRatio, decimals, RandT * unitRatio);
1108
        BottomR->setValues(0, pageHeight->value() - RandT * unitRatio, decimals, RandB * unitRatio);
1109
        LeftR->setValues(0, pageWidth->value() - RandR * unitRatio, decimals, RandL * unitRatio);
1110
        RightR->setValues(0, pageWidth->value() - RandL * unitRatio, decimals, RandR * unitRatio);
1641 cbradney 1111
        int decimalsOld;
1790 cbradney 1112
        double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
1113
 
1641 cbradney 1114
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1115
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1116
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1117
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1118
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1119
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1120
        tabGuides->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1121
        tabGuides->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1122
        tabGuides->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1123
        tabGuides->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1124
        tabTools->gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1125
        tabTools->gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1126
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1127
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1128
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1129
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1130
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1131
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1132
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1133
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1134
        tabPDF->BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1135
        tabPDF->BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1136
        tabPDF->BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1137
        tabPDF->BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1138
        tabPDF->BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1139
        tabPDF->BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1140
        tabPDF->BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1141
        tabPDF->BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1790 cbradney 1142
        tabPDF->unitRatio = unitRatio;
1641 cbradney 1143
        drawRuler();
1144
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1145
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1146
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1147
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1148
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1149
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1150
}
1151
 
1152
/*!
1153
 \fn void Preferences::SetDisScale()
1154
 \author Franz Schmid
1155
 \date
1156
 \brief Preferences (Display, Display Size). Sets Scale for ruler scale
1157
 \param None
1158
 \retval None
1159
 */
1160
void Preferences::setDisScale()
1161
{
1162
        DisScale = QMAX((100.0 + CaliSlider->value()) / 100.0, 0.01);
1163
        drawRuler();
1164
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
1165
}
1166
 
1167
/*!
1168
 \fn void Preferences::DrawRuler()
1169
 \author Franz Schmid
1170
 \date
1171
 \brief Preferences (Display, Display Size). Draws ruler depending on scaling factor
1172
 \param None
1173
 \retval None
1174
 */
1175
void Preferences::drawRuler()
1176
{
1177
        double xl, iter, iter2, maxi;
1178
        switch (docUnitIndex)
1179
        {
1180
        case 0:
1181
                iter = 10.0;
1182
                iter2 = iter * 10.0;
1183
                maxi = 200.0;
1184
                break;
1185
        case 1:
1186
                iter = (10.0 / 25.4) * 72.0;
1187
                iter2 = iter * 10.0;
1188
                maxi = iter2;
1189
                break;
1190
        case 2:
1191
                iter = 18.0;
1192
                iter2 = 72.0;
1193
                maxi = 2 * iter2;
1194
                break;
1195
        case 3:
1196
                iter = 12.0;
1197
                iter2 = 120.0;
1198
                maxi = 240.0;
1199
                break;
1200
        default:
1201
                iter = 10.0;
1202
                iter2 = iter * 10.0;
1203
                maxi = 200.0;
1204
                break;
1205
        }
1206
 
1207
        QPixmap pm(static_cast<int>(maxi*DisScale+30), 21);
1208
        pm.fill();
1209
        QPainter p;
1210
        p.begin(&pm);
1211
        p.drawLine(0, 19, width(), 19);
1212
        p.setBrush(black);
1213
        p.setPen(black);
1214
        p.scale(DisScale, 1.0);
1215
        for (xl = 0; xl < maxi; xl += iter)
1216
                p.drawLine(static_cast<int>(xl), 13, static_cast<int>(xl), 19);
1217
        for (xl = 0; xl < maxi+10; xl += iter2)
1218
        {
1219
                p.drawLine(static_cast<int>(xl), 6, static_cast<int>(xl), 19);
1220
                p.save();
1221
                p.scale(1.0 / DisScale, 1.0);
1222
                switch (docUnitIndex)
1223
                {
1224
                case 2:
1225
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1226
                                   QString::number(xl / iter2));
1227
                        break;
1228
                case 3:
1229
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1230
                                   QString::number(xl / iter));
1231
                        break;
1232
                default:
1233
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1234
                                   QString::number(xl / iter * 10));
1235
                        break;
1236
                }
1237
                p.restore();
1238
        }
1239
        p.end();
1240
        CaliRuler->setPixmap(pm);
1241
}
1242
/*
1243
QString Preferences::getSelectedGUILang( )
1244
{
1245
        return langMgr.getAbbrevFromLang(guiLangCombo->currentText());
1246
}
1247
*/
1248
void Preferences::setSelectedGUILang( const QString &newLang )
1249
{
1250
        selectedGUILang=langMgr.getAbbrevFromLang(newLang);
1251
}
1252
 
1253
void Preferences::setActionHistoryLength()
1254
{
1255
  UndoManager::instance()->setHistoryLength(urSpinBox->value());
1256
}
1257
 
1258
void Preferences::switchCMS(bool enable)
1259
{
1260
        tabPDF->enableCMS(enable);
1261
}
1262
 
1263
/*! Set selected item(=plugin) un/loadable (petr vanek) */
1264
void Preferences::changePluginLoad(QListViewItem *item, const QPoint &, int column)
1265
{
1266
        if (column != 3)
1267
                return;
1268
        if (item->text(3) == tr("Yes"))
1269
        {
1270
                item->setPixmap(3, loadIcon("DateiClos16.png"));
1271
                item->setText(3, tr("No"));
1272
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = false;
1273
        }
1274
        else
1275
        {
1276
                item->setPixmap(3, loadIcon("ok.png"));
1277
                item->setText(3, tr("Yes"));
1278
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = true;
1279
        }
1280
}
1701 cbradney 1281
 
1282
void Preferences::setTOCIndexData(QWidget *widgetToShow)
1283
{
1284
        //Update the attributes list in TOC setup 
1285
        if (widgetToShow==tabDefaultTOCIndexPrefs)
1286
                tabDefaultTOCIndexPrefs->setupItemAttrs( tabDefaultItemAttributes->getDocAttributesNames() );
1287
}