Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
3 paul 1
#include "reformdoc.h"
2
#include "reformdoc.moc"
2965 cbradney 3
 
4
#include <qcolordialog.h>
5
#include <qcursor.h>
6
#include <qspinbox.h>
249 Franz 7
#include <qtooltip.h>
2965 cbradney 8
 
3757 cbradney 9
#include "docsections.h"
788 fschmid 10
#include "tabtypography.h"
2246 subik 11
#include "docinfo.h"
879 fschmid 12
#include "tabguides.h"
1194 fschmid 13
#include "tabtools.h"
1235 fschmid 14
#include "tabcheckdoc.h"
795 fschmid 15
#include "hysettings.h"
16
#include "cmsprefs.h"
806 cbradney 17
#include "units.h"
838 cbradney 18
#include "mspinbox.h"
19
#include "scribus.h"
1307 fschmid 20
#include "tabpdfoptions.h"
1321 fschmid 21
#include "fontprefs.h"
1542 cbradney 22
#include "units.h"
23
#include "pagesize.h"
1641 cbradney 24
#include "docitemattrprefs.h"
1684 cbradney 25
#include "tocindexprefs.h"
2769 fschmid 26
#include "marginWidget.h"
3670 cbradney 27
#include "page.h"
2834 cbradney 28
#include "prefsmanager.h"
2901 fschmid 29
#include "pagelayout.h"
2965 cbradney 30
#include "fontcombo.h"
31
#include "linecombo.h"
32
#include "arrowchooser.h"
33
#include "polygonwidget.h"
3252 craig 34
#include "hyphenator.h"
3560 fschmid 35
#include "sccombobox.h"
788 fschmid 36
 
3 paul 37
extern QPixmap loadIcon(QString nam);
795 fschmid 38
extern bool CMSavail;
3 paul 39
 
2965 cbradney 40
#ifdef HAVE_CMS
41
extern cmsHPROFILE CMSoutputProf;
42
extern cmsHPROFILE CMSprinterProf;
43
extern cmsHTRANSFORM stdTransG;
44
extern cmsHTRANSFORM stdProofG;
45
extern cmsHTRANSFORM stdTransImgG;
46
extern cmsHTRANSFORM stdProofImgG;
47
extern cmsHTRANSFORM stdTransCMYKG;
48
extern cmsHTRANSFORM stdProofCMYKG;
49
extern cmsHTRANSFORM stdTransRGBG;
3046 fschmid 50
extern cmsHTRANSFORM stdProofCMYKGCG;
51
extern cmsHTRANSFORM stdProofGCG;
2965 cbradney 52
extern bool BlackPoint;
53
extern bool SoftProofing;
54
extern bool Gamut;
55
extern bool CMSuse;
56
extern int IntentMonitor;
57
extern int IntentPrinter;
58
#endif
59
 
1194 fschmid 60
ReformDoc::ReformDoc( QWidget* parent, ScribusDoc* doc ) : PrefsDialogBase( parent )
3 paul 61
{
2965 cbradney 62
        einheit = doc->unitIndex();
1694 cbradney 63
        currDoc = doc;
4026 craig 64
        ScMW = (ScribusMainWindow*)parent;
2965 cbradney 65
        unitRatio = doc->unitRatio();
66
        QString ein = unitGetSuffixFromIndex(einheit);
67
        decimals = unitGetDecimalsFromIndex(einheit);
3411 fschmid 68
        pageWidth = doc->pageWidth;
69
        pageHeight = doc->pageHeight;
249 Franz 70
        setCaption( tr( "Document Setup" ) );
693 fschmid 71
        tabPage = new QWidget( prefsWidgets, "tab" );
788 fschmid 72
        reformDocLayout = new QVBoxLayout( tabPage );
1878 cbradney 73
        reformDocLayout->setSpacing( 5 );
74
        reformDocLayout->setMargin( 0 );
2880 fschmid 75
        reformDocLayout->setAlignment( Qt::AlignTop );
2901 fschmid 76
        dsLayout4p = new QHBoxLayout;
77
        dsLayout4p->setSpacing( 5 );
78
        dsLayout4p->setMargin( 0 );
3026 fschmid 79
        docLayout = new PageLayouts(tabPage, doc->pageSets);
3032 fschmid 80
        docLayout->selectItem(doc->currentPageLayout);
81
        docLayout->firstPage->setCurrentItem(doc->pageSets[doc->currentPageLayout].FirstPage);
2901 fschmid 82
        dsLayout4p->addWidget( docLayout );
83
 
84
        dsLayout4pv = new QVBoxLayout;
85
        dsLayout4pv->setSpacing( 5 );
86
        dsLayout4pv->setMargin( 0 );
693 fschmid 87
        dsGroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
519 cbradney 88
        dsGroupBox7->setTitle( tr( "Page Size" ) );
89
        dsGroupBox7->setColumnLayout(0, Qt::Vertical );
90
        dsGroupBox7->layout()->setSpacing( 0 );
91
        dsGroupBox7->layout()->setMargin( 0 );
92
        dsGroupBox7Layout = new QHBoxLayout( dsGroupBox7->layout() );
93
        dsGroupBox7Layout->setAlignment( Qt::AlignTop );
94
        dsGroupBox7Layout->setSpacing( 0 );
95
        dsGroupBox7Layout->setMargin( 10 );
96
        dsLayout4 = new QGridLayout;
2901 fschmid 97
        dsLayout4->setSpacing( 5 );
519 cbradney 98
        dsLayout4->setMargin( 0 );
693 fschmid 99
        sizeQComboBox = new QComboBox( true, dsGroupBox7, "sizeQComboBox" );
2607 fschmid 100
        sizeQComboBox->setEditable(false);
693 fschmid 101
        sizeQLabel = new QLabel( sizeQComboBox, tr( "&Size:" ), dsGroupBox7, "sizeQLabel" );
1542 cbradney 102
 
103
        PageSize *ps=new PageSize(doc->PageSize);
2658 fschmid 104
        QStringList pageSizes=ps->getPageSizeList();
105
        sizeQComboBox->insertStringList(ps->getTrPageSizeList());
1542 cbradney 106
        sizeQComboBox->insertItem( tr( "Custom" ) );
2658 fschmid 107
        prefsPageSizeName=ps->getPageName();
2246 subik 108
 
1542 cbradney 109
        int sizeIndex=pageSizes.findIndex(ps->getPageText());
519 cbradney 110
        //set Custom if we dont have one already as old docs wont have this attribute
1542 cbradney 111
        if (sizeIndex!=-1)
112
                sizeQComboBox->setCurrentItem(sizeIndex);
113
        else
114
                sizeQComboBox->setCurrentItem(sizeQComboBox->count()-1);
2246 subik 115
 
693 fschmid 116
        dsLayout4->addWidget( sizeQLabel, 0, 0 );
117
        dsLayout4->addWidget( sizeQComboBox, 0, 1 );
118
        orientationQComboBox = new QComboBox( true, dsGroupBox7, "orientationQComboBox" );
119
        orientationQLabel = new QLabel( orientationQComboBox, tr( "Orie&ntation:" ), dsGroupBox7, "orientationQLabel" );
120
        orientationQComboBox->insertItem( tr( "Portrait" ) );
121
        orientationQComboBox->insertItem( tr( "Landscape" ) );
122
        orientationQComboBox->setCurrentItem(doc->PageOri);
2607 fschmid 123
        orientationQComboBox->setEditable(false);
693 fschmid 124
        dsLayout4->addWidget( orientationQLabel, 0, 2 );
519 cbradney 125
        dsLayout4->addWidget( orientationQComboBox, 0, 3 );
3413 cbradney 126
        widthMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
693 fschmid 127
        widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7, "widthLabel" );
128
        widthMSpinBox->setEnabled( false );
129
        widthMSpinBox->setSuffix(ein);
3411 fschmid 130
        widthMSpinBox->setValue(pageWidth * unitRatio);
693 fschmid 131
        widthQLabel->setBuddy(widthMSpinBox);
132
        dsLayout4->addWidget( widthQLabel, 1, 0 );
133
        dsLayout4->addWidget( widthMSpinBox, 1, 1 );
3413 cbradney 134
        heightMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
693 fschmid 135
        heightMSpinBox->setEnabled( false );
136
        heightMSpinBox->setSuffix(ein);
3411 fschmid 137
        heightMSpinBox->setValue(pageHeight * unitRatio);
800 fschmid 138
        heightQLabel = new QLabel(heightMSpinBox,  tr( "&Height:" ), dsGroupBox7, "heightLabel" );
693 fschmid 139
        dsLayout4->addWidget( heightQLabel, 1, 2 );
140
        dsLayout4->addWidget( heightMSpinBox, 1, 3 );
2607 fschmid 141
        if (sizeQComboBox->currentText() == tr("Custom"))
142
        {
143
                heightMSpinBox->setEnabled( true );
144
                widthMSpinBox->setEnabled( true );
145
        }
800 fschmid 146
        unitCombo = new QComboBox( true, dsGroupBox7, "unitCombo" );
