Subversion Repositories Scribus

Rev

Rev 1261 | Rev 1321 | 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"
249 Franz 3
#include <qtooltip.h>
838 cbradney 4
#include <qspinbox.h>
705 fschmid 5
#include <qcolordialog.h>
788 fschmid 6
#include "tabtypography.h"
879 fschmid 7
#include "tabguides.h"
1194 fschmid 8
#include "tabtools.h"
1235 fschmid 9
#include "tabcheckdoc.h"
795 fschmid 10
#include "hysettings.h"
11
#include "cmsprefs.h"
806 cbradney 12
#include "units.h"
838 cbradney 13
#include "mspinbox.h"
14
#include "scribus.h"
1307 fschmid 15
#include "tabpdfoptions.h"
788 fschmid 16
 
3 paul 17
extern QPixmap loadIcon(QString nam);
80 Franz 18
extern double UmReFaktor;
795 fschmid 19
extern bool CMSavail;
20
extern ProfilesL InputProfiles;
3 paul 21
 
1194 fschmid 22
ReformDoc::ReformDoc( QWidget* parent, ScribusDoc* doc ) : PrefsDialogBase( parent )
3 paul 23
{
1065 cbradney 24
        einheit = doc->docUnitIndex;
734 fschmid 25
        docc = doc;
795 fschmid 26
        ap = (ScribusApp*)parent;
734 fschmid 27
        Umrech = UmReFaktor;
1065 cbradney 28
        QString ein = unitGetSuffixFromIndex(doc->docUnitIndex);
29
        decimals = unitGetDecimalsFromIndex(doc->docUnitIndex);
519 cbradney 30
        int i=-1;
726 fschmid 31
        pageWidth = doc->PageB * UmReFaktor;
32
        pageHeight = doc->PageH * UmReFaktor;
249 Franz 33
        setCaption( tr( "Document Setup" ) );
693 fschmid 34
        tabPage = new QWidget( prefsWidgets, "tab" );
788 fschmid 35
        reformDocLayout = new QVBoxLayout( tabPage );
36
        reformDocLayout->setSpacing( 6 );
37
        reformDocLayout->setMargin( 10 );
693 fschmid 38
        dsGroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
519 cbradney 39
        dsGroupBox7->setTitle( tr( "Page Size" ) );
40
        dsGroupBox7->setColumnLayout(0, Qt::Vertical );
41
        dsGroupBox7->layout()->setSpacing( 0 );
42
        dsGroupBox7->layout()->setMargin( 0 );
43
        dsGroupBox7Layout = new QHBoxLayout( dsGroupBox7->layout() );
44
        dsGroupBox7Layout->setAlignment( Qt::AlignTop );
45
        dsGroupBox7Layout->setSpacing( 0 );
46
        dsGroupBox7Layout->setMargin( 10 );
47
        dsLayout4 = new QGridLayout;
48
        dsLayout4->setSpacing( 6 );
49
        dsLayout4->setMargin( 0 );
693 fschmid 50
        sizeQComboBox = new QComboBox( true, dsGroupBox7, "sizeQComboBox" );
51
        sizeQLabel = new QLabel( sizeQComboBox, tr( "&Size:" ), dsGroupBox7, "sizeQLabel" );
52
        QString sizelist[] = {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4",
53
                              "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive", "Folio",
54
                              "Ledger", tr("Legal"), tr("Letter"), tr("Tabloid"), tr("Custom")};
55
        size_t const num_mappings = (sizeof sizelist)/(sizeof *sizelist);
56
        for (uint m = 0; m < num_mappings; ++m)
57
        {
58
                sizeQComboBox->insertItem(sizelist[m]);
59
                if (sizelist[m]==doc->PageSize)
519 cbradney 60
                        i=m;
61
        }
62
        //set Custom if we dont have one already as old docs wont have this attribute
63
        if (i==-1)
64
                i=num_mappings-1;
693 fschmid 65
        sizeQComboBox->setEnabled(false);
66
        sizeQComboBox->setCurrentItem(i);
67
        dsLayout4->addWidget( sizeQLabel, 0, 0 );
68
        dsLayout4->addWidget( sizeQComboBox, 0, 1 );
69
        orientationQComboBox = new QComboBox( true, dsGroupBox7, "orientationQComboBox" );
70
        orientationQLabel = new QLabel( orientationQComboBox, tr( "Orie&ntation:" ), dsGroupBox7, "orientationQLabel" );
71
        orientationQComboBox->insertItem( tr( "Portrait" ) );
72
        orientationQComboBox->insertItem( tr( "Landscape" ) );
73
        orientationQComboBox->setEnabled(false);
74
        orientationQComboBox->setCurrentItem(doc->PageOri);
75
        dsLayout4->addWidget( orientationQLabel, 0, 2 );
519 cbradney 76
        dsLayout4->addWidget( orientationQComboBox, 0, 3 );
693 fschmid 77
        widthMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
78
        widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7, "widthLabel" );
