Subversion Repositories Scribus

Rev

Rev 3093 | Rev 3097 | 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"
2769 fschmid 35
#include "marginWidget.h"
2834 cbradney 36
#include "prefsmanager.h"
2873 cbradney 37
#include "polygonwidget.h"
38
#include "fontcombo.h"
39
#include "linecombo.h"
40
#include "arrowchooser.h"
2901 fschmid 41
#include "pagelayout.h"
1641 cbradney 42
 
43
using namespace std;
44
 
45
extern QPixmap loadIcon(QString nam);
46
extern bool CMSavail;
2873 cbradney 47
extern bool CMSuse;
1641 cbradney 48
extern ScribusApp *ScApp;
49
 
50
/*!
2834 cbradney 51
 \fn Preferences::Preferences( QWidget* parent)
1641 cbradney 52
 \author Franz Schmid
53
 \date
54
 \brief Constructor for Preferences dialog box
55
 \param parent QWidget pointer to parent window
2834 cbradney 56
 \param prefsData->ApplicationPrefs * struct
1641 cbradney 57
 \retval Preferences dialog
58
 */
2834 cbradney 59
Preferences::Preferences( QWidget* parent) : PrefsDialogBase( parent )
1641 cbradney 60
{
2834 cbradney 61
        prefsManager=PrefsManager::instance();
62
        ApplicationPrefs* prefsData=&(prefsManager->appPrefs);
1641 cbradney 63
        int decimals;
64
        ap = (ScribusApp*)parent;
65
        docUnitIndex = prefsData->docUnitIndex;
1790 cbradney 66
        unitRatio = unitGetRatioFromIndex(docUnitIndex);
1641 cbradney 67
        decimals = unitGetPrecisionFromIndex(docUnitIndex);
68
 
69
        DisScale = prefsData->DisScale;
70
        setCaption( tr( "Preferences" ) );
71
 
72
        tab = new QWidget( prefsWidgets, "tab" );
73
        tabLayout = new QGridLayout( tab );
1878 cbradney 74
        tabLayout->setSpacing( 5 );
75
        tabLayout->setMargin( 0 );
1641 cbradney 76
        tabLayout->setAlignment( Qt::AlignTop );
77
 
78
        // GUI Group
79
        ButtonGroup1 = new QButtonGroup( tr( "GUI" ), tab, "ButtonGroup1" );
80
        ButtonGroup1->setColumnLayout(0, Qt::Vertical );
81
        ButtonGroup1->layout()->setSpacing( 0 );
82
        ButtonGroup1->layout()->setMargin( 0 );
83
        ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
84
        ButtonGroup1Layout->setAlignment( Qt::AlignTop );
85
        ButtonGroup1Layout->setSpacing( 6 );
86
        ButtonGroup1Layout->setMargin( 10 );
87
 
88
        langMgr.init();
89
        QStringList languageList;
90
        langMgr.fillInstalledStringList(&languageList, true);
91
        languageList.sort();
92
        guiLangCombo = new QComboBox( false, ButtonGroup1, "guiLangCombo");
93
        guiLangCombo->insertStringList( languageList );
94
        selectedGUILang=prefsData->guiLanguage;
2834 cbradney 95
        guiLangCombo->setCurrentText(langMgr.getLangFromAbbrev(selectedGUILang));
1641 cbradney 96
        guiLangLabel = new QLabel(guiLangCombo, tr("&Language:"), ButtonGroup1, "guiLangLabel");
97
        ButtonGroup1Layout->addWidget( guiLangLabel, 0, 0 );
2439 cbradney 98
        ButtonGroup1Layout->addWidget( guiLangCombo, 0, 1 );
1641 cbradney 99
 
100
        GUICombo = new QComboBox( true, ButtonGroup1, "GUICombo" );
101
        QStringList STtest;
102
        STtest = QStyleFactory::keys();
103
        for (uint stt = 0; stt < STtest.count(); ++stt)
104
                GUICombo->insertItem(STtest[stt]);
105
        GUICombo->setEditable(false);
106
        GUICombo->setCurrentText(prefsData->GUI);
107
        TextGstil = new QLabel(GUICombo, tr("&Theme:"), ButtonGroup1, "dd");
108
        ButtonGroup1Layout->addWidget( TextGstil, 1, 0 );
2439 cbradney 109
        ButtonGroup1Layout->addWidget( GUICombo, 1, 1 );
1641 cbradney 110
 
1790 cbradney 111
        GFsize = new QSpinBox(8, 22, 1, ButtonGroup1, "gfs" );
1641 cbradney 112
        GFsize->setSuffix( tr( " pt" ) );
113
        GFsize->setValue( prefsData->AppFontSize );
114
        TextGstil2 = new QLabel(GFsize, tr("&Font Size:"), ButtonGroup1, "dd");
115
        ButtonGroup1Layout->addWidget( TextGstil2, 2, 0 );
116
        ButtonGroup1Layout->addWidget( GFsize, 2, 1, Qt::AlignLeft );
1790 cbradney 117
        SpinBox3 = new QSpinBox( 0, 1000, 10, ButtonGroup1, "SpinBox3" );
1641 cbradney 118
        SpinBox3->setValue( prefsData->Wheelval );
119
        TextLabel1_2 = new QLabel( SpinBox3, tr( "&Wheel Jump:" ), ButtonGroup1, "TextLabel1_2" );
120
        ButtonGroup1Layout->addWidget( TextLabel1_2, 3, 0 );
121
        ButtonGroup1Layout->addWidget( SpinBox3, 3, 1, Qt::AlignLeft );
1790 cbradney 122
        Recen = new QSpinBox( 1, 30, 1, ButtonGroup1, "Recen" );
1641 cbradney 123
        Recen->setValue( prefsData->RecentDCount );
124
        TextLabel4c = new QLabel( Recen, tr( "&Recent Documents:" ), ButtonGroup1, "TextLabel4c" );
125
        ButtonGroup1Layout->addWidget( TextLabel4c, 4, 0);
126
        ButtonGroup1Layout->addWidget( Recen, 4, 1, Qt::AlignLeft );
127
        tabLayout->addWidget( ButtonGroup1, 0, 0 );
128
 
129
        GroupBox200 = new QGroupBox( tr( "Paths" ), tab, "GroupBox200" );
130
        GroupBox200->setColumnLayout(0, Qt::Horizontal );
131
        GroupBox200->layout()->setSpacing( 0 );
132
        GroupBox200->layout()->setMargin( 0 );
133
        GroupBox200Layout = new QGridLayout( GroupBox200->layout() );
134
        GroupBox200Layout->setAlignment( Qt::AlignTop );
135
        GroupBox200Layout->setSpacing( 0 );
136
        GroupBox200Layout->setMargin( 5 );
137
 
138
        Docs = new QLineEdit( GroupBox200, "Datei" );
139
        Docs->setMinimumSize( QSize( 268, 22 ) );
140
        Docs->setText(prefsData->DocDir);
141
        PfadText = new QLabel( Docs, tr("&Documents:"), GroupBox200, "Pfadtext" );
142
        FileC = new QToolButton( GroupBox200, "FileC" );
143
        FileC->setMinimumSize( QSize( 88, 24 ) );
144
        FileC->setText( tr( "&Change..." ) );
145
        GroupBox200Layout->addWidget( PfadText, 0, 0 );
146
        GroupBox200Layout->addWidget( Docs, 0, 1 );
147
        GroupBox200Layout->addWidget( FileC, 0, 2 );
148
 
149
        ProPfad = new QLineEdit( GroupBox200, "Datei1" );
150
        ProPfad->setMinimumSize( QSize( 268, 22 ) );
151
        ProPfad->setText(prefsData->ProfileDir);
2012 fschmid 152
        if (ScApp->HaveDoc)
153
                ProPfad->setEnabled(false);
1641 cbradney 154
        PfadText2 = new QLabel( ProPfad, tr("&ICC Profiles:"), GroupBox200, "Pfadtext1" );
155
        FileC2 = new QToolButton( GroupBox200, "FileC1" );
156
        FileC2->setMinimumSize( QSize( 88, 24 ) );
157
        FileC2->setText( tr( "C&hange..." ) );
2012 fschmid 158
        if (ScApp->HaveDoc)
159
                FileC2->setEnabled(false);
1641 cbradney 160
        GroupBox200Layout->addWidget( PfadText2, 1, 0 );
161
        GroupBox200Layout->addWidget( ProPfad, 1, 1 );
162
        GroupBox200Layout->addWidget( FileC2, 1, 2 );
163
 
164
        ScriptPfad = new QLineEdit( GroupBox200, "Datei1" );
165
        ScriptPfad->setMinimumSize( QSize( 268, 22 ) );
166
        ScriptPfad->setText(prefsData->ScriptDir);
167
        PfadText3 = new QLabel( ScriptPfad, tr("&Scripts:"), GroupBox200, "Pfadtext1" );
168
        FileC3 = new QToolButton( GroupBox200, "FileC3" );
169
        FileC3->setMinimumSize( QSize( 88, 24 ) );
170
        FileC3->setText( tr( "Ch&ange..." ) );
171
        GroupBox200Layout->addWidget( PfadText3, 2, 0 );
172
        GroupBox200Layout->addWidget( ScriptPfad, 2, 1 );
173
        GroupBox200Layout->addWidget( FileC3, 2, 2 );
174
 
2093 cbradney 175
        DocumentTemplateDir = new QLineEdit( GroupBox200, "Datei1" );
176
        DocumentTemplateDir->setMinimumSize( QSize( 268, 22 ) );
177
        DocumentTemplateDir->setText(prefsData->documentTemplatesDir);
178
        PfadText4 = new QLabel( DocumentTemplateDir, tr("Document T&emplates:"), GroupBox200, "Pfadtext1" );
1641 cbradney 179
        FileC4 = new QToolButton( GroupBox200, "FileC4" );
180
        FileC4->setMinimumSize( QSize( 88, 24 ) );
181
        FileC4->setText( tr( "Cha&nge..." ) );
182
        GroupBox200Layout->addWidget( PfadText4, 3, 0 );
2093 cbradney 183
        GroupBox200Layout->addWidget( DocumentTemplateDir, 3, 1 );
1641 cbradney 184
        GroupBox200Layout->addWidget( FileC4, 3, 2 );
185
        tabLayout->addWidget( GroupBox200, 1, 0 );
186
        addItem( tr("General"), loadIcon("AppIcon.png"), tab);
187
 
188
        tab_7 = new QWidget( prefsWidgets, "tab_7" );
1878 cbradney 189
        tabLayout_7 = new QHBoxLayout( tab_7, 0, 5, "tabLayout_7");
1641 cbradney 190
        Layout21 = new QVBoxLayout( 0, 0, 6, "Layout21");
2901 fschmid 191
        dsLayout4p = new QHBoxLayout;
192
        dsLayout4p->setSpacing( 5 );
193
        dsLayout4p->setMargin( 0 );
194
        dsLayout4p->setAlignment( Qt::AlignLeft );
3026 fschmid 195
        docLayout = new PageLayouts(tab_7, prefsData->pageSets);
2901 fschmid 196
        docLayout->selectItem(prefsData->FacingPages);
3016 fschmid 197
        docLayout->firstPage->setCurrentItem(prefsData->pageSets[prefsData->FacingPages].FirstPage);
2901 fschmid 198
        dsLayout4p->addWidget( docLayout );
199
        dsLayout4pv = new QVBoxLayout;
200
        dsLayout4pv->setSpacing( 5 );
201
        dsLayout4pv->setMargin( 0 );
202
 
1641 cbradney 203
        GroupSize = new QButtonGroup( tr( "Page Size" ), tab_7, "GroupSize" );
204
        GroupSize->setColumnLayout(0, Qt::Vertical );
205
        GroupSize->layout()->setSpacing( 6 );
206
        GroupSize->layout()->setMargin( 10 );
207
        GroupSizeLayout = new QVBoxLayout( GroupSize->layout() );
208
        GroupSizeLayout->setAlignment( Qt::AlignTop );
209
        Layout6 = new QGridLayout( 0, 1, 1, 0, 6, "Layout6");
210
 
211
        GZComboF = new QComboBox( true, GroupSize, "GZComboF" );
212
        /*
213
        const QString ar_size[] =
214
            {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3",
215
             "B4", "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", tr("Executive"),
216
             tr("Folio"), tr("Ledger"), tr("Legal"), tr("Letter"), tr("Tabloid")
217
            };
218
        size_t ar_s = sizeof(ar_size) / sizeof(*ar_size);
219
        for (uint s = 0; s < ar_s; ++s)
220
                GZComboF->insertItem(ar_size[s]);
221
        */
222
 
223
        PageSize *ps=new PageSize(prefsData->pageSize);
224
        GZComboF->insertStringList(ps->getTrPageSizeList());
225
        GZComboF->insertItem( tr( "Custom" ) );
226
        GZComboF->setEditable(false);
227
 
228
        QStringList pageSizes=ps->getPageSizeList();
229
        int sizeIndex=pageSizes.findIndex(ps->getPageText());
230
        if (sizeIndex!=-1)
231
                GZComboF->setCurrentItem(sizeIndex);
232
        else
233
                GZComboF->setCurrentItem(GZComboF->count()-1);
234
        GZText1 = new QLabel( GZComboF, tr( "&Size:" ), GroupSize, "GZText1" );
235
        Layout6->addWidget( GZText1, 0, 0 );
236
        Layout6->addWidget( GZComboF, 0, 1 );
237
 
238
        GZComboO = new QComboBox( true, GroupSize, "GZComboO" );
239
        GZComboO->insertItem( tr( "Portrait" ) );
240
        GZComboO->insertItem( tr( "Landscape" ) );
241
        GZComboO->setEditable(false);
242
        GZComboO->setCurrentItem(prefsData->pageOrientation);
243
        GZText2 = new QLabel( GZComboO, tr( "Orie&ntation:" ), GroupSize, "GZText2" );
244
        Layout6->addWidget( GZText2, 1, 0 );
245
        Layout6->addWidget( GZComboO, 1, 1 );
246
        UnitCombo = new QComboBox( true, GroupSize, "UnitCombo" );
247
        UnitCombo->insertStringList(unitGetTextUnitList());
248
        UnitCombo->setEditable(false);
249
        UnitCombo->setCurrentItem(prefsData->docUnitIndex);
250
        unitComboText = new QLabel( UnitCombo, tr( "Units:" ), GroupSize, "unitComboText" );
251
        Layout6->addWidget( unitComboText, 2, 0 );
252
        Layout6->addWidget( UnitCombo, 2, 1 );
253
 
254
        GroupSizeLayout->addLayout( Layout6 );
255
 
256
        Layout5_2 = new QHBoxLayout( 0, 0, 6, "Layout5_2");
257
 
2582 cbradney 258
        pageWidth = new MSpinBox( 1, 100000, GroupSize, decimals );
1641 cbradney 259
        pageWidth->setEnabled( false );
260
        pageWidth->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 261
        pageWidth->setValue(prefsData->PageWidth * unitRatio);
1641 cbradney 262
        GZText3 = new QLabel( pageWidth, tr( "&Width:" ), GroupSize, "GZText3" );
263
        Layout5_2->addWidget( GZText3 );
264
        Layout5_2->addWidget( pageWidth );
265
 
2582 cbradney 266
        pageHeight = new MSpinBox( 1, 100000, GroupSize, decimals );
1641 cbradney 267
        pageHeight->setEnabled( false );
268
        pageHeight->setMinimumSize( QSize( 70, 20 ) );
1790 cbradney 269
        pageHeight->setValue(prefsData->PageHeight * unitRatio);
1641 cbradney 270
        GZText4 = new QLabel( pageHeight, tr( "&Height:" ), GroupSize, "GZText4" );
271
        Layout5_2->addWidget( GZText4 );
272
        Layout5_2->addWidget( pageHeight );
273
 
274
        GroupSizeLayout->addLayout( Layout5_2 );
2901 fschmid 275
        dsLayout4pv->addWidget( GroupSize );
1641 cbradney 276
 
2769 fschmid 277
        struct MarginStruct marg;
278
        marg.Top = prefsData->RandOben;
279
        marg.Bottom = prefsData->RandUnten;
280
        marg.Left = prefsData->RandLinks;
281
        marg.Right = prefsData->RandRechts;
282
        GroupRand = new MarginWidget(tab_7,  tr( "Margin Guides" ), &marg, decimals, unitRatio, unitGetSuffixFromIndex(docUnitIndex) );
283
        GroupRand->setPageHeight(prefsData->PageHeight);
284
        GroupRand->setPageWidth(prefsData->PageWidth);
2901 fschmid 285
        dsLayout4pv->addWidget( GroupRand );
286
        dsLayout4p->addLayout( dsLayout4pv );
287
        Layout21->addLayout( dsLayout4p );
1641 cbradney 288
        QBoxLayout *asurLayout = new QHBoxLayout( 0, 0, 6, "asurLayout");
289
 
290
        GroupAS = new QGroupBox( tr( "Autosave" ), tab_7, "GroupAS" );
291
        GroupAS->setColumnLayout(0, Qt::Vertical );
292
        GroupAS->layout()->setSpacing( 5 );
293
        GroupAS->layout()->setMargin( 10 );
294
        GroupASLayout = new QGridLayout( GroupAS->layout() );
295
        GroupASLayout->setAlignment( Qt::AlignTop );
296
        ASon = new QCheckBox( tr( "&Enabled" ), GroupAS, "Enable Autosave" );
297
        ASon->setChecked(prefsData->AutoSave);
298
        GroupASLayout->addMultiCellWidget( ASon, 0, 0, 0, 1 );
299
        ASTime = new QSpinBox( GroupAS, "Time" );
300
        ASTime->setMaxValue( 60 );
301
        ASTime->setMinValue( 1 );
302
        ASTime->setSuffix( " " + tr("min") );
303
        ASTime->setValue(prefsData->AutoSaveTime / 1000 / 60);
304
        ASText = new QLabel( ASTime, tr( "&Interval:" ), GroupAS, "ASText" );
305
        GroupASLayout->addWidget( ASText, 1, 0 );
306
        GroupASLayout->addWidget( ASTime, 1, 1 );
307
        asurLayout->addWidget(GroupAS);
308
 
2397 cbradney 309
        urGroup = new QGroupBox( tr("Undo/Redo"), tab_7, "urGroup");
1641 cbradney 310
        urGroup->setColumnLayout(0, Qt::Vertical);
311
        urGroup->layout()->setSpacing(5);
312
        urGroup->layout()->setMargin(10);
313
        QGridLayout *urGroupLayout = new QGridLayout(urGroup->layout());
314
        urGroupLayout->setAlignment(Qt::AlignTop);
315
        urSpinBox = new QSpinBox(urGroup, "urSpinBox");
316
        urSpinBox->setMinValue(0);
317
        urSpinBox->setMaxValue(1000);
318
        int urSBValue = UndoManager::instance()->getHistoryLength();
319
        if (urSBValue == -1)
320
                urSpinBox->setEnabled(false);
321
        else
322
                urSpinBox->setValue(urSBValue);
323
        urLabel = new QLabel(urSpinBox, tr("Action history length"), urGroup, "urLabel");
324
        urGroupLayout->addWidget(urLabel, 0, 0);
325
        urGroupLayout->addWidget(urSpinBox, 0, 1);
326
        asurLayout->addWidget(urGroup);
327
        Layout21->addLayout(asurLayout);
328
 
329
        tabLayout_7->addLayout( Layout21 );
330
        addItem( tr("Document"), loadIcon("page.png"), tab_7);
331
 
2889 cbradney 332
        tabGuides = new TabGuides(prefsWidgets, &prefsData->guidesSettings, &prefsData->typographicSettings, docUnitIndex);
1641 cbradney 333
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
2889 cbradney 334
        tabTypo = new TabTypograpy(  prefsWidgets, &prefsData->typographicSettings);
1641 cbradney 335
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
1790 cbradney 336
        tabTools = new TabTools(  prefsWidgets, &prefsData->toolSettings, docUnitIndex, 0);
1641 cbradney 337
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
338
 
339
        tabHyphenator = new HySettings(prefsWidgets, &ap->LangTransl);
340
        tabHyphenator->verbose->setChecked(!prefsData->Automatic);
341
        tabHyphenator->input->setChecked(prefsData->AutoCheck);
342
        tabHyphenator->language->setCurrentText(ap->LangTransl[prefsData->Language]);
343
        tabHyphenator->wordLen->setValue(prefsData->MinWordLen);
344
        tabHyphenator->maxCount->setValue(prefsData->HyCount);
345
        addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator);
