Subversion Repositories Scribus

Rev

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