Subversion Repositories Scribus

Rev

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