Subversion Repositories Scribus

Rev

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