1525 cbradney 147
        unitCombo->insertStringList(unitGetTextUnitList());
800 fschmid 148
        unitCombo->setEditable(false);
2965 cbradney 149
        unitCombo->setCurrentItem(doc->unitIndex());
800 fschmid 150
        unitQLabel = new QLabel(unitCombo, tr( "&Unit:" ), dsGroupBox7, "unitQLabel" );
151
        dsLayout4->addWidget( unitQLabel, 2, 0 );
152
        dsLayout4->addWidget( unitCombo, 2, 1 );
3795 cbradney 153
 
154
        sizeAllPages = new QCheckBox( dsGroupBox7, "moveObjects" );
155
        sizeAllPages->setText( tr( "Apply size settings to all pages" ) );
156
        sizeAllPages->setChecked( false );
157
        dsLayout4->addMultiCellWidget( sizeAllPages, 3, 3, 0, 3 );
158
 
519 cbradney 159
        dsGroupBox7Layout->addLayout( dsLayout4 );
2901 fschmid 160
        dsLayout4pv->addWidget( dsGroupBox7 );
2769 fschmid 161
 
3795 cbradney 162
        GroupRand = new MarginWidget(tabPage,  tr( "Margin Guides" ), &doc->pageMargins, decimals, unitRatio, ein, true );
3411 fschmid 163
        GroupRand->setPageWidthHeight(pageWidth, pageHeight);
2901 fschmid 164
        dsLayout4pv->addWidget( GroupRand );
3795 cbradney 165
 
2901 fschmid 166
        dsLayout4p->addLayout( dsLayout4pv );
167
        reformDocLayout->addLayout( dsLayout4p );
2880 fschmid 168
 
3795 cbradney 169
        /*
788 fschmid 170
        groupBox7a = new QGroupBox( tabPage, "groupBox7" );
2901 fschmid 171
        groupBox7a->setTitle( tr( "Options" ) );
788 fschmid 172
        groupBox7a->setColumnLayout(0, Qt::Vertical );
173
        groupBox7a->layout()->setSpacing( 0 );
174
        groupBox7a->layout()->setMargin( 0 );
175
        groupBox7aLayout = new QHBoxLayout( groupBox7a->layout() );
176
        groupBox7aLayout->setAlignment( Qt::AlignTop );
177
        groupBox7aLayout->setSpacing( 0 );
178
        groupBox7aLayout->setMargin( 10 );
179
        layout4a = new QGridLayout;
180
        layout4a->setSpacing( 6 );
181
        layout4a->setMargin( 0 );
3795 cbradney 182
 
2901 fschmid 183
        sizeAllPages = new QCheckBox( groupBox7a, "moveObjects" );
184
        sizeAllPages->setText( tr( "Apply size settings to all Pages" ) );
185
        sizeAllPages->setChecked( false );
186
        layout4a->addMultiCellWidget( sizeAllPages, 1, 1, 0, 1 );
3795 cbradney 187
 
2901 fschmid 188
        marginsForAllPages = new QCheckBox( groupBox7a, "moveObjects" );
189
        marginsForAllPages->setText( tr( "Apply margin settings to all Pages" ) );
190
        marginsForAllPages->setChecked( false );
191
        layout4a->addMultiCellWidget( marginsForAllPages, 1, 1, 2, 3 );
3795 cbradney 192
 
788 fschmid 193
        TextLabel1_3 = new QLabel( tr( "F&irst Page Number:" ), groupBox7a, "TextLabel1_3" );
2901 fschmid 194
        layout4a->addMultiCellWidget( TextLabel1_3, 0, 0, 0, 1 );
788 fschmid 195
        pageNumber = new QSpinBox( groupBox7a, "pageNumber" );
726 fschmid 196
        pageNumber->setMaxValue( 10000 );
197
        pageNumber->setMinValue( 1 );
198
        pageNumber->setValue(doc->FirstPnum);
2901 fschmid 199
        layout4a->addWidget( pageNumber, 0, 2, Qt::AlignRight );
726 fschmid 200
        TextLabel1_3->setBuddy(pageNumber);
788 fschmid 201
        groupBox7aLayout->addLayout( layout4a );
202
        reformDocLayout->addWidget( groupBox7a );
3795 cbradney 203
        */
800 fschmid 204
        groupAutoSave = new QGroupBox( tabPage, "groupAutoSave" );
205
        groupAutoSave->setTitle( tr( "Autosave" ) );
206
        groupAutoSave->setCheckable( true );
207
        groupAutoSave->setChecked( doc->AutoSave );
208
        groupAutoSave->setColumnLayout(0, Qt::Vertical );
209
        groupAutoSave->layout()->setSpacing( 6 );
210
        groupAutoSave->layout()->setMargin( 11 );
211
        groupAutoSaveLayout = new QHBoxLayout( groupAutoSave->layout() );
212
        groupAutoSaveLayout->setAlignment( Qt::AlignTop );
213
        autoSaveTime = new QSpinBox( groupAutoSave, "autoSaveTime" );
214
        autoSaveTime->setMinValue( 1 );
215
        autoSaveTime->setMaxValue( 60 );
216
        autoSaveTime->setSuffix( " " + tr("min") );
217
        autoSaveTime->setValue(doc->AutoSaveTime / 1000 / 60);
218
        textLabel1m = new QLabel(autoSaveTime, tr( "&Interval:" ), groupAutoSave, "textLabel1m" );
219
        groupAutoSaveLayout->addWidget( textLabel1m );
3389 fschmid 220
        groupAutoSaveLayout->addWidget( autoSaveTime );
800 fschmid 221
        reformDocLayout->addWidget( groupAutoSave );
3544 avox 222
        addItem( tr("Document"), loadIcon("scribusdoc.png"), tabPage);
693 fschmid 223
 
2246 subik 224
        docInfos = new DocInfos(prefsWidgets, doc->documentInfo);
2397 cbradney 225
        addItem( tr("Document Information"), loadIcon("documentinfo32.png"), docInfos);
2246 subik 226
 
2889 cbradney 227
        tabGuides = new TabGuides(prefsWidgets, &doc->guidesSettings, &doc->typographicSettings, einheit);
2397 cbradney 228
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
693 fschmid 229
 
705 fschmid 230
        tabView = new QWidget( prefsWidgets, "tabView" );
1878 cbradney 231
        tabViewLayout = new QVBoxLayout( tabView, 0, 5, "tabViewLayout");
705 fschmid 232
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
1195 fschmid 233
        pageBackground->setTitle( tr( "Page Display" ) );
705 fschmid 234
        pageBackground->setColumnLayout(0, Qt::Vertical );
235
        pageBackground->layout()->setSpacing( 5 );
236
        pageBackground->layout()->setMargin( 10 );
237
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
238
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
239
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
240
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
241
        textLabel9->setText( tr( "Color:" ) );
242
        layout10->addWidget( textLabel9 );
243
        backColor = new QPushButton( pageBackground, "backColor" );
244
        backColor->setMinimumSize( QSize( 60, 20 ) );
245
        backColor->setMaximumSize( QSize( 60, 20 ) );
246
        backColor->setFlat( false );
247
        backColor->setAutoDefault( false );
3333 avox 248
        QPixmap pm5(54, 14);
705 fschmid 249
        pm5.fill(doc->papColor);
250
        colorPaper = doc->papColor;
251
        backColor->setPixmap(pm5);
252
        backColor->setText( QString::null );
253
        layout10->addWidget( backColor );
1195 fschmid 254
        QSpacerItem* spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
705 fschmid 255
        layout10->addItem( spacer3 );
256
        pageBackgroundLayout->addLayout( layout10 );
257
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
258
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
259
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
1065 cbradney 260
        checkUnprintable->setChecked( doc->marginColored );
705 fschmid 261
        pageBackgroundLayout->addWidget( checkUnprintable );
1195 fschmid 262
        checkPictures = new QCheckBox( pageBackground, "checkPictures" );
263
        checkPictures->setText( tr( "Show Pictures" ) );
264
        checkPictures->setChecked(doc->guidesSettings.showPic);
265
        pageBackgroundLayout->addWidget( checkPictures );
266
        checkLink = new QCheckBox( pageBackground, "checkLink" );
267
        checkLink->setText( tr( "Show Text Chains" ) );
268
        checkLink->setChecked(doc->guidesSettings.linkShown);
269
        pageBackgroundLayout->addWidget( checkLink );
2353 fschmid 270
        checkControl = new QCheckBox( pageBackground, "checkControl" );
271
        checkControl->setText( tr( "Show Text Control Characters" ) );
272
        checkControl->setChecked(doc->guidesSettings.showControls);
273
        pageBackgroundLayout->addWidget( checkControl );
1195 fschmid 274
        checkFrame = new QCheckBox( pageBackground, "checkFrame" );
275
        checkFrame->setText( tr( "Show Frames" ) );
276
        checkFrame->setChecked(doc->guidesSettings.framesShown);
277
        pageBackgroundLayout->addWidget( checkFrame );
2863 fschmid 278
        checkRuler = new QCheckBox( pageBackground, "checkRuler" );
