Subversion Repositories Scribus

Rev

Rev 693 | Rev 715 | 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>
705 fschmid 4
#include <qcolordialog.h>
693 fschmid 5
#include "scribusdoc.h"
3 paul 6
extern QPixmap loadIcon(QString nam);
80 Franz 7
extern double UmReFaktor;
3 paul 8
 
693 fschmid 9
ReformDoc::ReformDoc( QWidget* parent, ScribusDoc* doc ) : PrefsDialogBase( parent )
3 paul 10
{
693 fschmid 11
        einheit = doc->Einheit;
274 Franz 12
        QString units[] = { tr(" pt"), tr(" mm"), tr(" in"), tr(" p")};
693 fschmid 13
        QString ein = units[doc->Einheit];
274 Franz 14
        int dp[] = {100, 1000, 10000, 100};
693 fschmid 15
        int decimals = dp[doc->Einheit];
519 cbradney 16
        int i=-1;
693 fschmid 17
        Breite = doc->PageB * UmReFaktor;
18
        Hoehe = doc->PageH * UmReFaktor;
249 Franz 19
        setCaption( tr( "Document Setup" ) );
693 fschmid 20
        prefsSelection->insertItem( tr("Page"));
21
        tabPage = new QWidget( prefsWidgets, "tab" );
22
        ReformDocLayout = new QVBoxLayout( tabPage );
249 Franz 23
        ReformDocLayout->setSpacing( 6 );
24
        ReformDocLayout->setMargin( 10 );
693 fschmid 25
        dsGroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
519 cbradney 26
        dsGroupBox7->setTitle( tr( "Page Size" ) );
27
        dsGroupBox7->setColumnLayout(0, Qt::Vertical );
28
        dsGroupBox7->layout()->setSpacing( 0 );
29
        dsGroupBox7->layout()->setMargin( 0 );
30
        dsGroupBox7Layout = new QHBoxLayout( dsGroupBox7->layout() );
31
        dsGroupBox7Layout->setAlignment( Qt::AlignTop );
32
        dsGroupBox7Layout->setSpacing( 0 );
33
        dsGroupBox7Layout->setMargin( 10 );
34
        dsLayout4 = new QGridLayout;
35
        dsLayout4->setSpacing( 6 );
36
        dsLayout4->setMargin( 0 );
693 fschmid 37
        sizeQComboBox = new QComboBox( true, dsGroupBox7, "sizeQComboBox" );
38
        sizeQLabel = new QLabel( sizeQComboBox, tr( "&Size:" ), dsGroupBox7, "sizeQLabel" );
39
        QString sizelist[] = {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4",
40
                              "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive", "Folio",
41
                              "Ledger", tr("Legal"), tr("Letter"), tr("Tabloid"), tr("Custom")};
42
        size_t const num_mappings = (sizeof sizelist)/(sizeof *sizelist);
43
        for (uint m = 0; m < num_mappings; ++m)
44
        {
45
                sizeQComboBox->insertItem(sizelist[m]);
46
                if (sizelist[m]==doc->PageSize)
519 cbradney 47
                        i=m;
48
        }
49
        //set Custom if we dont have one already as old docs wont have this attribute
50
        if (i==-1)
51
                i=num_mappings-1;
693 fschmid 52
        sizeQComboBox->setEnabled(false);
53
        sizeQComboBox->setCurrentItem(i);
54
        dsLayout4->addWidget( sizeQLabel, 0, 0 );
55
        dsLayout4->addWidget( sizeQComboBox, 0, 1 );
56
        orientationQComboBox = new QComboBox( true, dsGroupBox7, "orientationQComboBox" );
57
        orientationQLabel = new QLabel( orientationQComboBox, tr( "Orie&ntation:" ), dsGroupBox7, "orientationQLabel" );
58
        orientationQComboBox->insertItem( tr( "Portrait" ) );
59
        orientationQComboBox->insertItem( tr( "Landscape" ) );
60
        orientationQComboBox->setEnabled(false);
61
        orientationQComboBox->setCurrentItem(doc->PageOri);
62
        dsLayout4->addWidget( orientationQLabel, 0, 2 );
519 cbradney 63
        dsLayout4->addWidget( orientationQComboBox, 0, 3 );
693 fschmid 64
        widthMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
65
        widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7, "widthLabel" );
