Subversion Repositories Scribus

Rev

Rev 735 | Rev 776 | 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>
726 fschmid 5
#include "fontcombo.h"
731 fschmid 6
#include "polygonwidget.h"
745 fschmid 7
#include "arrowchooser.h"
3 paul 8
extern QPixmap loadIcon(QString nam);
726 fschmid 9
extern QPixmap fontSamples(QString da, int s, QString ts, QColor back);
80 Franz 10
extern double UmReFaktor;
3 paul 11
 
726 fschmid 12
ReformDoc::ReformDoc( QWidget* parent, ScribusDoc* doc, preV *prefsData ) : PrefsDialogBase( parent )
3 paul 13
{
693 fschmid 14
        einheit = doc->Einheit;
734 fschmid 15
        docc = doc;
726 fschmid 16
        fon = &prefsData->AvailFonts;
734 fschmid 17
        Umrech = UmReFaktor;
274 Franz 18
        QString units[] = { tr(" pt"), tr(" mm"), tr(" in"), tr(" p")};
693 fschmid 19
        QString ein = units[doc->Einheit];
274 Franz 20
        int dp[] = {100, 1000, 10000, 100};
734 fschmid 21
        decimals = dp[doc->Einheit];
519 cbradney 22
        int i=-1;
726 fschmid 23
        pageWidth = doc->PageB * UmReFaktor;
24
        pageHeight = doc->PageH * UmReFaktor;
249 Franz 25
        setCaption( tr( "Document Setup" ) );
693 fschmid 26
        tabPage = new QWidget( prefsWidgets, "tab" );
27
        ReformDocLayout = new QVBoxLayout( tabPage );
249 Franz 28
        ReformDocLayout->setSpacing( 6 );
29
        ReformDocLayout->setMargin( 10 );
693 fschmid 30
        dsGroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
519 cbradney 31
        dsGroupBox7->setTitle( tr( "Page Size" ) );
32
        dsGroupBox7->setColumnLayout(0, Qt::Vertical );
33
        dsGroupBox7->layout()->setSpacing( 0 );
34
        dsGroupBox7->layout()->setMargin( 0 );
35
        dsGroupBox7Layout = new QHBoxLayout( dsGroupBox7->layout() );
36
        dsGroupBox7Layout->setAlignment( Qt::AlignTop );
37
        dsGroupBox7Layout->setSpacing( 0 );
38
        dsGroupBox7Layout->setMargin( 10 );
39
        dsLayout4 = new QGridLayout;
40
        dsLayout4->setSpacing( 6 );
41
        dsLayout4->setMargin( 0 );
693 fschmid 42
        sizeQComboBox = new QComboBox( true, dsGroupBox7, "sizeQComboBox" );
43
        sizeQLabel = new QLabel( sizeQComboBox, tr( "&Size:" ), dsGroupBox7, "sizeQLabel" );
44
        QString sizelist[] = {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4",
45
                              "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive", "Folio",
46
                              "Ledger", tr("Legal"), tr("Letter"), tr("Tabloid"), tr("Custom")};
47
        size_t const num_mappings = (sizeof sizelist)/(sizeof *sizelist);
48
        for (uint m = 0; m < num_mappings; ++m)
49
        {
50
                sizeQComboBox->insertItem(sizelist[m]);
51
                if (sizelist[m]==doc->PageSize)
519 cbradney 52
                        i=m;
53
        }
54
        //set Custom if we dont have one already as old docs wont have this attribute
55
        if (i==-1)
56
                i=num_mappings-1;
693 fschmid 57
        sizeQComboBox->setEnabled(false);
58
        sizeQComboBox->setCurrentItem(i);
59
        dsLayout4->addWidget( sizeQLabel, 0, 0 );
60
        dsLayout4->addWidget( sizeQComboBox, 0, 1 );
61
        orientationQComboBox = new QComboBox( true, dsGroupBox7, "orientationQComboBox" );
62
        orientationQLabel = new QLabel( orientationQComboBox, tr( "Orie&ntation:" ), dsGroupBox7, "orientationQLabel" );
63
        orientationQComboBox->insertItem( tr( "Portrait" ) );
64
        orientationQComboBox->insertItem( tr( "Landscape" ) );
65
        orientationQComboBox->setEnabled(false);
66
        orientationQComboBox->setCurrentItem(doc->PageOri);
67
        dsLayout4->addWidget( orientationQLabel, 0, 2 );
519 cbradney 68
        dsLayout4->addWidget( orientationQComboBox, 0, 3 );
693 fschmid 69
        widthMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
70
        widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7, "widthLabel" );
71
        widthMSpinBox->setEnabled( false );
72
        widthMSpinBox->setSuffix(ein);
726 fschmid 73
        widthMSpinBox->setValue(pageWidth);
693 fschmid 74
        widthQLabel->setBuddy(widthMSpinBox);
75
        dsLayout4->addWidget( widthQLabel, 1, 0 );
76
        dsLayout4->addWidget( widthMSpinBox, 1, 1 );
77
        heightMSpinBox = new MSpinBox( 1, 10000, dsGroupBox7, 2 );
78
        heightQLabel = new QLabel( tr( "&Height:" ), dsGroupBox7, "heightLabel" );
79
        heightMSpinBox->setEnabled( false );
80
        heightMSpinBox->setSuffix(ein);
726 fschmid 81
        heightMSpinBox->setValue(pageHeight);
693 fschmid 82
        heightQLabel->setBuddy(heightMSpinBox);
83
        dsLayout4->addWidget( heightQLabel, 1, 2 );
84
        dsLayout4->addWidget( heightMSpinBox, 1, 3 );
519 cbradney 85
        dsGroupBox7Layout->addLayout( dsLayout4 );
86
        ReformDocLayout->addWidget( dsGroupBox7 );
693 fschmid 87
        GroupBox7 = new QGroupBox( tabPage, "GroupBox7" );
249 Franz 88
        GroupBox7->setTitle( tr( "Margin Guides" ) );
89
        GroupBox7->setColumnLayout(0, Qt::Vertical );
90
        GroupBox7->layout()->setSpacing( 0 );
91
        GroupBox7->layout()->setMargin( 0 );
92
        GroupBox7Layout = new QHBoxLayout( GroupBox7->layout() );
93
        GroupBox7Layout->setAlignment( Qt::AlignTop );
94
        GroupBox7Layout->setSpacing( 0 );
95
        GroupBox7Layout->setMargin( 10 );
96
        Layout4 = new QGridLayout;
97
        Layout4->setSpacing( 6 );
98
        Layout4->setMargin( 0 );
726 fschmid 99
        topR = new MSpinBox( GroupBox7, 4 );
100
        topR->setSuffix( ein );
101
        topR->setDecimals( decimals );
102
        topR->setMaxValue(pageHeight);
103
        topR->setValue(doc->PageM.Top * UmReFaktor);
104
        Layout4->addWidget( topR, 0, 1 );
340 Franz 105
        TextLabel5 = new QLabel( tr( "&Top:" ), GroupBox7, "TextLabel5" );
726 fschmid 106
        TextLabel5->setBuddy(topR);
340 Franz 107
        Layout4->addWidget( TextLabel5, 0, 0 );
726 fschmid 108
        leftR = new MSpinBox( GroupBox7, 4 );
109
        leftR->setSuffix( ein );
110
        leftR->setDecimals( decimals );
111
        leftR->setMaxValue(pageWidth);
112
        leftR->setValue(doc->PageM.Left * UmReFaktor);
113
        Layout4->addWidget( leftR, 0, 3 );
340 Franz 114
        Links = new QLabel( tr( "&Left:" ), GroupBox7, "Links" );
726 fschmid 115
        Links->setBuddy(leftR);
340 Franz 116
        Layout4->addWidget( Links, 0, 2 );
726 fschmid 117
        bottomR = new MSpinBox( GroupBox7, 4 );
118
        bottomR->setSuffix( ein );
119
        bottomR->setDecimals( decimals );
120
        bottomR->setMaxValue(pageHeight);
121
        bottomR->setValue(doc->PageM.Bottom * UmReFaktor);
122
        Layout4->addWidget( bottomR, 1, 1 );
340 Franz 123
        TextLabel7 = new QLabel( tr( "&Bottom:" ), GroupBox7, "TextLabel7" );
726 fschmid 124
        TextLabel7->setBuddy(bottomR);
340 Franz 125
        Layout4->addWidget( TextLabel7, 1, 0 );
726 fschmid 126
        rightR = new MSpinBox( GroupBox7, 4 );
127
        rightR->setSuffix( ein );
128
        rightR->setDecimals( decimals );
129
        rightR->setMaxValue(pageWidth);
130
        rightR->setValue(doc->PageM.Right * UmReFaktor);
131
        Layout4->addWidget( rightR, 1, 3 );
340 Franz 132
        Rechts = new QLabel( tr( "&Right:" ), GroupBox7, "Rechts" );
726 fschmid 133
        Rechts->setBuddy(rightR);
340 Franz 134
        Layout4->addWidget( Rechts, 1, 2 );
734 fschmid 135
        GroupBox7Layout->addLayout( Layout4 );
136
        ReformDocLayout->addWidget( GroupBox7 );
137
        GroupBox7a = new QGroupBox( tabPage, "GroupBox7" );
138
        GroupBox7a->setTitle( tr( "Layout" ) );
139
        GroupBox7a->setColumnLayout(0, Qt::Vertical );