346
 
2834 cbradney 347
        tabFonts = new FontPrefs(  prefsWidgets, prefsData->AvailFonts, false, ap->PrefsPfad, 0);
1641 cbradney 348
        addItem( tr("Fonts"), loadIcon("font.png"), tabFonts);
349
 
350
        tabDocChecker = new TabCheckDoc(  prefsWidgets, prefsData->checkerProfiles, prefsData->curCheckProfile);
2770 cbradney 351
        addItem( tr("Preflight Verifier"), loadIcon("checkdoc.png"), tabDocChecker);
1641 cbradney 352
 
353
        if (CMSavail)
354
        {
2989 fschmid 355
                tabColorManagement = new CMSPrefs(prefsWidgets, &prefsData->DCMSset, &ap->InputProfiles, &ap->InputProfilesCMYK, &ap->PrinterProfiles, &ap->MonitorProfiles);
1641 cbradney 356
                addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
357
        }
358
        QMap<QString,QFont> DocFonts;
359
        DocFonts.clear();
360
        tabPDF = new TabPDFOptions( prefsWidgets,
361
                                                                &prefsData->PDF_Options,
2834 cbradney 362
                                                                prefsData->AvailFonts,
1641 cbradney 363
                                                                &ap->PDFXProfiles,
364
                                                                DocFonts,
365
                                                                prefsData->PDF_Options.PresentVals,
1790 cbradney 366
                                                                docUnitIndex,
1641 cbradney 367
                                                                prefsData->PageHeight,
368
                                                                prefsData->PageWidth,
369
 
370
        addItem( tr("PDF Export"), loadIcon("acroread.png"), tabPDF);
1644 cbradney 371
 
1641 cbradney 372
        tabDefaultItemAttributes = new DocumentItemAttributes( prefsWidgets);
1701 cbradney 373
        defaultAttributesList=tabDefaultItemAttributes->getDocAttributesNames();
1641 cbradney 374
        tabDefaultItemAttributes->setup(&prefsData->defaultItemAttributes);
375
        addItem( tr("Document Item Attributes"), loadIcon("docattributes.png"), tabDefaultItemAttributes);
1701 cbradney 376
 
377
        tabDefaultTOCIndexPrefs = new TOCIndexPrefs( prefsWidgets );
378
        tabDefaultTOCIndexPrefs->setupItemAttrs( defaultAttributesList );
379
        tabDefaultTOCIndexPrefs->setup(&prefsData->defaultToCSetups, NULL);
380
        connect( prefsWidgets, SIGNAL(aboutToShow(QWidget *)), this, SLOT(setTOCIndexData(QWidget *)));
381
        addItem( tr("Table of Contents and Indexes"), loadIcon("tabtocindex.png"), tabDefaultTOCIndexPrefs);
2784 subik 382
 
383
 
1641 cbradney 384
        tabKeys = new KeyManager(prefsWidgets, prefsData->KeyActions);
385
        addItem( tr("Keyboard Shortcuts"), loadIcon("key_bindings.png"), tabKeys);
386
 
387
        tab_5 = new QWidget( prefsWidgets, "tab_5" );
388
        tabLayout_5 = new QGridLayout( tab_5 );
1878 cbradney 389
        tabLayout_5->setSpacing( 5 );
390
        tabLayout_5->setMargin( 0 );
1641 cbradney 391
        saving = new QGroupBox( tr( "Other Options" ), tab_5, "Saving" );
392
        saving->setColumnLayout(0, Qt::Vertical );
393
        saving->layout()->setSpacing( 0 );
394
        saving->layout()->setMargin( 0 );
395
        savingLayout = new QHBoxLayout( saving->layout() );
396
        savingLayout->setAlignment( Qt::AlignTop );
397
        savingLayout->setSpacing( 6 );
398
        savingLayout->setMargin( 25 );
399
        SaveAtQuit = new QCheckBox( tr( "Sa&ve Contents on Changes" ), saving, "SaveAtQuit" );
400
        SaveAtQuit->setChecked(prefsData->SaveAtQ);
401
        savingLayout->addWidget( SaveAtQuit );
402
        tabLayout_5->addWidget( saving, 1, 0 );
403
        preview = new QGroupBox( tr( "Preview" ), tab_5, "Preview" );
404
        preview->setColumnLayout(0, Qt::Vertical );
405
        preview->layout()->setSpacing( 0 );
406
        preview->layout()->setMargin( 0 );
407
        previewLayout = new QHBoxLayout( preview->layout() );
408
        previewLayout->setAlignment( Qt::AlignTop );
409
        previewLayout->setSpacing( 10 );
410
        previewLayout->setMargin( 24 );
411
        PreviewSize = new QComboBox( true, preview, "PreviewSize" );
412
        PreviewSize->insertItem( tr( "Small" ) );
413
        PreviewSize->insertItem( tr( "Medium" ) );
414
        PreviewSize->insertItem( tr( "Large" ) );
415
        PreviewSize->setEditable(false);
416
        int sci = prefsData->PSize == 40 ? 0 : prefsData->PSize == 60 ? 1 : 2;
417
        PreviewSize->setCurrentItem(sci);
418
        textLabelP = new QLabel( PreviewSize, tr( "&Size:" ), preview, "TextLabel1_3" );
419
        previewLayout->addWidget( textLabelP );
420
        previewLayout->addWidget( PreviewSize );
421
        tabLayout_5->addWidget( preview, 0, 0 );
422
        addItem(  tr("Scrapbook"), loadIcon("scrap.png"), tab_5);
423
 
424
        tabView = new QWidget( prefsWidgets, "tabView" );
1878 cbradney 425
        tabViewLayout = new QVBoxLayout( tabView, 0, 5, "tabViewLayout");
1641 cbradney 426
        tabViewLayout->setAlignment( Qt::AlignTop );
427
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
428
        pageBackground->setTitle( tr( "Page Display" ) );
429
        pageBackground->setColumnLayout(0, Qt::Vertical );
430
        pageBackground->layout()->setSpacing( 5 );
431
        pageBackground->layout()->setMargin( 10 );
2872 fschmid 432
        pageBackgroundLayout = new QGridLayout( pageBackground->layout() );
1641 cbradney 433
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
434
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
435
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
436
        textLabel9->setText( tr( "Color:" ) );
437
        layout10->addWidget( textLabel9 );
438
        backColor = new QPushButton( pageBackground, "backColor" );
439
        backColor->setMinimumSize( QSize( 60, 20 ) );
440
        backColor->setMaximumSize( QSize( 60, 20 ) );
441
        backColor->setFlat( false );
442
        backColor->setAutoDefault( false );
443
        QPixmap pm5 = QPixmap(54, 14);
444
        pm5.fill(prefsData->DpapColor);
445
        colorPaper = prefsData->DpapColor;
446
        backColor->setPixmap(pm5);
447
        backColor->setText( QString::null );
448
        layout10->addWidget( backColor );
449
        QSpacerItem* spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
450
        layout10->addItem( spacer3 );
2872 fschmid 451
        pageBackgroundLayout->addLayout( layout10, 0 ,0 );
1641 cbradney 452
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
453
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
454
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
455
        checkUnprintable->setChecked( prefsData->marginColored );
2872 fschmid 456
        pageBackgroundLayout->addWidget( checkUnprintable, 0, 1 );
1641 cbradney 457
        checkPictures = new QCheckBox( pageBackground, "checkPictures" );
458
        checkPictures->setText( tr( "Show Pictures" ) );
459
        checkPictures->setChecked(prefsData->guidesSettings.showPic);
2872 fschmid 460
        pageBackgroundLayout->addWidget( checkPictures, 1 , 0 );
1641 cbradney 461
        checkLink = new QCheckBox( pageBackground, "checkLink" );
462
        checkLink->setText( tr( "Show Text Chains" ) );
463
        checkLink->setChecked(prefsData->guidesSettings.linkShown);
2872 fschmid 464
        pageBackgroundLayout->addWidget( checkLink, 1, 1 );
2353 fschmid 465
        checkControl = new QCheckBox( pageBackground, "checkControl" );
466
        checkControl->setText( tr( "Show Text Control Characters" ) );
467
        checkControl->setChecked(prefsData->guidesSettings.showControls);
2872 fschmid 468
        pageBackgroundLayout->addWidget( checkControl, 2 , 0 );
1641 cbradney 469
        checkFrame = new QCheckBox( pageBackground, "checkFrame" );
470
        checkFrame->setText( tr( "Show Frames" ) );
471
        checkFrame->setChecked(prefsData->guidesSettings.framesShown);
2872 fschmid 472
        pageBackgroundLayout->addWidget( checkFrame, 2, 1 );
2863 fschmid 473
        checkRuler = new QCheckBox( pageBackground, "checkRuler" );
474
        checkRuler->setText( tr( "Rulers relative to Page" ) );
475
        checkRuler->setChecked(prefsData->guidesSettings.rulerMode);
2872 fschmid 476
        pageBackgroundLayout->addWidget( checkRuler, 3, 0 );
1641 cbradney 477
        tabViewLayout->addWidget( pageBackground );
478
 
479
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
480
        groupScratch->setTitle( tr( "Scratch Space" ) );
481
        groupScratch->setColumnLayout(0, Qt::Vertical );
482
        groupScratch->layout()->setSpacing( 0 );
483
        groupScratch->layout()->setMargin( 0 );
484
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
485
        groupScratchLayout->setAlignment( Qt::AlignTop );
486
        groupScratchLayout->setSpacing( 0 );
487
        groupScratchLayout->setMargin( 10 );
488
        Layout4s = new QGridLayout;
489
        Layout4s->setSpacing( 6 );
490
        Layout4s->setMargin( 0 );
491
        topScratch = new MSpinBox( groupScratch, 4 );
492
        topScratch->setDecimals( decimals );
493
        topScratch->setMaxValue(1000);
1790 cbradney 494
        topScratch->setValue(prefsData->ScratchTop * unitRatio);
1641 cbradney 495
        Layout4s->addWidget( topScratch, 0, 1 );
496
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
497
        Layout4s->addWidget( TextLabel5s, 0, 0 );
498
        leftScratch = new MSpinBox( groupScratch, 4 );
499
        leftScratch->setDecimals( decimals );
500
        leftScratch->setMaxValue(1000);
1790 cbradney 501
        leftScratch->setValue(prefsData->ScratchLeft * unitRatio);
1641 cbradney 502
        Layout4s->addWidget( leftScratch, 0, 3 );
503
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
504
        Layout4s->addWidget( Linkss, 0, 2 );
505
        bottomScratch = new MSpinBox( groupScratch, 4 );
506
        bottomScratch->setDecimals( decimals );
507
        bottomScratch->setMaxValue(1000);
1790 cbradney 508
        bottomScratch->setValue(prefsData->ScratchBottom * unitRatio);
1641 cbradney 509
        Layout4s->addWidget( bottomScratch, 1, 1 );
510
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
511
        Layout4s->addWidget( TextLabel7s, 1, 0 );
512
        rightScratch = new MSpinBox( groupScratch, 4 );
513
        rightScratch->setDecimals( decimals );
514
        rightScratch->setMaxValue(1000);
1790 cbradney 515
        rightScratch->setValue(prefsData->ScratchRight * unitRatio);
1641 cbradney 516
        Layout4s->addWidget( rightScratch, 1, 3 );
2189 cbradney 517
        QString unitSuffix = unitGetSuffixFromIndex(docUnitIndex);
518
        topScratch->setSuffix(unitSuffix);
519
        bottomScratch->setSuffix(unitSuffix);
520
        leftScratch->setSuffix(unitSuffix);
521
        rightScratch->setSuffix(unitSuffix);
1641 cbradney 522
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
523
        Layout4s->addWidget( Rechtss, 1, 2 );
524
        groupScratchLayout->addLayout( Layout4s );
525
        tabViewLayout->addWidget( groupScratch );
2872 fschmid 526
        groupGap = new QGroupBox( tabView, "GroupBox7" );
527
        groupGap->setTitle( tr( "Gaps between Pages" ) );
528
        groupGap->setColumnLayout(0, Qt::Vertical );
529
        groupGap->layout()->setSpacing( 0 );
530
        groupGap->layout()->setMargin( 0 );
531
        groupGapLayout = new QHBoxLayout( groupGap->layout() );
532
        groupGapLayout->setAlignment( Qt::AlignTop );
533
        groupGapLayout->setSpacing( 0 );
534
        groupGapLayout->setMargin( 10 );
535
        layout4sg = new QGridLayout;
536
        layout4sg->setSpacing( 6 );
537
        layout4sg->setMargin( 0 );
538
        gapHorizontal = new MSpinBox( groupGap, 4 );
539
        gapHorizontal->setSuffix( unitSuffix );
540
        gapHorizontal->setDecimals( decimals );
541
        gapHorizontal->setMaxValue(1000);
3016 fschmid 542
        gapHorizontal->setValue(prefsData->pageSets[prefsData->FacingPages].GapHorizontal * unitRatio);
2872 fschmid 543
        layout4sg->addWidget( gapHorizontal, 0, 1 );
544
        TextLabel5sg = new QLabel(gapHorizontal, tr( "Horizontal:" ), groupGap, "TextLabel5" );
545
        layout4sg->addWidget( TextLabel5sg, 0, 0 );
546
        gapVertical = new MSpinBox( groupGap, 4 );
547
        gapVertical->setSuffix( unitSuffix );
548
        gapVertical->setDecimals( decimals );
549
        gapVertical->setMaxValue(1000);
3016 fschmid 550
        gapVertical->setValue(prefsData->pageSets[prefsData->FacingPages].GapVertical * unitRatio);
2872 fschmid 551
        layout4sg->addWidget( gapVertical, 0, 3 );
552
        TextLabel7sg = new QLabel(gapVertical, tr( "Vertical:" ), groupGap, "Links" );
553
        layout4sg->addWidget( TextLabel7sg, 0, 2 );
554
        groupGapLayout->addLayout( layout4sg );
555
        tabViewLayout->addWidget( groupGap );
1641 cbradney 556
 
557
        CaliGroup = new QGroupBox( tr( "&Adjust Display Size" ), tabView, "CaliGroup" );
558
        CaliGroup->setColumnLayout(0, Qt::Vertical );
559
        CaliGroup->layout()->setSpacing( 6 );
560
        CaliGroup->layout()->setMargin( 11 );
561
        CaliGroupLayout = new QVBoxLayout( CaliGroup->layout() );
562
        CaliGroupLayout->setAlignment( Qt::AlignTop );
2598 cbradney 563
        CaliText = new QLabel( tr( "To adjust the display drag the ruler below with the slider." ), CaliGroup, "CaliText" );
1641 cbradney 564
        CaliGroupLayout->addWidget( CaliText );
565
        CaliRuler = new QLabel( CaliGroup, "CaliRuler" );
566
        CaliRuler->setMinimumSize( QSize( 20, 20 ) );
567
        drawRuler();
568
        CaliRuler->setFrameShape( QLabel::Box );
569
        CaliRuler->setFrameShadow( QLabel::Sunken );
570
        CaliRuler->setScaledContents( false );
571
        CaliGroupLayout->addWidget( CaliRuler );
572
        layout15ca = new QHBoxLayout( 0, 0, 6, "layout15");
573
        CaliSlider = new QSlider( CaliGroup, "CaliSlider" );
574
        CaliSlider->setMinValue( -100 );
575
        CaliSlider->setMaxValue( 100 );
576
        CaliSlider->setValue(static_cast<int>(100 * DisScale)-100);
577
        CaliSlider->setOrientation( QSlider::Horizontal );
578
        CaliSlider->setTickmarks( QSlider::Right );
579
        CaliSlider->setTickInterval( 10 );
580
        CaliText->setBuddy(CaliGroup);
581
        layout15ca->addWidget( CaliSlider );
582
        CaliAnz = new QLabel( CaliGroup, "CaliAnz" );
583
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
584
        layout15ca->addWidget( CaliAnz );
585
        CaliGroupLayout->addLayout( layout15ca );
586
        tabViewLayout->addWidget( CaliGroup );
587
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
588
 
589
        ExtTool = new QWidget( prefsWidgets, "ExtTool" );
1878 cbradney 590
        ExtToolLayout = new QVBoxLayout( ExtTool, 0, 5, "ExtToolLayout");
1641 cbradney 591
        ExtToolLayout->setAlignment( Qt::AlignTop );
2925 cbradney 592
        ghostscriptGroup = new QGroupBox( tr( "Postscript Interpreter" ), ExtTool, "ghostscriptGroup" );
593
        ghostscriptGroup->setColumnLayout(0, Qt::Vertical );
594
        ghostscriptGroup->layout()->setSpacing( 6 );
595
        ghostscriptGroup->layout()->setMargin( 10 );
596
        groupGhostScriptLayout = new QVBoxLayout( ghostscriptGroup->layout() );
597
        groupGhostScriptLayout->setAlignment( Qt::AlignTop );
598
        ghostscriptLayout = new QHBoxLayout( 0, 0, 6, "ghostscriptLayout");
599
        ghostscriptLineEdit = new QLineEdit( ghostscriptGroup, "ghostscriptLineEdit" );
600
        ghostscriptLineEdit->setText(prefsManager->ghostscriptExecutable());
601
        ghostscriptLabel = new QLabel( ghostscriptLineEdit, tr( "&Name of Executable:" ), ghostscriptGroup, "ghostscriptLabel" );
602
        ghostscriptChangeButton = new QToolButton( ghostscriptGroup, "ghostscriptChangeButton" );
603
        ghostscriptChangeButton->setMinimumSize( QSize( 88, 24 ) );
604
        ghostscriptChangeButton->setText( tr( "&Change..." ) );
605
        ghostscriptLayout->addWidget( ghostscriptLabel );
606
        ghostscriptLayout->addWidget( ghostscriptLineEdit );
607
        ghostscriptLayout->addWidget( ghostscriptChangeButton );
608
        groupGhostScriptLayout->addLayout( ghostscriptLayout );
609
        GSantiText = new QCheckBox( tr( "Antialias &Text" ), ghostscriptGroup, "GSantiText" );
1641 cbradney 610
        GSantiText->setChecked(prefsData->gs_AntiAliasText);
2925 cbradney 611
        groupGhostScriptLayout->addWidget( GSantiText );
612
        GSantiGraph = new QCheckBox( tr( "Antialias &Graphics" ), ghostscriptGroup, "GSantiGraph" );
1641 cbradney 613
        GSantiGraph->setChecked(prefsData->gs_AntiAliasGraphics);
2925 cbradney 614
        groupGhostScriptLayout->addWidget( GSantiGraph );
615
        GSlayout2 = new QHBoxLayout( 0, 0, 6, "ghostscriptLayout");
616
        GSResolution = new QSpinBox( ghostscriptGroup, "Time" );
2703 fschmid 617
        GSResolution->setMaxValue( 2400 );
618
        GSResolution->setMinValue( 10 );
619
        GSResolution->setSuffix( " " + tr("dpi") );
620
        GSResolution->setValue(prefsData->gs_Resolution);
2925 cbradney 621
        GSResText = new QLabel( GSResolution, tr( "Resolution:" ), ghostscriptGroup, "GSResText" );
2703 fschmid 622
        GSlayout2->addWidget( GSResText );
623
        GSlayout2->addWidget( GSResolution );
2925 cbradney 624
        groupGhostScriptLayout->addLayout( GSlayout2 );
625
        ExtToolLayout->addWidget( ghostscriptGroup );
626
        groupImageEditor = new QGroupBox( tr( "Image Processing Tool" ), ExtTool, "groupImageEditor" );
627
        groupImageEditor->setColumnLayout(0, Qt::Vertical );
628
        groupImageEditor->layout()->setSpacing( 6 );
629
        groupImageEditor->layout()->setMargin( 10 );
630
        groupImageEditorLayout = new QHBoxLayout( groupImageEditor->layout() );
631
        groupImageEditorLayout->setAlignment( Qt::AlignTop );
632
        imageEditorLineEdit = new QLineEdit( groupImageEditor, "imageEditorLineEdit" );
633
        imageEditorLineEdit->setText(prefsManager->imageEditorExecutable());
634
        imageEditorLabel = new QLabel( imageEditorLineEdit, tr( "Name of &Executable:" ), groupImageEditor, "imageEditorLabel" );
635
        imageEditorChangeButton = new QToolButton( groupImageEditor, "imageEditorChangeButton" );
636
        imageEditorChangeButton->setMinimumSize( QSize( 88, 24 ) );
637
        imageEditorChangeButton->setText( tr( "&Change..." ) );
638
        groupImageEditorLayout->addWidget( imageEditorLabel );
639
        groupImageEditorLayout->addWidget( imageEditorLineEdit );
640
        groupImageEditorLayout->addWidget( imageEditorChangeButton );
641
        ExtToolLayout->addWidget( groupImageEditor );
1641 cbradney 642
        QSpacerItem* spacer_gs = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
643
        ExtToolLayout->addItem( spacer_gs );
1878 cbradney 644
        addItem(  tr("External Tools"), loadIcon("misc.png"), ExtTool);
1641 cbradney 645
 
646
        Misc = new QWidget( prefsWidgets, "Misc" );
1878 cbradney 647
        MiscLayout = new QVBoxLayout( Misc, 0, 5, "MiscLayout");
1641 cbradney 648
        MiscLayout->setAlignment( Qt::AlignTop );
649
        groupPrint = new QGroupBox( tr( "Printing" ), Misc, "groupPrint" );
650
        groupPrint->setColumnLayout(0, Qt::Vertical );
651
        groupPrint->layout()->setSpacing( 10 );
652
        groupPrint->layout()->setMargin( 10 );
653
        groupPrintLayout = new QVBoxLayout( groupPrint->layout() );
654
        groupPrintLayout->setAlignment( Qt::AlignTop );
655
        ClipMarg = new QCheckBox( tr( "Clip to Page &Margins" ), groupPrint, "ClipMarg" );
656
        ClipMarg->setChecked(prefsData->ClipMargin);
657
        groupPrintLayout->addWidget( ClipMarg );
658
        DoGCR = new QCheckBox( tr( "Apply &Under Color Removal" ), groupPrint, "ClipMarg" );
659
        DoGCR->setChecked(prefsData->GCRMode);
660
        groupPrintLayout->addWidget( DoGCR );
661
        MiscLayout->addWidget( groupPrint );
2217 cbradney 662
        AskForSubs = new QCheckBox( tr( "Always ask before fonts are replaced when loading a document" ), Misc, "askforSubs" );
1641 cbradney 663
        AskForSubs->setChecked(prefsData->askBeforeSubstituite);
664
        MiscLayout->addWidget( AskForSubs );
2263 fschmid 665
        stylePreview = new QCheckBox( tr( "Preview of current Paragraph Style visible when editing Styles" ), Misc, "stylePreview" );
666
        stylePreview->setChecked(prefsData->haveStylePreview);
667
        MiscLayout->addWidget( stylePreview );
2833 fschmid 668
        startUpDialog = new QCheckBox( tr( "Show Startup Dialog" ), Misc, "startUpDialog" );
669
        startUpDialog->setChecked(prefsData->showStartupDialog);
670
        MiscLayout->addWidget( startUpDialog );
2784 subik 671
        // lorem ipsum
672
        groupLI = new QGroupBox(tr("Lorem Ipsum"), Misc, "groupLI");
673
        groupLI->setColumnLayout(0, Qt::Vertical);
674
        groupLI->layout()->setSpacing(10);
675
        groupLI->layout()->setMargin(10);
676
        groupLILayout = new QVBoxLayout(groupLI->layout());
677
        groupLILayout->setAlignment(Qt::AlignTop);
678
        useStandardLI = new QCheckBox(tr("Always use standard Lorem Ipsum"), groupLI, "useStandardLI");
679
        useStandardLI->setChecked(prefsData->useStandardLI);
680
        groupLILayout->addWidget(useStandardLI);
681
        paraLabelLI = new QLabel(tr("Count of the Paragraphs:"), groupLI, "paraLabelLI");
682
        paragraphsLI = new QSpinBox(groupLI, "paragraphsLI");
683
        paragraphsLI->setMinValue(1);
684
        paragraphsLI->setValue(prefsData->paragraphsLI);
685
        QHBoxLayout *liLayout = new QHBoxLayout();
686
        liLayout->addWidget(paraLabelLI);
687
        liLayout->addWidget(paragraphsLI);
688
        groupLILayout->addLayout(liLayout);
689
        MiscLayout->addWidget(groupLI);
690
        // spacer filling
1641 cbradney 691
        QSpacerItem* spacer_3m = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
692
        MiscLayout->addItem( spacer_3m );
1878 cbradney 693
        addItem(  tr("Miscellaneous"), loadIcon("misc.png"), Misc);
1641 cbradney 694
 
695
        // plugin manager. pv.
696
        pluginManagerWidget = new QWidget(prefsWidgets, "pluginManagerWidget");
1878 cbradney 697
        pluginMainLayout = new QVBoxLayout( pluginManagerWidget, 0, 5, "pluginMainLayout");
1641 cbradney 698
        pluginMainLayout->setAlignment( Qt::AlignTop );
2397 cbradney 699
        plugGroupBox = new QGroupBox( tr("Plugin Manager"), pluginManagerWidget, "plugGroupBox");
1641 cbradney 700
        plugGroupBox->setColumnLayout(0, Qt::Vertical);
701
        plugGroupBox->layout()->setSpacing(6);
702
        plugGroupBox->layout()->setMargin(11);
703
        plugGroupBoxLayout = new QGridLayout( plugGroupBox->layout() );
704
        plugGroupBoxLayout->setAlignment(Qt::AlignTop);
705
        plugLayout1 = new QVBoxLayout( 0, 0, 6, "plugLayout1");
706
        pluginsList = new QListView(plugGroupBox, "pluginsList");
707
        pluginsList->setAllColumnsShowFocus(true);
708
        pluginsList->setShowSortIndicator(true);
2397 cbradney 709
        pluginsList->addColumn( tr("Plugin"));
1641 cbradney 710
        pluginsList->setColumnWidthMode(0, QListView::Maximum);
2397 cbradney 711
        pluginsList->addColumn( tr("How to run"));
1641 cbradney 712
        pluginsList->setColumnWidthMode(1, QListView::Maximum);
2397 cbradney 713
        pluginsList->addColumn( tr("Type"));
1641 cbradney 714
        pluginsList->setColumnWidthMode(2, QListView::Maximum);
2397 cbradney 715
        pluginsList->addColumn( tr("Load it?"));
1641 cbradney 716
        pluginsList->setColumnWidthMode(3, QListView::Maximum);
2397 cbradney 717
        pluginsList->addColumn( tr("Plugin ID"));
1641 cbradney 718
        pluginsList->setColumnWidthMode(4, QListView::Maximum);
2397 cbradney 719
        pluginsList->addColumn( tr("File"));
1641 cbradney 720
        pluginsList->setColumnWidthMode(5, QListView::Maximum);
721
        for (QMap<int,PluginManager::PluginData>::Iterator it = ap->pluginManager->pluginMap.begin(); it != ap->pluginManager->pluginMap.end(); ++it)
722
        {
723
                QListViewItem *plugItem = new QListViewItem(pluginsList);
724
                plugItem->setText(0, (*it).name.replace('&', "").replace("...", "")); // name
725
                plugItem->setText(1, QString("%1 %2").arg((*it).actMenu).arg((*it).actMenuAfterName)); // menu path
726
                plugItem->setText(2, ap->pluginManager->getPluginType((*it).type)); // type
727
                // load at start?
728
                plugItem->setPixmap(3, (*it).loadPlugin ? loadIcon("ok.png") : loadIcon("DateiClos16.png"));
729
                plugItem->setText(3, (*it).loadPlugin ? tr("Yes") : tr("No"));
730
                plugItem->setText(4, QString("%1").arg(it.key())); // id for developers
731
                plugItem->setText(5, (*it).pluginFile); // file for developers
732
        }
733
        plugLayout1->addWidget(pluginsList);
734
        pluginWarning = new QLabel(plugGroupBox);
2018 mrdocs 735
        pluginWarning->setText("<qt>" + tr("You need to restart the application to apply the changes.") + "</qt>");
1641 cbradney 736
        plugLayout1->addWidget(pluginWarning);
737
        plugGroupBoxLayout->addLayout(plugLayout1, 0, 0);
738
        pluginMainLayout->addWidget(plugGroupBox);
2397 cbradney 739
        addItem( tr("Plugins"), loadIcon("plugins.png"), pluginManagerWidget);
1641 cbradney 740
 
2901 fschmid 741
        setDS(prefsData->FacingPages);
1641 cbradney 742
        //tab order
743
        QWidget::setTabOrder( GFsize, SpinBox3 );
744
        QWidget::setTabOrder( SpinBox3, UnitCombo );
745
        QWidget::setTabOrder( UnitCombo, Recen );
746
        QWidget::setTabOrder( Recen, Docs );
747
        QWidget::setTabOrder( Docs, FileC );
748
        QWidget::setTabOrder( FileC, ProPfad );
749
        QWidget::setTabOrder( ProPfad, FileC2  );
750
        QWidget::setTabOrder( FileC2, ScriptPfad );
751
        QWidget::setTabOrder( ScriptPfad, FileC3 );
2093 cbradney 752
        QWidget::setTabOrder( FileC3, DocumentTemplateDir );
753
        QWidget::setTabOrder( DocumentTemplateDir, FileC4 );
1641 cbradney 754
        QWidget::setTabOrder( PreviewSize, SaveAtQuit );
755
 
3095 mrdocs 756
        QToolTip::add( checkLink, tr("Enable or disable  the display of linked frames."));
2598 cbradney 757
        QToolTip::add( checkControl, "<qt>" + tr("Display non-printing characters such as paragraph markers in text frames") + "</qt>");
1641 cbradney 758
        QToolTip::add( checkFrame, tr("Turns the display of frames on or off"));
759
        QToolTip::add( checkPictures, tr("Turns the display of pictures on or off"));
3095 mrdocs 760
        QToolTip::add( guiLangCombo, "<qt>" + tr( "Select your default language for Scribus to run with. Leave this blank to choose based on environment variables. You can still override this by passing a command line option when starting Scribus" )+"</qt>" );
1641 cbradney 761
        QToolTip::add( GUICombo, tr( "Choose the default window decoration and looks.\nScribus inherits any available KDE or Qt themes" ) );
762
        QToolTip::add( GFsize, tr( "Default font size for the menus and windows" ) );
763
        QToolTip::add( UnitCombo, tr( "Default unit of measurement for document editing" ) );
764
        QToolTip::add( SpinBox3, tr( "Number of lines Scribus will scroll for each move of the mouse wheel" ) );
765
        QToolTip::add( Recen, tr( "Number of recently edited documents to show in the File menu" ) );
766
        QToolTip::add( Docs, tr( "Default documents directory" ) );
2018 mrdocs 767
        QToolTip::add( ProPfad, tr( "Default ICC profiles directory. This cannot\nbe changed with a document open." ) );
1641 cbradney 768
        QToolTip::add( ScriptPfad, tr( "Default Scripter scripts directory" ) );
2093 cbradney 769
        QToolTip::add( DocumentTemplateDir, "<qt>"+tr("Additional directory for document templates")+"</qt>" );
1641 cbradney 770
 
771
        QToolTip::add( GZComboF, tr( "Default page size, either a standard size or a custom size" ) );
772
        QToolTip::add( GZComboO, tr( "Default orientation of document pages" ) );
773
        QToolTip::add( pageWidth, tr( "Width of document pages, editable if you have chosen a custom page size" ) );
774
        QToolTip::add( pageHeight, tr( "Height of document pages, editable if you have chosen a custom page size" ) );
2901 fschmid 775
//      QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
776
//      QToolTip::add( Linkszuerst, tr( "Make the first page the left page of a document" ) );
1641 cbradney 777
        QToolTip::add( ASon, tr( "When enabled, Scribus saves a backup copy of your file with the .bak extension\neach time the time period elapses" ) );
778
        QToolTip::add( ASTime, tr( "Time period between saving automatically" ) );
779
 
780
        QToolTip::add( urSpinBox, tr("Set the length of the action history in steps.\nIf set to 0 infinite amount of actions will be stored."));
781
 
782
        QToolTip::add( PreviewSize, tr( "Choose the size of the preview in the scrapbook palette" ) );
783
        QToolTip::add( SaveAtQuit, tr( "Save the scrapbook contents everytime after a change" ) );
784
 
785
        QToolTip::add( backColor, tr( "Color for paper" ) );
786
        QToolTip::add( checkUnprintable, tr( "Mask the area outside the margins in the margin color" ) );
2598 cbradney 787
        QToolTip::add( CaliText, tr( "Set the default zoom level" ) );
788
        QToolTip::add( CaliGroup, "<qt>" + tr( "Place a ruler against your screen and drag the slider to set the zoom level so Scribus will display your pages and objects on them at the correct size" ) + "</qt>" );
1641 cbradney 789
 
2925 cbradney 790
        QToolTip::add( ghostscriptLineEdit, tr( "Filesystem location for the Ghostscript interpreter" ) );
1641 cbradney 791
        QToolTip::add( GSantiText, tr( "Antialias text for EPS and PDF onscreen rendering" ) );
792
        QToolTip::add( GSantiGraph, tr( "Antialias graphics for EPS and PDF onscreen rendering" ) );
2925 cbradney 793
        QToolTip::add( imageEditorLineEdit, tr( "File system location for graphics editor. If you use gimp\n"
1912 mrdocs 794
                                                "and your distro includes it, we recommend 'gimp-remote',\n"
795
                                                "as it allows you to edit the image in an already running\n"
796
                                                "instance of gimp." ) );
1641 cbradney 797
        QToolTip::add( ClipMarg, tr( "Do not show objects outside the margins on the printed page or exported file" ) );
798
        QToolTip::add( DoGCR, tr( "A way of switching off some of the gray shades which are composed\n"
799
                                          "of cyan, yellow and magenta and using black instead.\n"
800
                                          "UCR most affects parts of images which are neutral and/or dark tones\n"
801
                                          "which are close to the gray. Use of this may improve printing some images\n"
802
                                          "and some experimentation and testing is need on a case by case basis.\n"
803
                                          "UCR reduces the possibility of over saturation with CMY inks." ) );
804
 
2598 cbradney 805
        QToolTip::add( leftScratch, "<qt>" + tr( "Defines amount of space left of the document canvas available as a pasteboard for creating and modifying elements and dragging them onto the active page" ) + "</qt>" );
806
        QToolTip::add( rightScratch, "<qt>" + tr( "Defines amount of space right of the document canvas available as a pasteboard for creating and modifying elements and dragging them onto the active page" ) + "</qt>" );
807
        QToolTip::add( topScratch, "<qt>" + tr( "Defines amount of space above the document canvas available as a pasteboard for creating and modifying elements and dragging them onto the active page" ) + "</qt>" );
808
        QToolTip::add( bottomScratch, "<qt>" + tr( "Defines amount of space below the document canvas available as a pasteboard for creating and modifying elements and dragging them onto the active page" ) + "</qt>" );
809
 
810
 
1641 cbradney 811
        // signals and slots connections
812
        connect( guiLangCombo, SIGNAL( activated( const QString & ) ), this, SLOT( setSelectedGUILang( const QString & ) ) );
813
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
814
        connect(UnitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
815
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
816
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
2901 fschmid 817
        connect(docLayout, SIGNAL( selectedLayout(int) ), this, SLOT( setDS(int) ) );
1641 cbradney 818
        connect(GZComboO, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
2923 fschmid 819
        connect(GZComboF, SIGNAL(activated(const QString &)), this, SLOT(setPageSize()));
1641 cbradney 820
        connect(FileC, SIGNAL(clicked()), this, SLOT(changeDocs()));
821
        connect(FileC2, SIGNAL(clicked()), this, SLOT(changeProfs()));
822
        connect(FileC3, SIGNAL(clicked()), this, SLOT(changeScripts()));
2093 cbradney 823
        connect(FileC4, SIGNAL(clicked()), this, SLOT(changeDocumentTemplates()));
2925 cbradney 824
        connect(ghostscriptChangeButton, SIGNAL(clicked()), this, SLOT(changeGhostscript()));
825
        connect(imageEditorChangeButton, SIGNAL(clicked()), this, SLOT(changeImageEditor()));
1641 cbradney 826
        connect(CaliSlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
827
        connect(buttonOk, SIGNAL(clicked()), this, SLOT(setActionHistoryLength()));
828
        connect(pluginsList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)),
829
                        this, SLOT(changePluginLoad(QListViewItem *, const QPoint &, int)));
830
        if (CMSavail)
831
                connect(tabColorManagement, SIGNAL(cmsOn(bool )), this, SLOT(switchCMS(bool )));
832
 
833
        setSize(prefsData->pageSize);
834
        setOrien(prefsData->pageOrientation);
1790 cbradney 835
        pageWidth->setValue(prefsData->PageWidth * unitRatio);
836
        pageHeight->setValue(prefsData->PageHeight * unitRatio);
2769 fschmid 837
        pageWidth->setSuffix(unitSuffix);
838
        pageHeight->setSuffix(unitSuffix);
1641 cbradney 839
 
1790 cbradney 840
        //unitChange();
1641 cbradney 841
        resize( minimumSizeHint() );
842
        arrangeIcons();
1828 fschmid 843
        backToDefaults->hide();
1834 fschmid 844
        prefsSelection->setSelected(prefsSelection->firstItem(), true);
845
        itemSelected(prefsSelection->firstItem());
1641 cbradney 846
        clearWState( WState_Polished );
847
}
848
 
849
/*!
850
 \fn Preferences::~Preferences
851
 \author Franz Schmid
852
 \date
853
 \brief Destructor for Preferences dialog box
854
 \param None
855
 \retval None
856
 */
857
Preferences::~Preferences()
858
{
859
        // no need to delete child widgets, Qt does it all for us
860
}
861
 
862
 
863
/*!
864
 \fn void Preferences::ChangeDocs()
865
 \author Franz Schmid
866
 \date
867
 \brief Runs QFileDialog to get Preferences (General) Path to Documents directory
868
 \param None
869
 \retval None
870
 */
871
void Preferences::changeDocs()
872
{
873
        QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
2877 cbradney 874
        if (!s.isEmpty())
1641 cbradney 875
                Docs->setText(s);
876
}
877
 
878
/*!
879
 \fn void Preferences::ChangeProfs()
880
 \author Franz Schmid
881
 \date
882
 \brief Runs QFileDialog to get Preferences (General) Path to Colour Profiles directory
883
 \param None
884
 \retval None
885
 */
886
void Preferences::changeProfs()
887
{
888
        QString s = QFileDialog::getExistingDirectory(ProPfad->text(), this, "d", tr("Choose a Directory"), true);
2877 cbradney 889
        if (!s.isEmpty())
1641 cbradney 890
                ProPfad->setText(s);
891
}
892
 
893
/*!
894
 \fn void Preferences::ChangeScripts()
895
 \author Franz Schmid
896
 \date
897
 \brief Runs QFileDialog to get Preferences (General) Path to Scripts directory
898
 \param None
899
 \retval None
900
 */
901
void Preferences::changeScripts()
902
{
903
        QString s = QFileDialog::getExistingDirectory(ScriptPfad->text(), this, "d", tr("Choose a Directory"), true);
2877 cbradney 904
        if (!s.isEmpty())
1641 cbradney 905
                ScriptPfad->setText(s);
906
}
907
 
908
/*!
2093 cbradney 909
 \fn void Preferences::ChangeDocumentTemplates()
1641 cbradney 910
 \author Riku Leino
911
 \date
2093 cbradney 912
 \brief Runs QFileDialog to get Preferences (General) Path to Document Templates directory
1641 cbradney 913
 \param None
914
 \retval None
915
 */
2093 cbradney 916
void Preferences::changeDocumentTemplates()
1641 cbradney 917
{
2093 cbradney 918
        QString s = QFileDialog::getExistingDirectory(DocumentTemplateDir->text(), this, "d", tr("Choose a Directory"), true);
2877 cbradney 919
        if (!s.isEmpty())
2093 cbradney 920
                DocumentTemplateDir->setText(s);
1641 cbradney 921
}
922
 
923
/*!
2925 cbradney 924
 \fn void Preferences::ChangeDocumentTemplates()
925
 \author Craig Bradney
926
 \brief Runs QFileDialog to get Preferences Path to Ghostscript
927
 \param None
928
 \retval None
929
 */
930
void Preferences::changeGhostscript()
931
{
932
        QFileInfo fi(ghostscriptLineEdit->text());
933
        QString s = QFileDialog::getOpenFileName(fi.dirPath(), QString::null, this, "changeGhostscript", tr("Locate Ghostscript"));
934
        if (!s.isEmpty())
935
                ghostscriptLineEdit->setText(s);
936
}
937
 
938
/*!
939
 \fn void Preferences::ChangeDocumentTemplates()
940
 \author Craig Bradney
941
 \brief Runs QFileDialog to get Preferences Path to Image Editor
942
 \param None
943
 \retval None
944
 */
945
void Preferences::changeImageEditor()
946
{
947
        QFileInfo fi(imageEditorLineEdit->text());
948
        QString s = QFileDialog::getOpenFileName(fi.dirPath(), QString::null, this, "changeImageEditor", tr("Locate your image editor"));
949
        if (!s.isEmpty())
950
                imageEditorLineEdit->setText(s);
951
}
952
 
953
/*!
1641 cbradney 954
 \fn void Preferences::setDS()
955
 \author Franz Schmid
956
 \date
957
 \brief Preferences (Document / Page Size), switches default between Facing Pages and swaps text labels for margin guides
958
 \param None
959
 \retval None
960
 */
2901 fschmid 961
void Preferences::setDS(int layout)
1641 cbradney 962
{
2901 fschmid 963
        GroupRand->setFacingPages(!(layout == singlePage));
964
        choosenLayout = layout;
3016 fschmid 965
        docLayout->firstPage->setCurrentItem(prefsManager->appPrefs.pageSets[choosenLayout].FirstPage);
966
        gapHorizontal->setValue(prefsManager->appPrefs.pageSets[choosenLayout].GapHorizontal * unitRatio);
967
        gapVertical->setValue(prefsManager->appPrefs.pageSets[choosenLayout].GapVertical * unitRatio);
1641 cbradney 968
}
969
 
970
/*!
971
 \fn void Preferences::setPageWidth(int v)
972
 \author Franz Schmid
973
 \date
974
 \brief Preferences (Document / Page Size), sets Page width values
975
 \param v Width value
976
 \retval None
977
 */
978
void Preferences::setPageWidth(int)
979
{
1790 cbradney 980
        Pagebr = pageWidth->value() / unitRatio;
2769 fschmid 981
        GroupRand->setPageWidth(Pagebr);
1641 cbradney 982
}
983
 
984
/*!
985
 \fn void Preferences::setPageHeight(int v)
986
 \author Franz Schmid
987
 \date
988
 \brief Preferences (Document / Page Size), sets Page height values
989
 \param v Height value
990
 \retval None
991
 */
992
void Preferences::setPageHeight(int)
993
{
1790 cbradney 994
        Pageho = pageHeight->value() / unitRatio;
2769 fschmid 995
        GroupRand->setPageHeight(Pageho);
1641 cbradney 996
}
997
 
2923 fschmid 998
void Preferences::setPageSize()
999
{
1000
        setOrien(GZComboO->currentItem());
1001
}
1002
 
1641 cbradney 1003
/*!
1004
 \fn void Preferences::setSize(QString gr)
1005
 \author Franz Schmid
1006
 \date
1007
 \brief Preferences (Document / Page Size), sets Page size values. Connects signals for setting page dimensions.
1008
 \param gr Standard page size value (eg A4)
1009
 \retval None
1010
 */
1011
void Preferences::setSize(const QString & gr)
1012
{
1790 cbradney 1013
        Pagebr = pageWidth->value() / unitRatio;
1014
        Pageho = pageHeight->value() / unitRatio;
1641 cbradney 1015
        pageWidth->setEnabled(false);
1016
        pageHeight->setEnabled(false);
1017
        PageSize *ps2=new PageSize(gr);
1018
 
1019
        prefsPageSizeName=ps2->getPageName();
2607 fschmid 1020
        if (gr == tr("Custom"))
1641 cbradney 1021
        {
1022
                pageWidth->setEnabled(true);
1023
                pageHeight->setEnabled(true);
1024
        }
1025
        else
1026
        {
1027
                Pagebr = ps2->getPageWidth();
1028
                Pageho = ps2->getPageHeight();
1029
        }
1030
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1031
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1790 cbradney 1032
        pageWidth->setValue(Pagebr * unitRatio);
1033
        pageHeight->setValue(Pageho * unitRatio);
2769 fschmid 1034
        GroupRand->setPageHeight(Pageho);
1035
        GroupRand->setPageWidth(Pagebr);
1641 cbradney 1036
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1037
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
2607 fschmid 1038
        delete ps2;
1641 cbradney 1039
}
1040
 
1041
/*!
1042
 \fn void Preferences::setOrien(int ori)
1043
 \author Franz Schmid
1044
 \date
1045
 \brief Preferences (Document / Page Size), sets Page orientation value and page dimensions
1046
 \param ori Orientation value
1047
 \retval None
1048
 */
1049
void Preferences::setOrien(int ori)
1050
{
1051
        double br;
1052
        setSize(GZComboF->currentText());
1053
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1054
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1055
        if (ori == 0)
1056
        {
1057
                //if (GZComboF->currentItem() == 30)
1058
                if (GZComboF->currentText() == tr("Custom"))
1059
                {
1060
                        br = pageWidth->value();
1061
                        pageWidth->setValue(pageHeight->value());
1062
                        pageHeight->setValue(br);
1063
                }
1064
        }
1065
        else
1066
        {
1067
                br = pageWidth->value();
1068
                pageWidth->setValue(pageHeight->value());
1069
                pageHeight->setValue(br);
1070
        }
1071
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1072
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1073
}
1074
 
1075
/*!
1076
 \fn void Preferences::changePaperColor()
1077
 \author Franz Schmid
1078
 \date
1079
 \brief Preferences ([dox?], [dox?]), Sets Paper color [dox?]
1080
 \param None
1081
 \retval None
1082
 */
1083
void Preferences::changePaperColor()
1084
{
1085
        QColor neu = QColor();
1086
        neu = QColorDialog::getColor(colorPaper, this);
1087
        if (neu.isValid())
1088
        {
1089
                QPixmap pm = QPixmap(54, 14);
1090
                pm.fill(neu);
1091
                colorPaper = neu;
1092
                backColor->setPixmap(pm);
1093
        }
1094
}
1095
 
1096
/*!
1097
 \fn void Preferences::UnitChange()
1098
 \author Franz Schmid
1099
 \date
1100
 \brief Preferences (General, Units). Sets scaling factors and units descriptions when default units are changed. Updates preference values
1101
 \param None
1102
 \retval None
1103
 */
1104
void Preferences::unitChange()
1105
{
1106
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1107
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1108
        int decimals;
1790 cbradney 1109
        double oldUnitRatio = unitRatio;
1641 cbradney 1110
        double oldMin, oldMax, oldB, oldBM, oldH, oldHM, val;
1111
        pageWidth->getValues(&oldB, &oldBM, &decimals, &val);
1790 cbradney 1112
        oldB /= oldUnitRatio;
1113
        oldBM /= oldUnitRatio;
1641 cbradney 1114
        pageHeight->getValues(&oldH, &oldHM, &decimals, &val);
1790 cbradney 1115
        oldH /= oldUnitRatio;
1116
        oldHM /= oldUnitRatio;
1641 cbradney 1117
        QString einh;
1118
        docUnitIndex = UnitCombo->currentItem();
1790 cbradney 1119
        unitRatio = unitGetRatioFromIndex(docUnitIndex);
1641 cbradney 1120
        decimals = unitGetDecimalsFromIndex(docUnitIndex);
1121
        einh = unitGetSuffixFromIndex(docUnitIndex);
2784 subik 1122
 
1641 cbradney 1123
        pageWidth->setSuffix(einh);
1124
        pageHeight->setSuffix(einh);
1125
        tabGuides->minorSpace->setSuffix(einh);
1126
        tabGuides->majorSpace->setSuffix(einh);
1127
        tabGuides->snapDistance->setSuffix(einh);
1128
        tabGuides->baseGrid->setSuffix(einh);
1129
        tabGuides->baseOffset->setSuffix(einh);
1130
        tabTools->gapText->setSuffix(einh);
1131
        topScratch->setSuffix(einh);
1132
        bottomScratch->setSuffix(einh);
1133
        leftScratch->setSuffix(einh);
1134
        rightScratch->setSuffix(einh);
2872 fschmid 1135
        gapVertical->setSuffix( einh );
1136
        gapHorizontal->setSuffix( einh );
1641 cbradney 1137
        tabPDF->BleedBottom->setSuffix(einh);
1138
        tabPDF->BleedTop->setSuffix(einh);
1139
        tabPDF->BleedRight->setSuffix(einh);
1140
        tabPDF->BleedLeft->setSuffix(einh);
1790 cbradney 1141
        pageWidth->setValues(oldB * unitRatio, oldBM * unitRatio, decimals, Pagebr * unitRatio);
1142
        pageHeight->setValues(oldH * unitRatio, oldHM * unitRatio, decimals, Pageho * unitRatio);
2769 fschmid 1143
        GroupRand->unitChange(unitRatio, decimals, einh);
1144
        GroupRand->setPageHeight(Pageho);
1145
        GroupRand->setPageWidth(Pagebr);
1641 cbradney 1146
        int decimalsOld;
1790 cbradney 1147
        double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
2784 subik 1148
 
1641 cbradney 1149
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1150
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1151
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1152
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1153
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1154
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1155
        tabGuides->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1156
        tabGuides->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1157
        tabGuides->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1158
        tabGuides->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1159
        tabTools->gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1160
        tabTools->gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
2285 fschmid 1161
        tabTools->gapTab->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1162
        tabTools->gapTab->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1641 cbradney 1163
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1164
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1165
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1166
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1167
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1168
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1169
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1170
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
2872 fschmid 1171
        gapVertical->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1172
        gapVertical->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1173
        gapHorizontal->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1174
        gapHorizontal->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1641 cbradney 1175
        tabPDF->BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1176
        tabPDF->BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1177
        tabPDF->BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1178
        tabPDF->BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1179
        tabPDF->BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1180
        tabPDF->BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1181
        tabPDF->BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1182
        tabPDF->BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1790 cbradney 1183
        tabPDF->unitRatio = unitRatio;
1641 cbradney 1184
        drawRuler();
1185
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1186
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1187
}
1188
 
1189
/*!
1190
 \fn void Preferences::SetDisScale()
1191
 \author Franz Schmid
1192
 \date
1193
 \brief Preferences (Display, Display Size). Sets Scale for ruler scale
1194
 \param None
1195
 \retval None
1196
 */
1197
void Preferences::setDisScale()
1198
{
1199
        DisScale = QMAX((100.0 + CaliSlider->value()) / 100.0, 0.01);
1200
        drawRuler();
1201
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
1202
}
1203
 
1204
/*!
1205
 \fn void Preferences::DrawRuler()
1206
 \author Franz Schmid
1207
 \date
1208
 \brief Preferences (Display, Display Size). Draws ruler depending on scaling factor
1209
 \param None
1210
 \retval None
1211
 */
1212
void Preferences::drawRuler()
1213
{
1214
        double xl, iter, iter2, maxi;
1215
        switch (docUnitIndex)
1216
        {
1217
        case 0:
1218
                iter = 10.0;
1219
                iter2 = iter * 10.0;
1220
                maxi = 200.0;
1221
                break;
1222
        case 1:
1223
                iter = (10.0 / 25.4) * 72.0;
1224
                iter2 = iter * 10.0;
1225
                maxi = iter2;
1226
                break;
1227
        case 2:
1228
                iter = 18.0;
1229
                iter2 = 72.0;
1230
                maxi = 2 * iter2;
1231
                break;
1232
        case 3:
1233
                iter = 12.0;
1234
                iter2 = 120.0;
1235
                maxi = 240.0;
1236
                break;
2925 cbradney 1237
        case 4:
1238
                iter = 12.0;
1239
                iter2 = 120.0;
1240
                maxi = 240.0;
1241
                break;         
1641 cbradney 1242
        default:
1243
                iter = 10.0;
1244
                iter2 = iter * 10.0;
1245
                maxi = 200.0;
1246
                break;
1247
        }
1248
 
1249
        QPixmap pm(static_cast<int>(maxi*DisScale+30), 21);
1250
        pm.fill();
1251
        QPainter p;
1252
        p.begin(&pm);
1253
        p.drawLine(0, 19, width(), 19);
1254
        p.setBrush(black);
1255
        p.setPen(black);
1256
        p.scale(DisScale, 1.0);
1257
        for (xl = 0; xl < maxi; xl += iter)
1258
                p.drawLine(static_cast<int>(xl), 13, static_cast<int>(xl), 19);
1259
        for (xl = 0; xl < maxi+10; xl += iter2)
1260
        {
1261
                p.drawLine(static_cast<int>(xl), 6, static_cast<int>(xl), 19);
1262
                p.save();
1263
                p.scale(1.0 / DisScale, 1.0);
1264
                switch (docUnitIndex)
1265
                {
1266
                case 2:
1267
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1268
                                   QString::number(xl / iter2));
1269
                        break;
1270
                case 3:
1271
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1272
                                   QString::number(xl / iter));
1273
                        break;
1274
                default:
1275
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1276
                                   QString::number(xl / iter * 10));
1277
                        break;
1278
                }