66
        widthMSpinBox->setEnabled( false );
67
        widthMSpinBox->setSuffix(ein);
519 cbradney 68
        widthMSpinBox->setValue(Breite);
693 fschmid 69
        widthQLabel->setBuddy(widthMSpinBox);
70
        dsLayout4->addWidget( widthQLabel, 1, 0 );
71
        dsLayout4->addWidget( widthMSpinBox, 1, 1 );
72
        heightMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
73
        heightQLabel = new QLabel( tr( "&Height:" ), dsGroupBox7, "heightLabel" );
74
        heightMSpinBox->setEnabled( false );
75
        heightMSpinBox->setSuffix(ein);
519 cbradney 76
        heightMSpinBox->setValue(Hoehe);
693 fschmid 77
        heightQLabel->setBuddy(heightMSpinBox);
78
        dsLayout4->addWidget( heightQLabel, 1, 2 );
79
        dsLayout4->addWidget( heightMSpinBox, 1, 3 );
519 cbradney 80
        dsGroupBox7Layout->addLayout( dsLayout4 );
81
        ReformDocLayout->addWidget( dsGroupBox7 );
693 fschmid 82
        GroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
249 Franz 83
        GroupBox7->setTitle( tr( "Margin Guides" ) );
84
        GroupBox7->setColumnLayout(0, Qt::Vertical );
85
        GroupBox7->layout()->setSpacing( 0 );
86
        GroupBox7->layout()->setMargin( 0 );
87
        GroupBox7Layout = new QHBoxLayout( GroupBox7->layout() );
88
        GroupBox7Layout->setAlignment( Qt::AlignTop );
89
        GroupBox7Layout->setSpacing( 0 );
90
        GroupBox7Layout->setMargin( 10 );
91
        Layout4 = new QGridLayout;
92
        Layout4->setSpacing( 6 );
93
        Layout4->setMargin( 0 );
94
        TopR = new MSpinBox( GroupBox7, 4 );
95
        TopR->setSuffix( ein );
173 Franz 96
        TopR->setDecimals( decimals );
249 Franz 97
        TopR->setMaxValue(Hoehe);
693 fschmid 98
        TopR->setValue(doc->PageM.Top * UmReFaktor);
249 Franz 99
        Layout4->addWidget( TopR, 0, 1 );
340 Franz 100
        TextLabel5 = new QLabel( tr( "&Top:" ), GroupBox7, "TextLabel5" );
101
        TextLabel5->setBuddy(TopR);
102
        Layout4->addWidget( TextLabel5, 0, 0 );
249 Franz 103
        LeftR = new MSpinBox( GroupBox7, 4 );
104
        LeftR->setSuffix( ein );
173 Franz 105
        LeftR->setDecimals( decimals );
249 Franz 106
        LeftR->setMaxValue(Breite);
693 fschmid 107
        LeftR->setValue(doc->PageM.Left * UmReFaktor);
249 Franz 108
        Layout4->addWidget( LeftR, 0, 3 );
340 Franz 109
        Links = new QLabel( tr( "&Left:" ), GroupBox7, "Links" );
110
        Links->setBuddy(LeftR);
111
        Layout4->addWidget( Links, 0, 2 );
249 Franz 112
        BottomR = new MSpinBox( GroupBox7, 4 );
113
        BottomR->setSuffix( ein );
173 Franz 114
        BottomR->setDecimals( decimals );
249 Franz 115
        BottomR->setMaxValue(Hoehe);
693 fschmid 116
        BottomR->setValue(doc->PageM.Bottom * UmReFaktor);
249 Franz 117
        Layout4->addWidget( BottomR, 1, 1 );
340 Franz 118
        TextLabel7 = new QLabel( tr( "&Bottom:" ), GroupBox7, "TextLabel7" );
119
        TextLabel7->setBuddy(BottomR);
120
        Layout4->addWidget( TextLabel7, 1, 0 );
249 Franz 121
        RightR = new MSpinBox( GroupBox7, 4 );
