Subversion Repositories Scribus

Rev

Rev 1701 | Rev 1828 | 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();
774
        clearWState( WState_Polished );
775
}
776
 
777
/*!
778
 \fn Preferences::~Preferences
779
 \author Franz Schmid
780
 \date
781
 \brief Destructor for Preferences dialog box
782
 \param None
783
 \retval None
784
 */
785
Preferences::~Preferences()
786
{
787
        // no need to delete child widgets, Qt does it all for us
788
}
789
 
790
 
791
/*!
792
 \fn void Preferences::ChangeDocs()
793
 \author Franz Schmid
794
 \date
795
 \brief Runs QFileDialog to get Preferences (General) Path to Documents directory
796
 \param None
797
 \retval None
798
 */
799
void Preferences::changeDocs()
800
{
801
        QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
802
        if (s != "")
803
                Docs->setText(s);
804
}
805
 
806
/*!
807
 \fn void Preferences::ChangeProfs()
808
 \author Franz Schmid
809
 \date
810
 \brief Runs QFileDialog to get Preferences (General) Path to Colour Profiles directory
811
 \param None
812
 \retval None
813
 */
814
void Preferences::changeProfs()
815
{
816
        QString s = QFileDialog::getExistingDirectory(ProPfad->text(), this, "d", tr("Choose a Directory"), true);
817
        if (s != "")
818
                ProPfad->setText(s);
819
}
820
 
821
/*!
822
 \fn void Preferences::ChangeScripts()
823
 \author Franz Schmid
824
 \date
825
 \brief Runs QFileDialog to get Preferences (General) Path to Scripts directory
826
 \param None
827
 \retval None
828
 */
829
void Preferences::changeScripts()
830
{
831
        QString s = QFileDialog::getExistingDirectory(ScriptPfad->text(), this, "d", tr("Choose a Directory"), true);
832
        if (s != "")
833
                ScriptPfad->setText(s);
834
}
835
 
836
/*!
837
 \fn void Preferences::ChangeTemplates()
838
 \author Riku Leino
839
 \date
840
 \brief Runs QFileDialog to get Preferences (General) Path to Templates directory
841
 \param None
842
 \retval None
843
 */
844
void Preferences::changeTemplates()
845
{
846
        QString s = QFileDialog::getExistingDirectory(TemplateDir->text(), this, "d", tr("Choose a Directory"), true);
847
        if (s != "")
848
                TemplateDir->setText(s);
849
}
850
 
851
/*!
852
 \fn void Preferences::setDS()
853
 \author Franz Schmid
854
 \date
855
 \brief Preferences (Document / Page Size), switches default between Facing Pages and swaps text labels for margin guides
856
 \param None
857
 \retval None
858
 */
859
void Preferences::setDS()
860
{
861
        bool m = facingPages->isChecked() ? true : false;
862
        GRText3->setText(m == true ? tr( "&Inside:" ) : tr( "&Left:" ));
863
        GRText4->setText(m == true ? tr( "O&utside:" ) : tr( "&Right:" ));
864
        Linkszuerst->setEnabled(m);
865
        if (m == false)
866
                Linkszuerst->setChecked(false);
867
}
868
 
869
/*!
870
 \fn void Preferences::setPageWidth(int v)
871
 \author Franz Schmid
872
 \date
873
 \brief Preferences (Document / Page Size), sets Page width values
874
 \param v Width value
875
 \retval None
876
 */
877
void Preferences::setPageWidth(int)
878
{
1790 cbradney 879
        Pagebr = pageWidth->value() / unitRatio;
1641 cbradney 880
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
881
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
882
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
883
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
884
}
885
 
886
/*!
887
 \fn void Preferences::setPageHeight(int v)
888
 \author Franz Schmid
889
 \date
890
 \brief Preferences (Document / Page Size), sets Page height values
891
 \param v Height value
892
 \retval None
893
 */
894
void Preferences::setPageHeight(int)
895
{
1790 cbradney 896
        Pageho = pageHeight->value() / unitRatio;
1641 cbradney 897
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
898
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
899
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
900
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
901
}
902
 
903
/*!
904
 \fn void Preferences::setTop(int v)
905
 \author Franz Schmid
906
 \date
907
 \brief Preferences (Document / Page Size), sets Page top values
908
 \param v Top value
909
 \retval None
910
 */
911
void Preferences::setTop(int)
912
{
1790 cbradney 913
        RandT = TopR->value() / unitRatio;
1641 cbradney 914
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
915
}
916
 
