Subversion Repositories Scribus

Rev

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