122
        RightR->setSuffix( ein );
173 Franz 123
        RightR->setDecimals( decimals );
249 Franz 124
        RightR->setMaxValue(Breite);
693 fschmid 125
        RightR->setValue(doc->PageM.Right * UmReFaktor);
249 Franz 126
        Layout4->addWidget( RightR, 1, 3 );
340 Franz 127
        Rechts = new QLabel( tr( "&Right:" ), GroupBox7, "Rechts" );
128
        Rechts->setBuddy(RightR);
129
        Layout4->addWidget( Rechts, 1, 2 );
130
        Doppelseiten = new QCheckBox( tr( "&Facing Pages" ),GroupBox7, "Doppelseiten" );
693 fschmid 131
        Doppelseiten->setChecked( doc->PageFP );
249 Franz 132
        Layout4->addMultiCellWidget( Doppelseiten, 2, 2, 0, 1 );
340 Franz 133
        ErsteSeite = new QCheckBox( tr( "Left &Page First" ), GroupBox7, "n" );
693 fschmid 134
        ErsteSeite->setChecked( doc->FirstPageLeft );
249 Franz 135
        Layout4->addMultiCellWidget( ErsteSeite, 2, 2, 2, 3 );
693 fschmid 136
        if (!doc->PageFP)
249 Franz 137
                ErsteSeite->setEnabled(false);
138
        setDS();
534 fschmid 139
        TextLabel1_3 = new QLabel( tr( "F&irst Page Number:" ), GroupBox7, "TextLabel1_3" );
140
        Layout4->addMultiCellWidget( TextLabel1_3, 3, 3, 0, 1 );
141
        PgNr = new QSpinBox( GroupBox7, "PgNr" );
142
        PgNr->setMaxValue( 1000 );
143
        PgNr->setMinValue( 1 );
693 fschmid 144
        PgNr->setValue(doc->FirstPnum);
534 fschmid 145
        Layout4->addWidget( PgNr, 3, 2, Qt::AlignRight );
146
        TextLabel1_3->setBuddy(PgNr);
249 Franz 147
        GroupBox7Layout->addLayout( Layout4 );
148
        ReformDocLayout->addWidget( GroupBox7 );
693 fschmid 149
        prefsWidgets->addWidget( tabPage, 0 );
150
 
705 fschmid 151
        prefsSelection->insertItem( tr("Guides"));
152
        tabGuides = new QWidget( prefsWidgets, "tabView" );
153
        tabGuidesLayout = new QVBoxLayout( tabGuides, 10, 5, "tabViewLayout");
154
        checkGrid = new QGroupBox( tabGuides, "checkGrid" );
155
        checkGrid->setTitle( tr( "ShowGrid" ) );
156
        checkGrid->setCheckable( TRUE );
157
        checkGrid->setChecked(doc->GridShown);
158
        checkGrid->setColumnLayout(0, Qt::Vertical );
159
        checkGrid->layout()->setSpacing( 5 );
160
        checkGrid->layout()->setMargin( 10 );
161
        checkGridLayout = new QGridLayout( checkGrid->layout() );
162
        checkGridLayout->setAlignment( Qt::AlignTop );
163
        groupBox1 = new QGroupBox( checkGrid, "groupBox1" );
164
        groupBox1->setColumnLayout(0, Qt::Vertical );
165
        groupBox1->layout()->setSpacing( 5 );
166
        groupBox1->layout()->setMargin( 10 );
167
        groupBox1->setTitle( tr( "Major Grid" ) );
168
        groupBox1Layout = new QGridLayout( groupBox1->layout() );
169
        groupBox1Layout->setAlignment( Qt::AlignTop );
170
        majorGridColor = new QPushButton( groupBox1, "majorGridColor" );
171
        majorGridColor->setMinimumSize( QSize( 60, 20 ) );
172
        majorGridColor->setMaximumSize( QSize( 60, 20 ) );
173
        majorGridColor->setFlat( false );
174
        majorGridColor->setAutoDefault( false );
175
        QPixmap pm1 = QPixmap(54, 14);
176
        pm1.fill(doc->majorColor);
