Subversion Repositories Scribus

Rev

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