Subversion Repositories Scribus

Rev

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