Subversion Repositories Scribus

Rev

Rev 1065 | Rev 1194 | 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 );
715 fschmid 291
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
292
 
823 fschmid 293
        tabTypo = new TabTypograpy(  prefsWidgets, &doc->typographicSetttings, UmReFaktor, ein);
715 fschmid 294
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
295
 
726 fschmid 296
        tabTools = new QWidget( prefsWidgets, "tabTools" );
731 fschmid 297
        tabToolsLayout = new QHBoxLayout( tabTools, 11, 6, "tabToolsLayout");
298
        buttonGroupTools = new QButtonGroup( tabTools, "buttonGroupTools" );
734 fschmid 299
        buttonGroupTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, buttonGroupTools->sizePolicy().hasHeightForWidth() ) );
731 fschmid 300
        buttonGroupTools->setExclusive( true );
301
        buttonGroupTools->setRadioButtonExclusive( true );
302
        buttonGroupTools->setColumnLayout(0, Qt::Vertical );
303
        buttonGroupTools->layout()->setSpacing( 5 );
304
        buttonGroupTools->layout()->setMargin( 5 );
305
        buttonGroupTools->setTitle( QString::null );
306
        buttonGroupToolsLayout = new QVBoxLayout( buttonGroupTools->layout() );
307
        buttonGroupToolsLayout->setAlignment( Qt::AlignTop );
308
        toolText = new QToolButton( buttonGroupTools, "toolText" );
309
        toolText->setToggleButton( true );
310
        toolText->setText( QString::null );
311
        toolText->setIconSet( QIconSet( loadIcon("Text.xpm") ) );
312
        buttonGroupToolsLayout->addWidget( toolText );
313
        toolImage = new QToolButton( buttonGroupTools, "toolImage" );
314
        toolImage->setToggleButton( true );
315
        toolImage->setText( QString::null );
316
        toolImage->setIconSet( QIconSet( loadIcon("Bild.xpm") ) );
317
        buttonGroupToolsLayout->addWidget( toolImage );
318
        toolShape = new QToolButton( buttonGroupTools, "toolShape" );
319
        toolShape->setToggleButton( true );
320
        toolShape->setText( QString::null );
321
        toolShape->setIconSet( QIconSet( loadIcon("Rechtecke.xpm") ) );
322
        buttonGroupToolsLayout->addWidget( toolShape);
323
        toolPoly = new QToolButton( buttonGroupTools, "toolPoly" );
324
        toolPoly->setToggleButton( true );
325
        toolPoly->setText( QString::null );
326
        toolPoly->setIconSet( QIconSet( loadIcon("spline.png") ) );
327
        buttonGroupToolsLayout->addWidget( toolPoly );
328
        toolLine = new QToolButton( buttonGroupTools, "toolLine" );
329
        toolLine->setToggleButton( true );
330
        toolLine->setText( QString::null );
331
        toolLine->setIconSet( QIconSet( loadIcon("Stift.xpm") ) );
332
        buttonGroupToolsLayout->addWidget( toolLine );
333
        toolZoom = new QToolButton( buttonGroupTools, "toolZoom" );
334
        toolZoom->setToggleButton( true );
335
        toolZoom->setText( QString::null );
336
        toolZoom->setIconSet( QIconSet( loadIcon("Lupe.xpm") ) );
337
        buttonGroupToolsLayout->addWidget( toolZoom );
338
        tabToolsLayout->addWidget( buttonGroupTools );
339
        subStackTools = new QWidgetStack( tabTools, "subStackTools" );
734 fschmid 340
        subStackTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, subStackTools->sizePolicy().hasHeightForWidth() ) );
731 fschmid 341
        subStackTools->setFrameShape( QWidgetStack::GroupBoxPanel );
342
        subStackTools->setFrameShadow( QWidgetStack::Sunken );
782 fschmid 343
 
731 fschmid 344
        subTabText = new QWidget( subStackTools, "subTabText" );
345
        subTabTextLayout = new QGridLayout( subTabText, 1, 1, 11, 6, "subTabTextLayout");
726 fschmid 346
        fontComboText = new FontCombo(subTabText, prefsData);
347
        for (int fc=0; fc<fontComboText->count(); ++fc)
348
        {
349
                if (fontComboText->text(fc) == doc->Dfont)
350
                {
351
                        fontComboText->setCurrentItem(fc);
352
                        break;
353
                }
354
        }
745 fschmid 355
        subTabTextLayout->addMultiCellWidget( fontComboText, 0, 0, 1, 3, Qt::AlignLeft );
356
        textLabel1b = new QLabel( fontComboText, tr( "Font:" ), subTabText, "textLabel1b" );
357
        subTabTextLayout->addWidget( textLabel1b, 0, 0 );
726 fschmid 358
        sizeComboText = new QComboBox( true, subTabText, "SizeCombo" );
359
        sizeComboText->setEditable(false);
360
        QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"};
361
        size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes);
362
        for (uint s = 0; s < f_size; ++s)
363
                sizeComboText->insertItem(ar_sizes[s] + tr(" pt"));
