Subversion Repositories Scribus

Rev

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

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