Subversion Repositories Scribus

Rev

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