177
        colorMajorGrid = doc->majorColor;
178
        majorGridColor->setPixmap(pm1);
179
        majorGridColor->setText( QString::null );
180
        groupBox1Layout->addWidget( majorGridColor, 1, 1 );
181
        textLabel4 = new QLabel( groupBox1, "textLabel4" );
182
        textLabel4->setText( tr( "Color:" ) );
183
        groupBox1Layout->addWidget( textLabel4, 1, 0 );
184
        textLabel6 = new QLabel( groupBox1, "textLabel6" );
185
        textLabel6->setText( tr( "Spacing:" ) );
186
        groupBox1Layout->addWidget( textLabel6, 0, 0 );
187
        majorSpace = new MSpinBox( 1, 10000, groupBox1, 2 );
188
        majorSpace->setValue( doc->majorGrid * UmReFaktor );
189
        majorSpace->setSuffix( ein );
190
        groupBox1Layout->addWidget( majorSpace, 0, 1 );
191
        checkGridLayout->addWidget( groupBox1, 0, 0 );
192
        groupBox2 = new QGroupBox( checkGrid, "groupBox2" );
193
        groupBox2->setColumnLayout(0, Qt::Vertical );
194
        groupBox2->layout()->setSpacing( 5 );
195
        groupBox2->layout()->setMargin( 10 );
196
        groupBox2->setTitle( tr( "Minor Grid" ) );
197
        groupBox2Layout = new QGridLayout( groupBox2->layout() );
198
        groupBox2Layout->setAlignment( Qt::AlignTop );
199
        textLabel5 = new QLabel( groupBox2, "textLabel5" );
200
        textLabel5->setText( tr( "Color:" ) );
201
        groupBox2Layout->addWidget( textLabel5, 1, 0 );
202
        minorGridColor = new QPushButton( groupBox2, "minorGridColor" );
203
        minorGridColor->setMinimumSize( QSize( 60, 20 ) );
204
        minorGridColor->setMaximumSize( QSize( 60, 20 ) );
205
        minorGridColor->setFlat( false );
206
        minorGridColor->setAutoDefault( false );
207
        QPixmap pm = QPixmap(54, 14);
208
        pm.fill(doc->minorColor);
209
        colorMinorGrid = doc->minorColor;
210
        minorGridColor->setPixmap(pm);
211
        minorGridColor->setText( QString::null );
212
        groupBox2Layout->addWidget( minorGridColor, 1, 1 );
213
        textLabel7 = new QLabel( groupBox2, "textLabel7" );
214
        textLabel7->setText( tr( "Spacing:" ) );
215
        groupBox2Layout->addWidget( textLabel7, 0, 0 );
216
        minorSpace = new MSpinBox( 1, 10000, groupBox2, 2 );
217
        minorSpace->setValue( doc->minorGrid  * UmReFaktor);
218
        minorSpace->setSuffix( ein );
219
        groupBox2Layout->addWidget( minorSpace, 0, 1 );
220
        checkGridLayout->addWidget( groupBox2, 0, 1 );
221
        tabGuidesLayout->addWidget( checkGrid );
222
        layout11 = new QGridLayout( 0, 1, 1, 0, 5, "layout11");
223
        textLabel8 = new QLabel( tabGuides, "textLabel8" );
224
        textLabel8->setText( tr( "Guide Snap Distance:" ) );
225
        layout11->addWidget( textLabel8, 0, 0 );
226
        snapDistance = new MSpinBox( 1, 10000, tabGuides, 2 );
227
        snapDistance->setValue( doc->GuideRad * UmReFaktor );
228
        snapDistance->setSuffix( ein );
229
        layout11->addWidget( snapDistance, 0, 1, Qt::AlignLeft );
230
        checkMargin = new QCheckBox( tabGuides, "checkMargin" );
693 fschmid 231
        checkMargin->setText( tr( "Show Margins" ) );
232
        checkMargin->setChecked(doc->MarginsShown);
705 fschmid 233
        layout11->addWidget( checkMargin, 1, 0 );
234
        checkGuides = new QCheckBox( tabGuides, "checkGuides" );