364
        for (int a = 0; a < sizeComboText->count(); ++a)
365
        {
366
                if (sizeComboText->text(a).left(2).toInt() == doc->Dsize / 10)
367
                        sizeComboText->setCurrentItem(a);
368
        }
745 fschmid 369
        subTabTextLayout->addMultiCellWidget( sizeComboText, 1, 1, 1, 3, Qt::AlignLeft );
370
        textLabel2b = new QLabel(sizeComboText, tr( "Size:" ), subTabText, "textLabel2b" );
371
        subTabTextLayout->addWidget( textLabel2b, 1, 0 );
726 fschmid 372
        colorComboText = new QComboBox( true, subTabText, "colorComboText" );
373
        colorComboText->setEditable(false);
374
        QPixmap pmT2;
375
        pmT2 = QPixmap(15, 15);
1065 cbradney 376
        ColorList::Iterator itc;
745 fschmid 377
        colorComboText->insertItem( tr("None"));
727 fschmid 378
        if (doc->DpenText == "None")
379
                colorComboText->setCurrentItem(colorComboText->count()-1);
726 fschmid 380
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
381
        {
382
                pmT2.fill(doc->PageColors[itc.key()].getRGBColor());
383
                colorComboText->insertItem(pmT2, itc.key());
384
                if (itc.key() == doc->DpenText)
385
                        colorComboText->setCurrentItem(colorComboText->count()-1);
386
        }
745 fschmid 387
        subTabTextLayout->addMultiCellWidget( colorComboText, 2, 2, 1, 3, Qt::AlignLeft );
388
        textLabel3b = new QLabel(colorComboText, tr( "Fill Color:" ), subTabText, "textLabel3b" );
389
        subTabTextLayout->addWidget( textLabel3b, 2, 0 );
390
        colorComboStrokeText = new QComboBox( true, subTabText, "colorComboStrokeText" );
391
        colorComboStrokeText->setEditable(false);
392
        colorComboStrokeText->insertItem( tr("None"));
393
        if (doc->DstrokeText == "None")
394
                colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
395
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
396
        {
397
                pmT2.fill(doc->PageColors[itc.key()].getRGBColor());
398
                colorComboStrokeText->insertItem(pmT2, itc.key());
399
                if (itc.key() == doc->DstrokeText)
400
                        colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
401
        }
402
        subTabTextLayout->addMultiCellWidget( colorComboStrokeText, 3, 3, 1, 3, Qt::AlignLeft );
403
        textLabel3b2 = new QLabel(colorComboStrokeText, tr( "Stroke Color:" ), subTabText, "textLabel3b2" );
404
        subTabTextLayout->addWidget( textLabel3b2, 3, 0 );
405
        columnsText = new QSpinBox( subTabText, "columnsText" );
406
        columnsText->setMinValue( 1 );
407
        columnsText->setMaxValue(100);
408
        columnsText->setValue(doc->DCols);
409
        subTabTextLayout->addWidget( columnsText, 4, 1, Qt::AlignLeft );
410
        textLabel4b = new QLabel(columnsText, tr("Colu&mns:"), subTabText, "TextCol");
411
        subTabTextLayout->addWidget( textLabel4b, 4, 0 );
726 fschmid 412
        gapText = new MSpinBox( 0, 200, subTabText, decimals );
413
        gapText->setSuffix( tr( " pt" ) );
734 fschmid 414
        gapText->setValue(doc->DGap * UmReFaktor);
745 fschmid 415
        subTabTextLayout->addWidget( gapText, 4, 3, Qt::AlignLeft );
726 fschmid 416
        textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol");
745 fschmid 417
        subTabTextLayout->addWidget( textLabel5b, 4, 2 );
418
        previewText = new QLabel( tr( "Woven silk pyjamas exchanged for blue quartz" ), subTabText, "previewText" );
419
        previewText->setMinimumSize( QSize( 280, 70 ) );
420
        previewText->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
421
        subTabTextLayout->addMultiCellWidget( previewText, 5, 5, 0, 3 );
731 fschmid 422
        subStackTools->addWidget( subTabText, 0 );
726 fschmid 423
 
731 fschmid 424
        subTabShape = new QWidget( subStackTools, "subTabShape" );
425
        subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
745 fschmid 426
        subTabShapeLayout->setAlignment( Qt::AlignTop );
727 fschmid 427
        colorComboLineShape = new QComboBox( true, subTabShape, "colorComboLineShape" );
428
        colorComboLineShape->setEditable(false);
429
        colorComboLineShape->insertItem( tr("None"));
430
        if (doc->Dpen == "None")
431
                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
432
        QPixmap pm2S = QPixmap(15, 15);
433
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
434
        {
435
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
436
                colorComboLineShape->insertItem(pm2S, itc.key());
437
                if (itc.key() == doc->Dpen)
438
                        colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
439
        }
745 fschmid 440
        subTabShapeLayout->addWidget( colorComboLineShape, 0, 1, Qt::AlignLeft );
727 fschmid 441
        textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" );