140
        GroupBox7a->layout()->setSpacing( 0 );
141
        GroupBox7a->layout()->setMargin( 0 );
142
        GroupBox7aLayout = new QHBoxLayout( GroupBox7a->layout() );
143
        GroupBox7aLayout->setAlignment( Qt::AlignTop );
144
        GroupBox7aLayout->setSpacing( 0 );
145
        GroupBox7aLayout->setMargin( 10 );
146
        Layout4a = new QGridLayout;
147
        Layout4a->setSpacing( 6 );
148
        Layout4a->setMargin( 0 );
149
        facingPages = new QCheckBox( tr( "&Facing Pages" ),GroupBox7a, "facingPages" );
726 fschmid 150
        facingPages->setChecked( doc->PageFP );
734 fschmid 151
        Layout4a->addMultiCellWidget( facingPages, 2, 2, 0, 1 );
152
        firstPage = new QCheckBox( tr( "Left &Page First" ), GroupBox7a, "n" );
726 fschmid 153
        firstPage->setChecked( doc->FirstPageLeft );
734 fschmid 154
        Layout4a->addMultiCellWidget( firstPage, 2, 2, 2, 3 );
693 fschmid 155
        if (!doc->PageFP)
726 fschmid 156
                firstPage->setEnabled(false);
249 Franz 157
        setDS();
734 fschmid 158
        TextLabel1_3 = new QLabel( tr( "F&irst Page Number:" ), GroupBox7a, "TextLabel1_3" );
159
        Layout4a->addMultiCellWidget( TextLabel1_3, 3, 3, 0, 1 );
160
        pageNumber = new QSpinBox( GroupBox7a, "pageNumber" );
726 fschmid 161
        pageNumber->setMaxValue( 10000 );
162
        pageNumber->setMinValue( 1 );
163
        pageNumber->setValue(doc->FirstPnum);
734 fschmid 164
        Layout4a->addWidget( pageNumber, 3, 2, Qt::AlignRight );
726 fschmid 165
        TextLabel1_3->setBuddy(pageNumber);
734 fschmid 166
        GroupBox7aLayout->addLayout( Layout4a );
167
        ReformDocLayout->addWidget( GroupBox7a );
715 fschmid 168
        addItem( tr("Page"), loadIcon("page.png"), tabPage);
693 fschmid 169
 
705 fschmid 170
        tabGuides = new QWidget( prefsWidgets, "tabView" );
171
        tabGuidesLayout = new QVBoxLayout( tabGuides, 10, 5, "tabViewLayout");
172
        checkGrid = new QGroupBox( tabGuides, "checkGrid" );
173
        checkGrid->setTitle( tr( "ShowGrid" ) );
174
        checkGrid->setCheckable( TRUE );
175
        checkGrid->setChecked(doc->GridShown);
176
        checkGrid->setColumnLayout(0, Qt::Vertical );
177
        checkGrid->layout()->setSpacing( 5 );
178
        checkGrid->layout()->setMargin( 10 );
179
        checkGridLayout = new QGridLayout( checkGrid->layout() );
180
        checkGridLayout->setAlignment( Qt::AlignTop );
181
        groupBox1 = new QGroupBox( checkGrid, "groupBox1" );
182
        groupBox1->setColumnLayout(0, Qt::Vertical );
183
        groupBox1->layout()->setSpacing( 5 );
184
        groupBox1->layout()->setMargin( 10 );
185
        groupBox1->setTitle( tr( "Major Grid" ) );
186
        groupBox1Layout = new QGridLayout( groupBox1->layout() );
187
        groupBox1Layout->setAlignment( Qt::AlignTop );
188
        majorGridColor = new QPushButton( groupBox1, "majorGridColor" );
189
        majorGridColor->setMinimumSize( QSize( 60, 20 ) );
190
        majorGridColor->setMaximumSize( QSize( 60, 20 ) );
191
        majorGridColor->setFlat( false );
192
        majorGridColor->setAutoDefault( false );
193
        QPixmap pm1 = QPixmap(54, 14);
194
        pm1.fill(doc->majorColor);
195
        colorMajorGrid = doc->majorColor;
196
        majorGridColor->setPixmap(pm1);
197
        majorGridColor->setText( QString::null );
198
        groupBox1Layout->addWidget( majorGridColor, 1, 1 );
199
        textLabel4 = new QLabel( groupBox1, "textLabel4" );
200
        textLabel4->setText( tr( "Color:" ) );
201
        groupBox1Layout->addWidget( textLabel4, 1, 0 );
202
        textLabel6 = new QLabel( groupBox1, "textLabel6" );
203
        textLabel6->setText( tr( "Spacing:" ) );
204
        groupBox1Layout->addWidget( textLabel6, 0, 0 );
205
        majorSpace = new MSpinBox( 1, 10000, groupBox1, 2 );
206
        majorSpace->setValue( doc->majorGrid * UmReFaktor );
207
        majorSpace->setSuffix( ein );
208
        groupBox1Layout->addWidget( majorSpace, 0, 1 );
209
        checkGridLayout->addWidget( groupBox1, 0, 0 );
210
        groupBox2 = new QGroupBox( checkGrid, "groupBox2" );
211
        groupBox2->setColumnLayout(0, Qt::Vertical );
212
        groupBox2->layout()->setSpacing( 5 );
213
        groupBox2->layout()->setMargin( 10 );
214
        groupBox2->setTitle( tr( "Minor Grid" ) );
215
        groupBox2Layout = new QGridLayout( groupBox2->layout() );
216
        groupBox2Layout->setAlignment( Qt::AlignTop );
217
        textLabel5 = new QLabel( groupBox2, "textLabel5" );
218
        textLabel5->setText( tr( "Color:" ) );
219
        groupBox2Layout->addWidget( textLabel5, 1, 0 );
220
        minorGridColor = new QPushButton( groupBox2, "minorGridColor" );
221
        minorGridColor->setMinimumSize( QSize( 60, 20 ) );
222
        minorGridColor->setMaximumSize( QSize( 60, 20 ) );
223
        minorGridColor->setFlat( false );
224
        minorGridColor->setAutoDefault( false );
225
        QPixmap pm = QPixmap(54, 14);
226
        pm.fill(doc->minorColor);
227
        colorMinorGrid = doc->minorColor;
228
        minorGridColor->setPixmap(pm);
229
        minorGridColor->setText( QString::null );
230
        groupBox2Layout->addWidget( minorGridColor, 1, 1 );
231
        textLabel7 = new QLabel( groupBox2, "textLabel7" );
232
        textLabel7->setText( tr( "Spacing:" ) );
233
        groupBox2Layout->addWidget( textLabel7, 0, 0 );
234
        minorSpace = new MSpinBox( 1, 10000, groupBox2, 2 );
235
        minorSpace->setValue( doc->minorGrid  * UmReFaktor);
236
        minorSpace->setSuffix( ein );
237
        groupBox2Layout->addWidget( minorSpace, 0, 1 );
238
        checkGridLayout->addWidget( groupBox2, 0, 1 );
239
        tabGuidesLayout->addWidget( checkGrid );
240
        layout11 = new QGridLayout( 0, 1, 1, 0, 5, "layout11");
241
        textLabel8 = new QLabel( tabGuides, "textLabel8" );
242
        textLabel8->setText( tr( "Guide Snap Distance:" ) );
243
        layout11->addWidget( textLabel8, 0, 0 );
244
        snapDistance = new MSpinBox( 1, 10000, tabGuides, 2 );
245
        snapDistance->setValue( doc->GuideRad * UmReFaktor );
246
        snapDistance->setSuffix( ein );
247
        layout11->addWidget( snapDistance, 0, 1, Qt::AlignLeft );
248
        checkMargin = new QCheckBox( tabGuides, "checkMargin" );
693 fschmid 249
        checkMargin->setText( tr( "Show Margins" ) );
250
        checkMargin->setChecked(doc->MarginsShown);
705 fschmid 251
        layout11->addWidget( checkMargin, 1, 0 );
252
        checkGuides = new QCheckBox( tabGuides, "checkGuides" );
253
        checkGuides->setText( tr( "Show Guides" ) );
254
        checkGuides->setChecked(doc->GuidesShown);
255
        layout11->addWidget( checkGuides, 2, 0 );
256
        checkBaseline = new QCheckBox( tabGuides, "checkBaseline" );
257
        checkBaseline->setText( tr( "Show Baseline Grid" ) );
258
        checkBaseline->setChecked(doc->BaseShown);
259
        layout11->addWidget( checkBaseline, 3, 0 );
260
        layout2 = new QHBoxLayout( 0, 0, 5, "layout2");
261
        textLabel2 = new QLabel( tabGuides, "textLabel2" );
262
        textLabel2->setText( tr( "Color:" ) );
263
        layout2->addWidget( textLabel2 );
264
        baselineColor = new QPushButton( tabGuides, "baselineColor" );
265
        baselineColor->setMinimumSize( QSize( 60, 20 ) );
266
        baselineColor->setMaximumSize( QSize( 60, 20 ) );
267
        baselineColor->setFlat( false );
268
        baselineColor->setAutoDefault( false );
269
        QPixmap pm4 = QPixmap(54, 14);
270
        pm4.fill(doc->baseColor);
271
        colorBaselineGrid = doc->baseColor;
272
        baselineColor->setPixmap(pm4);