917
/*!
918
 \fn void Preferences::setBottom(int v)
919
 \author Franz Schmid
920
 \date
921
 \brief Preferences (Document / Page Size), sets Page bottom values
922
 \param v Bottom value
923
 \retval None
924
 */
925
void Preferences::setBottom(int)
926
{
1790 cbradney 927
        RandB = BottomR->value() / unitRatio;
1641 cbradney 928
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
929
}
930
 
931
/*!
932
 \fn void Preferences::setLeft(int v)
933
 \author Franz Schmid
934
 \date
935
 \brief Preferences (Document / Page Size), sets Page left values
936
 \param v Top value
937
 \retval None
938
 */
939
void Preferences::setLeft(int)
940
{
1790 cbradney 941
        RandL = LeftR->value() / unitRatio;
1641 cbradney 942
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
943
}
944
 
945
/*!
946
 \fn void Preferences::setRight(int v)
947
 \author Franz Schmid
948
 \date
949
 \brief Preferences (Document / Page Size), sets Page right values
950
 \param v Right value
951
 \retval None
952
 */
953
void Preferences::setRight(int)
954
{
1790 cbradney 955
        RandR = RightR->value() / unitRatio;
1641 cbradney 956
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
957
}
958
 
959
/*!
960
 \fn void Preferences::setSize(QString gr)
961
 \author Franz Schmid
962
 \date
963
 \brief Preferences (Document / Page Size), sets Page size values. Connects signals for setting page dimensions.
964
 \param gr Standard page size value (eg A4)
965
 \retval None
966
 */
967
void Preferences::setSize(const QString & gr)
968
{
1790 cbradney 969
        Pagebr = pageWidth->value() / unitRatio;
970
        Pageho = pageHeight->value() / unitRatio;
1641 cbradney 971
        pageWidth->setEnabled(false);
972
        pageHeight->setEnabled(false);
973
        PageSize *ps2=new PageSize(gr);
974
 
975
        prefsPageSizeName=ps2->getPageName();
976
        if (gr==tr("Custom"))
977
        {
978
                pageWidth->setEnabled(true);
979
                pageHeight->setEnabled(true);
980
        }
981
        else
982
        {
983
                Pagebr = ps2->getPageWidth();
984
                Pageho = ps2->getPageHeight();
985
        }
986
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
987
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1790 cbradney 988
        pageWidth->setValue(Pagebr * unitRatio);
989
        pageHeight->setValue(Pageho * unitRatio);
1641 cbradney 990
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
991
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
992
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
993
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
994
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
995
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
996
}
997
 
998
/*!
999
 \fn void Preferences::setOrien(int ori)
1000
 \author Franz Schmid
1001
 \date
1002
 \brief Preferences (Document / Page Size), sets Page orientation value and page dimensions
1003
 \param ori Orientation value
1004
 \retval None
1005
 */
1006
void Preferences::setOrien(int ori)
1007
{
1008
        double br;
1009
        setSize(GZComboF->currentText());
1010
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1011
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1012
        if (ori == 0)
1013
        {
1014
                //if (GZComboF->currentItem() == 30)
1015
                if (GZComboF->currentText() == tr("Custom"))
1016
                {
1017
                        br = pageWidth->value();
1018
                        pageWidth->setValue(pageHeight->value());
1019
                        pageHeight->setValue(br);
1020
                }
1021
        }
1022
        else
1023
        {
1024
                br = pageWidth->value();
1025
                pageWidth->setValue(pageHeight->value());
1026
                pageHeight->setValue(br);
1027
        }
1028
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1029
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1030
}
1031
 
1032
/*!
1033
 \fn void Preferences::changePaperColor()
1034
 \author Franz Schmid
1035
 \date
1036
 \brief Preferences ([dox?], [dox?]), Sets Paper color [dox?]
1037
 \param None
1038
 \retval None
1039
 */
1040
void Preferences::changePaperColor()
1041
{
1042
        QColor neu = QColor();
1043
        neu = QColorDialog::getColor(colorPaper, this);
1044
        if (neu.isValid())
1045
        {
1046
                QPixmap pm = QPixmap(54, 14);
1047
                pm.fill(neu);
1048
                colorPaper = neu;
1049
                backColor->setPixmap(pm);
1050
        }
1051
}
1052
 