235
        checkGuides->setText( tr( "Show Guides" ) );
236
        checkGuides->setChecked(doc->GuidesShown);
237
        layout11->addWidget( checkGuides, 2, 0 );
238
        checkBaseline = new QCheckBox( tabGuides, "checkBaseline" );
239
        checkBaseline->setText( tr( "Show Baseline Grid" ) );
240
        checkBaseline->setChecked(doc->BaseShown);
241
        layout11->addWidget( checkBaseline, 3, 0 );
242
        layout2 = new QHBoxLayout( 0, 0, 5, "layout2");
243
        textLabel2 = new QLabel( tabGuides, "textLabel2" );
244
        textLabel2->setText( tr( "Color:" ) );
245
        layout2->addWidget( textLabel2 );
246
        baselineColor = new QPushButton( tabGuides, "baselineColor" );
247
        baselineColor->setMinimumSize( QSize( 60, 20 ) );
248
        baselineColor->setMaximumSize( QSize( 60, 20 ) );
249
        baselineColor->setFlat( false );
250
        baselineColor->setAutoDefault( false );
251
        QPixmap pm4 = QPixmap(54, 14);
252
        pm4.fill(doc->baseColor);
253
        colorBaselineGrid = doc->baseColor;
254
        baselineColor->setPixmap(pm4);
255
        baselineColor->setText( QString::null );
256
        layout2->addWidget( baselineColor );
257
        layout11->addLayout( layout2, 3, 1 );
258
        layout3 = new QHBoxLayout( 0, 0, 5, "layout3");
259
        textLabel3 = new QLabel( tabGuides, "textLabel3" );
260
        textLabel3->setText( tr( "Color:" ) );
261
        layout3->addWidget( textLabel3 );
262
        guideColor = new QPushButton( tabGuides, "guideColor" );
263
        guideColor->setMinimumSize( QSize( 60, 20 ) );
264
        guideColor->setMaximumSize( QSize( 60, 20 ) );
265
        guideColor->setFlat( false );
266
        guideColor->setAutoDefault( false );
267
        QPixmap pm3 = QPixmap(54, 14);
268
        pm3.fill(doc->guideColor);
269
        colorGuides = doc->guideColor;
270
        guideColor->setPixmap(pm3);
271
        guideColor->setText( QString::null );
272
        layout3->addWidget( guideColor );
273
        layout11->addLayout( layout3, 2, 1 );
274
        layout9 = new QHBoxLayout( 0, 0, 5, "layout9");
275
        textLabel1 = new QLabel( tabGuides, "textLabel1" );
276
        textLabel1->setText( tr( "Color:" ) );
277
        layout9->addWidget( textLabel1 );
278
        marginColor = new QPushButton( tabGuides, "marginColor" );
279
        marginColor->setMinimumSize( QSize( 60, 20 ) );
280
        marginColor->setMaximumSize( QSize( 60, 20 ) );
281
        marginColor->setAutoDefault( false );
282
        QPixmap pm6 = QPixmap(54, 14);
283
        pm6.fill(doc->margColor);
284
        colorMargin = doc->margColor;
285
        marginColor->setPixmap(pm6);
286
        marginColor->setFlat( false );
287
        marginColor->setText( QString::null );
288
        layout9->addWidget( marginColor );
289
        layout11->addLayout( layout9, 1, 1 );
290
        tabGuidesLayout->addLayout( layout11 );
291
        layout12 = new QGridLayout( 0, 1, 1, 0, 5, "layout12");
292
        checkLink = new QCheckBox( tabGuides, "checkLink" );
293
        checkLink->setText( tr( "Show Text Chains" ) );
294
        checkLink->setChecked(doc->linkShown);
295
        layout12->addWidget( checkLink, 1, 0 );
296
        checkFrame = new QCheckBox( tabGuides, "checkFrame" );
693 fschmid 297
        checkFrame->setText( tr( "Show Frames" ) );
298
        checkFrame->setChecked(doc->FramesShown);
705 fschmid 299
        layout12->addWidget( checkFrame, 0, 0 );
300
        checkPictures = new QCheckBox( tabGuides, "checkPictures" );