273
        baselineColor->setText( QString::null );
274
        layout2->addWidget( baselineColor );
275
        layout11->addLayout( layout2, 3, 1 );
276
        layout3 = new QHBoxLayout( 0, 0, 5, "layout3");
277
        textLabel3 = new QLabel( tabGuides, "textLabel3" );
278
        textLabel3->setText( tr( "Color:" ) );
279
        layout3->addWidget( textLabel3 );
280
        guideColor = new QPushButton( tabGuides, "guideColor" );
281
        guideColor->setMinimumSize( QSize( 60, 20 ) );
282
        guideColor->setMaximumSize( QSize( 60, 20 ) );
283
        guideColor->setFlat( false );
284
        guideColor->setAutoDefault( false );
285
        QPixmap pm3 = QPixmap(54, 14);
286
        pm3.fill(doc->guideColor);
287
        colorGuides = doc->guideColor;
288
        guideColor->setPixmap(pm3);
289
        guideColor->setText( QString::null );
290
        layout3->addWidget( guideColor );
291
        layout11->addLayout( layout3, 2, 1 );
292
        layout9 = new QHBoxLayout( 0, 0, 5, "layout9");
293
        textLabel1 = new QLabel( tabGuides, "textLabel1" );
294
        textLabel1->setText( tr( "Color:" ) );
295
        layout9->addWidget( textLabel1 );
296
        marginColor = new QPushButton( tabGuides, "marginColor" );
297
        marginColor->setMinimumSize( QSize( 60, 20 ) );
298
        marginColor->setMaximumSize( QSize( 60, 20 ) );
299
        marginColor->setAutoDefault( false );
300
        QPixmap pm6 = QPixmap(54, 14);
301
        pm6.fill(doc->margColor);
302
        colorMargin = doc->margColor;
303
        marginColor->setPixmap(pm6);
304
        marginColor->setFlat( false );
305
        marginColor->setText( QString::null );
306
        layout9->addWidget( marginColor );
307
        layout11->addLayout( layout9, 1, 1 );
308
        tabGuidesLayout->addLayout( layout11 );
309
        layout12 = new QGridLayout( 0, 1, 1, 0, 5, "layout12");
310
        checkLink = new QCheckBox( tabGuides, "checkLink" );
311
        checkLink->setText( tr( "Show Text Chains" ) );
312
        checkLink->setChecked(doc->linkShown);
313
        layout12->addWidget( checkLink, 1, 0 );
314
        checkFrame = new QCheckBox( tabGuides, "checkFrame" );
693 fschmid 315
        checkFrame->setText( tr( "Show Frames" ) );
316
        checkFrame->setChecked(doc->FramesShown);
705 fschmid 317
        layout12->addWidget( checkFrame, 0, 0 );
318
        checkPictures = new QCheckBox( tabGuides, "checkPictures" );
693 fschmid 319
        checkPictures->setText( tr( "Show Pictures" ) );
705 fschmid 320
        layout12->addWidget( checkPictures, 0, 1 );
693 fschmid 321
        checkPictures->setChecked(doc->ShowPic);
705 fschmid 322
        tabGuidesLayout->addLayout( layout12 );
715 fschmid 323
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
693 fschmid 324
 
705 fschmid 325
        tabView = new QWidget( prefsWidgets, "tabView" );
326
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
327
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
328
        pageBackground->setTitle( tr( "Page Background" ) );
329
        pageBackground->setColumnLayout(0, Qt::Vertical );
330
        pageBackground->layout()->setSpacing( 5 );
331
        pageBackground->layout()->setMargin( 10 );
332
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
333
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
334
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
335
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
336
        textLabel9->setText( tr( "Color:" ) );
337
        layout10->addWidget( textLabel9 );
338
        backColor = new QPushButton( pageBackground, "backColor" );
339
        backColor->setMinimumSize( QSize( 60, 20 ) );
340
        backColor->setMaximumSize( QSize( 60, 20 ) );
341
        backColor->setFlat( false );
342
        backColor->setAutoDefault( false );
343
        QPixmap pm5 = QPixmap(54, 14);
344
        pm5.fill(doc->papColor);
345
        colorPaper = doc->papColor;
346
        backColor->setPixmap(pm5);
347
        backColor->setText( QString::null );
348
        layout10->addWidget( backColor );
349
        spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
350
        layout10->addItem( spacer3 );
351
        pageBackgroundLayout->addLayout( layout10 );
352
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
353
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
354
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
355
        checkUnprintable->setChecked( doc->RandFarbig );
356
        pageBackgroundLayout->addWidget( checkUnprintable );
357
        tabViewLayout->addWidget( pageBackground );
734 fschmid 358
 
359
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
360
        groupScratch->setTitle( tr( "Scratch Space" ) );
361
        groupScratch->setColumnLayout(0, Qt::Vertical );
362
        groupScratch->layout()->setSpacing( 0 );
363
        groupScratch->layout()->setMargin( 0 );
364
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
365
        groupScratchLayout->setAlignment( Qt::AlignTop );
366
        groupScratchLayout->setSpacing( 0 );
367
        groupScratchLayout->setMargin( 10 );
368
        Layout4s = new QGridLayout;
369
        Layout4s->setSpacing( 6 );
370
        Layout4s->setMargin( 0 );
371
        topScratch = new MSpinBox( groupScratch, 4 );
372
        topScratch->setSuffix( ein );
373
        topScratch->setDecimals( decimals );
374
        topScratch->setMaxValue(1000);
375
        topScratch->setValue(doc->ScratchTop * UmReFaktor);
376
        Layout4s->addWidget( topScratch, 0, 1 );
377
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
378
        Layout4s->addWidget( TextLabel5s, 0, 0 );
379
        leftScratch = new MSpinBox( groupScratch, 4 );
380
        leftScratch->setSuffix( ein );
381
        leftScratch->setDecimals( decimals );
382
        leftScratch->setMaxValue(1000);
383
        leftScratch->setValue(doc->ScratchLeft * UmReFaktor);
384
        Layout4s->addWidget( leftScratch, 0, 3 );
385
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
386
        Layout4s->addWidget( Linkss, 0, 2 );
387
        bottomScratch = new MSpinBox( groupScratch, 4 );
388
        bottomScratch->setSuffix( ein );
389
        bottomScratch->setDecimals( decimals );
390
        bottomScratch->setMaxValue(1000);
391
        bottomScratch->setValue(doc->ScratchBottom * UmReFaktor);
392
        Layout4s->addWidget( bottomScratch, 1, 1 );
393
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
394
        Layout4s->addWidget( TextLabel7s, 1, 0 );
395
        rightScratch = new MSpinBox( groupScratch, 4 );
396
        rightScratch->setSuffix( ein );
397
        rightScratch->setDecimals( decimals );
398
        rightScratch->setMaxValue(1000);
399
        rightScratch->setValue(doc->ScratchRight * UmReFaktor);
400
        Layout4s->addWidget( rightScratch, 1, 3 );
401
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
402
        Layout4s->addWidget( Rechtss, 1, 2 );
403
        groupScratchLayout->addLayout( Layout4s );
404
        tabViewLayout->addWidget( groupScratch );
405
 
705 fschmid 406
        buttonGroup1 = new QButtonGroup( tabView, "buttonGroup1" );
407
        buttonGroup1->setExclusive( true );
408
        buttonGroup1->setColumnLayout(0, Qt::Vertical );
409
        buttonGroup1->layout()->setSpacing( 5 );
410
        buttonGroup1->layout()->setMargin( 10 );
411
        buttonGroup1->setTitle( tr( "Placing of Guides" ) );
412
        buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() );
413
        buttonGroup1Layout->setAlignment( Qt::AlignTop );
414
        inBackground = new QRadioButton( buttonGroup1, "inBackground" );
415
        inBackground->setText( tr( "In the Background" ) );
416
        buttonGroup1Layout->addWidget( inBackground );
417
        inForeground = new QRadioButton( buttonGroup1, "inForeground" );
418
        inForeground->setText( tr( "In the Foreground" ) );
419
        buttonGroup1Layout->addWidget( inForeground );
420
        inBackground->setChecked( doc->Before );
421
        inForeground->setChecked( !doc->Before );
422
        tabViewLayout->addWidget( buttonGroup1 );
715 fschmid 423
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
424
 
425
 
426
        tabTypo = new QWidget( prefsWidgets, "tabTypo" );
427
        tabTypoLayout = new QGridLayout( tabTypo, 1, 1, 11, 6, "tabTypoLayout");
428
        groupBox1a = new QGroupBox( tabTypo, "groupBox1a" );
429
        groupBox1a->setColumnLayout(0, Qt::Vertical );
430
        groupBox1a->layout()->setSpacing( 6 );
431
        groupBox1a->layout()->setMargin( 11 );
432
        groupBox1a->setTitle( tr( "Subscript" ) );
433
        groupBox1aLayout = new QGridLayout( groupBox1a->layout() );
434
        groupBox1aLayout->setAlignment( Qt::AlignTop );
435
        subDisplacement = new QSpinBox( groupBox1a, "subDisplacement" );
436
        subDisplacement->setMaxValue( 100 );
437
        subDisplacement->setValue( doc->VTief );
438
        subDisplacement->setSuffix( tr( " %" ) );
745 fschmid 439
        groupBox1aLayout->addWidget( subDisplacement, 0, 1, Qt::AlignLeft );