79
        widthMSpinBox->setEnabled( false );
80
        widthMSpinBox->setSuffix(ein);
726 fschmid 81
        widthMSpinBox->setValue(pageWidth);
693 fschmid 82
        widthQLabel->setBuddy(widthMSpinBox);
83
        dsLayout4->addWidget( widthQLabel, 1, 0 );
84
        dsLayout4->addWidget( widthMSpinBox, 1, 1 );
85
        heightMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
86
        heightMSpinBox->setEnabled( false );
87
        heightMSpinBox->setSuffix(ein);
726 fschmid 88
        heightMSpinBox->setValue(pageHeight);
800 fschmid 89
        heightQLabel = new QLabel(heightMSpinBox,  tr( "&Height:" ), dsGroupBox7, "heightLabel" );
693 fschmid 90
        dsLayout4->addWidget( heightQLabel, 1, 2 );
91
        dsLayout4->addWidget( heightMSpinBox, 1, 3 );
800 fschmid 92
        unitCombo = new QComboBox( true, dsGroupBox7, "unitCombo" );
93
        unitCombo->insertItem( tr( "Points (pt)" ) );
94
        unitCombo->insertItem( tr( "Millimetres (mm)" ) );
95
        unitCombo->insertItem( tr( "Inches (in)" ) );
96
        unitCombo->insertItem( tr( "Picas (p)" ) );
97
        unitCombo->setEditable(false);
1065 cbradney 98
        unitCombo->setCurrentItem(doc->docUnitIndex);
800 fschmid 99
        unitQLabel = new QLabel(unitCombo, tr( "&Unit:" ), dsGroupBox7, "unitQLabel" );
100
        dsLayout4->addWidget( unitQLabel, 2, 0 );
101
        dsLayout4->addWidget( unitCombo, 2, 1 );
519 cbradney 102
        dsGroupBox7Layout->addLayout( dsLayout4 );
788 fschmid 103
        reformDocLayout->addWidget( dsGroupBox7 );
104
        groupBox7 = new QGroupBox( tabPage, "GroupBox7" );
105
        groupBox7->setTitle( tr( "Margin Guides" ) );
106
        groupBox7->setColumnLayout(0, Qt::Vertical );
107
        groupBox7->layout()->setSpacing( 0 );
108
        groupBox7->layout()->setMargin( 0 );
109
        groupBox7Layout = new QHBoxLayout( groupBox7->layout() );
110
        groupBox7Layout->setAlignment( Qt::AlignTop );
111
        groupBox7Layout->setSpacing( 0 );
112
        groupBox7Layout->setMargin( 10 );
113
        layout4 = new QGridLayout;
114
        layout4->setSpacing( 6 );
115
        layout4->setMargin( 0 );
116
        topR = new MSpinBox( groupBox7, 4 );
726 fschmid 117
        topR->setSuffix( ein );
118
        topR->setDecimals( decimals );
119
        topR->setMaxValue(pageHeight);
120
        topR->setValue(doc->PageM.Top * UmReFaktor);
788 fschmid 121
        layout4->addWidget( topR, 0, 1 );
122
        TextLabel5 = new QLabel( tr( "&Top:" ), groupBox7, "TextLabel5" );
726 fschmid 123
        TextLabel5->setBuddy(topR);
788 fschmid 124
        layout4->addWidget( TextLabel5, 0, 0 );
125
        leftR = new MSpinBox( groupBox7, 4 );
726 fschmid 126
        leftR->setSuffix( ein );
127
        leftR->setDecimals( decimals );
128
        leftR->setMaxValue(pageWidth);
129
        leftR->setValue(doc->PageM.Left * UmReFaktor);
788 fschmid 130
        layout4->addWidget( leftR, 0, 3 );