731 fschmid 442
        subTabShapeLayout->addWidget( textLabel7b, 0, 0 );
443
        shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" );
444
        shadingLineShape->setMaxValue( 100 );
445
        shadingLineShape->setSuffix( tr( " %" ) );
727 fschmid 446
        shadingLineShape->setMinValue( 0 );
447
        shadingLineShape->setValue(doc->Dshade2);
731 fschmid 448
        subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
727 fschmid 449
        textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
731 fschmid 450
        subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
727 fschmid 451
        comboFillShape = new QComboBox( true, subTabShape, "comboFillShape" );
452
        comboFillShape->setEditable(false);
453
        comboFillShape->insertItem( tr("None"));
454
        if (doc->Dbrush == "None")
455
                comboFillShape->setCurrentItem(comboFillShape->count()-1);
456
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
457
        {
458
                pm2S.fill(doc->PageColors[itc.key()].getRGBColor());
459
                comboFillShape->insertItem(pm2S, itc.key());
460
                if (itc.key() == doc->Dbrush)
461
                        comboFillShape->setCurrentItem(comboFillShape->count()-1);
462
        }
745 fschmid 463
        subTabShapeLayout->addWidget( comboFillShape, 2, 1, Qt::AlignLeft );
727 fschmid 464
        textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" );
731 fschmid 465
        subTabShapeLayout->addWidget( textLabel9b, 2, 0 );
466
        shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" );
467
        shadingFillShape->setMaxValue( 100 );
468
        shadingFillShape->setSuffix( tr( " %" ) );
727 fschmid 469
        shadingFillShape->setMinValue( 0 );
470
        shadingFillShape->setValue(doc->Dshade);
731 fschmid 471
        subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft );
727 fschmid 472
        textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" );
731 fschmid 473
        subTabShapeLayout->addWidget( textLabel10b, 3, 0 );
727 fschmid 474
        comboStyleShape = new LineCombo(subTabShape);
475
        comboStyleShape->setEditable(false);
476
        switch (doc->DLineArt)
477
        {
478
        case SolidLine:
479
                comboStyleShape->setCurrentItem(0);
480
                break;
481
        case DashLine:
482
                comboStyleShape->setCurrentItem(1);
483
                break;
484
        case DotLine:
485
                comboStyleShape->setCurrentItem(2);
486
                break;
487
        case DashDotLine:
488
                comboStyleShape->setCurrentItem(3);
489
                break;
490
        case DashDotDotLine:
491
                comboStyleShape->setCurrentItem(4);
492
                break;
493
        default:
494
                comboStyleShape->setCurrentItem(0);
495
                break;
496
        }
745 fschmid 497
        subTabShapeLayout->addWidget( comboStyleShape, 4, 1, Qt::AlignLeft );
727 fschmid 498
        textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" );
731 fschmid 499
        subTabShapeLayout->addWidget( textLabel11b, 4, 0 );
727 fschmid 500
        lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 );
501
        lineWidthShape->setSuffix( tr( " pt" ) );
502
        lineWidthShape->setValue(doc->Dwidth);
731 fschmid 503
        subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft );
727 fschmid 504
        textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" );
731 fschmid 505
        subTabShapeLayout->addWidget( textLabel12b, 5, 0 );
506
        subStackTools->addWidget( subTabShape, 1 );
727 fschmid 507
 
731 fschmid 508
        subTabLine = new QWidget( subStackTools, "subTabLine" );
509
        subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
745 fschmid 510
        subTabLineLayout->setAlignment( Qt::AlignTop );
731 fschmid 511
        colorComboLine = new QComboBox( true, subTabLine, "colorComboLine" );
512
        colorComboLine->setEditable(false);
513
        QPixmap pm2L = QPixmap(15, 15);
514
        comboFillShape->insertItem( tr("None"));
515
        if (doc->DpenLine == "None")
516
                colorComboLine->setCurrentItem(colorComboLine->count()-1);
517
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
518
        {
519
                pm2L.fill(doc->PageColors[itc.key()].getRGBColor());
520
                colorComboLine->insertItem(pm2L, itc.key());
521
                if (itc.key() == doc->DpenLine)
522
                        colorComboLine->setCurrentItem(colorComboLine->count()-1);
523
        }
745 fschmid 524
        subTabLineLayout->addMultiCellWidget( colorComboLine, 0, 0, 1, 2, Qt::AlignLeft );
731 fschmid 525
        textLabel13b = new QLabel(colorComboLine, tr("&Line Color:"), subTabLine, "textLabel13b" );
526
        subTabLineLayout->addWidget( textLabel13b, 0, 0 );
527
        shadingLine = new QSpinBox( subTabLine, "shadingLine" );
528
        shadingLine->setMaxValue( 100 );
529
        shadingLine->setValue(doc->DshadeLine);
530
        shadingLine->setSuffix( tr( " %" ) );
745 fschmid 531
        subTabLineLayout->addMultiCellWidget( shadingLine, 1, 1, 1, 2, Qt::AlignLeft );
