Subversion Repositories Scribus

Rev

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