279
        checkRuler->setText( tr( "Rulers relative to Page" ) );
280
        checkRuler->setChecked(doc->guidesSettings.rulerMode);
281
        pageBackgroundLayout->addWidget( checkRuler );
705 fschmid 282
        tabViewLayout->addWidget( pageBackground );
734 fschmid 283
 
284
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
2863 fschmid 285
        groupScratch->setTitle( tr( "Minimum Scratch Space" ) );
734 fschmid 286
        groupScratch->setColumnLayout(0, Qt::Vertical );
287
        groupScratch->layout()->setSpacing( 0 );
288
        groupScratch->layout()->setMargin( 0 );
289
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
290
        groupScratchLayout->setAlignment( Qt::AlignTop );
291
        groupScratchLayout->setSpacing( 0 );
292
        groupScratchLayout->setMargin( 10 );
788 fschmid 293
        layout4s = new QGridLayout;
294
        layout4s->setSpacing( 6 );
295
        layout4s->setMargin( 0 );
734 fschmid 296
        topScratch = new MSpinBox( groupScratch, 4 );
297
        topScratch->setSuffix( ein );
298
        topScratch->setDecimals( decimals );
299
        topScratch->setMaxValue(1000);
1843 cbradney 300
        topScratch->setValue(doc->ScratchTop * unitRatio);
788 fschmid 301
        layout4s->addWidget( topScratch, 0, 1 );
734 fschmid 302
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
788 fschmid 303
        layout4s->addWidget( TextLabel5s, 0, 0 );
734 fschmid 304
        leftScratch = new MSpinBox( groupScratch, 4 );
305
        leftScratch->setSuffix( ein );
306
        leftScratch->setDecimals( decimals );
307
        leftScratch->setMaxValue(1000);
1843 cbradney 308
        leftScratch->setValue(doc->ScratchLeft * unitRatio);
788 fschmid 309
        layout4s->addWidget( leftScratch, 0, 3 );
734 fschmid 310
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
788 fschmid 311
        layout4s->addWidget( Linkss, 0, 2 );
734 fschmid 312
        bottomScratch = new MSpinBox( groupScratch, 4 );
313
        bottomScratch->setSuffix( ein );
314
        bottomScratch->setDecimals( decimals );
315
        bottomScratch->setMaxValue(1000);
1843 cbradney 316
        bottomScratch->setValue(doc->ScratchBottom * unitRatio);
788 fschmid 317
        layout4s->addWidget( bottomScratch, 1, 1 );
734 fschmid 318
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
788 fschmid 319
        layout4s->addWidget( TextLabel7s, 1, 0 );
734 fschmid 320
        rightScratch = new MSpinBox( groupScratch, 4 );
321
        rightScratch->setSuffix( ein );
322
        rightScratch->setDecimals( decimals );
323
        rightScratch->setMaxValue(1000);
1843 cbradney 324
        rightScratch->setValue(doc->ScratchRight * unitRatio);
788 fschmid 325
        layout4s->addWidget( rightScratch, 1, 3 );
734 fschmid 326
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
788 fschmid 327
        layout4s->addWidget( Rechtss, 1, 2 );
328
        groupScratchLayout->addLayout( layout4s );
734 fschmid 329
        tabViewLayout->addWidget( groupScratch );
2872 fschmid 330
 
331
        groupGap = new QGroupBox( tabView, "GroupBox7" );
332
        groupGap->setTitle( tr( "Gaps between Pages" ) );
333
        groupGap->setColumnLayout(0, Qt::Vertical );
334
        groupGap->layout()->setSpacing( 0 );
335
        groupGap->layout()->setMargin( 0 );
336
        groupGapLayout = new QHBoxLayout( groupGap->layout() );
337
        groupGapLayout->setAlignment( Qt::AlignTop );
338
        groupGapLayout->setSpacing( 0 );
339
        groupGapLayout->setMargin( 10 );
340
        layout4sg = new QGridLayout;
341
        layout4sg->setSpacing( 6 );
342
        layout4sg->setMargin( 0 );
343
        gapHorizontal = new MSpinBox( groupGap, 4 );
344
        gapHorizontal->setSuffix( ein );
345
        gapHorizontal->setDecimals( decimals );
346
        gapHorizontal->setMaxValue(1000);
3032 fschmid 347
        gapHorizontal->setValue(doc->pageSets[doc->currentPageLayout].GapHorizontal * unitRatio);
2872 fschmid 348
        layout4sg->addWidget( gapHorizontal, 0, 1 );
349
        TextLabel5sg = new QLabel(gapHorizontal, tr( "Horizontal:" ), groupGap, "TextLabel5" );
350
        layout4sg->addWidget( TextLabel5sg, 0, 0 );
351
        gapVertical = new MSpinBox( groupGap, 4 );
352
        gapVertical->setSuffix( ein );
353
        gapVertical->setDecimals( decimals );
354
        gapVertical->setMaxValue(1000);
3187 fschmid 355
        gapVertical->setValue(doc->pageSets[doc->currentPageLayout].GapBelow * unitRatio);
2872 fschmid 356
        layout4sg->addWidget( gapVertical, 0, 3 );
357
        TextLabel7sg = new QLabel(gapVertical, tr( "Vertical:" ), groupGap, "Links" );
358
        layout4sg->addWidget( TextLabel7sg, 0, 2 );
359
        groupGapLayout->addLayout( layout4sg );
360
        tabViewLayout->addWidget( groupGap );
715 fschmid 361
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
362
 
2889 cbradney 363
        tabTypo = new TabTypograpy(  prefsWidgets, &doc->typographicSettings);
3544 avox 364
        addItem( tr("Typography"), loadIcon("typography.png"), tabTypo);
715 fschmid 365
 
1790 cbradney 366
        tabTools = new TabTools(  prefsWidgets, &doc->toolSettings, einheit, doc);
726 fschmid 367
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
368
 
4026 craig 369
        tabHyphenator = new HySettings(prefsWidgets, &ScMW->LangTransl);
1065 cbradney 370
        tabHyphenator->verbose->setChecked(!doc->docHyphenator->Automatic);
371
        tabHyphenator->input->setChecked(doc->docHyphenator->AutoCheck);
4026 craig 372
        tabHyphenator->language->setCurrentText(ScMW->LangTransl[doc->docHyphenator->Language]);
1065 cbradney 373
        tabHyphenator->wordLen->setValue(doc->docHyphenator->MinWordLen);
374
        tabHyphenator->maxCount->setValue(doc->docHyphenator->HyCount);
795 fschmid 375
        addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator);
2246 subik 376
 
4026 craig 377
        tabFonts = new FontPrefs(  prefsWidgets, PrefsManager::instance()->appPrefs.AvailFonts, true, ScMW->PrefsPfad, doc);
1321 fschmid 378
        addItem( tr("Fonts"), loadIcon("font.png"), tabFonts);
1235 fschmid 379
 
1261 fschmid 380
        tabDocChecker = new TabCheckDoc(  prefsWidgets, doc->checkerProfiles, doc->curCheckProfile);
2770 cbradney 381
        addItem( tr("Preflight Verifier"), loadIcon("checkdoc.png"), tabDocChecker);
2246 subik 382
 
2834 cbradney 383
        tabPDF = new TabPDFOptions( prefsWidgets, &doc->PDF_Options, PrefsManager::instance()->appPrefs.AvailFonts,
4026 craig 384
                                                                &ScMW->PDFXProfiles, doc->UsedFonts, doc->PDF_Options.PresentVals,
2142 cbradney 385
                                                                einheit, doc->pageHeight, doc->pageWidth, 0 );
1307 fschmid 386
        addItem( tr("PDF Export"), loadIcon("acroread.png"), tabPDF);
2246 subik 387
 
1641 cbradney 388
        tabDocItemAttributes = new DocumentItemAttributes( prefsWidgets);
1694 cbradney 389
        docAttributesList=tabDocItemAttributes->getDocAttributesNames();
1641 cbradney 390
        tabDocItemAttributes->setup(&doc->docItemAttributes);
391
        addItem( tr("Document Item Attributes"), loadIcon("docattributes.png"), tabDocItemAttributes);
1235 fschmid 392
 
1684 cbradney 393
        tabTOCIndexPrefs = new TOCIndexPrefs( prefsWidgets );
1701 cbradney 394
        tabTOCIndexPrefs->setupItemAttrs( docAttributesList );
395
        tabTOCIndexPrefs->setup(&(currDoc->docToCSetups), currDoc);
1694 cbradney 396
        connect( prefsWidgets, SIGNAL(aboutToShow(QWidget *)), this, SLOT(setTOCIndexData(QWidget *)));
1684 cbradney 397
        addItem( tr("Table of Contents and Indexes"), loadIcon("tabtocindex.png"), tabTOCIndexPrefs);
2246 subik 398
 
3757 cbradney 399
        tabDocSections = new DocSections(prefsWidgets);
3770 cbradney 400
        tabDocSections->setup(currDoc->sections, currDoc->DocPages.count()-1);
3757 cbradney 401
        addItem( tr("Sections"), loadIcon("tabtocindex.png"), tabDocSections);