715 fschmid 440
        textLabel1a = new QLabel(subDisplacement, tr( "&Displacement:" ), groupBox1a, "textLabel1a" );
441
        groupBox1aLayout->addWidget( textLabel1a, 0, 0 );
442
        subScaling = new QSpinBox( groupBox1a, "subScaling" );
443
        subScaling->setMaxValue( 100 );
444
        subScaling->setMinValue( 1 );
445
        subScaling->setValue( doc->VTiefSc );
446
        subScaling->setSuffix( tr( " %" ) );
745 fschmid 447
        groupBox1aLayout->addWidget( subScaling, 0, 3, Qt::AlignLeft );
715 fschmid 448
        textLabel2a = new QLabel(subScaling, tr( "&Scaling:" ), groupBox1a, "textLabel2a" );
726 fschmid 449
        groupBox1aLayout->addWidget( textLabel2a, 0, 2 );
715 fschmid 450
        tabTypoLayout->addWidget( groupBox1a, 0, 0 );
451
        groupBox2a = new QGroupBox( tabTypo, "groupBox2a" );
452
        groupBox2a->setColumnLayout(0, Qt::Vertical );
453
        groupBox2a->layout()->setSpacing( 6 );
454
        groupBox2a->layout()->setMargin( 11 );
455
        groupBox2a->setTitle( tr( "Superscript" ) );
456
        groupBox2aLayout = new QGridLayout( groupBox2a->layout() );
457
        groupBox2aLayout->setAlignment( Qt::AlignTop );
458
        superDisplacement = new QSpinBox( groupBox2a, "superDisplacement" );
459
        superDisplacement->setMaxValue( 100 );
460
        superDisplacement->setValue( doc->VHoch );
461
        superDisplacement->setSuffix( tr( " %" ) );
745 fschmid 462
        groupBox2aLayout->addWidget( superDisplacement, 0, 1, Qt::AlignLeft );
715 fschmid 463
        textLabel3a = new QLabel(superDisplacement, tr( "D&isplacement:" ), groupBox2a, "textLabel3a" );
464
        groupBox2aLayout->addWidget( textLabel3a, 0, 0 );
465
        superScaling = new QSpinBox( groupBox2a, "superScaling" );
466
        superScaling->setMaxValue( 100 );
467
        superScaling->setMinValue( 1 );
468
        superScaling->setValue( doc->VHochSc );
469
        superScaling->setSuffix( tr( " %" ) );
745 fschmid 470
        groupBox2aLayout->addWidget( superScaling, 0, 3, Qt::AlignLeft );
715 fschmid 471
        textLabel4a = new QLabel(superScaling, tr( "S&caling:" ), groupBox2a, "textLabel4a" );
726 fschmid 472
        groupBox2aLayout->addWidget( textLabel4a, 0, 2 );
715 fschmid 473
        tabTypoLayout->addWidget( groupBox2a, 1, 0 );
474
        groupBox3a = new QGroupBox( tabTypo, "groupBox3a" );
475
        groupBox3a->setColumnLayout(0, Qt::Vertical );
476
        groupBox3a->layout()->setSpacing( 6 );
477
        groupBox3a->layout()->setMargin( 11 );
478
        groupBox3a->setTitle( tr( "Small Caps" ) );
479
        groupBox3aLayout = new QGridLayout( groupBox3a->layout() );
480
        groupBox3aLayout->setAlignment( Qt::AlignTop );
481
        capsScaling = new QSpinBox( groupBox3a, "capsScaling" );
482
        capsScaling->setMaxValue( 100 );
483
        capsScaling->setMinValue( 1 );
484
        capsScaling->setValue( doc->VKapit );
485
        capsScaling->setSuffix( tr( " %" ) );
745 fschmid 486
        groupBox3aLayout->addWidget( capsScaling, 0, 1, Qt::AlignLeft );
715 fschmid 487
        textLabel5a = new QLabel(capsScaling, tr( "Sc&aling:" ), groupBox3a, "textLabel5a" );
488
        groupBox3aLayout->addWidget( textLabel5a, 0, 0 );
726 fschmid 489
        tabTypoLayout->addWidget( groupBox3a, 2, 0 );
715 fschmid 490
        groupBox4a = new QGroupBox( tabTypo, "groupBox4a" );
491
        groupBox4a->setColumnLayout(0, Qt::Vertical );
492
        groupBox4a->layout()->setSpacing( 6 );
493
        groupBox4a->layout()->setMargin( 11 );
494
        groupBox4a->setTitle( tr( "Other" ) );
495
        groupBox4aLayout = new QGridLayout( groupBox4a->layout() );
496
        groupBox4aLayout->setAlignment( Qt::AlignTop );
497
        baseGrid = new MSpinBox( 1, doc->PageH, groupBox4a, 1 );
498
        baseGrid->setSuffix( ein );
499
        baseGrid->setValue(doc->BaseGrid * UmReFaktor);
745 fschmid 500
        groupBox4aLayout->addWidget( baseGrid, 0, 1, Qt::AlignLeft );
715 fschmid 501
        textLabel6a = new QLabel(baseGrid, tr( "Baseline &Grid:" ),groupBox4a, "textLabel6a" );
502
        groupBox4aLayout->addWidget( textLabel6a, 0, 0 );
503
        baseOffset = new MSpinBox( 0, doc->PageH, groupBox4a, 1 );
504
        baseOffset->setSuffix( ein );
505
        baseOffset->setValue(doc->BaseOffs * UmReFaktor);
745 fschmid 506
        groupBox4aLayout->addWidget( baseOffset, 1, 1, Qt::AlignLeft );
715 fschmid 507
        textLabel7a = new QLabel(baseOffset, tr( "Baseline &Offset:" ),groupBox4a, "textLabel7a" );
508
        groupBox4aLayout->addWidget( textLabel7a, 1, 0 );
509
        autoLine = new QSpinBox( groupBox4a, "autoLine" );
510
        autoLine->setMaxValue( 100 );
511
        autoLine->setMinValue( 1 );
512
        autoLine->setValue( doc->AutoLine );
513
        autoLine->setSuffix( tr( " %" ) );
745 fschmid 514
        groupBox4aLayout->addWidget( autoLine, 2, 1, Qt::AlignLeft );
715 fschmid 515
        textLabel8a = new QLabel( autoLine, tr( "Automatic &Line Spacing:" ), groupBox4a, "textLabel8a" );
516
        groupBox4aLayout->addWidget( textLabel8a, 2, 0 );
726 fschmid 517
        tabTypoLayout->addWidget( groupBox4a, 3, 0 );
715 fschmid 518
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
519
 
726 fschmid 520
        tabTools = new QWidget( prefsWidgets, "tabTools" );
731 fschmid 521
        tabToolsLayout = new QHBoxLayout( tabTools, 11, 6, "tabToolsLayout");
522
        buttonGroupTools = new QButtonGroup( tabTools, "buttonGroupTools" );
734 fschmid 523
        buttonGroupTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, buttonGroupTools->sizePolicy().hasHeightForWidth() ) );
731 fschmid 524
        buttonGroupTools->setExclusive( true );
525
        buttonGroupTools->setRadioButtonExclusive( true );
526
        buttonGroupTools->setColumnLayout(0, Qt::Vertical );
527
        buttonGroupTools->layout()->setSpacing( 5 );
528
        buttonGroupTools->layout()->setMargin( 5 );
529
        buttonGroupTools->setTitle( QString::null );
530
        buttonGroupToolsLayout = new QVBoxLayout( buttonGroupTools->layout() );
531
        buttonGroupToolsLayout->setAlignment( Qt::AlignTop );
532
        toolText = new QToolButton( buttonGroupTools, "toolText" );
533
        toolText->setToggleButton( true );
534
        toolText->setText( QString::null );
535
        toolText->setIconSet( QIconSet( loadIcon("Text.xpm") ) );
536
        buttonGroupToolsLayout->addWidget( toolText );
537
        toolImage = new QToolButton( buttonGroupTools, "toolImage" );
538
        toolImage->setToggleButton( true );
539
        toolImage->setText( QString::null );
540
        toolImage->setIconSet( QIconSet( loadIcon("Bild.xpm") ) );
541
        buttonGroupToolsLayout->addWidget( toolImage );
542
        toolShape = new QToolButton( buttonGroupTools, "toolShape" );
543
        toolShape->setToggleButton( true );
544
        toolShape->setText( QString::null );
545
        toolShape->setIconSet( QIconSet( loadIcon("Rechtecke.xpm") ) );
546
        buttonGroupToolsLayout->addWidget( toolShape);
547
        toolPoly = new QToolButton( buttonGroupTools, "toolPoly" );
548
        toolPoly->setToggleButton( true );
549
        toolPoly->setText( QString::null );
550
        toolPoly->setIconSet( QIconSet( loadIcon("spline.png") ) );
551
        buttonGroupToolsLayout->addWidget( toolPoly );
552
        toolLine = new QToolButton( buttonGroupTools, "toolLine" );
553
        toolLine->setToggleButton( true );
554
        toolLine->setText( QString::null );
555
        toolLine->setIconSet( QIconSet( loadIcon("Stift.xpm") ) );
556
        buttonGroupToolsLayout->addWidget( toolLine );
557
        toolZoom = new QToolButton( buttonGroupTools, "toolZoom" );
558
        toolZoom->setToggleButton( true );
559
        toolZoom->setText( QString::null );