131
        Links = new QLabel( tr( "&Left:" ), groupBox7, "Links" );
726 fschmid 132
        Links->setBuddy(leftR);
788 fschmid 133
        layout4->addWidget( Links, 0, 2 );
134
        bottomR = new MSpinBox( groupBox7, 4 );
726 fschmid 135
        bottomR->setSuffix( ein );
136
        bottomR->setDecimals( decimals );
137
        bottomR->setMaxValue(pageHeight);
138
        bottomR->setValue(doc->PageM.Bottom * UmReFaktor);
788 fschmid 139
        layout4->addWidget( bottomR, 1, 1 );
140
        TextLabel7 = new QLabel( tr( "&Bottom:" ), groupBox7, "TextLabel7" );
726 fschmid 141
        TextLabel7->setBuddy(bottomR);
788 fschmid 142
        layout4->addWidget( TextLabel7, 1, 0 );
143
        rightR = new MSpinBox( groupBox7, 4 );
726 fschmid 144
        rightR->setSuffix( ein );
145
        rightR->setDecimals( decimals );
146
        rightR->setMaxValue(pageWidth);
147
        rightR->setValue(doc->PageM.Right * UmReFaktor);
788 fschmid 148
        layout4->addWidget( rightR, 1, 3 );
149
        Rechts = new QLabel( tr( "&Right:" ), groupBox7, "Rechts" );
726 fschmid 150
        Rechts->setBuddy(rightR);
788 fschmid 151
        layout4->addWidget( Rechts, 1, 2 );
152
        groupBox7Layout->addLayout( layout4 );
153
        reformDocLayout->addWidget( groupBox7 );
154
        groupBox7a = new QGroupBox( tabPage, "groupBox7" );
155
        groupBox7a->setTitle( tr( "Layout" ) );
156
        groupBox7a->setColumnLayout(0, Qt::Vertical );
157
        groupBox7a->layout()->setSpacing( 0 );
158
        groupBox7a->layout()->setMargin( 0 );
159
        groupBox7aLayout = new QHBoxLayout( groupBox7a->layout() );
160
        groupBox7aLayout->setAlignment( Qt::AlignTop );
161
        groupBox7aLayout->setSpacing( 0 );
162
        groupBox7aLayout->setMargin( 10 );
163
        layout4a = new QGridLayout;
164
        layout4a->setSpacing( 6 );
165
        layout4a->setMargin( 0 );
166
        facingPages = new QCheckBox( tr( "&Facing Pages" ),groupBox7a, "facingPages" );
726 fschmid 167
        facingPages->setChecked( doc->PageFP );
788 fschmid 168
        layout4a->addMultiCellWidget( facingPages, 2, 2, 0, 1 );
169
        firstPage = new QCheckBox( tr( "Left &Page First" ), groupBox7a, "n" );
726 fschmid 170
        firstPage->setChecked( doc->FirstPageLeft );
788 fschmid 171
        layout4a->addMultiCellWidget( firstPage, 2, 2, 2, 3 );
693 fschmid 172
        if (!doc->PageFP)
726 fschmid 173
                firstPage->setEnabled(false);
249 Franz 174
        setDS();
788 fschmid 175
        TextLabel1_3 = new QLabel( tr( "F&irst Page Number:" ), groupBox7a, "TextLabel1_3" );
176
        layout4a->addMultiCellWidget( TextLabel1_3, 3, 3, 0, 1 );
177
        pageNumber = new QSpinBox( groupBox7a, "pageNumber" );
726 fschmid 178
        pageNumber->setMaxValue( 10000 );
179
        pageNumber->setMinValue( 1 );
180
        pageNumber->setValue(doc->FirstPnum);
788 fschmid 181
        layout4a->addWidget( pageNumber, 3, 2, Qt::AlignRight );
726 fschmid 182
        TextLabel1_3->setBuddy(pageNumber);
788 fschmid 183
        groupBox7aLayout->addLayout( layout4a );
184
        reformDocLayout->addWidget( groupBox7a );
800 fschmid 185
        groupAutoSave = new QGroupBox( tabPage, "groupAutoSave" );
186
        groupAutoSave->setTitle( tr( "Autosave" ) );
187
        groupAutoSave->setCheckable( true );
188
        groupAutoSave->setChecked( doc->AutoSave );
189
        groupAutoSave->setColumnLayout(0, Qt::Vertical );