1053
/*!
1054
 \fn void Preferences::UnitChange()
1055
 \author Franz Schmid
1056
 \date
1057
 \brief Preferences (General, Units). Sets scaling factors and units descriptions when default units are changed. Updates preference values
1058
 \param None
1059
 \retval None
1060
 */
1061
void Preferences::unitChange()
1062
{
1063
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1064
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1065
        disconnect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1066
        disconnect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1067
        disconnect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1068
        disconnect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1069
        int decimals;
1790 cbradney 1070
        double oldUnitRatio = unitRatio;
1641 cbradney 1071
        double oldMin, oldMax, oldB, oldBM, oldH, oldHM, val;
1072
        pageWidth->getValues(&oldB, &oldBM, &decimals, &val);
1790 cbradney 1073
        oldB /= oldUnitRatio;
1074
        oldBM /= oldUnitRatio;
1641 cbradney 1075
        pageHeight->getValues(&oldH, &oldHM, &decimals, &val);
1790 cbradney 1076
        oldH /= oldUnitRatio;
1077
        oldHM /= oldUnitRatio;
1641 cbradney 1078
        QString einh;
1079
        docUnitIndex = UnitCombo->currentItem();
1790 cbradney 1080
        unitRatio = unitGetRatioFromIndex(docUnitIndex);
1641 cbradney 1081
        decimals = unitGetDecimalsFromIndex(docUnitIndex);
1082
        einh = unitGetSuffixFromIndex(docUnitIndex);
1083
 
1084
        pageWidth->setSuffix(einh);
1085
        pageHeight->setSuffix(einh);
1086
        TopR->setSuffix(einh);
1087
        BottomR->setSuffix(einh);
1088
        LeftR->setSuffix(einh);
1089
        RightR->setSuffix(einh);
1090
        tabGuides->minorSpace->setSuffix(einh);
1091
        tabGuides->majorSpace->setSuffix(einh);
1092
        tabGuides->snapDistance->setSuffix(einh);
1093
        tabGuides->baseGrid->setSuffix(einh);
1094
        tabGuides->baseOffset->setSuffix(einh);
1095
        tabTools->gapText->setSuffix(einh);
1096
        topScratch->setSuffix(einh);
1097
        bottomScratch->setSuffix(einh);
1098
        leftScratch->setSuffix(einh);
1099
        rightScratch->setSuffix(einh);
1100
        tabPDF->BleedBottom->setSuffix(einh);
1101
        tabPDF->BleedTop->setSuffix(einh);
1102
        tabPDF->BleedRight->setSuffix(einh);
1103
        tabPDF->BleedLeft->setSuffix(einh);
1790 cbradney 1104
        pageWidth->setValues(oldB * unitRatio, oldBM * unitRatio, decimals, Pagebr * unitRatio);
1105
        pageHeight->setValues(oldH * unitRatio, oldHM * unitRatio, decimals, Pageho * unitRatio);
1106
        TopR->setValues(0, pageHeight->value() - RandB * unitRatio, decimals, RandT * unitRatio);
1107
        BottomR->setValues(0, pageHeight->value() - RandT * unitRatio, decimals, RandB * unitRatio);
1108
        LeftR->setValues(0, pageWidth->value() - RandR * unitRatio, decimals, RandL * unitRatio);
1109
        RightR->setValues(0, pageWidth->value() - RandL * unitRatio, decimals, RandR * unitRatio);
1641 cbradney 1110
        int decimalsOld;
1790 cbradney 1111
        double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
1112
 
1641 cbradney 1113
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1114
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1115
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1116
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1117
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1118
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1119
        tabGuides->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1120
        tabGuides->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1121
        tabGuides->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1122
        tabGuides->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1123
        tabTools->gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1124
        tabTools->gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1125
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1126
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1127
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1128
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1129
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1130
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1131
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1132
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1133
        tabPDF->BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1134
        tabPDF->BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1135
        tabPDF->BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1136
        tabPDF->BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1137
        tabPDF->BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1138
        tabPDF->BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1139
        tabPDF->BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1140
        tabPDF->BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1790 cbradney 1141
        tabPDF->unitRatio = unitRatio;
1641 cbradney 1142
        drawRuler();
1143
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1144
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1145
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1146
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1147
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1148
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1149
}
1150
 
1151
/*!
1152
 \fn void Preferences::SetDisScale()
1153
 \author Franz Schmid
1154
 \date
1155
 \brief Preferences (Display, Display Size). Sets Scale for ruler scale
1156
 \param None
1157
 \retval None
1158
 */