560
        toolZoom->setIconSet( QIconSet( loadIcon("Lupe.xpm") ) );
561
        buttonGroupToolsLayout->addWidget( toolZoom );
562
        tabToolsLayout->addWidget( buttonGroupTools );
563
        subStackTools = new QWidgetStack( tabTools, "subStackTools" );
734 fschmid 564
        subStackTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, subStackTools->sizePolicy().hasHeightForWidth() ) );
731 fschmid 565
        subStackTools->setFrameShape( QWidgetStack::GroupBoxPanel );
566
        subStackTools->setFrameShadow( QWidgetStack::Sunken );
745 fschmid 567
 
731 fschmid 568
        subTabText = new QWidget( subStackTools, "subTabText" );
569
        subTabTextLayout = new QGridLayout( subTabText, 1, 1, 11, 6, "subTabTextLayout");
726 fschmid 570
        fontComboText = new FontCombo(subTabText, prefsData);
571
        for (int fc=0; fc<fontComboText->count(); ++fc)
572
        {
573
                if (fontComboText->text(fc) == doc->Dfont)
574
                {
575
                        fontComboText->setCurrentItem(fc);
576
                        break;
577
                }
578
        }
745 fschmid 579
        subTabTextLayout->addMultiCellWidget( fontComboText, 0, 0, 1, 3, Qt::AlignLeft );
580
        textLabel1b = new QLabel( fontComboText, tr( "Font:" ), subTabText, "textLabel1b" );
581
        subTabTextLayout->addWidget( textLabel1b, 0, 0 );
726 fschmid 582
        sizeComboText = new QComboBox( true, subTabText, "SizeCombo" );
583
        sizeComboText->setEditable(false);
584
        QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"};
585
        size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes);
586
        for (uint s = 0; s < f_size; ++s)
587
                sizeComboText->insertItem(ar_sizes[s] + tr(" pt"));
588
        for (int a = 0; a < sizeComboText->count(); ++a)
589
        {
590
                if (sizeComboText->text(a).left(2).toInt() == doc->Dsize / 10)
591
                        sizeComboText->setCurrentItem(a);
592
        }
745 fschmid 593
        subTabTextLayout->addMultiCellWidget( sizeComboText, 1, 1, 1, 3, Qt::AlignLeft );
594
        textLabel2b = new QLabel(sizeComboText, tr( "Size:" ), subTabText, "textLabel2b" );
595
        subTabTextLayout->addWidget( textLabel2b, 1, 0 );
726 fschmid 596
        colorComboText = new QComboBox( true, subTabText, "colorComboText" );
597
        colorComboText->setEditable(false);
598
        QPixmap pmT2;
599
        pmT2 = QPixmap(15, 15);
600
        CListe::Iterator itc;
745 fschmid 601
        colorComboText->insertItem( tr("None"));
727 fschmid 602
        if (doc->DpenText == "None")
603
                colorComboText->setCurrentItem(colorComboText->count()-1);
726 fschmid 604
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
605
        {
606
                pmT2.fill(doc->PageColors[itc.key()].getRGBColor());
607
                colorComboText->insertItem(pmT2, itc.key());
608
                if (itc.key() == doc->DpenText)
609
                        colorComboText->setCurrentItem(colorComboText->count()-1);
610
        }
745 fschmid 611
        subTabTextLayout->addMultiCellWidget( colorComboText, 2, 2, 1, 3, Qt::AlignLeft );
612
        textLabel3b = new QLabel(colorComboText, tr( "Fill Color:" ), subTabText, "textLabel3b" );
613
        subTabTextLayout->addWidget( textLabel3b, 2, 0 );
614
        colorComboStrokeText = new QComboBox( true, subTabText, "colorComboStrokeText" );
615
        colorComboStrokeText->setEditable(false);
616
        colorComboStrokeText->insertItem( tr("None"));
617
        if (doc->DstrokeText == "None")
618
                colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
619
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
620
        {
621
                pmT2.fill(doc->PageColors[itc.key()].getRGBColor());
622
                colorComboStrokeText->insertItem(pmT2, itc.key());
623
                if (itc.key() == doc->DstrokeText)
624
                        colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
625
        }
626
        subTabTextLayout->addMultiCellWidget( colorComboStrokeText, 3, 3, 1, 3, Qt::AlignLeft );
627
        textLabel3b2 = new QLabel(colorComboStrokeText, tr( "Stroke Color:" ), subTabText, "textLabel3b2" );
628
        subTabTextLayout->addWidget( textLabel3b2, 3, 0 );
629
        columnsText = new QSpinBox( subTabText, "columnsText" );
630
        columnsText->setMinValue( 1 );
631
        columnsText->setMaxValue(100);
632
        columnsText->setValue(doc->DCols);
633
        subTabTextLayout->addWidget( columnsText, 4, 1, Qt::AlignLeft );
634
        textLabel4b = new QLabel(columnsText, tr("Colu&mns:"), subTabText, "TextCol");
635
        subTabTextLayout->addWidget( textLabel4b, 4, 0 );
726 fschmid 636
        gapText = new MSpinBox( 0, 200, subTabText, decimals );
637
        gapText->setSuffix( tr( " pt" ) );
734 fschmid 638
        gapText->setValue(doc->DGap * UmReFaktor);
745 fschmid 639
        subTabTextLayout->addWidget( gapText, 4, 3, Qt::AlignLeft );
726 fschmid 640
        textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol");
745 fschmid 641
        subTabTextLayout->addWidget( textLabel5b, 4, 2 );
642
        previewText = new QLabel( tr( "Woven silk pyjamas exchanged for blue quartz" ), subTabText, "previewText" );
643
        previewText->setMinimumSize( QSize( 280, 70 ) );
644
        previewText->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
645
        subTabTextLayout->addMultiCellWidget( previewText, 5, 5, 0, 3 );
731 fschmid 646
        subStackTools->addWidget( subTabText, 0 );
726 fschmid 647
 
731 fschmid 648
        subTabShape = new QWidget( subStackTools, "subTabShape" );
649
        subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
745 fschmid 650
        subTabShapeLayout->setAlignment( Qt::AlignTop );
727 fschmid 651
        colorComboLineShape = new QComboBox( true, subTabShape, "colorComboLineShape" );
652
        colorComboLineShape->setEditable(false);
653
        colorComboLineShape->insertItem( tr("None"));
654
        if (doc->Dpen == "None")
655
                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
656
        QPixmap pm2S = QPixmap(15, 15);
657
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
658
        {
659
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
660
                colorComboLineShape->insertItem(pm2S, itc.key());
661
                if (itc.key() == doc->Dpen)
662
                        colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
663
        }
745 fschmid 664
        subTabShapeLayout->addWidget( colorComboLineShape, 0, 1, Qt::AlignLeft );
727 fschmid 665
        textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" );
731 fschmid 666
        subTabShapeLayout->addWidget( textLabel7b, 0, 0 );
667
        shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" );
668
        shadingLineShape->setMaxValue( 100 );
669
        shadingLineShape->setSuffix( tr( " %" ) );
727 fschmid 670
        shadingLineShape->setMinValue( 0 );
671
        shadingLineShape->setValue(doc->Dshade2);
731 fschmid 672
        subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
727 fschmid 673
        textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
731 fschmid 674
        subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
727 fschmid 675
        comboFillShape = new QComboBox( true, subTabShape, "comboFillShape" );
676
        comboFillShape->setEditable(false);
677
        comboFillShape->insertItem( tr("None"));
678
        if (doc->Dbrush == "None")
679
                comboFillShape->setCurrentItem(comboFillShape->count()-1);
680
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
681
        {
682
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
683
                comboFillShape->insertItem(pm2S, itc.key());
684
                if (itc.key() == doc->Dbrush)
685
                        comboFillShape->setCurrentItem(comboFillShape->count()-1);
686
        }
745 fschmid 687
        subTabShapeLayout->addWidget( comboFillShape, 2, 1, Qt::AlignLeft );
727 fschmid 688
        textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" );
731 fschmid 689
        subTabShapeLayout->addWidget( textLabel9b, 2, 0 );
690
        shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" );
691
        shadingFillShape->setMaxValue( 100 );
692
        shadingFillShape->setSuffix( tr( " %" ) );
727 fschmid 693
        shadingFillShape->setMinValue( 0 );
694
        shadingFillShape->setValue(doc->Dshade);
731 fschmid 695
        subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft );
727 fschmid 696
        textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" );
731 fschmid 697
        subTabShapeLayout->addWidget( textLabel10b, 3, 0 );
727 fschmid 698
        comboStyleShape = new LineCombo(subTabShape);
699
        comboStyleShape->setEditable(false);
700
        switch (doc->DLineArt)
701
        {
702
        case SolidLine:
703
                comboStyleShape->setCurrentItem(0);
704
                break;
705
        case DashLine:
706
                comboStyleShape->setCurrentItem(1);
707
                break;
708
        case DotLine:
709
                comboStyleShape->setCurrentItem(2);
710
                break;
711
        case DashDotLine:
712
                comboStyleShape->setCurrentItem(3);
713
                break;
714
        case DashDotDotLine:
715
                comboStyleShape->setCurrentItem(4);
716
                break;
717
        default:
718
                comboStyleShape->setCurrentItem(0);
719
                break;
720
        }
745 fschmid 721
        subTabShapeLayout->addWidget( comboStyleShape, 4, 1, Qt::AlignLeft );