731 fschmid 532
        textLabel14b = new QLabel(shadingLine, tr("&Shading:"), subTabLine, "textLabel14b" );
533
        subTabLineLayout->addWidget( textLabel14b, 1, 0 );
534
        comboStyleLine = new LineCombo(subTabLine);
535
        comboStyleLine->setEditable(false);
536
        switch (doc->DLstyleLine)
537
        {
538
        case SolidLine:
539
                comboStyleLine->setCurrentItem(0);
540
                break;
541
        case DashLine:
542
                comboStyleLine->setCurrentItem(1);
543
                break;
544
        case DotLine:
545
                comboStyleLine->setCurrentItem(2);
546
                break;
547
        case DashDotLine:
548
                comboStyleLine->setCurrentItem(3);
549
                break;
550
        case DashDotDotLine:
551
                comboStyleLine->setCurrentItem(4);
552
                break;
553
        default:
554
                comboStyleLine->setCurrentItem(0);
555
                break;
556
        }
745 fschmid 557
        subTabLineLayout->addMultiCellWidget( comboStyleLine, 2, 2, 1, 2, Qt::AlignLeft );
731 fschmid 558
        textLabel15b = new QLabel(subTabLine, tr("Line S&tyle:"), subTabLine, "textLabel15b" );
559
        subTabLineLayout->addWidget( textLabel15b, 2, 0 );
745 fschmid 560
        startArrow = new ArrowChooser(subTabLine, true);
561
        subTabLineLayout->addWidget( startArrow, 4, 1 );
562
        endArrow = new ArrowChooser(subTabLine, false);
563
        subTabLineLayout->addWidget( endArrow, 4, 2 );
782 fschmid 564
        startArrow->rebuildList(&doc->arrowStyles);
565
        endArrow->rebuildList(&doc->arrowStyles);
745 fschmid 566
        startArrow->setCurrentItem(doc->DstartArrow);
567
        endArrow->setCurrentItem(doc->DendArrow);
568
        arrowText = new QLabel( tr( "Arrows:" ), subTabLine, "arrowText" );
569
        subTabLineLayout->addMultiCellWidget( arrowText, 3, 4, 0, 0 );
570
        startArrowText = new QLabel( startArrow, tr( "Start:" ), subTabLine, "startArrowText" );
571
        subTabLineLayout->addWidget( startArrowText, 3, 1 );
572
        endArrowText = new QLabel( endArrow, tr( "End:" ), subTabLine, "endArrowText" );
573
        subTabLineLayout->addWidget( endArrowText, 3, 2 );
731 fschmid 574
        lineWidthLine = new MSpinBox( 1, 36, subTabLine, 1 );
575
        lineWidthLine->setSuffix( tr( " pt" ) );
576
        lineWidthLine->setValue(doc->DwidthLine);
745 fschmid 577
        subTabLineLayout->addMultiCellWidget( lineWidthLine, 5, 5, 1, 2, Qt::AlignLeft );
731 fschmid 578
        textLabel16b = new QLabel(lineWidthLine, tr("Line &Width:"), subTabLine, "textLabel16b" );
745 fschmid 579
        subTabLineLayout->addWidget( textLabel16b, 5, 0 );
731 fschmid 580
        subStackTools->addWidget( subTabLine, 2 );
727 fschmid 581
 
731 fschmid 582
        subTabImage = new QWidget( subStackTools, "subTabImage" );
583
        subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout");
745 fschmid 584
        subTabImageLayout->setAlignment( Qt::AlignTop );
731 fschmid 585
        buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" );
586
        buttonGroup3->setCheckable( true );
587
        buttonGroup3->setChecked( doc->ScaleType );
588
        buttonGroup3->setColumnLayout(0, Qt::Vertical );
589
        buttonGroup3->layout()->setSpacing( 6 );
590
        buttonGroup3->layout()->setMargin( 11 );
591
        buttonGroup3->setTitle( tr( "&Free Scaling" ) );
592
        buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
593
        buttonGroup3Layout->setAlignment( Qt::AlignTop );
594
        scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" );
595
        scalingHorizontal->setMaxValue( 1000 );
596
        scalingHorizontal->setMinValue( 1 );
597
        scalingHorizontal->setValue(qRound(doc->ScaleX * 100));
598
        scalingHorizontal->setSuffix( tr( " %" ) );
599
        buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1, Qt::AlignRight );
600
        textLabel17b = new QLabel(scalingHorizontal, tr("&Horizontal Scaling:"), buttonGroup3, "textLabel17b" );
601
        buttonGroup3Layout->addWidget( textLabel17b, 0, 0 );
602
        scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" );
603
        scalingVertical->setMaxValue( 1000 );
604
        scalingVertical->setMinValue( 1 );
605
        scalingVertical->setSuffix( tr( " %" ) );
606
        scalingVertical->setValue(qRound(doc->ScaleY * 100));
607
        buttonGroup3Layout->addWidget( scalingVertical, 1, 1, Qt::AlignRight );
608
        textLabel18b = new QLabel(scalingVertical, tr( "&Vertical Scaling:" ), buttonGroup3, "textLabel18b" );
