Subversion Repositories Scribus

Rev

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