693 fschmid 301
        checkPictures->setText( tr( "Show Pictures" ) );
705 fschmid 302
        layout12->addWidget( checkPictures, 0, 1 );
693 fschmid 303
        checkPictures->setChecked(doc->ShowPic);
705 fschmid 304
        tabGuidesLayout->addLayout( layout12 );
305
        prefsWidgets->addWidget( tabGuides, 1 );
693 fschmid 306
 
705 fschmid 307
        prefsSelection->insertItem( tr("View"));
308
        tabView = new QWidget( prefsWidgets, "tabView" );
309
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
310
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
311
        pageBackground->setTitle( tr( "Page Background" ) );
312
        pageBackground->setColumnLayout(0, Qt::Vertical );
313
        pageBackground->layout()->setSpacing( 5 );
314
        pageBackground->layout()->setMargin( 10 );
315
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
316
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
317
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
318
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
319
        textLabel9->setText( tr( "Color:" ) );
320
        layout10->addWidget( textLabel9 );
321
        backColor = new QPushButton( pageBackground, "backColor" );
322
        backColor->setMinimumSize( QSize( 60, 20 ) );
323
        backColor->setMaximumSize( QSize( 60, 20 ) );
324
        backColor->setFlat( false );
325
        backColor->setAutoDefault( false );
326
        QPixmap pm5 = QPixmap(54, 14);
327
        pm5.fill(doc->papColor);
328
        colorPaper = doc->papColor;
329
        backColor->setPixmap(pm5);
330
        backColor->setText( QString::null );
331
        layout10->addWidget( backColor );
332
        spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
333
        layout10->addItem( spacer3 );
334
        pageBackgroundLayout->addLayout( layout10 );
335
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
336
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
337
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
338
        checkUnprintable->setChecked( doc->RandFarbig );
339
        pageBackgroundLayout->addWidget( checkUnprintable );
340
        tabViewLayout->addWidget( pageBackground );
341
        buttonGroup1 = new QButtonGroup( tabView, "buttonGroup1" );
342
        buttonGroup1->setExclusive( true );
343
        buttonGroup1->setColumnLayout(0, Qt::Vertical );
344
        buttonGroup1->layout()->setSpacing( 5 );
345
        buttonGroup1->layout()->setMargin( 10 );
346
        buttonGroup1->setTitle( tr( "Placing of Guides" ) );
347
        buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() );
348
        buttonGroup1Layout->setAlignment( Qt::AlignTop );
349
        inBackground = new QRadioButton( buttonGroup1, "inBackground" );
350
        inBackground->setText( tr( "In the Background" ) );
351
        buttonGroup1Layout->addWidget( inBackground );
352
        inForeground = new QRadioButton( buttonGroup1, "inForeground" );
353
        inForeground->setText( tr( "In the Foreground" ) );
354
        buttonGroup1Layout->addWidget( inForeground );
355
        inBackground->setChecked( doc->Before );
356
        inForeground->setChecked( !doc->Before );
357
        tabViewLayout->addWidget( buttonGroup1 );
358
        prefsWidgets->addWidget( tabView, 2 );
359
 
360
 
249 Franz 361
        RightR->setMaxValue(Breite - LeftR->value());
362
        LeftR->setMaxValue(Breite - RightR->value());
363
        TopR->setMaxValue(Hoehe - BottomR->value());
364
        BottomR->setMaxValue(Hoehe - TopR->value());
365
        //tooltips
366
        QToolTip::add( Doppelseiten, tr( "Enable single or spread based layout" ) );
367
        QToolTip::add( ErsteSeite, tr( "Make the first page the left page of the document" ) );
368
        QToolTip::add( TopR, tr( "Distance between the top margin guide and the edge of the page" ) );