727 fschmid 722
        textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" );
731 fschmid 723
        subTabShapeLayout->addWidget( textLabel11b, 4, 0 );
727 fschmid 724
        lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 );
725
        lineWidthShape->setSuffix( tr( " pt" ) );
726
        lineWidthShape->setValue(doc->Dwidth);
731 fschmid 727
        subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft );
727 fschmid 728
        textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" );
731 fschmid 729
        subTabShapeLayout->addWidget( textLabel12b, 5, 0 );
730
        subStackTools->addWidget( subTabShape, 1 );
727 fschmid 731
 
731 fschmid 732
        subTabLine = new QWidget( subStackTools, "subTabLine" );
733
        subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
745 fschmid 734
        subTabLineLayout->setAlignment( Qt::AlignTop );
731 fschmid 735
        colorComboLine = new QComboBox( true, subTabLine, "colorComboLine" );
736
        colorComboLine->setEditable(false);
737
        QPixmap pm2L = QPixmap(15, 15);
738
        comboFillShape->insertItem( tr("None"));
739
        if (doc->DpenLine == "None")
740
                colorComboLine->setCurrentItem(colorComboLine->count()-1);
741
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
742
        {
743
                pm2L.fill(doc->PageColors[itc.key()].getRGBColor());
744
                colorComboLine->insertItem(pm2L, itc.key());
745
                if (itc.key() == doc->DpenLine)
746
                        colorComboLine->setCurrentItem(colorComboLine->count()-1);
747
        }
745 fschmid 748
        subTabLineLayout->addMultiCellWidget( colorComboLine, 0, 0, 1, 2, Qt::AlignLeft );
731 fschmid 749
        textLabel13b = new QLabel(colorComboLine, tr("&Line Color:"), subTabLine, "textLabel13b" );
750
        subTabLineLayout->addWidget( textLabel13b, 0, 0 );
751
        shadingLine = new QSpinBox( subTabLine, "shadingLine" );
752
        shadingLine->setMaxValue( 100 );
753
        shadingLine->setValue(doc->DshadeLine);
754
        shadingLine->setSuffix( tr( " %" ) );
745 fschmid 755
        subTabLineLayout->addMultiCellWidget( shadingLine, 1, 1, 1, 2, Qt::AlignLeft );
731 fschmid 756
        textLabel14b = new QLabel(shadingLine, tr("&Shading:"), subTabLine, "textLabel14b" );
757
        subTabLineLayout->addWidget( textLabel14b, 1, 0 );
758
        comboStyleLine = new LineCombo(subTabLine);
759
        comboStyleLine->setEditable(false);
760
        switch (doc->DLstyleLine)
761
        {
762
        case SolidLine:
763
                comboStyleLine->setCurrentItem(0);
764
                break;
765
        case DashLine:
766
                comboStyleLine->setCurrentItem(1);
767
                break;
768
        case DotLine:
769
                comboStyleLine->setCurrentItem(2);
770
                break;
771
        case DashDotLine:
772
                comboStyleLine->setCurrentItem(3);
773
                break;
774
        case DashDotDotLine:
775
                comboStyleLine->setCurrentItem(4);
776
                break;
777
        default:
778
                comboStyleLine->setCurrentItem(0);
779
                break;
780
        }
745 fschmid 781
        subTabLineLayout->addMultiCellWidget( comboStyleLine, 2, 2, 1, 2, Qt::AlignLeft );
731 fschmid 782
        textLabel15b = new QLabel(subTabLine, tr("Line S&tyle:"), subTabLine, "textLabel15b" );
783
        subTabLineLayout->addWidget( textLabel15b, 2, 0 );
745 fschmid 784
        startArrow = new ArrowChooser(subTabLine, true);
785
        subTabLineLayout->addWidget( startArrow, 4, 1 );
786
        endArrow = new ArrowChooser(subTabLine, false);
787
        subTabLineLayout->addWidget( endArrow, 4, 2 );
788
        startArrow->rebuildList(doc);
789
        endArrow->rebuildList(doc);
790
        startArrow->setCurrentItem(doc->DstartArrow);
791
        endArrow->setCurrentItem(doc->DendArrow);
792
        arrowText = new QLabel( tr( "Arrows:" ), subTabLine, "arrowText" );
793
        subTabLineLayout->addMultiCellWidget( arrowText, 3, 4, 0, 0 );
794
        startArrowText = new QLabel( startArrow, tr( "Start:" ), subTabLine, "startArrowText" );
795
        subTabLineLayout->addWidget( startArrowText, 3, 1 );
796
        endArrowText = new QLabel( endArrow, tr( "End:" ), subTabLine, "endArrowText" );
797
        subTabLineLayout->addWidget( endArrowText, 3, 2 );
731 fschmid 798
        lineWidthLine = new MSpinBox( 1, 36, subTabLine, 1 );
799
        lineWidthLine->setSuffix( tr( " pt" ) );
800
        lineWidthLine->setValue(doc->DwidthLine);
745 fschmid 801
        subTabLineLayout->addMultiCellWidget( lineWidthLine, 5, 5, 1, 2, Qt::AlignLeft );
731 fschmid 802
        textLabel16b = new QLabel(lineWidthLine, tr("Line &Width:"), subTabLine, "textLabel16b" );
745 fschmid 803
        subTabLineLayout->addWidget( textLabel16b, 5, 0 );
731 fschmid 804
        subStackTools->addWidget( subTabLine, 2 );
727 fschmid 805
 
731 fschmid 806
        subTabImage = new QWidget( subStackTools, "subTabImage" );
807
        subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout");
745 fschmid 808
        subTabImageLayout->setAlignment( Qt::AlignTop );
731 fschmid 809
        buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" );
810
        buttonGroup3->setCheckable( true );
811
        buttonGroup3->setChecked( doc->ScaleType );
812
        buttonGroup3->setColumnLayout(0, Qt::Vertical );
813
        buttonGroup3->layout()->setSpacing( 6 );
814
        buttonGroup3->layout()->setMargin( 11 );
815
        buttonGroup3->setTitle( tr( "&Free Scaling" ) );
816
        buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
817
        buttonGroup3Layout->setAlignment( Qt::AlignTop );
818
        scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" );
819
        scalingHorizontal->setMaxValue( 1000 );
820
        scalingHorizontal->setMinValue( 1 );
821
        scalingHorizontal->setValue(qRound(doc->ScaleX * 100));
822
        scalingHorizontal->setSuffix( tr( " %" ) );
823
        buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1, Qt::AlignRight );
824
        textLabel17b = new QLabel(scalingHorizontal, tr("&Horizontal Scaling:"), buttonGroup3, "textLabel17b" );
825
        buttonGroup3Layout->addWidget( textLabel17b, 0, 0 );
826
        scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" );
827
        scalingVertical->setMaxValue( 1000 );
828
        scalingVertical->setMinValue( 1 );
829
        scalingVertical->setSuffix( tr( " %" ) );
830
        scalingVertical->setValue(qRound(doc->ScaleY * 100));
831
        buttonGroup3Layout->addWidget( scalingVertical, 1, 1, Qt::AlignRight );
832
        textLabel18b = new QLabel(scalingVertical, tr( "&Vertical Scaling:" ), buttonGroup3, "textLabel18b" );
833
        buttonGroup3Layout->addWidget( textLabel18b, 1, 0 );
726 fschmid 834
        chainButton = new LinkButton( buttonGroup3 );
835
        chainButton->setToggleButton( true );
836
        chainButton->setAutoRaise(true);
731 fschmid 837
        buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft );
838
        subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 );
839
        buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" );
840
        buttonGroup5->setCheckable( true );
841
        buttonGroup5->setChecked( !doc->ScaleType );
842
        buttonGroup5->setColumnLayout(0, Qt::Vertical );
843
        buttonGroup5->layout()->setSpacing( 6 );
844
        buttonGroup5->layout()->setMargin( 11 );
845
        buttonGroup5->setTitle( tr( "&Scale Picture to Frame Size" ) );
846
        buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() );
847
        buttonGroup5Layout->setAlignment( Qt::AlignTop );
848
        checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" );
849
        checkRatioImage->setText( tr( "Keep Aspect &Ratio" ) );
850
        checkRatioImage->setChecked(doc->AspectRatio);
851
        buttonGroup5Layout->addWidget( checkRatioImage );
852
        subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
853
        comboFillImage = new QComboBox( true, subTabImage, "comboFillImage" );
854
        comboFillImage->setEditable(false);
855
        QPixmap pm2I = QPixmap(15, 15);
856
        comboFillImage->insertItem( tr("None"));
857
        if (doc->DbrushPict == "None")
858
                comboFillImage->setCurrentItem(comboFillImage->count()-1);
859
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
860
        {
861
                pm2I.fill(doc->PageColors[itc.key()].getRGBColor());
862
                comboFillImage->insertItem(pm2I, itc.key());
863
                if (itc.key() == doc->DbrushPict)
864
                        comboFillImage->setCurrentItem(comboFillImage->count()-1);
865
        }
745 fschmid 866
        subTabImageLayout->addWidget( comboFillImage, 2, 1, Qt::AlignLeft );
731 fschmid 867
        textLabel19b = new QLabel(comboFillImage, tr( "F&ill Color:" ), subTabImage, "textLabel19b" );