609
        buttonGroup3Layout->addWidget( textLabel18b, 1, 0 );
726 fschmid 610
        chainButton = new LinkButton( buttonGroup3 );
611
        chainButton->setToggleButton( true );
612
        chainButton->setAutoRaise(true);
731 fschmid 613
        buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft );
614
        subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 );
615
        buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" );
616
        buttonGroup5->setCheckable( true );
617
        buttonGroup5->setChecked( !doc->ScaleType );
618
        buttonGroup5->setColumnLayout(0, Qt::Vertical );
619
        buttonGroup5->layout()->setSpacing( 6 );
620
        buttonGroup5->layout()->setMargin( 11 );
621
        buttonGroup5->setTitle( tr( "&Scale Picture to Frame Size" ) );
622
        buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() );
623
        buttonGroup5Layout->setAlignment( Qt::AlignTop );
624
        checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" );
625
        checkRatioImage->setText( tr( "Keep Aspect &Ratio" ) );
626
        checkRatioImage->setChecked(doc->AspectRatio);
627
        buttonGroup5Layout->addWidget( checkRatioImage );
628
        subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
629
        comboFillImage = new QComboBox( true, subTabImage, "comboFillImage" );
630
        comboFillImage->setEditable(false);
631
        QPixmap pm2I = QPixmap(15, 15);
632
        comboFillImage->insertItem( tr("None"));
633
        if (doc->DbrushPict == "None")
634
                comboFillImage->setCurrentItem(comboFillImage->count()-1);
635
        for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
636
        {
637
                pm2I.fill(doc->PageColors[itc.key()].getRGBColor());
638
                comboFillImage->insertItem(pm2I, itc.key());
639
                if (itc.key() == doc->DbrushPict)
640
                        comboFillImage->setCurrentItem(comboFillImage->count()-1);
641
        }
745 fschmid 642
        subTabImageLayout->addWidget( comboFillImage, 2, 1, Qt::AlignLeft );
731 fschmid 643
        textLabel19b = new QLabel(comboFillImage, tr( "F&ill Color:" ), subTabImage, "textLabel19b" );
644
        subTabImageLayout->addWidget( textLabel19b, 2, 0 );
645
        shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" );
646
        shadingFillImage->setMaxValue( 100 );
647
        shadingFillImage->setValue( doc->ShadePict );
648
        shadingFillImage->setSuffix( tr( " %" ) );
649
        subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft );
650
        textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" );
651
        subTabImageLayout->addWidget( textLabel20b, 3, 0 );
652
        subStackTools->addWidget( subTabImage, 3 );
727 fschmid 653
 
731 fschmid 654
        subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
655
        subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout");
745 fschmid 656
        subTabPolygonLayout->setAlignment( Qt::AlignTop );
731 fschmid 657
        polyWidget = new PolygonWidget(subTabPolygon, doc->PolyC, doc->PolyFd, doc->PolyF, doc->PolyS, doc->PolyR);
658
        subTabPolygonLayout->addWidget( polyWidget );
659
        subStackTools->addWidget( subTabPolygon, 4 );
727 fschmid 660
 
731 fschmid 661
        subTabZoom = new QWidget( subStackTools, "subTabZoom" );
662
        subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout");
745 fschmid 663
        subTabZoomLayout->setAlignment( Qt::AlignTop );
731 fschmid 664
        minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" );
665
        minimumZoom->setMaxValue( 3200 );
666
        minimumZoom->setMinValue( 10 );
727 fschmid 667
        minimumZoom->setValue(doc->MagMin);
731 fschmid 668
        minimumZoom->setSuffix( tr( " %" ) );
745 fschmid 669
        subTabZoomLayout->addWidget( minimumZoom, 0, 1, Qt::AlignLeft );
727 fschmid 670
        textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" );
745 fschmid 671
        subTabZoomLayout->addWidget( textLabel21b, 0, 0);
731 fschmid 672
        maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" );
673
        maximumZoom->setMaxValue( 3200 );
674
        maximumZoom->setMinValue( 10 );
727 fschmid 675
        maximumZoom->setValue(doc->MagMax);
731 fschmid 676
        maximumZoom->setSuffix( tr( " %" ) );
745 fschmid 677
        subTabZoomLayout->addWidget( maximumZoom, 1, 1, Qt::AlignLeft );
727 fschmid 678
        textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" );
745 fschmid 679
        subTabZoomLayout->addWidget( textLabel22b, 1, 0 );
731 fschmid 680
        zoomStep = new QSpinBox( subTabZoom, "zoomStep" );
681
        zoomStep->setMaxValue( 200 );
682
        zoomStep->setMinValue( 1 );
683
        zoomStep->setLineStep( 25 );
684
        zoomStep->setValue( doc->MagStep );
685
        zoomStep->setSuffix( tr( " %" ) );
745 fschmid 686
        subTabZoomLayout->addWidget( zoomStep, 2, 1, Qt::AlignLeft );
727 fschmid 687
        textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" );