369
        QToolTip::add( BottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
370
        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" ) );
371
        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 372
 
249 Franz 373
        // signals and slots connections
374
        connect( Doppelseiten, SIGNAL( clicked() ), this, SLOT( setDS() ) );
693 fschmid 375
        connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
376
        connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
249 Franz 377
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
378
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
379
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
380
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
705 fschmid 381
        connect(majorGridColor, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
382
        connect(minorGridColor, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
383
        connect(baselineColor, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
384
        connect(guideColor, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
385
        connect(marginColor, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
386
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
693 fschmid 387
        prefsWidgets->raiseWidget(0);
388
        resize( minimumSizeHint() );
389
        clearWState( WState_Polished );
3 paul 390
}
391
 
705 fschmid 392
void ReformDoc::changeMajorColor()
393
{
394
        QColor neu = QColor();
395
        neu = QColorDialog::getColor(colorMajorGrid, this);
396
        if (neu.isValid())
397
        {
398
                QPixmap pm = QPixmap(54, 14);
399
                pm.fill(neu);
400
                colorMajorGrid = neu;
401
                majorGridColor->setPixmap(pm);
402
        }
403
}
404
 
405
void ReformDoc::changeMinorColor()
406
{
407
        QColor neu = QColor();
408
        neu = QColorDialog::getColor(colorMinorGrid, this);
409
        if (neu.isValid())
410
        {
411
                QPixmap pm = QPixmap(54, 14);
412
                pm.fill(neu);
413
                colorMinorGrid = neu;
414
                minorGridColor->setPixmap(pm);
415
        }
416
}
417
 
418
void ReformDoc::changePaperColor()
419
{
420
        QColor neu = QColor();
421
        neu = QColorDialog::getColor(colorPaper, this);
422
        if (neu.isValid())
423
        {
424
                QPixmap pm = QPixmap(54, 14);
425
                pm.fill(neu);
426
                colorPaper = neu;
427
                backColor->setPixmap(pm);
428
        }
429
}
430
 
431
void ReformDoc::changeBaselineColor()
432
{
433
        QColor neu = QColor();
434
        neu = QColorDialog::getColor(colorBaselineGrid, this);
435
        if (neu.isValid())
436
        {
437
                QPixmap pm = QPixmap(54, 14);
438
                pm.fill(neu);
439
                colorBaselineGrid = neu;
440
                baselineColor->setPixmap(pm);
441
        }
442
}
443
 
444
void ReformDoc::changeGuideColor()
445
{
446
        QColor neu = QColor();
447
        neu = QColorDialog::getColor(colorGuides, this);
448
        if (neu.isValid())
449
        {
450
                QPixmap pm = QPixmap(54, 14);
451
                pm.fill(neu);
452
                colorGuides = neu;
453
                guideColor->setPixmap(pm);
454
        }
455
}
456
 
457
void ReformDoc::changeMarginColor()
458
{
459
        QColor neu = QColor();
460
        neu = QColorDialog::getColor(colorMargin, this);
461
        if (neu.isValid())
462
        {
463
                QPixmap pm = QPixmap(54, 14);
464
                pm.fill(neu);
465
                colorMargin = neu;
466
                marginColor->setPixmap(pm);
467
        }
468
}
469
 
693 fschmid 470
void ReformDoc::setTop(int )
36 Franz 471
{
472
        BottomR->setMaxValue(Hoehe - TopR->value());
473
}
3 paul 474
 
693 fschmid 475
void ReformDoc::setBottom(int )
36 Franz 476
{
477
        TopR->setMaxValue(Hoehe - BottomR->value());
478
}
479
 
693 fschmid 480
void ReformDoc::setLeft(int )
36 Franz 481
{
482
        RightR->setMaxValue(Breite - LeftR->value());
483
}
484
 
693 fschmid 485
void ReformDoc::setRight(int )
36 Franz 486
{
487
        LeftR->setMaxValue(Breite - RightR->value());
488
}
489
 
3 paul 490
void ReformDoc::setDS()
491
{
249 Franz 492
        if (Doppelseiten->isChecked())
493
        {
340 Franz 494
                Links->setText( tr( "&Inside:" ) );
495
                Rechts->setText( tr( "&Outside:" ) );
249 Franz 496
                ErsteSeite->setEnabled(true);
497
        }
498
        else
499
        {
340 Franz 500
                Links->setText( tr( "&Left:" ) );
501
                Rechts->setText( tr( "&Right:" ) );
249 Franz 502
                ErsteSeite->setEnabled(false);
503
        }
348 Franz 504
}