868
        subTabImageLayout->addWidget( textLabel19b, 2, 0 );
869
        shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" );
870
        shadingFillImage->setMaxValue( 100 );
871
        shadingFillImage->setValue( doc->ShadePict );
872
        shadingFillImage->setSuffix( tr( " %" ) );
873
        subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft );
874
        textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" );
875
        subTabImageLayout->addWidget( textLabel20b, 3, 0 );
876
        subStackTools->addWidget( subTabImage, 3 );
727 fschmid 877
 
731 fschmid 878
        subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
879
        subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout");
745 fschmid 880
        subTabPolygonLayout->setAlignment( Qt::AlignTop );
731 fschmid 881
        polyWidget = new PolygonWidget(subTabPolygon, doc->PolyC, doc->PolyFd, doc->PolyF, doc->PolyS, doc->PolyR);
882
        subTabPolygonLayout->addWidget( polyWidget );
883
        subStackTools->addWidget( subTabPolygon, 4 );
727 fschmid 884
 
731 fschmid 885
        subTabZoom = new QWidget( subStackTools, "subTabZoom" );
886
        subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout");
745 fschmid 887
        subTabZoomLayout->setAlignment( Qt::AlignTop );
731 fschmid 888
        minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" );
889
        minimumZoom->setMaxValue( 3200 );
890
        minimumZoom->setMinValue( 10 );
727 fschmid 891
        minimumZoom->setValue(doc->MagMin);
731 fschmid 892
        minimumZoom->setSuffix( tr( " %" ) );
745 fschmid 893
        subTabZoomLayout->addWidget( minimumZoom, 0, 1, Qt::AlignLeft );
727 fschmid 894
        textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" );
745 fschmid 895
        subTabZoomLayout->addWidget( textLabel21b, 0, 0);
731 fschmid 896
        maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" );
897
        maximumZoom->setMaxValue( 3200 );
898
        maximumZoom->setMinValue( 10 );
727 fschmid 899
        maximumZoom->setValue(doc->MagMax);
731 fschmid 900
        maximumZoom->setSuffix( tr( " %" ) );
745 fschmid 901
        subTabZoomLayout->addWidget( maximumZoom, 1, 1, Qt::AlignLeft );
727 fschmid 902
        textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" );
745 fschmid 903
        subTabZoomLayout->addWidget( textLabel22b, 1, 0 );
731 fschmid 904
        zoomStep = new QSpinBox( subTabZoom, "zoomStep" );
905
        zoomStep->setMaxValue( 200 );
906
        zoomStep->setMinValue( 1 );
907
        zoomStep->setLineStep( 25 );
908
        zoomStep->setValue( doc->MagStep );
909
        zoomStep->setSuffix( tr( " %" ) );
745 fschmid 910
        subTabZoomLayout->addWidget( zoomStep, 2, 1, Qt::AlignLeft );
727 fschmid 911
        textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" );
745 fschmid 912
        subTabZoomLayout->addWidget( textLabel23b, 2, 0 );
731 fschmid 913
        subStackTools->addWidget( subTabZoom, 5 );
914
        tabToolsLayout->addWidget( subStackTools );
726 fschmid 915
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
916
 
734 fschmid 917
        tabMisc = new QWidget( prefsWidgets, "tabMisc" );
918
        tabMiscLayout = new QVBoxLayout( tabMisc, 11, 6, "tabMiscLayout");
919
        groupAutoSave = new QGroupBox( tabMisc, "groupAutoSave" );
920
        groupAutoSave->setTitle( tr( "Autosave" ) );
921
        groupAutoSave->setCheckable( true );
922
        groupAutoSave->setChecked( doc->AutoSave );
923
        groupAutoSave->setColumnLayout(0, Qt::Vertical );
924
        groupAutoSave->layout()->setSpacing( 6 );
925
        groupAutoSave->layout()->setMargin( 11 );
926
        groupAutoSaveLayout = new QHBoxLayout( groupAutoSave->layout() );
927
        groupAutoSaveLayout->setAlignment( Qt::AlignTop );
928
        autoSaveTime = new QSpinBox( groupAutoSave, "autoSaveTime" );
929
        autoSaveTime->setMinValue( 1 );
930
        autoSaveTime->setMaxValue( 60 );
931
        autoSaveTime->setSuffix( " " + tr("min") );
932
        autoSaveTime->setValue(doc->AutoSaveTime / 1000 / 60);
933
        groupAutoSaveLayout->addWidget( autoSaveTime );
934
        textLabel1m = new QLabel(autoSaveTime, tr( "&Interval:" ), groupAutoSave, "textLabel1m" );
935
        groupAutoSaveLayout->addWidget( textLabel1m );
936
        tabMiscLayout->addWidget( groupAutoSave );
937
        groupUnit = new QGroupBox( tabMisc, "groupUnit" );
938
        groupUnit->setTitle( tr( "Units" ) );
939
        groupUnit->setColumnLayout(0, Qt::Vertical );
940
        groupUnit->layout()->setSpacing( 6 );
941
        groupUnit->layout()->setMargin( 11 );
942
        groupUnitLayout = new QHBoxLayout( groupUnit->layout() );
943
        groupUnitLayout->setAlignment( Qt::AlignTop );
944
        unitCombo = new QComboBox( true, groupUnit, "unitCombo" );
945
        unitCombo->insertItem( tr( "Points (pt)" ) );
946
        unitCombo->insertItem( tr( "Millimetres (mm)" ) );
947
        unitCombo->insertItem( tr( "Inches (in)" ) );
948
        unitCombo->insertItem( tr( "Picas (p)" ) );
949
        unitCombo->setEditable(false);
950
        unitCombo->setCurrentItem(doc->Einheit);
951
        groupUnitLayout->addWidget( unitCombo );
952
        tabMiscLayout->addWidget( groupUnit );
953
        addItem(  tr("Misc."), loadIcon("misc.png"), tabMisc);
954
 
726 fschmid 955
        rightR->setMaxValue(pageWidth - leftR->value());
956
        leftR->setMaxValue(pageWidth - rightR->value());
957
        topR->setMaxValue(pageHeight - bottomR->value());
958
        bottomR->setMaxValue(pageHeight - topR->value());
959
        toolText->setOn(true);
727 fschmid 960
        setSample();
249 Franz 961
        //tooltips
726 fschmid 962
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
963
        QToolTip::add( firstPage, tr( "Make the first page the left page of the document" ) );
964
        QToolTip::add( topR, tr( "Distance between the top margin guide and the edge of the page" ) );
965
        QToolTip::add( bottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
966
        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" ) );
967
        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 968
 
249 Franz 969
        // signals and slots connections
726 fschmid 970
        connect( facingPages, SIGNAL( clicked() ), this, SLOT( setDS() ) );
693 fschmid 971
        connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
972
        connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
726 fschmid 973
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
974
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
975
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
976
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
705 fschmid 977
        connect(majorGridColor, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
978
        connect(minorGridColor, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
979
        connect(baselineColor, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
980
        connect(guideColor, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
981
        connect(marginColor, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
982
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
727 fschmid 983
        connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool()));
984
        connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool()));
985
        connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool()));
986
        connect(toolText, SIGNAL(clicked()), this, SLOT(setTool()));
987
        connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool()));
988
        connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool()));
989
        connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
990
        connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
991
        connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int)));
992
        connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int)));
731 fschmid 993
        connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
994
        connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
995
        connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
734 fschmid 996
        connect(unitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
731 fschmid 997
 
693 fschmid 998
        prefsWidgets->raiseWidget(0);
999
        resize( minimumSizeHint() );
735 fschmid 1000
        arrangeIcons();
693 fschmid 1001
        clearWState( WState_Polished );
3 paul 1002
}
1003
 
734 fschmid 1004
void ReformDoc::unitChange()
1005
{
1006
        disconnect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1007
        disconnect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1008
        disconnect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1009
        disconnect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1010
        int decimalsOld;
1011
        double AltUmrech = Umrech;
1012
        double oldMin, oldMax, val;
1013
        QString einh;
1014
        einheit = unitCombo->currentItem();
1015
        switch (unitCombo->currentItem())
1016
        {
1017
        case 0:
1018
                Umrech = 1.0;
1019
                decimals = 100;
1020
                einh = tr( " pt" );
1021
                break;
1022
        case 1:
1023
                Umrech = 0.3527777;
1024
                decimals = 1000;
1025
                einh = tr( " mm" );
1026
                break;
1027
        case 2:
1028
                Umrech = 1.0 / 72.0;
1029
                decimals = 10000;
1030
                einh = tr( " in" );
1031
                break;
1032
        case 3:
1033
                Umrech = 1.0 / 12.0;
1034
                decimals = 100;
1035
                einh = tr( " p" );
1036
                break;
1037
        }
1038
        widthMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1039
        widthMSpinBox->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, docc->PageB * Umrech);
1040
        widthMSpinBox->setSuffix(einh);
1041
        heightMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1042
        heightMSpinBox->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, docc->PageH * Umrech);
1043
        heightMSpinBox->setSuffix(einh);
1044
        topR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1045
        topR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1046
        topR->setSuffix(einh);
1047
        bottomR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1048
        bottomR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1049
        bottomR->setSuffix(einh);
1050
        leftR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1051
        leftR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1052
        leftR->setSuffix(einh);