745 fschmid 688
        subTabZoomLayout->addWidget( textLabel23b, 2, 0 );
731 fschmid 689
        subStackTools->addWidget( subTabZoom, 5 );
690
        tabToolsLayout->addWidget( subStackTools );
726 fschmid 691
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
692
 
795 fschmid 693
        tabHyphenator = new HySettings(prefsWidgets, &ap->LangTransl);
1065 cbradney 694
        tabHyphenator->verbose->setChecked(!doc->docHyphenator->Automatic);
695
        tabHyphenator->input->setChecked(doc->docHyphenator->AutoCheck);
696
        tabHyphenator->language->setCurrentText(ap->LangTransl[doc->docHyphenator->Language]);
697
        tabHyphenator->wordLen->setValue(doc->docHyphenator->MinWordLen);
698
        tabHyphenator->maxCount->setValue(doc->docHyphenator->HyCount);
795 fschmid 699
        addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator);
800 fschmid 700
 
701
        int cmsTab = 0;
795 fschmid 702
        if (CMSavail)
703
        {
704
                tabColorManagement = new CMSPrefs(prefsWidgets, &doc->CMSSettings, &InputProfiles, &ap->PrinterProfiles, &ap->MonitorProfiles);
800 fschmid 705
                cmsTab = addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
795 fschmid 706
        }
707
 
726 fschmid 708
        rightR->setMaxValue(pageWidth - leftR->value());
709
        leftR->setMaxValue(pageWidth - rightR->value());
710
        topR->setMaxValue(pageHeight - bottomR->value());
711
        bottomR->setMaxValue(pageHeight - topR->value());
712
        toolText->setOn(true);
727 fschmid 713
        setSample();
249 Franz 714
        //tooltips
782 fschmid 715
        QToolTip::add( toolText, tr( "Text Frame Properties" ) );
716
        QToolTip::add( toolImage, tr( "Picture Frame Properties" ) );
717
        QToolTip::add( toolShape, tr( "Shape Drawing Properties" ) );
718
        QToolTip::add( toolZoom, tr( "Magnification Level Defaults" ) );
719
        QToolTip::add( toolLine, tr( "Line Drawing Properties" ) );
720
        QToolTip::add( toolPoly, tr( "Polygon Drawing Properties" ) );
721
        QToolTip::add( fontComboText, tr( "Font for new text frames" ) );
722
        QToolTip::add( sizeComboText, tr( "Size of font for new text frames" ) );
723
        QToolTip::add( colorComboText, tr( "Color of font" ) );
724
        QToolTip::add( columnsText, tr( "Number of columns in a text frame" ) );
725
        QToolTip::add( gapText, tr( "Gap between text frame columns" ) );
726
        QToolTip::add( previewText, tr( "Sample of your font" ) );
727
        QToolTip::add( buttonGroup3, tr( "Picture frames allow pictures to scale to any size" ) );
728
        QToolTip::add( scalingHorizontal, tr( "Horizontal scaling of images" ) );
729
        QToolTip::add( scalingVertical, tr( "Vertical scaling of images" ) );
730
        QToolTip::add( chainButton, tr( "Keep horizontal and vertical scaling the same" ) );
731
        QToolTip::add( buttonGroup5, tr( "Pictures in picture frames are scaled to the size of the frame" ) );
732
        QToolTip::add( checkRatioImage, tr( "Automatically scaled pictures keep their original proportions" ) );
733
        QToolTip::add( comboFillImage, tr( "Fill color of picture frames" ) );
734
        QToolTip::add( shadingFillImage, tr( "Saturation of color of fill" ) );
735
        QToolTip::add( colorComboLineShape, tr( "Line color of shapes" ) );
736
        QToolTip::add( shadingLineShape, tr( "Saturation of color of lines" ) );
737
        QToolTip::add( comboFillShape, tr( "Fill color of shapes" ) );
738
        QToolTip::add( shadingFillShape, tr( "Saturation of color of fill" ) );
739
        QToolTip::add( comboStyleShape, tr( "Line style of shapes" ) );
740
        QToolTip::add( lineWidthShape, tr( "Line width of shapes" ) );
741
        QToolTip::add( minimumZoom, tr( "Minimum magnification allowed" ) );
742
        QToolTip::add( maximumZoom, tr( "Maximum magnification allowed" ) );
743
        QToolTip::add( zoomStep, tr( "Change in magnification for each zoom operation" ) );
744
        QToolTip::add( colorComboLine, tr( "Color of lines" ) );
745
        QToolTip::add( shadingLine, tr( "Saturation of color" ) );
746
        QToolTip::add( comboStyleLine, tr( "Style of lines" ) );
747
        QToolTip::add( lineWidthLine, tr( "Width of lines" ) );
776 fschmid 748
        QToolTip::add( backColor, tr( "Color for paper" ) );
749
        QToolTip::add( checkUnprintable, tr( "Mask the area outside the margins in the margin color" ) );
726 fschmid 750
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
751
        QToolTip::add( firstPage, tr( "Make the first page the left page of the document" ) );