1159
void Preferences::setDisScale()
1160
{
1161
        DisScale = QMAX((100.0 + CaliSlider->value()) / 100.0, 0.01);
1162
        drawRuler();
1163
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
1164
}
1165
 
1166
/*!
1167
 \fn void Preferences::DrawRuler()
1168
 \author Franz Schmid
1169
 \date
1170
 \brief Preferences (Display, Display Size). Draws ruler depending on scaling factor
1171
 \param None
1172
 \retval None
1173
 */
1174
void Preferences::drawRuler()
1175
{
1176
        double xl, iter, iter2, maxi;
1177
        switch (docUnitIndex)
1178
        {
1179
        case 0:
1180
                iter = 10.0;
1181
                iter2 = iter * 10.0;
1182
                maxi = 200.0;
1183
                break;
1184
        case 1:
1185
                iter = (10.0 / 25.4) * 72.0;
1186
                iter2 = iter * 10.0;
1187
                maxi = iter2;
1188
                break;
1189
        case 2:
1190
                iter = 18.0;
1191
                iter2 = 72.0;
1192
                maxi = 2 * iter2;
1193
                break;
1194
        case 3:
1195
                iter = 12.0;
1196
                iter2 = 120.0;
1197
                maxi = 240.0;
1198
                break;
1199
        default:
1200
                iter = 10.0;
1201
                iter2 = iter * 10.0;
1202
                maxi = 200.0;
1203
                break;
1204
        }
1205
 
1206
        QPixmap pm(static_cast<int>(maxi*DisScale+30), 21);
1207
        pm.fill();
1208
        QPainter p;
1209
        p.begin(&pm);
1210
        p.drawLine(0, 19, width(), 19);
1211
        p.setBrush(black);
1212
        p.setPen(black);
1213
        p.scale(DisScale, 1.0);
1214
        for (xl = 0; xl < maxi; xl += iter)
1215
                p.drawLine(static_cast<int>(xl), 13, static_cast<int>(xl), 19);
1216
        for (xl = 0; xl < maxi+10; xl += iter2)
1217
        {
1218
                p.drawLine(static_cast<int>(xl), 6, static_cast<int>(xl), 19);
1219
                p.save();
1220
                p.scale(1.0 / DisScale, 1.0);
1221
                switch (docUnitIndex)
1222
                {
1223
                case 2:
1224
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1225
                                   QString::number(xl / iter2));
1226
                        break;
1227
                case 3:
1228
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1229
                                   QString::number(xl / iter));
1230
                        break;
1231
                default:
1232
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1233
                                   QString::number(xl / iter * 10));
1234
                        break;
1235
                }
1236
                p.restore();
1237
        }
1238
        p.end();
1239
        CaliRuler->setPixmap(pm);
1240
}
1241
/*
1242
QString Preferences::getSelectedGUILang( )
1243
{
1244
        return langMgr.getAbbrevFromLang(guiLangCombo->currentText());
1245
}
1246
*/
1247
void Preferences::setSelectedGUILang( const QString &newLang )
1248
{
1249
        selectedGUILang=langMgr.getAbbrevFromLang(newLang);
1250
}
1251
 
1252
void Preferences::setActionHistoryLength()
1253
{
1254
  UndoManager::instance()->setHistoryLength(urSpinBox->value());
1255
}
1256
 
1257
void Preferences::switchCMS(bool enable)
1258
{
1259
        tabPDF->enableCMS(enable);
1260
}
1261
 
1262
/*! Set selected item(=plugin) un/loadable (petr vanek) */
1263
void Preferences::changePluginLoad(QListViewItem *item, const QPoint &, int column)
1264
{
1265
        if (column != 3)
1266
                return;
1267
        if (item->text(3) == tr("Yes"))
1268
        {
1269
                item->setPixmap(3, loadIcon("DateiClos16.png"));
1270
                item->setText(3, tr("No"));
1271
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = false;
1272
        }
1273
        else
1274
        {
1275
                item->setPixmap(3, loadIcon("ok.png"));
1276
                item->setText(3, tr("Yes"));
1277
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = true;
1278
        }
1279
}
1701 cbradney 1280
 
1281
void Preferences::setTOCIndexData(QWidget *widgetToShow)
1282
{
1283
        //Update the attributes list in TOC setup 
1284
        if (widgetToShow==tabDefaultTOCIndexPrefs)
1285
                tabDefaultTOCIndexPrefs->setupItemAttrs( tabDefaultItemAttributes->getDocAttributesNames() );
1286
}