1053
        rightR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1054
        rightR->setValues(0, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1055
        rightR->setSuffix(einh);
1056
        minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1057
        minorSpace->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1058
        minorSpace->setSuffix(einh);
1059
        majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1060
        majorSpace->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1061
        majorSpace->setSuffix(einh);
1062
        snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1063
        snapDistance->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1064
        snapDistance->setSuffix(einh);
1065
        baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1066
        baseGrid->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1067
        baseGrid->setSuffix(einh);
1068
        baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1069
        baseOffset->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1070
        baseOffset->setSuffix(einh);
1071
        gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1072
        gapText->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1073
        gapText->setSuffix(einh);
1074
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1075
        topScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1076
        topScratch->setSuffix(einh);
1077
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1078
        bottomScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1079
        bottomScratch->setSuffix(einh);
1080
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1081
        leftScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1082
        leftScratch->setSuffix(einh);
1083
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1084
        rightScratch->setValues(oldMin / AltUmrech * Umrech, oldMax / AltUmrech * Umrech, decimals, val / AltUmrech * Umrech);
1085
        rightScratch->setSuffix(einh);
1086
        pageWidth = docc->PageB * Umrech;
1087
        pageHeight = docc->PageH * Umrech;
1088
        rightR->setMaxValue(pageWidth - leftR->value());
1089
        leftR->setMaxValue(pageWidth - rightR->value());
1090
        topR->setMaxValue(pageHeight - bottomR->value());
1091
        bottomR->setMaxValue(pageHeight - topR->value());
1092
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1093
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1094
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1095
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1096
}
1097
 
731 fschmid 1098
/*!
1099
 \fn void ReformDoc::ToggleKette()
1100
 \author Franz Schmid
1101
 \date  
1102
 \brief ReformDoc (Tools, Image Frame), Sets Y Scale value from X Scale value when chain is toggled
1103
 \param None
1104
 \retval None
1105
 */
1106
void ReformDoc::toggleChain()
1107
{
1108
        if (chainButton->isOn())
1109
                scalingVertical->setValue(scalingHorizontal->value());
1110
}
1111
 
1112
/*!
1113
 \fn void ReformDoc::HChange()
1114
 \author Franz Schmid
1115
 \date  
1116
 \brief ReformDoc (Tools, Image Frame), Sets Y Scale value from X Scale value when X Scale value is changed
1117
 \param None
1118
 \retval None
1119
 */
1120
void ReformDoc::hChange()
1121
{
1122
        if (chainButton->isOn())
1123
                scalingVertical->setValue(scalingHorizontal->value());
1124
}
1125
 
1126
/*!
1127
 \fn void ReformDoc::vChange()
1128
 \author Franz Schmid
1129
 \date  
1130
 \brief ReformDoc (Tools, Image Frame). Sets X Scale value from Y Scale value when Y Scale value is changed
1131
 \param None
1132
 \retval None
1133
 */
1134
void ReformDoc::vChange()
1135
{
1136
        if (chainButton->isOn())
1137
                scalingHorizontal->setValue(scalingVertical->value());
1138
}
1139
 
727 fschmid 1140
void ReformDoc::changeImageScalingFree(int)
1141
{
1142
        if (buttonGroup3->isChecked())
1143
                buttonGroup5->setChecked(false);
1144
        else
1145
                buttonGroup5->setChecked(true);
1146
}
1147
 
1148
void ReformDoc::changeImageScalingRatio(int)
1149
{
1150
        if (buttonGroup5->isChecked())
1151
                buttonGroup3->setChecked(false);
1152
        else
1153
                buttonGroup3->setChecked(true);
1154
}
1155
 
726 fschmid 1156
/*!
1157
 \fn void ReformDoc::SetSample()
1158
 \author Franz Schmid
1159
 \date  
1160
 \brief ReformDoc (Tools, Text frame), Sets the sample text in selected font in text frame preferences
1161
 \param None
1162
 \retval None
1163
 */
727 fschmid 1164
void ReformDoc::setSample()
726 fschmid 1165
{
1166
        QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" );
1167
        QString da = (*fon)[fontComboText->currentText()]->Datei;
1168
        int s = sizeComboText->currentText().left(2).toInt();
1169
        QPixmap pm = fontSamples(da, s, ts, paletteBackgroundColor());
1170
        previewText->setPixmap(pm);
1171
}
1172
 
1173
/*!
1174
 \fn void ReformDoc::SetTool()
1175
 \author Franz Schmid
1176
 \date  
1177
 \brief ReformDoc (Tools), Raises widget for selected Tool properties
1178
 \param None
1179
 \retval None
1180
 */
727 fschmid 1181
void ReformDoc::setTool()
726 fschmid 1182
{
1183
        if (toolText == sender())
1184
                subStackTools->raiseWidget(0);
1185
        if (toolShape == sender())
1186
                subStackTools->raiseWidget(1);
1187
        if (toolLine == sender())
1188
                subStackTools->raiseWidget(2);
1189
        if (toolImage == sender())
1190
                subStackTools->raiseWidget(3);
1191
        if (toolPoly == sender())
1192
                subStackTools->raiseWidget(4);
1193
        if (toolZoom == sender())
1194
                subStackTools->raiseWidget(5);
1195
}
1196
 
705 fschmid 1197
void ReformDoc::changeMajorColor()
1198
{
1199
        QColor neu = QColor();
1200
        neu = QColorDialog::getColor(colorMajorGrid, this);
1201
        if (neu.isValid())
1202
        {
1203
                QPixmap pm = QPixmap(54, 14);
1204
                pm.fill(neu);
1205
                colorMajorGrid = neu;
1206
                majorGridColor->setPixmap(pm);
1207
        }
1208
}
1209
 
1210
void ReformDoc::changeMinorColor()
1211
{
1212
        QColor neu = QColor();
1213
        neu = QColorDialog::getColor(colorMinorGrid, this);
1214
        if (neu.isValid())
1215
        {
1216
                QPixmap pm = QPixmap(54, 14);
1217
                pm.fill(neu);
1218
                colorMinorGrid = neu;
1219
                minorGridColor->setPixmap(pm);
1220
        }
1221
}
1222
 
1223
void ReformDoc::changePaperColor()
1224
{
1225
        QColor neu = QColor();
1226
        neu = QColorDialog::getColor(colorPaper, this);
1227
        if (neu.isValid())
1228
        {
1229
                QPixmap pm = QPixmap(54, 14);
1230
                pm.fill(neu);
1231
                colorPaper = neu;
1232
                backColor->setPixmap(pm);
1233
        }
1234
}
1235
 
1236
void ReformDoc::changeBaselineColor()
1237
{
1238
        QColor neu = QColor();
1239
        neu = QColorDialog::getColor(colorBaselineGrid, this);
1240
        if (neu.isValid())
1241
        {
1242
                QPixmap pm = QPixmap(54, 14);
1243
                pm.fill(neu);
1244
                colorBaselineGrid = neu;
1245
                baselineColor->setPixmap(pm);
1246
        }
1247
}
1248
 
1249
void ReformDoc::changeGuideColor()
1250
{
1251
        QColor neu = QColor();
1252
        neu = QColorDialog::getColor(colorGuides, this);
1253
        if (neu.isValid())
1254
        {
1255
                QPixmap pm = QPixmap(54, 14);
1256
                pm.fill(neu);
1257
                colorGuides = neu;
1258
                guideColor->setPixmap(pm);
1259
        }
1260
}
1261
 
1262
void ReformDoc::changeMarginColor()
1263
{
1264
        QColor neu = QColor();
1265
        neu = QColorDialog::getColor(colorMargin, this);
1266
        if (neu.isValid())
1267
        {
1268
                QPixmap pm = QPixmap(54, 14);
1269
                pm.fill(neu);
1270
                colorMargin = neu;
1271
                marginColor->setPixmap(pm);
1272
        }
1273
}
1274
 
693 fschmid 1275
void ReformDoc::setTop(int )
36 Franz 1276
{
726 fschmid 1277
        bottomR->setMaxValue(pageHeight - topR->value());
36 Franz 1278
}
3 paul 1279
 
693 fschmid 1280
void ReformDoc::setBottom(int )
36 Franz 1281
{
726 fschmid 1282
        topR->setMaxValue(pageHeight - bottomR->value());
36 Franz 1283
}
1284
 
693 fschmid 1285
void ReformDoc::setLeft(int )
36 Franz 1286
{
726 fschmid 1287
        rightR->setMaxValue(pageWidth - leftR->value());
36 Franz 1288
}
1289
 
693 fschmid 1290
void ReformDoc::setRight(int )
36 Franz 1291
{
726 fschmid 1292
        leftR->setMaxValue(pageWidth - rightR->value());
36 Franz 1293
}
1294
 
3 paul 1295
void ReformDoc::setDS()
1296
{
726 fschmid 1297
        if (facingPages->isChecked())
249 Franz 1298
        {
340 Franz 1299
                Links->setText( tr( "&Inside:" ) );
1300
                Rechts->setText( tr( "&Outside:" ) );
726 fschmid 1301
                firstPage->setEnabled(true);
249 Franz 1302
        }
1303
        else
1304
        {
340 Franz 1305
                Links->setText( tr( "&Left:" ) );
1306
                Rechts->setText( tr( "&Right:" ) );
726 fschmid 1307
                firstPage->setEnabled(false);
249 Franz 1308
        }
348 Franz 1309
}