402
 
800 fschmid 403
        int cmsTab = 0;
795 fschmid 404
        if (CMSavail)
405
        {
4026 craig 406
                tabColorManagement = new CMSPrefs(prefsWidgets, &doc->CMSSettings, &ScMW->InputProfiles, &ScMW->InputProfilesCMYK, &ScMW->PrinterProfiles, &ScMW->MonitorProfiles);
800 fschmid 407
                cmsTab = addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
795 fschmid 408
        }
409
 
3032 fschmid 410
        setDS(doc->currentPageLayout);
2658 fschmid 411
        pageWidth = widthMSpinBox->value() / unitRatio;
412
        pageHeight = heightMSpinBox->value() / unitRatio;
249 Franz 413
        //tooltips
3095 mrdocs 414
        QToolTip::add( checkLink, "<qt>" + tr("Enable or disable the display of linked text frames.") + "</qt>");
2598 cbradney 415
        QToolTip::add( checkControl, "<qt>" + tr("Display non-printing characters such as paragraph markers in text frames") + "</qt>");
2246 subik 416
        QToolTip::add( checkFrame, "<qt>" + tr("Turns the display of frames on or off") + "</qt>");
417
        QToolTip::add( checkPictures, "<qt>" + tr("Turns the display of pictures on or off") + "</qt>");
418
        QToolTip::add( backColor, "<qt>" + tr( "Color for paper" ) + "</qt>" );
419
        QToolTip::add( checkUnprintable, "<qt>" + tr( "Mask the area outside the margins in the margin color" ) + "</qt>" );
2901 fschmid 420
//      QToolTip::add( facingPages, "<qt>" + tr( "Enable single or spread based layout" ) + "</qt>" );
421
//      QToolTip::add( firstPage, "<qt>" + tr( "Make the first page the left page of the document" ) + "</qt>" );
3795 cbradney 422
        QToolTip::add( sizeAllPages, "<qt>" + tr( "Apply the page size changes to all existing pages in the document" ) + "</qt>" );
3 paul 423
 
249 Franz 424
        // signals and slots connections
2901 fschmid 425
        connect(docLayout, SIGNAL( selectedLayout(int) ), this, SLOT( setDS(int) ) );
2607 fschmid 426
        connect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
427
        connect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
705 fschmid 428
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
734 fschmid 429
        connect(unitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
1828 fschmid 430
        connect(backToDefaults, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
2607 fschmid 431
        connect(orientationQComboBox, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
2923 fschmid 432
        connect(sizeQComboBox, SIGNAL(activated(const QString &)), this, SLOT(setPageSize()));
731 fschmid 433
 
800 fschmid 434
        if (CMSavail)
1307 fschmid 435
        {
800 fschmid 436
                prefsWidgets->raiseWidget(cmsTab);
1307 fschmid 437
                connect(tabColorManagement, SIGNAL(cmsOn(bool )), this, SLOT(switchCMS(bool )));
438
        }
800 fschmid 439
        arrangeIcons();
693 fschmid 440
        resize( minimumSizeHint() );
441
        clearWState( WState_Polished );
1834 fschmid 442
        prefsSelection->setSelected(prefsSelection->firstItem(), true);
443
        itemSelected(prefsSelection->firstItem());
3 paul 444
}
445
 
1828 fschmid 446
void ReformDoc::restoreDefaults()
447
{
448
        QWidget* current = prefsWidgets->visibleWidget();
449
        if (current == tabPage)
450
        {
2965 cbradney 451
                unitCombo->setCurrentItem(currDoc->unitIndex());
1828 fschmid 452
                unitChange();
453
                autoSaveTime->setValue(currDoc->AutoSaveTime / 1000 / 60);
454
                groupAutoSave->setChecked( currDoc->AutoSave );
3796 cbradney 455
                //pageNumber->setValue(currDoc->FirstPnum);
3032 fschmid 456
                docLayout->selectItem(currDoc->currentPageLayout);
457
                setDS(currDoc->currentPageLayout);
458
                docLayout->firstPage->setCurrentItem(currDoc->pageSets[currDoc->currentPageLayout].FirstPage);
2769 fschmid 459
                GroupRand->rightR->setValue(currDoc->pageMargins.Right * unitRatio);
460
                GroupRand->bottomR->setValue(currDoc->pageMargins.Bottom * unitRatio);
461
                GroupRand->leftR->setValue(currDoc->pageMargins.Left * unitRatio);
462
                GroupRand->topR->setValue(currDoc->pageMargins.Top * unitRatio);
463
                GroupRand->RandR = GroupRand->rightR->value() / unitRatio;
464
                GroupRand->RandL = GroupRand->leftR->value() / unitRatio;
465
                GroupRand->RandB = GroupRand->bottomR->value() / unitRatio;
466
                GroupRand->RandT = GroupRand->topR->value() / unitRatio;
1828 fschmid 467
        }
468
        else if (current == tabView)
469
        {
3333 avox 470
                QPixmap pm(54, 14);
1828 fschmid 471
                pm.fill(currDoc->papColor);
472
                colorPaper = currDoc->papColor;
473
                backColor->setPixmap(pm);
474
                checkUnprintable->setChecked( currDoc->marginColored );
475
                checkPictures->setChecked(currDoc->guidesSettings.showPic);
476
                checkLink->setChecked(currDoc->guidesSettings.linkShown);
477
                checkFrame->setChecked(currDoc->guidesSettings.framesShown);
2863 fschmid 478
                checkRuler->setChecked(currDoc->guidesSettings.rulerMode);
1828 fschmid 479
                topScratch->setValue(currDoc->ScratchTop * unitRatio);
480
                leftScratch->setValue(currDoc->ScratchLeft * unitRatio);
481
                bottomScratch->setValue(currDoc->ScratchBottom * unitRatio);
482
                rightScratch->setValue(currDoc->ScratchRight * unitRatio);
3032 fschmid 483
                gapHorizontal->setValue(currDoc->pageSets[currDoc->currentPageLayout].GapHorizontal * unitRatio);
3187 fschmid 484
                gapVertical->setValue(currDoc->pageSets[currDoc->currentPageLayout].GapBelow * unitRatio);
1828 fschmid 485
        }
486
        else if (current == tabHyphenator)
487
        {
488
                tabHyphenator->verbose->setChecked(!currDoc->docHyphenator->Automatic);
489
                tabHyphenator->input->setChecked(currDoc->docHyphenator->AutoCheck);
4026 craig 490
                tabHyphenator->language->setCurrentText(ScMW->LangTransl[currDoc->docHyphenator->Language]);
1828 fschmid 491
                tabHyphenator->wordLen->setValue(currDoc->docHyphenator->MinWordLen);
492
                tabHyphenator->maxCount->setValue(currDoc->docHyphenator->HyCount);
493
        }
494
        else if (current == tabGuides)
2889 cbradney 495
                tabGuides->restoreDefaults(&currDoc->guidesSettings, &currDoc->typographicSettings, einheit);
1828 fschmid 496
        else if (current == tabTypo)
2889 cbradney 497
                tabTypo->restoreDefaults(&currDoc->typographicSettings);
1828 fschmid 498
        else if (current == tabTools)
499
                tabTools->restoreDefaults();
500
        else if (current == tabFonts)
501
                tabFonts->restoreDefaults();
502
        else if (current == tabDocChecker)
503
                tabDocChecker->restoreDefaults();
504
        else if (current == tabPDF)
505
                tabPDF->restoreDefaults();
506
        else if (current == tabColorManagement)
507
                tabColorManagement->restoreDefaults();
2246 subik 508
        else if (current == docInfos)
509
                docInfos->restoreDefaults();
1828 fschmid 510
}
511
 
734 fschmid 512
void ReformDoc::unitChange()
513
{
2607 fschmid 514
        disconnect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
515
        disconnect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
734 fschmid 516
        int decimalsOld;
1790 cbradney 517
        double oldUnitRatio = unitRatio;
734 fschmid 518
        double oldMin, oldMax, val;
519
        QString einh;
520
        einheit = unitCombo->currentItem();
1790 cbradney 521
        unitRatio=unitGetRatioFromIndex(einheit);
1525 cbradney 522
        decimals=unitGetDecimalsFromIndex(einheit);
523
        einh=unitGetSuffixFromIndex(einheit);
781 cbradney 524
 
782 fschmid 525
        widthMSpinBox->setSuffix(einh);
526
        heightMSpinBox->setSuffix(einh);
879 fschmid 527
        tabGuides->minorSpace->setSuffix(einh);
528
        tabGuides->majorSpace->setSuffix(einh);
529
        tabGuides->snapDistance->setSuffix(einh);
1195 fschmid 530
        tabGuides->baseGrid->setSuffix(einh);
531
        tabGuides->baseOffset->setSuffix(einh);
1194 fschmid 532
        tabTools->gapText->setSuffix(einh);
782 fschmid 533
        topScratch->setSuffix(einh);
534
        bottomScratch->setSuffix(einh);
535
        leftScratch->setSuffix(einh);
536
        rightScratch->setSuffix(einh);
2872 fschmid 537
        gapVertical->setSuffix( einh );
538
        gapHorizontal->setSuffix( einh );
1307 fschmid 539
        tabPDF->BleedBottom->setSuffix(einh);
540
        tabPDF->BleedTop->setSuffix(einh);
541
        tabPDF->BleedRight->setSuffix(einh);
542
        tabPDF->BleedLeft->setSuffix(einh);
781 cbradney 543
 
1790 cbradney 544
        double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
734 fschmid 545
        widthMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
2142 cbradney 546
        widthMSpinBox->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, currDoc->pageWidth * unitRatio);
734 fschmid 547
        heightMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
2142 cbradney 548
        heightMSpinBox->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, currDoc->pageHeight * unitRatio);
879 fschmid 549
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
550
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
551
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
552
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
553
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
554
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1195 fschmid 555
        tabGuides->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
556
        tabGuides->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
557
        tabGuides->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
558
        tabGuides->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1194 fschmid 559
        tabTools->gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
560
        tabTools->gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
2285 fschmid 561
        tabTools->gapTab->getValues(&oldMin, &oldMax, &decimalsOld, &val);
562
        tabTools->gapTab->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 563
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 564
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 565
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 566
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 567
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 568
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 569
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 570
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
2872 fschmid 571
        gapVertical->getValues(&oldMin, &oldMax, &decimalsOld, &val);
572
        gapVertical->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
573
        gapHorizontal->getValues(&oldMin, &oldMax, &decimalsOld, &val);
574
        gapHorizontal->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1307 fschmid 575
        tabPDF->BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
576
        tabPDF->BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
577
        tabPDF->BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
578
        tabPDF->BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
579
        tabPDF->BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
580
        tabPDF->BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
581
        tabPDF->BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
582
        tabPDF->BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1790 cbradney 583
        tabPDF->unitRatio = unitRatio;
2607 fschmid 584
        pageWidth = widthMSpinBox->value() / unitRatio;
585
        pageHeight = heightMSpinBox->value() / unitRatio;
2769 fschmid 586
        GroupRand->unitChange(unitRatio, decimals, einh);
587
        GroupRand->setPageHeight(pageHeight);
588
        GroupRand->setPageWidth(pageWidth);
2607 fschmid 589
        connect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
590
        connect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
734 fschmid 591
}
592
 