1279
                p.restore();
1280
        }
1281
        p.end();
1282
        CaliRuler->setPixmap(pm);
1283
}
1284
/*
1285
QString Preferences::getSelectedGUILang( )
1286
{
1287
        return langMgr.getAbbrevFromLang(guiLangCombo->currentText());
1288
}
1289
*/
1290
void Preferences::setSelectedGUILang( const QString &newLang )
1291
{
1292
        selectedGUILang=langMgr.getAbbrevFromLang(newLang);
1293
}
1294
 
1295
void Preferences::setActionHistoryLength()
1296
{
1297
  UndoManager::instance()->setHistoryLength(urSpinBox->value());
1298
}
1299
 
1300
void Preferences::switchCMS(bool enable)
1301
{
1302
        tabPDF->enableCMS(enable);
1303
}
1304
 
2784 subik 1305
/*! Set selected item(=plugin) un/loadable
1306
\author Petr Vanek
1307
*/
1641 cbradney 1308
void Preferences::changePluginLoad(QListViewItem *item, const QPoint &, int column)
1309
{
1310
        if (column != 3)
1311
                return;
1312
        if (item->text(3) == tr("Yes"))
1313
        {
1314
                item->setPixmap(3, loadIcon("DateiClos16.png"));
1315
                item->setText(3, tr("No"));
1316
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = false;
1317
        }
1318
        else
1319
        {
1320
                item->setPixmap(3, loadIcon("ok.png"));
1321
                item->setText(3, tr("Yes"));
1322
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = true;
1323
        }
1324
}
1701 cbradney 1325
 
