Subversion Repositories Scribus

Rev

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