Subversion Repositories Scribus

Rev

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