705 fschmid 593
void ReformDoc::changePaperColor()
594
{
595
        QColor neu = QColor();
596
        neu = QColorDialog::getColor(colorPaper, this);
597
        if (neu.isValid())
598
        {
3333 avox 599
                QPixmap pm(54, 14);
705 fschmid 600
                pm.fill(neu);
601
                colorPaper = neu;
602
                backColor->setPixmap(pm);
603
        }
604
}
605
 
2901 fschmid 606
void ReformDoc::setDS(int layout)
3 paul 607
{
2901 fschmid 608
        GroupRand->setFacingPages(!(layout == singlePage));
609
        choosenLayout = layout;
3016 fschmid 610
        docLayout->firstPage->setCurrentItem(currDoc->pageSets[choosenLayout].FirstPage);
611
        gapHorizontal->setValue(currDoc->pageSets[choosenLayout].GapHorizontal * unitRatio);
3187 fschmid 612
        gapVertical->setValue(currDoc->pageSets[choosenLayout].GapBelow * unitRatio);
348 Franz 613
}
1307 fschmid 614
 
2607 fschmid 615
void ReformDoc::setPageWidth(int)
616
{
617
        pageWidth = widthMSpinBox->value() / unitRatio;
2769 fschmid 618
        GroupRand->setPageWidth(pageWidth);
2607 fschmid 619
}
620
 
621
void ReformDoc::setPageHeight(int)
622
{
623
        pageHeight = heightMSpinBox->value() / unitRatio;
2769 fschmid 624
        GroupRand->setPageHeight(pageHeight);
2607 fschmid 625
}
626
 
2923 fschmid 627
void ReformDoc::setPageSize()
628
{
629
        setOrien(orientationQComboBox->currentItem());
630
}
631
 
2607 fschmid 632
void ReformDoc::setSize(const QString & gr)
633
{
634
        pageWidth = widthMSpinBox->value() / unitRatio;
635
        pageHeight = heightMSpinBox->value() / unitRatio;
636
        widthMSpinBox->setEnabled(false);
637
        heightMSpinBox->setEnabled(false);
638
        PageSize *ps2=new PageSize(gr);
639
        prefsPageSizeName=ps2->getPageName();
640
        if (gr == tr("Custom"))
641
        {
642
                widthMSpinBox->setEnabled(true);
643
                heightMSpinBox->setEnabled(true);
644
        }
645
        else
646
        {
647
                pageWidth = ps2->getPageWidth();
648
                pageHeight = ps2->getPageHeight();
649
        }
650
        disconnect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
651
        disconnect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
652
        widthMSpinBox->setValue(pageWidth * unitRatio);
653
        heightMSpinBox->setValue(pageHeight * unitRatio);
2769 fschmid 654
        GroupRand->setPageHeight(pageHeight);
655
        GroupRand->setPageWidth(pageWidth);
2607 fschmid 656
        connect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
657
        connect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
658
        delete ps2;
659
}
660
 
661
void ReformDoc::setOrien(int ori)
662
{
663
        double br;
664
        setSize(sizeQComboBox->currentText());
665
        disconnect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
666
        disconnect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
667
        if (ori == 0)
668
        {
669
                if (sizeQComboBox->currentText() == tr("Custom"))
670
                {
671
                        br = widthMSpinBox->value();
672
                        widthMSpinBox->setValue(heightMSpinBox->value());
673
                        heightMSpinBox->setValue(br);
674
                }
675
        }
676
        else
677
        {
678
                br = widthMSpinBox->value();
679
                widthMSpinBox->setValue(heightMSpinBox->value());
680
                heightMSpinBox->setValue(br);
681
        }
682
        pageWidth = widthMSpinBox->value() / unitRatio;
683
        pageHeight = heightMSpinBox->value() / unitRatio;
684
        connect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
685
        connect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
686
}
687
 
1307 fschmid 688
void ReformDoc::switchCMS(bool enable)
689
{
690
        tabPDF->enableCMS(enable);
691
}
1694 cbradney 692
 
693
void ReformDoc::setTOCIndexData(QWidget *widgetToShow)
694
{
2246 subik 695
        //Update the attributes list in TOC setup
1694 cbradney 696
        if (widgetToShow==tabTOCIndexPrefs)
697
                tabTOCIndexPrefs->setupItemAttrs( tabDocItemAttributes->getDocAttributesNames() );
698
}
2965 cbradney 699
 
700
const int ReformDoc::getSelectedUnit()
701
{
702
        return unitCombo->currentItem();
703
}
704
 
705
const bool ReformDoc::colorManagementSettingsChanged()
706
{
707
        return tabColorManagement->changed;
708
}
709
 
710
const bool ReformDoc::imageResolutionChanged()
711
{
712
        return viewToRecalcPictureRes;
713
}
714
 