190
        groupAutoSave->layout()->setSpacing( 6 );
191
        groupAutoSave->layout()->setMargin( 11 );
192
        groupAutoSaveLayout = new QHBoxLayout( groupAutoSave->layout() );
193
        groupAutoSaveLayout->setAlignment( Qt::AlignTop );
194
        autoSaveTime = new QSpinBox( groupAutoSave, "autoSaveTime" );
195
        autoSaveTime->setMinValue( 1 );
196
        autoSaveTime->setMaxValue( 60 );
197
        autoSaveTime->setSuffix( " " + tr("min") );
198
        autoSaveTime->setValue(doc->AutoSaveTime / 1000 / 60);
199
        groupAutoSaveLayout->addWidget( autoSaveTime );
200
        textLabel1m = new QLabel(autoSaveTime, tr( "&Interval:" ), groupAutoSave, "textLabel1m" );
201
        groupAutoSaveLayout->addWidget( textLabel1m );
202
        reformDocLayout->addWidget( groupAutoSave );
203
        addItem( tr("Document"), loadIcon("page.png"), tabPage);
693 fschmid 204
 
1195 fschmid 205
        tabGuides = new TabGuides(prefsWidgets, &doc->guidesSettings, &doc->typographicSetttings, UmReFaktor, ein);
715 fschmid 206
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
693 fschmid 207
 
705 fschmid 208
        tabView = new QWidget( prefsWidgets, "tabView" );
209
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
210
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
1195 fschmid 211
        pageBackground->setTitle( tr( "Page Display" ) );
705 fschmid 212
        pageBackground->setColumnLayout(0, Qt::Vertical );
213
        pageBackground->layout()->setSpacing( 5 );
214
        pageBackground->layout()->setMargin( 10 );
215
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
216
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
217
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
218
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
219
        textLabel9->setText( tr( "Color:" ) );
220
        layout10->addWidget( textLabel9 );
221
        backColor = new QPushButton( pageBackground, "backColor" );
222
        backColor->setMinimumSize( QSize( 60, 20 ) );
223
        backColor->setMaximumSize( QSize( 60, 20 ) );
224
        backColor->setFlat( false );
225
        backColor->setAutoDefault( false );
226
        QPixmap pm5 = QPixmap(54, 14);
227
        pm5.fill(doc->papColor);
228
        colorPaper = doc->papColor;
229
        backColor->setPixmap(pm5);
230
        backColor->setText( QString::null );
231
        layout10->addWidget( backColor );
1195 fschmid 232
        QSpacerItem* spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
705 fschmid 233
        layout10->addItem( spacer3 );
234
        pageBackgroundLayout->addLayout( layout10 );
235
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
236
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
237
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
1065 cbradney 238
        checkUnprintable->setChecked( doc->marginColored );
705 fschmid 239
        pageBackgroundLayout->addWidget( checkUnprintable );
1195 fschmid 240
        checkPictures = new QCheckBox( pageBackground, "checkPictures" );
241
        checkPictures->setText( tr( "Show Pictures" ) );
242
        checkPictures->setChecked(doc->guidesSettings.showPic);
243
        pageBackgroundLayout->addWidget( checkPictures );
244
        checkLink = new QCheckBox( pageBackground, "checkLink" );
245
        checkLink->setText( tr( "Show Text Chains" ) );
246
        checkLink->setChecked(doc->guidesSettings.linkShown);
247
        pageBackgroundLayout->addWidget( checkLink );
248
        checkFrame = new QCheckBox( pageBackground, "checkFrame" );
249
        checkFrame->setText( tr( "Show Frames" ) );
250
        checkFrame->setChecked(doc->guidesSettings.framesShown);
251
        pageBackgroundLayout->addWidget( checkFrame );
705 fschmid 252
        tabViewLayout->addWidget( pageBackground );
734 fschmid 253
 
254
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
255
        groupScratch->setTitle( tr( "Scratch Space" ) );
256
        groupScratch->setColumnLayout(0, Qt::Vertical );
257
        groupScratch->layout()->setSpacing( 0 );
258
        groupScratch->layout()->setMargin( 0 );
259
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
260
        groupScratchLayout->setAlignment( Qt::AlignTop );
261
        groupScratchLayout->setSpacing( 0 );
262
        groupScratchLayout->setMargin( 10 );
788 fschmid 263
        layout4s = new QGridLayout;
