Subversion Repositories Scribus

Rev

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