715
void ReformDoc::updateDocumentSettings()
716
{
717
        double tpr2, lr2, rr2, br2;
718
        tpr2 = GroupRand->RandT;
719
        br2 = GroupRand->RandB;
720
        lr2 = GroupRand->RandL;
721
        rr2 = GroupRand->RandR;
722
        int fp = choosenLayout;
3016 fschmid 723
        currDoc->pageSets[fp].FirstPage = docLayout->firstPage->currentItem();
724
        currDoc->pageSets[fp].GapHorizontal = gapHorizontal->value() / currDoc->unitRatio();
3187 fschmid 725
        currDoc->pageSets[fp].GapBelow = gapVertical->value() / currDoc->unitRatio();
3796 cbradney 726
        //currDoc->FirstPnum = pageNumber->value();
2965 cbradney 727
        currDoc->resetPage(tpr2, lr2, rr2, br2, fp);
728
        currDoc->PageOri = orientationQComboBox->currentItem();
729
        currDoc->PageSize = prefsPageSizeName;
730
        currDoc->pageWidth = pageWidth;
731
        currDoc->pageHeight = pageHeight;
3724 cbradney 732
        for (uint p = 0; p < currDoc->Pages->count(); ++p)
2965 cbradney 733
        {
3724 cbradney 734
                Page *pp = currDoc->Pages->at(p);
2965 cbradney 735
                if (sizeAllPages->isChecked())
736
                {
3200 cbradney 737
                        pp->setInitialWidth(currDoc->pageWidth);
738
                        pp->setInitialHeight(currDoc->pageHeight);
2965 cbradney 739
                }
3795 cbradney 740
                if (GroupRand->marginsForAllPages->isChecked())
2965 cbradney 741
                {
742
                        pp->initialMargins.Left = lr2;
743
                        pp->initialMargins.Right = rr2;
744
                        pp->initialMargins.Top = tpr2;
745
                        pp->initialMargins.Bottom = br2;
746
                }
747
        }
748
        for (uint p = 0; p < currDoc->MasterPages.count(); ++p)
749
        {
750
                Page *pp = currDoc->MasterPages.at(p);
751
                if (sizeAllPages->isChecked())
752
                {
3200 cbradney 753
                        pp->setInitialWidth(currDoc->pageWidth);
754
                        pp->setInitialHeight(currDoc->pageHeight);
2965 cbradney 755
                }
3795 cbradney 756
                if (GroupRand->marginsForAllPages->isChecked())
2965 cbradney 757
                {
758
                        pp->initialMargins.Left = lr2;
759
                        pp->initialMargins.Right = rr2;
760
                        pp->initialMargins.Top = tpr2;
761
                        pp->initialMargins.Bottom = br2;
762
                }
763
        }
764
        currDoc->guidesSettings.before = tabGuides->inBackground->isChecked();
765
        currDoc->marginColored = checkUnprintable->isChecked();
766
        currDoc->papColor = colorPaper;
767
        currDoc->guidesSettings.marginsShown = tabGuides->marginBox->isChecked();
768
        currDoc->guidesSettings.framesShown = checkFrame->isChecked();
769
        currDoc->guidesSettings.gridShown = tabGuides->checkGrid->isChecked();
770
        currDoc->guidesSettings.guidesShown = tabGuides->guideBox->isChecked();
771
        currDoc->guidesSettings.baseShown = tabGuides->baselineBox->isChecked();
772
        currDoc->guidesSettings.showPic = checkPictures->isChecked();
773
        currDoc->guidesSettings.linkShown = checkLink->isChecked();
774
        currDoc->guidesSettings.showControls = checkControl->isChecked();
775
        currDoc->guidesSettings.rulerMode = checkRuler->isChecked();
776
        currDoc->guidesSettings.grabRad = tabGuides->grabDistance->value();
777
        currDoc->guidesSettings.guideRad = tabGuides->snapDistance->value() / currDoc->unitRatio();
778
        currDoc->guidesSettings.minorGrid = tabGuides->minorSpace->value() / currDoc->unitRatio();
779
        currDoc->guidesSettings.majorGrid = tabGuides->majorSpace->value() / currDoc->unitRatio();
780
        currDoc->guidesSettings.minorColor = tabGuides->colorMinorGrid;
781
        currDoc->guidesSettings.majorColor = tabGuides->colorMajorGrid;
782
        currDoc->guidesSettings.margColor = tabGuides->colorMargin;
783
        currDoc->guidesSettings.guideColor = tabGuides->colorGuides;
784
        currDoc->guidesSettings.baseColor = tabGuides->colorBaselineGrid;
785
        currDoc->checkerProfiles = tabDocChecker->checkerProfile;
786
        currDoc->curCheckProfile = tabDocChecker->curCheckProfile->currentText();
787
        currDoc->typographicSettings.valueSuperScript = tabTypo->superDisplacement->value();
788
        currDoc->typographicSettings.scalingSuperScript = tabTypo->superScaling->value();
789
        currDoc->typographicSettings.valueSubScript = tabTypo->subDisplacement->value();
790
        currDoc->typographicSettings.scalingSubScript = tabTypo->subScaling->value();
791
        currDoc->typographicSettings.valueSmallCaps = tabTypo->capsScaling->value();
792
        currDoc->typographicSettings.autoLineSpacing = tabTypo->autoLine->value();
793
        currDoc->typographicSettings.valueBaseGrid = tabGuides->baseGrid->value() / currDoc->unitRatio();
794
        currDoc->typographicSettings.offsetBaseGrid = tabGuides->baseOffset->value() / currDoc->unitRatio();
795
        currDoc->typographicSettings.valueUnderlinePos = qRound(tabTypo->underlinePos->value() * 10);
796
        currDoc->typographicSettings.valueUnderlineWidth = qRound(tabTypo->underlineWidth->value() * 10);
797
        currDoc->typographicSettings.valueStrikeThruPos = qRound(tabTypo->strikethruPos->value() * 10);
798
        currDoc->typographicSettings.valueStrikeThruWidth = qRound(tabTypo->strikethruWidth->value() * 10);
799
        currDoc->toolSettings.defFont = tabTools->fontComboText->currentText();
800
        currDoc->toolSettings.defSize = tabTools->sizeComboText->currentText().left(2).toInt() * 10;
801
        currDoc->toolSettings.dStrokeText = tabTools->colorComboStrokeText->currentText();
802
        switch (tabTools->tabFillCombo->currentItem())
803
        {
804
                case 0:
805
                        currDoc->toolSettings.tabFillChar = "";
806
                        break;
807
                case 1:
808
                        currDoc->toolSettings.tabFillChar = ".";
809
                        break;
810
                case 2:
811
                        currDoc->toolSettings.tabFillChar = "-";
812
                        break;
813
                case 3:
814
                        currDoc->toolSettings.tabFillChar = "_";
815
                        break;
816
                case 4:
817
                        currDoc->toolSettings.tabFillChar = tabTools->tabFillCombo->currentText().right(1);
818
                        break;
819
        }
2995 fschmid 820
        // TODO fix these tr("None") things
4026 craig 821
        if (currDoc->toolSettings.dStrokeText == ScMW->noneString)
2965 cbradney 822
                currDoc->toolSettings.dStrokeText = "None";
823
        currDoc->toolSettings.dPenText = tabTools->colorComboText->currentText();
4026 craig 824
        if (currDoc->toolSettings.dPenText == ScMW->noneString)
2965 cbradney 825
                currDoc->toolSettings.dPenText = "None";
3093 fschmid 826
        currDoc->toolSettings.dTextBackGround = tabTools->colorComboTextBackground->currentText();
4026 craig 827
        if (currDoc->toolSettings.dTextBackGround == ScMW->noneString)
3093 fschmid 828
                currDoc->toolSettings.dTextBackGround = "None";
829
        currDoc->toolSettings.dTextLineColor = tabTools->colorComboTextLine->currentText();
4026 craig 830
        if (currDoc->toolSettings.dTextLineColor == ScMW->noneString)
3093 fschmid 831
                currDoc->toolSettings.dTextLineColor = "None";
832
        currDoc->toolSettings.dTextBackGroundShade = tabTools->shadingTextBack->value();
833
        currDoc->toolSettings.dTextLineShade = tabTools->shadingTextLine->value();
834
        currDoc->toolSettings.dTextPenShade = tabTools->shadingText->value();
835
        currDoc->toolSettings.dTextStrokeShade = tabTools->shadingTextStroke->value();
2965 cbradney 836
        currDoc->toolSettings.dCols = tabTools->columnsText->value();
837
        currDoc->toolSettings.dGap = tabTools->gapText->value() / currDoc->unitRatio();
838
        currDoc->toolSettings.dTabWidth = tabTools->gapTab->value() / currDoc->unitRatio();
839
        currDoc->toolSettings.dPen = tabTools->colorComboLineShape->currentText();
4026 craig 840
        if (currDoc->toolSettings.dPen == ScMW->noneString)
2965 cbradney 841
                currDoc->toolSettings.dPen = "None";
842
        currDoc->toolSettings.dBrush = tabTools->comboFillShape->currentText();
4026 craig 843
        if (currDoc->toolSettings.dBrush == ScMW->noneString)
2965 cbradney 844
                currDoc->toolSettings.dBrush = "None";
845
        currDoc->toolSettings.dShade = tabTools->shadingFillShape->value();
846
        currDoc->toolSettings.dShade2 = tabTools->shadingLineShape->value();
847
        switch (tabTools->comboStyleShape->currentItem())
848
        {
849
        case 0:
850
                currDoc->toolSettings.dLineArt = SolidLine;
851
                break;
852
        case 1:
853
                currDoc->toolSettings.dLineArt = DashLine;
854
                break;
855
        case 2:
856
                currDoc->toolSettings.dLineArt = DotLine;
857
                break;
858
        case 3:
859
                currDoc->toolSettings.dLineArt = DashDotLine;
860
                break;
861
        case 4:
862
                currDoc->toolSettings.dLineArt = DashDotDotLine;
863
                break;
864
        }
865
        currDoc->toolSettings.dWidth = tabTools->lineWidthShape->value();
866
        currDoc->toolSettings.dStartArrow = tabTools->startArrow->currentItem();
867
        currDoc->toolSettings.dEndArrow = tabTools->endArrow->currentItem();
868
        currDoc->toolSettings.magMin = tabTools->minimumZoom->value();
869
        currDoc->toolSettings.magMax = tabTools->maximumZoom->value();
870
        currDoc->toolSettings.magStep = tabTools->zoomStep->value();
871
        currDoc->toolSettings.dPenLine = tabTools->colorComboLine->currentText();
4026 craig 872
        if (currDoc->toolSettings.dPenLine == ScMW->noneString)
2965 cbradney 873
                currDoc->toolSettings.dPenLine = "None";
874
        currDoc->toolSettings.dShadeLine = tabTools->shadingLine->value();
875
        switch (tabTools->comboStyleLine->currentItem())
876
        {
877
        case 0:
878
                currDoc->toolSettings.dLstyleLine = SolidLine;
879
                break;
880
        case 1:
881
                currDoc->toolSettings.dLstyleLine = DashLine;
882
                break;
883
        case 2:
884
                currDoc->toolSettings.dLstyleLine = DotLine;
885
                break;
886
        case 3:
887
                currDoc->toolSettings.dLstyleLine = DashDotLine;
888
                break;
889
        case 4:
890
                currDoc->toolSettings.dLstyleLine = DashDotDotLine;
891
                break;
892
        }
893
        currDoc->toolSettings.dWidthLine = tabTools->lineWidthLine->value();
894
        currDoc->toolSettings.dBrushPict = tabTools->comboFillImage->currentText();
4026 craig 895
        if (currDoc->toolSettings.dBrushPict == ScMW->noneString)
2965 cbradney 896
                currDoc->toolSettings.dBrushPict = "None";
897
        currDoc->toolSettings.shadePict = tabTools->shadingFillImage->value();
898
        currDoc->toolSettings.scaleX = static_cast<double>(tabTools->scalingHorizontal->value()) / 100.0;
899
        currDoc->toolSettings.scaleY = static_cast<double>(tabTools->scalingVertical->value()) / 100.0;
900
        currDoc->toolSettings.scaleType = tabTools->buttonGroup3->isChecked();
901
        currDoc->toolSettings.aspectRatio = tabTools->checkRatioImage->isChecked();
902
        currDoc->toolSettings.useEmbeddedPath = tabTools->embeddedPath->isChecked();
903
        int haRes = 0;
904
        if (tabTools->checkFullRes->isChecked())
905
                haRes = 0;
906
        if (tabTools->checkNormalRes->isChecked())
907
                haRes = 1;
908
        if (tabTools->checkHalfRes->isChecked())
909
                haRes = 2;
910
        if (currDoc->toolSettings.lowResType != haRes)
911
        {
912
                currDoc->toolSettings.lowResType = haRes;
913
                viewToRecalcPictureRes=true;
914
        }
915
        else
916
                viewToRecalcPictureRes=false;
917
        tabTools->polyWidget->getValues(&currDoc->toolSettings.polyC, &currDoc->toolSettings.polyFd, &currDoc->toolSettings.polyF, &currDoc->toolSettings.polyS, &currDoc->toolSettings.polyR);
918
        currDoc->ScratchBottom = bottomScratch->value() / currDoc->unitRatio();
919
        currDoc->ScratchLeft = leftScratch->value() / currDoc->unitRatio();
920
        currDoc->ScratchRight = rightScratch->value() / currDoc->unitRatio();
921
        currDoc->ScratchTop = topScratch->value() / currDoc->unitRatio();
922
        currDoc->AutoSave = groupAutoSave->isChecked();
923
        currDoc->AutoSaveTime = autoSaveTime->value() * 60 * 1000;
924
        if (currDoc->AutoSave)
925
        {
926
                currDoc->autoSaveTimer->stop();
927
                currDoc->autoSaveTimer->start(currDoc->AutoSaveTime);
928
        }
4026 craig 929
        currDoc->docHyphenator->slotNewDict(ScMW->GetLang(tabHyphenator->language->currentText()));
2965 cbradney 930
        currDoc->docHyphenator->slotNewSettings(tabHyphenator->wordLen->value(),
931
                                                                                                                                !tabHyphenator->verbose->isChecked(),
932
                                                                                                                                tabHyphenator->input->isChecked(),
933
                                                                                                                                tabHyphenator->maxCount->value());
934
        if (CMSavail)
935
        {
3051 fschmid 936
                bool oldCM = currDoc->CMSSettings.CMSinUse;
2965 cbradney 937
                tabColorManagement->setValues();
938
                if (tabColorManagement->changed)
939
                {
4026 craig 940
                        ScMW->mainWindowStatusLabel->setText( tr("Adjusting Colors"));
941
                        ScMW->mainWindowProgressBar->reset();
3841 cbradney 942
                        int cc = currDoc->PageColors.count() + currDoc->Items->count();
4026 craig 943
                        ScMW->mainWindowProgressBar->setTotalSteps(cc);
2965 cbradney 944
#ifdef HAVE_CMS
945
                        currDoc->HasCMS = currDoc->CMSSettings.CMSinUse;
946
                        currDoc->SoftProofing = currDoc->CMSSettings.SoftProofOn;
947
                        currDoc->Gamut = currDoc->CMSSettings.GamutCheck;
948
                        currDoc->IntentPrinter = currDoc->CMSSettings.DefaultIntentPrinter;
949
                        currDoc->IntentMonitor = currDoc->CMSSettings.DefaultIntentMonitor;
950
                        CMSuse = currDoc->CMSSettings.CMSinUse;
951
                        SoftProofing = currDoc->CMSSettings.SoftProofOn;
952
                        Gamut = currDoc->CMSSettings.GamutCheck;
953
                        BlackPoint = currDoc->CMSSettings.BlackPoint;
954
                        IntentPrinter = currDoc->CMSSettings.DefaultIntentPrinter;
955
                        IntentMonitor = currDoc->CMSSettings.DefaultIntentMonitor;
956
                        qApp->setOverrideCursor(QCursor(waitCursor), true);
3051 fschmid 957
                        bool newCM = currDoc->CMSSettings.CMSinUse;
958
                        currDoc->CMSSettings.CMSinUse = oldCM;
2965 cbradney 959
                        currDoc->CloseCMSProfiles();
3051 fschmid 960
                        currDoc->CMSSettings.CMSinUse = newCM;
4026 craig 961
                        currDoc->OpenCMSProfiles(ScMW->InputProfiles, ScMW->MonitorProfiles, ScMW->PrinterProfiles);
2965 cbradney 962
                        stdProofG = currDoc->stdProof;
963
                        stdTransG = currDoc->stdTrans;
964
                        stdProofImgG = currDoc->stdProofImg;
965
                        stdTransImgG = currDoc->stdTransImg;
966
                        stdProofCMYKG = currDoc->stdProofCMYK;
967
                        stdTransCMYKG = currDoc->stdTransCMYK;
3046 fschmid 968
                        stdProofGCG = currDoc->stdProofGC;
969
                        stdProofCMYKGCG = currDoc->stdProofCMYKGC;
2965 cbradney 970
                        stdTransRGBG = currDoc->stdTransRGB;
971
                        CMSoutputProf = currDoc->DocOutputProf;
972
                        CMSprinterProf = currDoc->DocPrinterProf;
973
                        if (static_cast<int>(cmsGetColorSpace(currDoc->DocInputProf)) == icSigRgbData)
974
                                currDoc->CMSSettings.ComponentsInput2 = 3;
975
                        if (static_cast<int>(cmsGetColorSpace(currDoc->DocInputProf)) == icSigCmykData)
976
                                currDoc->CMSSettings.ComponentsInput2 = 4;
977
                        if (static_cast<int>(cmsGetColorSpace(currDoc->DocInputProf)) == icSigCmyData)
978
                                currDoc->CMSSettings.ComponentsInput2 = 3;
979
                        if (static_cast<int>(cmsGetColorSpace(currDoc->DocPrinterProf)) == icSigRgbData)
980
                                currDoc->CMSSettings.ComponentsPrinter = 3;
981
                        if (static_cast<int>(cmsGetColorSpace(currDoc->DocPrinterProf)) == icSigCmykData)
982
                                currDoc->CMSSettings.ComponentsPrinter = 4;
983
                        if (static_cast<int>(cmsGetColorSpace(currDoc->DocPrinterProf)) == icSigCmyData)
984
                                currDoc->CMSSettings.ComponentsPrinter = 3;
985
                        currDoc->PDF_Options.SComp = currDoc->CMSSettings.ComponentsInput2;
2984 fschmid 986
                        currDoc->PDF_Options.SolidProf = currDoc->CMSSettings.DefaultSolidColorProfile;
987
                        currDoc->PDF_Options.ImageProf = currDoc->CMSSettings.DefaultImageRGBProfile;
2965 cbradney 988
                        currDoc->PDF_Options.PrintProf = currDoc->CMSSettings.DefaultPrinterProfile;
989
                        currDoc->PDF_Options.Intent = currDoc->CMSSettings.DefaultIntentMonitor;
4026 craig 990
                        ScMW->recalcColors(ScMW->mainWindowProgressBar);
991
                        currDoc->RecalcPictures(&ScMW->InputProfiles, &ScMW->InputProfilesCMYK, ScMW->mainWindowProgressBar);
2965 cbradney 992
#endif
4026 craig 993
                        ScMW->mainWindowProgressBar->setProgress(cc);
2965 cbradney 994
                        qApp->setOverrideCursor(QCursor(arrowCursor), true);
4026 craig 995
                        ScMW->mainWindowStatusLabel->setText("");
996
                        ScMW->mainWindowProgressBar->reset();
2965 cbradney 997
                }
998
        }
999
        PrefsManager* prefsManager=PrefsManager::instance();
1000
        SCFontsIterator it(prefsManager->appPrefs.AvailFonts);
1001
        for ( ; it.current() ; ++it)
1002
        {
1003
                it.current()->EmbedPS = tabFonts->fontFlags[it.currentKey()].FlagPS;
1004
                it.current()->UseFont = tabFonts->fontFlags[it.currentKey()].FlagUse;
1005
                it.current()->Subset = tabFonts->fontFlags[it.currentKey()].FlagSub;
1006
        }
1007
        uint a = 0;
1008
        prefsManager->appPrefs.GFontSub.clear();
1009
        QMap<QString,QString>::Iterator itfsu;
1010
        QMap<QString,QString>::Iterator itfsuend=tabFonts->RList.end();
1011
        for (itfsu = tabFonts->RList.begin(); itfsu != itfsuend; ++itfsu)
1012
                prefsManager->appPrefs.GFontSub[itfsu.key()] = tabFonts->FlagsRepl.at(a++)->currentText();
1013
        QStringList uf = currDoc->UsedFonts.keys();
3544 avox 1014
        QMap<QString,int>::Iterator it3;
2965 cbradney 1015
        for (it3 = currDoc->UsedFonts.begin(); it3 != currDoc->UsedFonts.end(); ++it3)
1016
                FT_Done_Face(currDoc->FFonts[it3.key()]);
1017
        currDoc->UsedFonts.clear();
1018
        QStringList::Iterator it3a;
1019
        QStringList::Iterator it3aend=uf.end();
1020
        for (it3a = uf.begin(); it3a != it3aend; ++it3a)
3544 avox 1021
                currDoc->AddFont(*it3a);
2965 cbradney 1022
 
1023
        currDoc->PDF_Options.Thumbnails = tabPDF->CheckBox1->isChecked();
1024
        currDoc->PDF_Options.Compress = tabPDF->Compression->isChecked();
1025
        currDoc->PDF_Options.CompressMethod = tabPDF->CMethod->currentItem();
1026
        currDoc->PDF_Options.Quality = tabPDF->CQuality->currentItem();
1027
        currDoc->PDF_Options.Resolution = tabPDF->Resolution->value();
1028
        currDoc->PDF_Options.RecalcPic = tabPDF->DSColor->isChecked();
1029
        currDoc->PDF_Options.PicRes = tabPDF->ValC->value();
1030
        currDoc->PDF_Options.Bookmarks = tabPDF->CheckBM->isChecked();
1031
        currDoc->PDF_Options.Binding = tabPDF->ComboBind->currentItem();
1032
        currDoc->PDF_Options.MirrorH = tabPDF->MirrorH->isOn();
1033
        currDoc->PDF_Options.MirrorV = tabPDF->MirrorV->isOn();
1034
        currDoc->PDF_Options.RotateDeg = tabPDF->RotateDeg->currentItem() * 90;
1035
        currDoc->PDF_Options.Articles = tabPDF->Article->isChecked();
1036
        currDoc->PDF_Options.Encrypt = tabPDF->Encry->isChecked();
1037
        currDoc->PDF_Options.UseLPI = tabPDF->UseLPI->isChecked();
1038
        currDoc->PDF_Options.useLayers = tabPDF->useLayers->isChecked();
3079 fschmid 1039
        currDoc->PDF_Options.UseSpotColors = !tabPDF->useSpot->isChecked();
1040
        currDoc->PDF_Options.doMultiFile = false;
2965 cbradney 1041
        currDoc->PDF_Options.BleedBottom = tabPDF->BleedBottom->value() / currDoc->unitRatio();
1042
        currDoc->PDF_Options.BleedTop = tabPDF->BleedTop->value() / currDoc->unitRatio();
1043
        currDoc->PDF_Options.BleedLeft = tabPDF->BleedLeft->value() / currDoc->unitRatio();
1044
        currDoc->PDF_Options.BleedRight = tabPDF->BleedRight->value() / currDoc->unitRatio();
4197 fschmid 1045
        currDoc->PDF_Options.displayBookmarks = tabPDF->useBookmarks->isChecked();
1046
        currDoc->PDF_Options.displayFullscreen = tabPDF->useFullScreen->isChecked();
1047
        currDoc->PDF_Options.displayLayers = tabPDF->useLayers2->isChecked();
1048
        currDoc->PDF_Options.displayThumbs = tabPDF->useThumbnails->isChecked();
1049
        int pgl = PDFOptions::SinglePage;
1050
        if (tabPDF->singlePage->isChecked())
1051
                pgl = PDFOptions::SinglePage;
1052
        else if (tabPDF->continuousPages->isChecked())
1053
                pgl = PDFOptions::OneColumn;
1054
        else if (tabPDF->doublePageLeft->isChecked())
1055
                pgl = PDFOptions::TwoColumnLeft;
1056
        else if (tabPDF->doublePageRight->isChecked())
1057
                pgl = PDFOptions::TwoColumnRight;
1058
        currDoc->PDF_Options.PageLayout = pgl;
1059
        currDoc->PDF_Options.openAction = "";
2965 cbradney 1060
        if (tabPDF->Encry->isChecked())
1061
        {
1062
                int Perm = -64;
1063
                if (tabPDF->PDFVersionCombo->currentItem() == 1)
1064
                        Perm &= ~0x00240000;
1065
                if (tabPDF->PrintSec->isChecked())
1066
                        Perm += 4;
1067
                if (tabPDF->ModifySec->isChecked())
1068
                        Perm += 8;
1069
                if (tabPDF->CopySec->isChecked())
1070
                        Perm += 16;
1071
                if (tabPDF->AddSec->isChecked())
1072
                        Perm += 32;
1073
                currDoc->PDF_Options.Permissions = Perm;
1074
                currDoc->PDF_Options.PassOwner = tabPDF->PassOwner->text();
1075
                currDoc->PDF_Options.PassUser = tabPDF->PassUser->text();
1076
        }
1077
        if (tabPDF->PDFVersionCombo->currentItem() == 0)
1078
                currDoc->PDF_Options.Version = PDFOptions::PDFVersion_13;
1079
        if (tabPDF->PDFVersionCombo->currentItem() == 1)
1080
                currDoc->PDF_Options.Version = PDFOptions::PDFVersion_14;
1081
        if (tabPDF->PDFVersionCombo->currentItem() == 2)
1082
                currDoc->PDF_Options.Version = PDFOptions::PDFVersion_15;
1083
        if (tabPDF->PDFVersionCombo->currentItem() == 3)
1084
                currDoc->PDF_Options.Version = PDFOptions::PDFVersion_X3;
1085
        if (tabPDF->OutCombo->currentItem() == 0)
1086
        {
1087
                currDoc->PDF_Options.isGrayscale = false;
1088
                currDoc->PDF_Options.UseRGB = true;
1089
                currDoc->PDF_Options.UseProfiles = false;
1090
                currDoc->PDF_Options.UseProfiles2 = false;
1091
        }
1092
        else
1093
        {
1094
                if (tabPDF->OutCombo->currentItem() == 3)
1095
                {
1096
                        currDoc->PDF_Options.isGrayscale = true;
1097
                        currDoc->PDF_Options.UseRGB = false;
1098
                        currDoc->PDF_Options.UseProfiles = false;
1099
                        currDoc->PDF_Options.UseProfiles2 = false;
1100
                }
1101
                else
1102
                {
1103
                        currDoc->PDF_Options.isGrayscale = false;
1104
                        currDoc->PDF_Options.UseRGB = false;
1105
#ifdef HAVE_CMS
1106
                        if (CMSuse)
1107
                        {
1108
                                currDoc->PDF_Options.UseProfiles = tabPDF->EmbedProfs->isChecked();
1109
                                currDoc->PDF_Options.UseProfiles2 = tabPDF->EmbedProfs2->isChecked();
1110
                                currDoc->PDF_Options.Intent = tabPDF->IntendS->currentItem();
1111
                                currDoc->PDF_Options.Intent2 = tabPDF->IntendI->currentItem();
1112
                                currDoc->PDF_Options.EmbeddedI = tabPDF->NoEmbedded->isChecked();
1113
                                currDoc->PDF_Options.SolidProf = tabPDF->SolidPr->currentText();
1114
                                currDoc->PDF_Options.ImageProf = tabPDF->ImageP->currentText();
1115
                                currDoc->PDF_Options.PrintProf = tabPDF->PrintProfC->currentText();
1116
                        }
1117
#endif
1118
                }
1119
        }
1120
 
1121
        currDoc->documentInfo = docInfos->getDocInfo();
1122
        currDoc->docItemAttributes = *(tabDocItemAttributes->getNewAttributes());
1123
        currDoc->docToCSetups = *(tabTOCIndexPrefs->getNewToCs());
3757 cbradney 1124
        currDoc->sections = tabDocSections->getNewSections();
2965 cbradney 1125
 
3727 cbradney 1126
        uint itemCount=currDoc->Items->count();
2965 cbradney 1127
        for (uint b=0; b<itemCount; ++b)
1128
        {
3727 cbradney 1129
                if (currDoc->Items->at(b)->itemType() == PageItem::ImageFrame)
1130
                        currDoc->Items->at(b)->PicArt = currDoc->guidesSettings.showPic;
2965 cbradney 1131
        }
1132
}