264
        layout4s->setSpacing( 6 );
265
        layout4s->setMargin( 0 );
734 fschmid 266
        topScratch = new MSpinBox( groupScratch, 4 );
267
        topScratch->setSuffix( ein );
268
        topScratch->setDecimals( decimals );
269
        topScratch->setMaxValue(1000);
270
        topScratch->setValue(doc->ScratchTop * UmReFaktor);
788 fschmid 271
        layout4s->addWidget( topScratch, 0, 1 );
734 fschmid 272
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
788 fschmid 273
        layout4s->addWidget( TextLabel5s, 0, 0 );
734 fschmid 274
        leftScratch = new MSpinBox( groupScratch, 4 );
275
        leftScratch->setSuffix( ein );
276
        leftScratch->setDecimals( decimals );
277
        leftScratch->setMaxValue(1000);
278
        leftScratch->setValue(doc->ScratchLeft * UmReFaktor);
788 fschmid 279
        layout4s->addWidget( leftScratch, 0, 3 );
734 fschmid 280
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
788 fschmid 281
        layout4s->addWidget( Linkss, 0, 2 );
734 fschmid 282
        bottomScratch = new MSpinBox( groupScratch, 4 );
283
        bottomScratch->setSuffix( ein );
284
        bottomScratch->setDecimals( decimals );
285
        bottomScratch->setMaxValue(1000);
286
        bottomScratch->setValue(doc->ScratchBottom * UmReFaktor);
788 fschmid 287
        layout4s->addWidget( bottomScratch, 1, 1 );
734 fschmid 288
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
788 fschmid 289
        layout4s->addWidget( TextLabel7s, 1, 0 );
734 fschmid 290
        rightScratch = new MSpinBox( groupScratch, 4 );
291
        rightScratch->setSuffix( ein );
292
        rightScratch->setDecimals( decimals );
293
        rightScratch->setMaxValue(1000);
294
        rightScratch->setValue(doc->ScratchRight * UmReFaktor);
788 fschmid 295
        layout4s->addWidget( rightScratch, 1, 3 );
734 fschmid 296
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
788 fschmid 297
        layout4s->addWidget( Rechtss, 1, 2 );
298
        groupScratchLayout->addLayout( layout4s );
734 fschmid 299
        tabViewLayout->addWidget( groupScratch );
1195 fschmid 300
 
301
 
715 fschmid 302
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
303
 
1195 fschmid 304
        tabTypo = new TabTypograpy(  prefsWidgets, &doc->typographicSetttings);
715 fschmid 305
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
306
 
1194 fschmid 307
        tabTools = new TabTools(  prefsWidgets, &doc->toolSettings, UmReFaktor, ein, doc);
726 fschmid 308
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
309
 
795 fschmid 310
        tabHyphenator = new HySettings(prefsWidgets, &ap->LangTransl);
1065 cbradney 311
        tabHyphenator->verbose->setChecked(!doc->docHyphenator->Automatic);
312
        tabHyphenator->input->setChecked(doc->docHyphenator->AutoCheck);
313
        tabHyphenator->language->setCurrentText(ap->LangTransl[doc->docHyphenator->Language]);
314
        tabHyphenator->wordLen->setValue(doc->docHyphenator->MinWordLen);
315
        tabHyphenator->maxCount->setValue(doc->docHyphenator->HyCount);
795 fschmid 316
        addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator);
1235 fschmid 317
 
1261 fschmid 318
        tabDocChecker = new TabCheckDoc(  prefsWidgets, doc->checkerProfiles, doc->curCheckProfile);
1235 fschmid 319
        addItem( tr("Doc-Checker"), loadIcon("checkdoc.png"), tabDocChecker);
1307 fschmid 320
 