1326
void Preferences::setTOCIndexData(QWidget *widgetToShow)
1327
{
2784 subik 1328
        //Update the attributes list in TOC setup
1701 cbradney 1329
        if (widgetToShow==tabDefaultTOCIndexPrefs)
1330
                tabDefaultTOCIndexPrefs->setupItemAttrs( tabDefaultItemAttributes->getDocAttributesNames() );
1331
}
2873 cbradney 1332
 
1333
void Preferences::updatePreferences()
1334
{
1335
        prefsManager->appPrefs.AppFontSize = GFsize->value();
1336
        prefsManager->appPrefs.Wheelval = SpinBox3->value();
1337
        prefsManager->appPrefs.RecentDCount = Recen->value();
1338
        prefsManager->appPrefs.DocDir = Docs->text();
1339
        prefsManager->appPrefs.ProfileDir = ProPfad->text();
1340
        prefsManager->appPrefs.ScriptDir = ScriptPfad->text();
1341
        prefsManager->appPrefs.documentTemplatesDir = DocumentTemplateDir->text();
1342
        switch (PreviewSize->currentItem())
1343
        {
1344
                case 0:
1345
                        prefsManager->appPrefs.PSize = 40;
1346
                        break;
1347
                case 1:
1348
                        prefsManager->appPrefs.PSize = 60;
1349
                        break;
1350
                case 2:
1351
                        prefsManager->appPrefs.PSize = 80;
1352
                        break;
1353
        }
1354
        prefsManager->appPrefs.SaveAtQ = SaveAtQuit->isChecked();
1355
        prefsManager->appPrefs.guiLanguage=selectedGUILang;
1356
        prefsManager->appPrefs.GUI = GUICombo->currentText();
1357
        tabTools->polyWidget->getValues(&prefsManager->appPrefs.toolSettings.polyC, &prefsManager->appPrefs.toolSettings.polyFd, &prefsManager->appPrefs.toolSettings.polyF, &prefsManager->appPrefs.toolSettings.polyS, &prefsManager->appPrefs.toolSettings.polyR);
1358
        prefsManager->appPrefs.pageSize = prefsPageSizeName;
1359
        prefsManager->appPrefs.pageOrientation = GZComboO->currentItem();
1360
        prefsManager->appPrefs.PageWidth = Pagebr;
1361
        prefsManager->appPrefs.PageHeight = Pageho;
1362
        prefsManager->appPrefs.RandOben = GroupRand->RandT;
1363
        prefsManager->appPrefs.RandUnten = GroupRand->RandB;
1364
        prefsManager->appPrefs.RandLinks = GroupRand->RandL;
1365
        prefsManager->appPrefs.RandRechts = GroupRand->RandR;
3016 fschmid 1366
        double prefsUnitRatio = unitGetRatioFromIndex(UnitCombo->currentItem());
2901 fschmid 1367
        prefsManager->appPrefs.FacingPages  = choosenLayout;
3016 fschmid 1368
        prefsManager->appPrefs.pageSets[choosenLayout].FirstPage = docLayout->firstPage->currentItem();
1369
        prefsManager->appPrefs.pageSets[choosenLayout].GapHorizontal = gapHorizontal->value() / prefsUnitRatio;
1370
        prefsManager->appPrefs.pageSets[choosenLayout].GapVertical = gapVertical->value() / prefsUnitRatio;
2925 cbradney 1371
        prefsManager->setImageEditorExecutable(imageEditorLineEdit->text());
2873 cbradney 1372
        prefsManager->appPrefs.gs_AntiAliasGraphics = GSantiGraph->isChecked();
1373
        prefsManager->appPrefs.gs_AntiAliasText = GSantiText->isChecked();
2925 cbradney 1374
        prefsManager->setGhostscriptExecutable(ghostscriptLineEdit->text());
2873 cbradney 1375
        prefsManager->appPrefs.gs_Resolution = GSResolution->value();
1376
        prefsManager->appPrefs.ClipMargin = ClipMarg->isChecked();
1377
        prefsManager->appPrefs.GCRMode = DoGCR->isChecked();
1378
        prefsManager->appPrefs.guidesSettings.before = tabGuides->inBackground->isChecked();
1379
        prefsManager->appPrefs.marginColored = checkUnprintable->isChecked();
1380
        prefsManager->appPrefs.askBeforeSubstituite = AskForSubs->isChecked();
1381
        prefsManager->appPrefs.haveStylePreview = stylePreview->isChecked();
1382
        prefsManager->appPrefs.showStartupDialog = startUpDialog->isChecked();
1383
        // lorem ipsum
1384
        prefsManager->appPrefs.useStandardLI = useStandardLI->isChecked();
1385
        prefsManager->appPrefs.paragraphsLI = paragraphsLI->value();
1386
        prefsManager->appPrefs.DisScale = DisScale;
1387
 
1388
        prefsManager->appPrefs.docUnitIndex = UnitCombo->currentItem();
1389
        prefsManager->appPrefs.ScratchBottom = bottomScratch->value() / prefsUnitRatio;
1390
        prefsManager->appPrefs.ScratchLeft = leftScratch->value() / prefsUnitRatio;
1391
        prefsManager->appPrefs.ScratchRight = rightScratch->value() / prefsUnitRatio;
1392
        prefsManager->appPrefs.ScratchTop = topScratch->value() / prefsUnitRatio;
1393
        prefsManager->appPrefs.DpapColor = colorPaper;
1394
        prefsManager->appPrefs.toolSettings.defFont = tabTools->fontComboText->currentText();
1395
        prefsManager->appPrefs.toolSettings.defSize = tabTools->sizeComboText->currentText().left(2).toInt() * 10;
1396
        prefsManager->appPrefs.guidesSettings.marginsShown = tabGuides->marginBox->isChecked();
1397
        prefsManager->appPrefs.guidesSettings.framesShown = checkFrame->isChecked();
1398
        prefsManager->appPrefs.guidesSettings.rulerMode = checkRuler->isChecked();
1399
        prefsManager->appPrefs.guidesSettings.gridShown = tabGuides->checkGrid->isChecked();
1400
        prefsManager->appPrefs.guidesSettings.guidesShown = tabGuides->guideBox->isChecked();
1401
        prefsManager->appPrefs.guidesSettings.baseShown = tabGuides->baselineBox->isChecked();
1402
        prefsManager->appPrefs.guidesSettings.showPic = checkPictures->isChecked();
1403
        prefsManager->appPrefs.guidesSettings.linkShown = checkLink->isChecked();
1404
        prefsManager->appPrefs.guidesSettings.showControls = checkControl->isChecked();
1405
        prefsManager->appPrefs.guidesSettings.grabRad = tabGuides->grabDistance->value();
1406
        prefsManager->appPrefs.guidesSettings.guideRad = tabGuides->snapDistance->value() / prefsUnitRatio;
1407
        prefsManager->appPrefs.guidesSettings.minorGrid = tabGuides->minorSpace->value() / prefsUnitRatio;
1408
        prefsManager->appPrefs.guidesSettings.majorGrid = tabGuides->majorSpace->value() / prefsUnitRatio;
1409
        prefsManager->appPrefs.guidesSettings.minorColor = tabGuides->colorMinorGrid;
1410
        prefsManager->appPrefs.guidesSettings.majorColor = tabGuides->colorMajorGrid;
1411
        prefsManager->appPrefs.guidesSettings.margColor = tabGuides->colorMargin;
1412
        prefsManager->appPrefs.guidesSettings.guideColor = tabGuides->colorGuides;
1413
        prefsManager->appPrefs.guidesSettings.baseColor = tabGuides->colorBaselineGrid;
1414
        prefsManager->appPrefs.checkerProfiles = tabDocChecker->checkerProfile;
1415
        prefsManager->appPrefs.curCheckProfile = tabDocChecker->curCheckProfile->currentText();
2889 cbradney 1416
        prefsManager->appPrefs.typographicSettings.valueSuperScript = tabTypo->superDisplacement->value();
1417
        prefsManager->appPrefs.typographicSettings.scalingSuperScript = tabTypo->superScaling->value();
1418
        prefsManager->appPrefs.typographicSettings.valueSubScript = tabTypo->subDisplacement->value();
1419
        prefsManager->appPrefs.typographicSettings.scalingSubScript = tabTypo->subScaling->value();
1420
        prefsManager->appPrefs.typographicSettings.valueSmallCaps = tabTypo->capsScaling->value();
1421
        prefsManager->appPrefs.typographicSettings.autoLineSpacing = tabTypo->autoLine->value();
1422
        prefsManager->appPrefs.typographicSettings.valueBaseGrid = tabGuides->baseGrid->value() / prefsUnitRatio;
1423
        prefsManager->appPrefs.typographicSettings.offsetBaseGrid = tabGuides->baseOffset->value() / prefsUnitRatio;
1424
        prefsManager->appPrefs.typographicSettings.valueUnderlinePos = qRound(tabTypo->underlinePos->value() * 10);
1425
        prefsManager->appPrefs.typographicSettings.valueUnderlineWidth = qRound(tabTypo->underlineWidth->value() * 10);
1426
        prefsManager->appPrefs.typographicSettings.valueStrikeThruPos = qRound(tabTypo->strikethruPos->value() * 10);
1427
        prefsManager->appPrefs.typographicSettings.valueStrikeThruWidth = qRound(tabTypo->strikethruWidth->value() * 10);
3093 fschmid 1428
        prefsManager->appPrefs.toolSettings.dTextBackGround = tabTools->colorComboTextBackground->currentText();
1429
        if (prefsManager->appPrefs.toolSettings.dTextBackGround == ScApp->noneString)
1430
                prefsManager->appPrefs.toolSettings.dTextBackGround = "None";
1431
        prefsManager->appPrefs.toolSettings.dTextLineColor = tabTools->colorComboTextLine->currentText();
1432
        if (prefsManager->appPrefs.toolSettings.dTextLineColor == ScApp->noneString)
1433
                prefsManager->appPrefs.toolSettings.dTextLineColor = "None";
1434
        prefsManager->appPrefs.toolSettings.dTextBackGroundShade = tabTools->shadingTextBack->value();
1435
        prefsManager->appPrefs.toolSettings.dTextLineShade = tabTools->shadingTextLine->value();
1436
        prefsManager->appPrefs.toolSettings.dTextPenShade = tabTools->shadingText->value();
1437
        prefsManager->appPrefs.toolSettings.dTextStrokeShade = tabTools->shadingTextStroke->value();
2873 cbradney 1438
        prefsManager->appPrefs.toolSettings.dPen = tabTools->colorComboLineShape->currentText();
2894 fschmid 1439
        if (prefsManager->appPrefs.toolSettings.dPen == ScApp->noneString)
2873 cbradney 1440
                prefsManager->appPrefs.toolSettings.dPen = "None";
1441
        prefsManager->appPrefs.toolSettings.dPenText = tabTools->colorComboText->currentText();
2894 fschmid 1442
        if (prefsManager->appPrefs.toolSettings.dPenText == ScApp->noneString)
2873 cbradney 1443
                prefsManager->appPrefs.toolSettings.dPenText = "None";
1444
        prefsManager->appPrefs.toolSettings.dStrokeText = tabTools->colorComboStrokeText->currentText();
2894 fschmid 1445
        if (prefsManager->appPrefs.toolSettings.dStrokeText == ScApp->noneString)
2873 cbradney 1446
                prefsManager->appPrefs.toolSettings.dStrokeText = "None";
1447
        prefsManager->appPrefs.toolSettings.dCols = tabTools->columnsText->value();
1448
        prefsManager->appPrefs.toolSettings.dGap = tabTools->gapText->value() / prefsUnitRatio;
1449
        prefsManager->appPrefs.toolSettings.dTabWidth = tabTools->gapTab->value() / prefsUnitRatio;
1450
        prefsManager->appPrefs.toolSettings.dBrush = tabTools->comboFillShape->currentText();
2894 fschmid 1451
        if (prefsManager->appPrefs.toolSettings.dBrush == ScApp->noneString)
2873 cbradney 1452
                prefsManager->appPrefs.toolSettings.dBrush = "None";
1453
        prefsManager->appPrefs.toolSettings.dShade = tabTools->shadingFillShape->value();
1454
        prefsManager->appPrefs.toolSettings.dShade2 = tabTools->shadingLineShape->value();
1455
        switch (tabTools->tabFillCombo->currentItem())
1456
        {
1457
                case 0:
1458
                        prefsManager->appPrefs.toolSettings.tabFillChar = "";
1459
                        break;
1460
                case 1:
1461
                        prefsManager->appPrefs.toolSettings.tabFillChar = ".";
1462
                        break;
1463
                case 2:
1464
                        prefsManager->appPrefs.toolSettings.tabFillChar = "-";
1465
                        break;
1466
                case 3:
1467
                        prefsManager->appPrefs.toolSettings.tabFillChar = "_";
1468
                        break;
1469
                case 4:
1470
                        prefsManager->appPrefs.toolSettings.tabFillChar = tabTools->tabFillCombo->currentText().right(1);
1471
                        break;
1472
        }
1473
        switch (tabTools->comboStyleShape->currentItem())
1474
        {
1475
                case 0:
1476
                        prefsManager->appPrefs.toolSettings.dLineArt = SolidLine;
1477
                        break;
1478
                case 1:
1479
                        prefsManager->appPrefs.toolSettings.dLineArt = DashLine;
1480
                        break;
1481
                case 2:
1482
                        prefsManager->appPrefs.toolSettings.dLineArt = DotLine;
1483
                        break;
1484
                case 3:
1485
                        prefsManager->appPrefs.toolSettings.dLineArt = DashDotLine;
1486
                        break;
1487
                case 4:
1488
                        prefsManager->appPrefs.toolSettings.dLineArt = DashDotDotLine;
1489
                        break;
1490
        }
1491
        prefsManager->appPrefs.toolSettings.dWidth = tabTools->lineWidthShape->value();
1492
        prefsManager->appPrefs.toolSettings.dPenLine = tabTools->colorComboLine->currentText();
2894 fschmid 1493
        if (prefsManager->appPrefs.toolSettings.dPenLine == ScApp->noneString)
2873 cbradney 1494
                prefsManager->appPrefs.toolSettings.dPenLine = "None";
1495
        prefsManager->appPrefs.toolSettings.dShadeLine = tabTools->shadingLine->value();
1496
        switch (tabTools->comboStyleLine->currentItem())
1497
        {
1498
        case 0:
1499
                prefsManager->appPrefs.toolSettings.dLstyleLine = SolidLine;
1500
                break;
1501
        case 1:
1502
                prefsManager->appPrefs.toolSettings.dLstyleLine = DashLine;
1503
                break;
1504
        case 2:
1505
                prefsManager->appPrefs.toolSettings.dLstyleLine = DotLine;
1506
                break;
1507
        case 3:
1508
                prefsManager->appPrefs.toolSettings.dLstyleLine = DashDotLine;
1509
                break;
1510
        case 4:
1511
                prefsManager->appPrefs.toolSettings.dLstyleLine = DashDotDotLine;
1512
                break;
1513
        }
1514
        prefsManager->appPrefs.toolSettings.dWidthLine = tabTools->lineWidthLine->value();
1515
        prefsManager->appPrefs.toolSettings.dStartArrow = tabTools->startArrow->currentItem();
1516
        prefsManager->appPrefs.toolSettings.dEndArrow = tabTools->endArrow->currentItem();
1517
        prefsManager->appPrefs.toolSettings.magMin = tabTools->minimumZoom->value();
1518
        prefsManager->appPrefs.toolSettings.magMax = tabTools->maximumZoom->value();
1519
        prefsManager->appPrefs.toolSettings.magStep = tabTools->zoomStep->value();
1520
        prefsManager->appPrefs.toolSettings.dBrushPict = tabTools->comboFillImage->currentText();
2894 fschmid 1521
        if (prefsManager->appPrefs.toolSettings.dBrushPict == ScApp->noneString)
2873 cbradney 1522
                prefsManager->appPrefs.toolSettings.dBrushPict = "None";
1523
        prefsManager->appPrefs.toolSettings.shadePict = tabTools->shadingFillImage->value();
1524
        prefsManager->appPrefs.toolSettings.scaleX = static_cast<double>(tabTools->scalingHorizontal->value()) / 100.0;
1525
        prefsManager->appPrefs.toolSettings.scaleY = static_cast<double>(tabTools->scalingVertical->value()) / 100.0;
1526
        prefsManager->appPrefs.toolSettings.scaleType = tabTools->buttonGroup3->isChecked();
1527
        prefsManager->appPrefs.toolSettings.aspectRatio = tabTools->checkRatioImage->isChecked();
1528
        prefsManager->appPrefs.toolSettings.useEmbeddedPath = tabTools->embeddedPath->isChecked();
1529
        int haRes = 0;
1530
        if (tabTools->checkFullRes->isChecked())
1531
                haRes = 0;
1532
        if (tabTools->checkNormalRes->isChecked())
1533
                haRes = 1;
1534
        if (tabTools->checkHalfRes->isChecked())
1535
                haRes = 2;
1536
        prefsManager->appPrefs.toolSettings.lowResType = haRes;
1537
        prefsManager->appPrefs.AutoSave = ASon->isChecked();
1538
        prefsManager->appPrefs.AutoSaveTime = ASTime->value() * 60 * 1000;
1539
        prefsManager->appPrefs.MinWordLen = tabHyphenator->wordLen->value();
1540
        prefsManager->appPrefs.Language = ScApp->GetLang(tabHyphenator->language->currentText());
1541
        prefsManager->appPrefs.Automatic = !tabHyphenator->verbose->isChecked();
1542
        prefsManager->appPrefs.AutoCheck = tabHyphenator->input->isChecked();
1543
        prefsManager->appPrefs.HyCount = tabHyphenator->maxCount->value();
1544
        if (CMSavail)
1545
                tabColorManagement->setValues();
1546
        uint a = 0;
1547
        SCFontsIterator it(prefsManager->appPrefs.AvailFonts);
1548
        for ( ; it.current() ; ++it)
1549
        {
1550
                it.current()->EmbedPS = tabFonts->fontFlags[it.currentKey()].FlagPS;
1551
                it.current()->UseFont = tabFonts->fontFlags[it.currentKey()].FlagUse;
1552
                it.current()->Subset = tabFonts->fontFlags[it.currentKey()].FlagSub;
1553
        }
1554
        a = 0;
1555
        QMap<QString,QString>::Iterator itfsuend=tabFonts->RList.end();
1556
        prefsManager->appPrefs.GFontSub.clear();
1557
        for (QMap<QString,QString>::Iterator itfsu = tabFonts->RList.begin(); itfsu != itfsuend; ++itfsu)
1558
                prefsManager->appPrefs.GFontSub[itfsu.key()] = tabFonts->FlagsRepl.at(a++)->currentText();
1559
        prefsManager->appPrefs.PDF_Options.Thumbnails = tabPDF->CheckBox1->isChecked();
1560
        prefsManager->appPrefs.PDF_Options.Compress = tabPDF->Compression->isChecked();
1561
        prefsManager->appPrefs.PDF_Options.CompressMethod = tabPDF->CMethod->currentItem();
1562
        prefsManager->appPrefs.PDF_Options.Quality = tabPDF->CQuality->currentItem();
1563
        prefsManager->appPrefs.PDF_Options.Resolution = tabPDF->Resolution->value();
1564
        prefsManager->appPrefs.PDF_Options.RecalcPic = tabPDF->DSColor->isChecked();
1565
        prefsManager->appPrefs.PDF_Options.PicRes = tabPDF->ValC->value();
1566
        prefsManager->appPrefs.PDF_Options.Bookmarks = tabPDF->CheckBM->isChecked();
1567
        prefsManager->appPrefs.PDF_Options.Binding = tabPDF->ComboBind->currentItem();
1568
        prefsManager->appPrefs.PDF_Options.MirrorH = tabPDF->MirrorH->isOn();
1569
        prefsManager->appPrefs.PDF_Options.MirrorV = tabPDF->MirrorV->isOn();
1570
        prefsManager->appPrefs.PDF_Options.RotateDeg = tabPDF->RotateDeg->currentItem() * 90;
1571
        prefsManager->appPrefs.PDF_Options.Articles = tabPDF->Article->isChecked();
1572
        prefsManager->appPrefs.PDF_Options.Encrypt = tabPDF->Encry->isChecked();
1573
        prefsManager->appPrefs.PDF_Options.UseLPI = tabPDF->UseLPI->isChecked();
3079 fschmid 1574
        prefsManager->appPrefs.PDF_Options.UseSpotColors = !tabPDF->useSpot->isChecked();
1575
        prefsManager->appPrefs.PDF_Options.doMultiFile = false;
2873 cbradney 1576
        prefsManager->appPrefs.PDF_Options.BleedBottom = tabPDF->BleedBottom->value() / prefsUnitRatio;
1577
        prefsManager->appPrefs.PDF_Options.BleedTop = tabPDF->BleedTop->value() / prefsUnitRatio;
1578
        prefsManager->appPrefs.PDF_Options.BleedLeft = tabPDF->BleedLeft->value() / prefsUnitRatio;
1579
        prefsManager->appPrefs.PDF_Options.BleedRight = tabPDF->BleedRight->value() / prefsUnitRatio;
1580
        if (tabPDF->Encry->isChecked())
1581
        {
1582
                int Perm = -64;
1583
                if (tabPDF->PDFVersionCombo->currentItem() == 1)
1584
                        Perm &= ~0x00240000;
1585
                if (tabPDF->PrintSec->isChecked())
1586
                        Perm += 4;
1587
                if (tabPDF->ModifySec->isChecked())
1588
                        Perm += 8;
1589
                if (tabPDF->CopySec->isChecked())
1590
                        Perm += 16;
1591
                if (tabPDF->AddSec->isChecked())
1592
                        Perm += 32;
1593
                prefsManager->appPrefs.PDF_Options.Permissions = Perm;
1594
                prefsManager->appPrefs.PDF_Options.PassOwner = tabPDF->PassOwner->text();
1595
                prefsManager->appPrefs.PDF_Options.PassUser = tabPDF->PassUser->text();
1596
        }
1597
        if (tabPDF->PDFVersionCombo->currentItem() == 0)
1598
                prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_13;
1599
        if (tabPDF->PDFVersionCombo->currentItem() == 1)
1600
                prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_14;
1601
        if (tabPDF->PDFVersionCombo->currentItem() == 2)
1602
                prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_15;
1603
        if (tabPDF->PDFVersionCombo->currentItem() == 3)
1604
                prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_X3;
1605
        if (tabPDF->OutCombo->currentItem() == 0)
1606
        {
1607
                prefsManager->appPrefs.PDF_Options.isGrayscale = false;
1608
                prefsManager->appPrefs.PDF_Options.UseRGB = true;
1609
                prefsManager->appPrefs.PDF_Options.UseProfiles = false;
1610
                prefsManager->appPrefs.PDF_Options.UseProfiles2 = false;
1611
        }
1612
        else
1613
        {
1614
                if (tabPDF->OutCombo->currentItem() == 2)
1615
                {
1616
                        prefsManager->appPrefs.PDF_Options.isGrayscale = true;
1617
                        prefsManager->appPrefs.PDF_Options.UseRGB = false;
1618
                        prefsManager->appPrefs.PDF_Options.UseProfiles = false;
1619
                        prefsManager->appPrefs.PDF_Options.UseProfiles2 = false;
1620
                }
1621
                else
1622
                {
1623
                        prefsManager->appPrefs.PDF_Options.isGrayscale = false;
1624
                        prefsManager->appPrefs.PDF_Options.UseRGB = false;
1625
#ifdef HAVE_CMS
1626
                        if (CMSuse)
1627
                        {
1628
                                prefsManager->appPrefs.PDF_Options.UseProfiles = tabPDF->EmbedProfs->isChecked();
1629
                                prefsManager->appPrefs.PDF_Options.UseProfiles2 = tabPDF->EmbedProfs2->isChecked();
1630
                                prefsManager->appPrefs.PDF_Options.Intent = tabPDF->IntendS->currentItem();
1631
                                prefsManager->appPrefs.PDF_Options.Intent2 = tabPDF->IntendI->currentItem();
1632
                                prefsManager->appPrefs.PDF_Options.EmbeddedI = tabPDF->NoEmbedded->isChecked();
1633
                                prefsManager->appPrefs.PDF_Options.SolidProf = tabPDF->SolidPr->currentText();
1634
                                prefsManager->appPrefs.PDF_Options.ImageProf = tabPDF->ImageP->currentText();
1635
                                prefsManager->appPrefs.PDF_Options.PrintProf = tabPDF->PrintProfC->currentText();
1636
                        }
1637
#endif
1638
                }
1639
        }
1640
        prefsManager->appPrefs.defaultItemAttributes = *(tabDefaultItemAttributes->getNewAttributes());
1641
        prefsManager->appPrefs.defaultToCSetups = *(tabDefaultTOCIndexPrefs->getNewToCs());
1642
        prefsManager->appPrefs.KeyActions = tabKeys->getNewKeyMap();
1643
}