752
        QToolTip::add( topR, tr( "Distance between the top margin guide and the edge of the page" ) );
753
        QToolTip::add( bottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
754
        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" ) );
755
        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 756
 
249 Franz 757
        // signals and slots connections
726 fschmid 758
        connect( facingPages, SIGNAL( clicked() ), this, SLOT( setDS() ) );
759
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
760
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
761
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
762
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
705 fschmid 763
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
727 fschmid 764
        connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool()));
765
        connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool()));
766
        connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool()));
767
        connect(toolText, SIGNAL(clicked()), this, SLOT(setTool()));
768
        connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool()));
769
        connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool()));
770
        connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
771
        connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
772
        connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int)));
773
        connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int)));
731 fschmid 774
        connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
775
        connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
776
        connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
734 fschmid 777
        connect(unitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
731 fschmid 778
 
800 fschmid 779
        if (CMSavail)
780
                prefsWidgets->raiseWidget(cmsTab);
781
        arrangeIcons();
693 fschmid 782
        resize( minimumSizeHint() );
783
        clearWState( WState_Polished );
800 fschmid 784
        prefsWidgets->raiseWidget(0);
3 paul 785
}
786
 
734 fschmid 787
void ReformDoc::unitChange()
788
{
789
        disconnect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
790
        disconnect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
791
        disconnect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
792
        disconnect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
793
        int decimalsOld;
794
        double AltUmrech = Umrech;
795
        double oldMin, oldMax, val;
796
        QString einh;
797
        einheit = unitCombo->currentItem();
798
        switch (unitCombo->currentItem())
799
        {
800
        case 0:
801
                Umrech = 1.0;
802
                decimals = 100;
803
                einh = tr( " pt" );
804
                break;
805
        case 1:
806
                Umrech = 0.3527777;
807
                decimals = 1000;
808
                einh = tr( " mm" );
809
                break;
810
        case 2:
811
                Umrech = 1.0 / 72.0;
812
                decimals = 10000;
813
                einh = tr( " in" );
814
                break;
815
        case 3:
816
                Umrech = 1.0 / 12.0;
817
                decimals = 100;
818
                einh = tr( " p" );
819
                break;
820
        }
781 cbradney 821
 
782 fschmid 822
        widthMSpinBox->setSuffix(einh);
823
        heightMSpinBox->setSuffix(einh);
824
        topR->setSuffix(einh);
825
        bottomR->setSuffix(einh);
826
        leftR->setSuffix(einh);
827
        rightR->setSuffix(einh);
879 fschmid 828
        tabGuides->minorSpace->setSuffix(einh);
829
        tabGuides->majorSpace->setSuffix(einh);
830
        tabGuides->snapDistance->setSuffix(einh);
788 fschmid 831
        tabTypo->baseGrid->setSuffix(einh);
832
        tabTypo->baseOffset->setSuffix(einh);
782 fschmid 833
        gapText->setSuffix(einh);
834
        topScratch->setSuffix(einh);
835
        bottomScratch->setSuffix(einh);
836
        leftScratch->setSuffix(einh);
837
        rightScratch->setSuffix(einh);
781 cbradney 838
 
782 fschmid 839
        double invUnitConversion = 1.0 / AltUmrech * Umrech;
781 cbradney 840
 
734 fschmid 841
        widthMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 842
        widthMSpinBox->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, docc->PageB * Umrech);
734 fschmid 843
        heightMSpinBox->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 844
        heightMSpinBox->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, docc->PageH * Umrech);
734 fschmid 845
        topR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 846
        topR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 847
        bottomR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 848
        bottomR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 849
        leftR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 850
        leftR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 851
        rightR->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 852
        rightR->setValues(0, oldMax * invUnitConversion, decimals, val * invUnitConversion);
879 fschmid 853
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
854
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
855
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
856
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
857
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
858
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
788 fschmid 859
        tabTypo->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
860
        tabTypo->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
861
        tabTypo->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
862
        tabTypo->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 863
        gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 864
        gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 865
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 866
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 867
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 868
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 869
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 870
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
734 fschmid 871
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
781 cbradney 872
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
873
 
734 fschmid 874
        pageWidth = docc->PageB * Umrech;
875
        pageHeight = docc->PageH * Umrech;
876
        rightR->setMaxValue(pageWidth - leftR->value());
877
        leftR->setMaxValue(pageWidth - rightR->value());
878
        topR->setMaxValue(pageHeight - bottomR->value());
879
        bottomR->setMaxValue(pageHeight - topR->value());