321
        tabPDF = new TabPDFOptions( prefsWidgets,
322
                                                                                                                                &doc->PDF_Optionen,
323
                                                                                                                                ap->Prefs.AvailFonts,
324
                                                                                                                                &ap->PDFXProfiles,
325
                                                                                                                                doc->UsedFonts,
326
                                                                                                                                doc->PDF_Optionen.PresentVals,
327
                                                                                                                                UmReFaktor,
328
                                                                                                                                ein,
329
                                                                                                                                doc->PageH,
330
                                                                                                                                doc->PageB,
331
 
332
        addItem( tr("PDF Export"), loadIcon("acroread.png"), tabPDF);
1235 fschmid 333
 
800 fschmid 334
        int cmsTab = 0;
795 fschmid 335
        if (CMSavail)
336
        {
337
                tabColorManagement = new CMSPrefs(prefsWidgets, &doc->CMSSettings, &InputProfiles, &ap->PrinterProfiles, &ap->MonitorProfiles);
800 fschmid 338
                cmsTab = addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
795 fschmid 339
        }
340
 
726 fschmid 341
        rightR->setMaxValue(pageWidth - leftR->value());
342
        leftR->setMaxValue(pageWidth - rightR->value());
343
        topR->setMaxValue(pageHeight - bottomR->value());
344
        bottomR->setMaxValue(pageHeight - topR->value());
249 Franz 345
        //tooltips
1195 fschmid 346
        QToolTip::add( checkLink, tr("Turns the of linked frames on or off"));
347
        QToolTip::add( checkFrame, tr("Turns the display of frames on or off"));
348
        QToolTip::add( checkPictures, tr("Turns the display of pictures on or off"));
776 fschmid 349
        QToolTip::add( backColor, tr( "Color for paper" ) );
350
        QToolTip::add( checkUnprintable, tr( "Mask the area outside the margins in the margin color" ) );
726 fschmid 351
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
352
        QToolTip::add( firstPage, tr( "Make the first page the left page of the document" ) );
353
        QToolTip::add( topR, tr( "Distance between the top margin guide and the edge of the page" ) );
354
        QToolTip::add( bottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
355
        QToolTip::add( leftR, tr( "Distance between the left margin guide and the edge of the page.\nIf Facing Pages is selected, this margin space can be used to achieve the correct margins for binding" ) );
356
        QToolTip::add( rightR, tr( "Distance between the right margin guide and the edge of the page.\nIf Facing Pages is selected, this margin space can be used to achieve the correct margins for binding" ) );
3 paul 357
 
249 Franz 358
        // signals and slots connections
726 fschmid 359
        connect( facingPages, SIGNAL( clicked() ), this, SLOT( setDS() ) );
360
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
361
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
362
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
363
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
705 fschmid 364
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
734 fschmid 365
        connect(unitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
731 fschmid 366
 
800 fschmid 367
        if (CMSavail)
1307 fschmid 368
        {
800 fschmid 369
                prefsWidgets->raiseWidget(cmsTab);
1307 fschmid 370
                connect(tabColorManagement, SIGNAL(cmsOn(bool )), this, SLOT(switchCMS(bool )));
371
        }
800 fschmid 372
        arrangeIcons();
693 fschmid 373
        resize( minimumSizeHint() );
374
        clearWState( WState_Polished );
800 fschmid 375
        prefsWidgets->raiseWidget(0);
3 paul 376
}
377
 
734 fschmid 378
void ReformDoc::unitChange()
379
{
380
        disconnect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
381
        disconnect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
382
        disconnect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
383
        disconnect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
384
        int decimalsOld;
385
        double AltUmrech = Umrech;
386
        double oldMin, oldMax, val;
387
        QString einh;
388
        einheit = unitCombo->currentItem();
389
        switch (unitCombo->currentItem())
390
        {
391
        case 0:
392
                Umrech = 1.0;
393
                decimals = 100;
394
                einh = tr( " pt" );
395
                break;
396
        case 1:
397
                Umrech = 0.3527777;
398
                decimals = 1000;
399
                einh = tr( " mm" );
400
                break;
401
        case 2:
402
                Umrech = 1.0 / 72.0;
403
                decimals = 10000;
404
                einh = tr( " in" );
405
                break;
406
        case 3:
407
                Umrech = 1.0 / 12.0;
408
                decimals = 100;
409
                einh = tr( " p" );
410
                break;
411
        }
781 cbradney 412
 
782 fschmid 413
        widthMSpinBox->setSuffix(einh);
414
        heightMSpinBox->setSuffix(einh);
415
        topR->setSuffix(einh);
416
        bottomR->setSuffix(einh);
417
        leftR->setSuffix(einh);
418
        rightR->setSuffix(einh);
879 fschmid 419
        tabGuides->minorSpace->setSuffix(einh);
420
        tabGuides->majorSpace->setSuffix(einh);
421
        tabGuides->snapDistance->setSuffix(einh);
1195 fschmid 422
        tabGuides->baseGrid->setSuffix(einh);
423
        tabGuides->baseOffset->setSuffix(einh);
1194 fschmid 424
        tabTools->gapText->setSuffix(einh);
782 fschmid 425
        topScratch->setSuffix(einh);
426
        bottomScratch->setSuffix(einh);
427
        leftScratch->setSuffix(einh);
428
        rightScratch->setSuffix(einh);
1307 fschmid 429
        tabPDF->BleedBottom->setSuffix(einh);
430
        tabPDF->BleedTop->setSuffix(einh);
431
        tabPDF->BleedRight->setSuffix(einh);
432
        tabPDF->BleedLeft->setSuffix(einh);
781 cbradney 433
 
782 fschmid 434
        double invUnitConversion = 1.0 / AltUmrech * Umrech;
781 cbradney 435
 
734 fschmid 436
        widthMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 437
        widthMSpinBox->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, docc->PageB * Umrech);
734 fschmid 438
        heightMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 439
        heightMSpinBox->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, docc->PageH * Umrech);
734 fschmid 440
        topR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 441
        topR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 442
        bottomR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 443
        bottomR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 444
        leftR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 445
        leftR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 446
        rightR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 447
        rightR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
879 fschmid 448
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
449
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
450
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
451
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
452
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
453
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1195 fschmid 454
        tabGuides->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
455
        tabGuides->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
456
        tabGuides->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
457
        tabGuides->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1194 fschmid 458
        tabTools->gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
459
        tabTools->gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 460
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 461
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 462
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 463
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 464
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 465
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 466
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 467
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1307 fschmid 468
        tabPDF->BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
469
        tabPDF->BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
470
        tabPDF->BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
471
        tabPDF->BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
472
        tabPDF->BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
473
        tabPDF->BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
474
        tabPDF->BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
475
        tabPDF->BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
476
        tabPDF->unitConv = Umrech;
734 fschmid 477
        pageWidth = docc->PageB * Umrech;
478
        pageHeight = docc->PageH * Umrech;
479
        rightR->setMaxValue(pageWidth - leftR->value());
480
        leftR->setMaxValue(pageWidth - rightR->value());
481
        topR->setMaxValue(pageHeight - bottomR->value());
482
        bottomR->setMaxValue(pageHeight - topR->value());
483
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
484
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
485
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
486
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
487
}
488
 