880
        connect(topR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
881
        connect(bottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
882
        connect(leftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
883
        connect(rightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
884
}
885
 
731 fschmid 886
/*!
887
 \fn void ReformDoc::ToggleKette()
888
 \author Franz Schmid
889
 \date  
890
 \brief ReformDoc (Tools, Image Frame), Sets Y Scale value from X Scale value when chain is toggled
891
 \param None
892
 \retval None
893
 */
894
void ReformDoc::toggleChain()
895
{
896
        if (chainButton->isOn())
897
                scalingVertical->setValue(scalingHorizontal->value());
898
}
899
 
900
/*!
901
 \fn void ReformDoc::HChange()
902
 \author Franz Schmid
903
 \date  
904
 \brief ReformDoc (Tools, Image Frame), Sets Y Scale value from X Scale value when X Scale value is changed
905
 \param None
906
 \retval None
907
 */
908
void ReformDoc::hChange()
909
{
910
        if (chainButton->isOn())
911
                scalingVertical->setValue(scalingHorizontal->value());
912
}
913
 
914
/*!
915
 \fn void ReformDoc::vChange()
916
 \author Franz Schmid
917
 \date  
918
 \brief ReformDoc (Tools, Image Frame). Sets X Scale value from Y Scale value when Y Scale value is changed
919
 \param None
920
 \retval None
921
 */
922
void ReformDoc::vChange()
923
{
924
        if (chainButton->isOn())
925
                scalingHorizontal->setValue(scalingVertical->value());
926
}
927
 
727 fschmid 928
void ReformDoc::changeImageScalingFree(int)
929
{
930
        if (buttonGroup3->isChecked())
931
                buttonGroup5->setChecked(false);
932
        else
933
                buttonGroup5->setChecked(true);
934
}
935
 
936
void ReformDoc::changeImageScalingRatio(int)
937
{
938
        if (buttonGroup5->isChecked())
939
                buttonGroup3->setChecked(false);
940
        else
941
                buttonGroup3->setChecked(true);
942
}
943
 
726 fschmid 944
/*!
945
 \fn void ReformDoc::SetSample()
946
 \author Franz Schmid
947
 \date  
948
 \brief ReformDoc (Tools, Text frame), Sets the sample text in selected font in text frame preferences
949
 \param None
950
 \retval None
951
 */
727 fschmid 952
void ReformDoc::setSample()
726 fschmid 953
{
954
        QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" );
955
        QString da = (*fon)[fontComboText->currentText()]->Datei;
956
        int s = sizeComboText->currentText().left(2).toInt();
957
        QPixmap pm = fontSamples(da, s, ts, paletteBackgroundColor());
958
        previewText->setPixmap(pm);
959
}
960
 
961
/*!
962
 \fn void ReformDoc::SetTool()
963
 \author Franz Schmid
964
 \date  
965
 \brief ReformDoc (Tools), Raises widget for selected Tool properties
966
 \param None
967
 \retval None
968
 */
727 fschmid 969
void ReformDoc::setTool()
726 fschmid 970
{
971
        if (toolText == sender())
972
                subStackTools->raiseWidget(0);
973
        if (toolShape == sender())
974
                subStackTools->raiseWidget(1);
975
        if (toolLine == sender())
976
                subStackTools->raiseWidget(2);
977
        if (toolImage == sender())
978
                subStackTools->raiseWidget(3);
979
        if (toolPoly == sender())
980
                subStackTools->raiseWidget(4);
981
        if (toolZoom == sender())
982
                subStackTools->raiseWidget(5);
983
}
984
 
705 fschmid 985
void ReformDoc::changePaperColor()
986
{
987
        QColor neu = QColor();
988
        neu = QColorDialog::getColor(colorPaper, this);
989
        if (neu.isValid())
990
        {
991
                QPixmap pm = QPixmap(54, 14);
992
                pm.fill(neu);
993
                colorPaper = neu;
994
                backColor->setPixmap(pm);
995
        }
996
}
997
 
693 fschmid 998
void ReformDoc::setTop(int )
36 Franz 999
{
726 fschmid 1000
        bottomR->setMaxValue(pageHeight - topR->value());
36 Franz 1001
}
3 paul 1002
 
693 fschmid 1003
void ReformDoc::setBottom(int )
36 Franz 1004
{
726 fschmid 1005
        topR->setMaxValue(pageHeight - bottomR->value());
36 Franz 1006
}
1007
 
693 fschmid 1008
void ReformDoc::setLeft(int )
36 Franz 1009
{
726 fschmid 1010
        rightR->setMaxValue(pageWidth - leftR->value());
36 Franz 1011
}
1012
 
693 fschmid 1013
void ReformDoc::setRight(int )
36 Franz 1014
{
726 fschmid 1015
        leftR->setMaxValue(pageWidth - rightR->value());
36 Franz 1016
}
1017
 
3 paul 1018
void ReformDoc::setDS()
1019
{
726 fschmid 1020
        if (facingPages->isChecked())
249 Franz 1021
        {
340 Franz 1022
                Links->setText( tr( "&Inside:" ) );
1023
                Rechts->setText( tr( "&Outside:" ) );
726 fschmid 1024
                firstPage->setEnabled(true);
249 Franz 1025
        }
1026
        else
1027
        {
340 Franz 1028
                Links->setText( tr( "&Left:" ) );
1029
                Rechts->setText( tr( "&Right:" ) );
726 fschmid 1030
                firstPage->setEnabled(false);
249 Franz 1031
        }
348 Franz 1032
}