705 fschmid 489
void ReformDoc::changePaperColor()
490
{
491
        QColor neu = QColor();
492
        neu = QColorDialog::getColor(colorPaper, this);
493
        if (neu.isValid())
494
        {
495
                QPixmap pm = QPixmap(54, 14);
496
                pm.fill(neu);
497
                colorPaper = neu;
498
                backColor->setPixmap(pm);
499
        }
500
}
501
 
693 fschmid 502
void ReformDoc::setTop(int )
36 Franz 503
{
726 fschmid 504
        bottomR->setMaxValue(pageHeight - topR->value());
36 Franz 505
}
3 paul 506
 
693 fschmid 507
void ReformDoc::setBottom(int )
36 Franz 508
{
726 fschmid 509
        topR->setMaxValue(pageHeight - bottomR->value());
36 Franz 510
}
511
 
693 fschmid 512
void ReformDoc::setLeft(int )
36 Franz 513
{
726 fschmid 514
        rightR->setMaxValue(pageWidth - leftR->value());
36 Franz 515
}
516
 
693 fschmid 517
void ReformDoc::setRight(int )
36 Franz 518
{
726 fschmid 519
        leftR->setMaxValue(pageWidth - rightR->value());
36 Franz 520
}
521
 
3 paul 522
void ReformDoc::setDS()
523
{
726 fschmid 524
        if (facingPages->isChecked())
249 Franz 525
        {
340 Franz 526
                Links->setText( tr( "&Inside:" ) );
527
                Rechts->setText( tr( "&Outside:" ) );
726 fschmid 528
                firstPage->setEnabled(true);
249 Franz 529
        }
530
        else
531
        {
340 Franz 532
                Links->setText( tr( "&Left:" ) );
533
                Rechts->setText( tr( "&Right:" ) );
726 fschmid 534
                firstPage->setEnabled(false);
249 Franz 535
        }
348 Franz 536
}
1307 fschmid 537
 
538
void ReformDoc::switchCMS(bool enable)
539
{
540
        tabPDF->enableCMS(enable);
541
}