Subversion Repositories Scribus

Rev

Rev 3457 | Rev 3680 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1195 fschmid 1
#include "tabtools.h"
2
#include "tabtools.moc"
3
#include <qtooltip.h>
4
#include <qspinbox.h>
3457 avox 5
 
6
#include "sccombobox.h"
1195 fschmid 7
#include "units.h"
8
#include "mspinbox.h"
9
#include "linecombo.h"
10
#include "fontcombo.h"
11
#include "polygonwidget.h"
12
#include "arrowchooser.h"
13
#include "linkbutton.h"
14
#include "scribusstructs.h"
15
#include "scribus.h"
2529 craig 16
#include "scfontmetrics.h"
2636 cbradney 17
#include "util.h"
2834 cbradney 18
#include "prefsmanager.h"
3252 craig 19
#include "scfonts.h"
2529 craig 20
 
2636 cbradney 21
 
1195 fschmid 22
 
3205 craig 23
 
1790 cbradney 24
TabTools::TabTools( QWidget* parent, struct toolPrefs *prefsData, int unitIndex, ScribusDoc* doc) : QWidget( parent, "tabtools", 0 )
1195 fschmid 25
{
2834 cbradney 26
        PrefsManager* prefsManager=PrefsManager::instance();
1790 cbradney 27
        unit = unitGetSuffixFromIndex(unitIndex);
28
        precision = unitGetPrecisionFromIndex(unitIndex);
29
        unitRatio = unitGetRatioFromIndex(unitIndex);
30
 
1878 cbradney 31
        tabToolsLayout = new QHBoxLayout( this, 0, 5, "tabToolsLayout");
1195 fschmid 32
        buttonGroupTools = new QButtonGroup( this, "buttonGroupTools" );
33
        buttonGroupTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, buttonGroupTools->sizePolicy().hasHeightForWidth() ) );
34
        buttonGroupTools->setExclusive( true );
35
        buttonGroupTools->setRadioButtonExclusive( true );
36
        buttonGroupTools->setColumnLayout(0, Qt::Vertical );
37
        buttonGroupTools->layout()->setSpacing( 5 );
38
        buttonGroupTools->layout()->setMargin( 5 );
39
        buttonGroupTools->setTitle( QString::null );
40
        buttonGroupToolsLayout = new QVBoxLayout( buttonGroupTools->layout() );
41
        buttonGroupToolsLayout->setAlignment( Qt::AlignTop );
42
        toolText = new QToolButton( buttonGroupTools, "toolText" );
43
        toolText->setToggleButton( true );
44
        toolText->setText( QString::null );
45
        toolText->setIconSet( QIconSet( loadIcon("Text.xpm") ) );
46
        buttonGroupToolsLayout->addWidget( toolText );
47
        toolImage = new QToolButton( buttonGroupTools, "toolImage" );
48
        toolImage->setToggleButton( true );
49
        toolImage->setText( QString::null );
50
        toolImage->setIconSet( QIconSet( loadIcon("Bild.xpm") ) );
51
        buttonGroupToolsLayout->addWidget( toolImage );
52
        toolShape = new QToolButton( buttonGroupTools, "toolShape" );
53
        toolShape->setToggleButton( true );
54
        toolShape->setText( QString::null );
55
        toolShape->setIconSet( QIconSet( loadIcon("Rechtecke.xpm") ) );
56
        buttonGroupToolsLayout->addWidget( toolShape);
57
        toolPoly = new QToolButton( buttonGroupTools, "toolPoly" );
58
        toolPoly->setToggleButton( true );
59
        toolPoly->setText( QString::null );
60
        toolPoly->setIconSet( QIconSet( loadIcon("spline.png") ) );
61
        buttonGroupToolsLayout->addWidget( toolPoly );
62
        toolLine = new QToolButton( buttonGroupTools, "toolLine" );
63
        toolLine->setToggleButton( true );
64
        toolLine->setText( QString::null );
65
        toolLine->setIconSet( QIconSet( loadIcon("Stift.xpm") ) );
66
        buttonGroupToolsLayout->addWidget( toolLine );
67
        toolZoom = new QToolButton( buttonGroupTools, "toolZoom" );
68
        toolZoom->setToggleButton( true );
69
        toolZoom->setText( QString::null );
70
        toolZoom->setIconSet( QIconSet( loadIcon("Lupe.xpm") ) );
71
        buttonGroupToolsLayout->addWidget( toolZoom );
72
        tabToolsLayout->addWidget( buttonGroupTools );
73
        subStackTools = new QWidgetStack( this, "subStackTools" );
74
        subStackTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, subStackTools->sizePolicy().hasHeightForWidth() ) );
75
        subStackTools->setFrameShape( QWidgetStack::GroupBoxPanel );
76
        subStackTools->setFrameShadow( QWidgetStack::Sunken );
77
 
78
        subTabText = new QWidget( subStackTools, "subTabText" );
79
        subTabTextLayout = new QGridLayout( subTabText, 1, 1, 11, 6, "subTabTextLayout");
2834 cbradney 80
        fontComboText = new FontCombo(subTabText);
1195 fschmid 81
        for (int fc=0; fc<fontComboText->count(); ++fc)
82
        {
83
                if (fontComboText->text(fc) == prefsData->defFont)
84
                {
85
                        fontComboText->setCurrentItem(fc);
86
                        break;
87
                }
88
        }
89
        subTabTextLayout->addMultiCellWidget( fontComboText, 0, 0, 1, 3, Qt::AlignLeft );
90
        textLabel1b = new QLabel( fontComboText, tr( "Font:" ), subTabText, "textLabel1b" );
91
        subTabTextLayout->addWidget( textLabel1b, 0, 0 );
3457 avox 92
        sizeComboText = new ScComboBox( true, subTabText, "SizeCombo" );
1195 fschmid 93
        sizeComboText->setEditable(false);
94
        QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"};
95
        size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes);
96
        for (uint s = 0; s < f_size; ++s)
97
                sizeComboText->insertItem(ar_sizes[s] + tr(" pt"));
98
        for (int a = 0; a < sizeComboText->count(); ++a)
99
        {
100
                if (sizeComboText->text(a).left(2).toInt() == prefsData->defSize / 10)
101
                        sizeComboText->setCurrentItem(a);
102
        }
103
        subTabTextLayout->addMultiCellWidget( sizeComboText, 1, 1, 1, 3, Qt::AlignLeft );
104
        textLabel2b = new QLabel(sizeComboText, tr( "Size:" ), subTabText, "textLabel2b" );
105
        subTabTextLayout->addWidget( textLabel2b, 1, 0 );
3093 fschmid 106
 
3457 avox 107
        colorComboText = new ScComboBox( true, subTabText, "colorComboText" );
1195 fschmid 108
        colorComboText->setEditable(false);
109
        ColorList::Iterator itc;
110
        colorComboText->insertItem( tr("None"));
111
        if (prefsData->dPenText == "None")
112
                colorComboText->setCurrentItem(colorComboText->count()-1);
113
        if (doc != 0)
114
        {
115
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
116
                {
3046 fschmid 117
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
2636 cbradney 118
                        colorComboText->insertItem( *pm, itc.key());
1195 fschmid 119
                        if (itc.key() == prefsData->dPenText)
120
                                colorComboText->setCurrentItem(colorComboText->count()-1);
121
                }
122
        }
123
        else
124
        {
2871 cbradney 125
                ColorList* colorList=prefsManager->colorSetPtr();
126
                ColorList::Iterator endOfColorList=colorList->end();
127
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
1195 fschmid 128
                {
3046 fschmid 129
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
2636 cbradney 130
                        colorComboText->insertItem( *pm, itc.key());
1195 fschmid 131
                        if (itc.key() == prefsData->dPenText)
132
                                colorComboText->setCurrentItem(colorComboText->count()-1);
133
                }
134
        }
3093 fschmid 135
        subTabTextLayout->addWidget( colorComboText, 2, 1 );
136
        textLabel3b = new QLabel(colorComboText, tr( "Text Color:" ), subTabText, "textLabel3b" );
1195 fschmid 137
        subTabTextLayout->addWidget( textLabel3b, 2, 0 );
3093 fschmid 138
        shadingText = new QSpinBox( subTabText, "shadingText" );
139
        shadingText->setMaxValue( 100 );
140
        shadingText->setSuffix( tr( " %" ) );
141
        shadingText->setMinValue( 0 );
142
        shadingText->setValue(prefsData->dTextPenShade);
143
        subTabTextLayout->addWidget( shadingText, 2, 3, Qt::AlignLeft );
144
        textLabelTS = new QLabel( shadingText, tr( "Shading:" ), subTabText, "textLabelTS" );
145
        subTabTextLayout->addWidget( textLabelTS, 2, 2 );
146
 
3457 avox 147
        colorComboStrokeText = new ScComboBox( true, subTabText, "colorComboStrokeText" );
1195 fschmid 148
        colorComboStrokeText->setEditable(false);
149
        colorComboStrokeText->insertItem( tr("None"));
150
        if (prefsData->dStrokeText == "None")
151
                colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
152
        if (doc != 0)
153
        {
154
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
155
                {
3046 fschmid 156
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
2636 cbradney 157
                        colorComboStrokeText->insertItem( *pm, itc.key());
1195 fschmid 158
                        if (itc.key() == prefsData->dStrokeText)
159
                                colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
160
                }
161
        }
162
        else
163
        {
2871 cbradney 164
                ColorList* colorList=prefsManager->colorSetPtr();
165
                ColorList::Iterator endOfColorList=colorList->end();
166
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
1195 fschmid 167
                {
3046 fschmid 168
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
2636 cbradney 169
                        colorComboStrokeText->insertItem( *pm, itc.key());
1195 fschmid 170
                        if (itc.key() == prefsData->dStrokeText)
171
                                colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
172
                }
173
        }
3093 fschmid 174
        subTabTextLayout->addWidget( colorComboStrokeText, 3, 1 );
175
        textLabel3b2 = new QLabel(colorComboStrokeText, tr( "Text Stroke:" ), subTabText, "textLabel3b2" );
1195 fschmid 176
        subTabTextLayout->addWidget( textLabel3b2, 3, 0 );
3093 fschmid 177
        shadingTextStroke = new QSpinBox( subTabText, "shadingTextStroke" );
178
        shadingTextStroke->setMaxValue( 100 );
179
        shadingTextStroke->setSuffix( tr( " %" ) );
180
        shadingTextStroke->setMinValue( 0 );
181
        shadingTextStroke->setValue(prefsData->dTextStrokeShade);
182
        subTabTextLayout->addWidget( shadingTextStroke, 3, 3, Qt::AlignLeft );
183
        textLabelTSS = new QLabel( shadingTextStroke, tr( "Shading:" ), subTabText, "textLabelTS" );
184
        subTabTextLayout->addWidget( textLabelTSS, 3, 2 );
185
 
3457 avox 186
        colorComboTextBackground = new ScComboBox( true, subTabText, "colorComboTextBackground" );
3093 fschmid 187
        colorComboTextBackground->setEditable(false);
188
        colorComboTextBackground->insertItem( tr("None"));
189
        if (prefsData->dTextBackGround == "None")
190
                colorComboTextBackground->setCurrentItem(colorComboTextBackground->count()-1);
191
        if (doc != 0)
192
        {
193
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
194
                {
195
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
196
                        colorComboTextBackground->insertItem( *pm, itc.key());
197
                        if (itc.key() == prefsData->dTextBackGround)
198
                                colorComboTextBackground->setCurrentItem(colorComboTextBackground->count()-1);
199
                }
200
        }
201
        else
202
        {
203
                ColorList* colorList=prefsManager->colorSetPtr();
204
                ColorList::Iterator endOfColorList=colorList->end();
205
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
206
                {
207
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
208
                        colorComboTextBackground->insertItem( *pm, itc.key());
209
                        if (itc.key() == prefsData->dTextBackGround)
210
                                colorComboTextBackground->setCurrentItem(colorComboTextBackground->count()-1);
211
                }
212
        }
213
        subTabTextLayout->addWidget( colorComboTextBackground, 4, 1 );
214
        textLabel3bT = new QLabel(colorComboTextBackground, tr( "Fill Color:" ), subTabText, "textLabel3b" );
215
        subTabTextLayout->addWidget( textLabel3bT, 4, 0 );
216
        shadingTextBack = new QSpinBox( subTabText, "shadingTextBack" );
217
        shadingTextBack->setMaxValue( 100 );
218
        shadingTextBack->setSuffix( tr( " %" ) );
219
        shadingTextBack->setMinValue( 0 );
220
        shadingTextBack->setValue(prefsData->dTextBackGroundShade);
221
        subTabTextLayout->addWidget( shadingTextBack, 4, 3, Qt::AlignLeft );
222
        textLabelTSB = new QLabel( shadingTextBack, tr( "Shading:" ), subTabText, "textLabelTSS" );
223
        subTabTextLayout->addWidget( textLabelTSB, 4, 2 );
224
 
3457 avox 225
        colorComboTextLine = new ScComboBox( true, subTabText, "colorComboTextLine" );
3093 fschmid 226
        colorComboTextLine->setEditable(false);
227
        colorComboTextLine->insertItem( tr("None"));
228
        if (prefsData->dTextLineColor == "None")
229
                colorComboTextLine->setCurrentItem(colorComboTextLine->count()-1);
230
        if (doc != 0)
231
        {
232
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
233
                {
234
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
235
                        colorComboTextLine->insertItem( *pm, itc.key());
236
                        if (itc.key() == prefsData->dTextLineColor)
237
                                colorComboTextLine->setCurrentItem(colorComboTextLine->count()-1);
238
                }
239
        }
240
        else
241
        {
242
                ColorList* colorList=prefsManager->colorSetPtr();
243
                ColorList::Iterator endOfColorList=colorList->end();
244
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
245
                {
246
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
247
                        colorComboTextLine->insertItem( *pm, itc.key());
248
                        if (itc.key() == prefsData->dTextLineColor)
249
                                colorComboTextLine->setCurrentItem(colorComboTextLine->count()-1);
250
                }
251
        }
252
        subTabTextLayout->addWidget( colorComboTextLine, 5, 1 );
253
        textLabel3bTL = new QLabel(colorComboTextLine, tr( "Stroke Color:" ), subTabText, "textLabel3b2" );
254
        subTabTextLayout->addWidget( textLabel3bTL, 5, 0 );
255
        shadingTextLine = new QSpinBox( subTabText, "shadingTextStroke" );
256
        shadingTextLine->setMaxValue( 100 );
257
        shadingTextLine->setSuffix( tr( " %" ) );
258
        shadingTextLine->setMinValue( 0 );
259
        shadingTextLine->setValue(prefsData->dTextLineShade);
260
        subTabTextLayout->addWidget( shadingTextLine, 5, 3, Qt::AlignLeft );
261
        textLabelTSL = new QLabel( shadingTextLine, tr( "Shading:" ), subTabText, "textLabelTSL" );
262
        subTabTextLayout->addWidget( textLabelTSL, 5, 2 );
263
 
3457 avox 264
        tabFillCombo = new ScComboBox( true, subTabText, "tabFillCombo" );
2219 fschmid 265
        tabFillCombo->setEditable(false);
266
        tabFillCombo->insertItem( tr("None"));
3360 cbradney 267
        tabFillCombo->insertItem( tr("Dot"));
268
        tabFillCombo->insertItem( tr("Hyphen"));
269
        tabFillCombo->insertItem( tr("Underscore"));
270
        tabFillCombo->insertItem( tr("Custom"));
2877 cbradney 271
        if (prefsData->tabFillChar.isEmpty())
2282 fschmid 272
        {
273
                tabFillCombo->setEditable(false);
2219 fschmid 274
                tabFillCombo->setCurrentItem(0);
2282 fschmid 275
        }
276
        else if (prefsData->tabFillChar == ".")
277
        {
278
                tabFillCombo->setEditable(false);
2219 fschmid 279
                tabFillCombo->setCurrentItem(1);
2282 fschmid 280
        }
281
        else if (prefsData->tabFillChar == "-")
282
        {
283
                tabFillCombo->setEditable(false);
2219 fschmid 284
                tabFillCombo->setCurrentItem(2);
2282 fschmid 285
        }
286
        else if (prefsData->tabFillChar == "_")
287
        {
288
                tabFillCombo->setEditable(false);
2219 fschmid 289
                tabFillCombo->setCurrentItem(3);
2282 fschmid 290
        }
291
        else
292
        {
293
                tabFillCombo->setCurrentItem(4);
294
                tabFillCombo->setEditable(true);
295
                tabFillCombo->setEditText( tr("Custom: "+prefsData->tabFillChar));
296
        }
3093 fschmid 297
        subTabTextLayout->addWidget( tabFillCombo, 6, 1, Qt::AlignLeft );
2219 fschmid 298
        textLabel3b2t = new QLabel(tabFillCombo, tr( "Tab Fill Character:" ), subTabText, "textLabel3b2t" );
3093 fschmid 299
        subTabTextLayout->addWidget( textLabel3b2t, 6, 0 );
2285 fschmid 300
        gapTab = new MSpinBox( 1, 200, subTabText, precision );
301
        gapTab->setSuffix( unit );
302
        gapTab->setValue(prefsData->dTabWidth * unitRatio);
3093 fschmid 303
        subTabTextLayout->addWidget( gapTab, 6, 3, Qt::AlignLeft );
2285 fschmid 304
        textLabel3b2t2 = new QLabel(gapTab, tr( "Tab Width:" ), subTabText, "textLabel3b2t2" );
3093 fschmid 305
        subTabTextLayout->addWidget( textLabel3b2t2, 6, 2 );
1195 fschmid 306
        columnsText = new QSpinBox( subTabText, "columnsText" );
307
        columnsText->setMinValue( 1 );
308
        columnsText->setMaxValue(100);
309
        columnsText->setValue(prefsData->dCols);
3093 fschmid 310
        subTabTextLayout->addWidget( columnsText, 7, 1, Qt::AlignLeft );
1195 fschmid 311
        textLabel4b = new QLabel(columnsText, tr("Colu&mns:"), subTabText, "TextCol");
3093 fschmid 312
        subTabTextLayout->addWidget( textLabel4b, 7, 0 );
1790 cbradney 313
        gapText = new MSpinBox( 0, 200, subTabText, precision );
1195 fschmid 314
        gapText->setSuffix( unit );
1790 cbradney 315
        gapText->setValue(prefsData->dGap * unitRatio);
3093 fschmid 316
        subTabTextLayout->addWidget( gapText, 7, 3, Qt::AlignLeft );
1195 fschmid 317
        textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol");
3093 fschmid 318
        subTabTextLayout->addWidget( textLabel5b, 7, 2 );
1195 fschmid 319
        previewText = new QLabel( tr( "Woven silk pyjamas exchanged for blue quartz" ), subTabText, "previewText" );
320
        previewText->setMinimumSize( QSize( 280, 70 ) );
321
        previewText->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
3093 fschmid 322
        subTabTextLayout->addMultiCellWidget( previewText, 8, 8, 0, 3 );
1195 fschmid 323
        subStackTools->addWidget( subTabText, 0 );
324
 
325
        subTabShape = new QWidget( subStackTools, "subTabShape" );
326
        subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
327
        subTabShapeLayout->setAlignment( Qt::AlignTop );
3457 avox 328
        colorComboLineShape = new ScComboBox( true, subTabShape, "colorComboLineShape" );
1195 fschmid 329
        colorComboLineShape->setEditable(false);
330
        colorComboLineShape->insertItem( tr("None"));
331
        if (prefsData->dPen == "None")
332
                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
333
        if (doc != 0)
334
        {
335
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
336
                {
3046 fschmid 337
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
2636 cbradney 338
                        colorComboLineShape->insertItem(*pm, itc.key());
1195 fschmid 339
                        if (itc.key() == prefsData->dPen)
340
                                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
341
                }
342
        }
343
        else
344
        {
2871 cbradney 345
                ColorList* colorList=prefsManager->colorSetPtr();
346
                ColorList::Iterator endOfColorList=colorList->end();
347
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
1195 fschmid 348
                {
3046 fschmid 349
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
2636 cbradney 350
                        colorComboLineShape->insertItem( *pm, itc.key());
1195 fschmid 351
                        if (itc.key() == prefsData->dPen)
352
                                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
353
                }
354
        }
355
        subTabShapeLayout->addWidget( colorComboLineShape, 0, 1, Qt::AlignLeft );
356
        textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" );
357
        subTabShapeLayout->addWidget( textLabel7b, 0, 0 );
358
        shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" );
359
        shadingLineShape->setMaxValue( 100 );
360
        shadingLineShape->setSuffix( tr( " %" ) );
361
        shadingLineShape->setMinValue( 0 );
362
        shadingLineShape->setValue(prefsData->dShade2);
363
        subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
364
        textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
365
        subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
3457 avox 366
        comboFillShape = new ScComboBox( true, subTabShape, "comboFillShape" );
1195 fschmid 367
        comboFillShape->setEditable(false);
368
        comboFillShape->insertItem( tr("None"));
369
        if (prefsData->dBrush == "None")
370
                comboFillShape->setCurrentItem(comboFillShape->count()-1);
371
        if (doc != 0)
372
        {
373
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
374
                {
3046 fschmid 375
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
2636 cbradney 376
                        comboFillShape->insertItem( *pm, itc.key());
1195 fschmid 377
                        if (itc.key() == prefsData->dBrush)
378
                                comboFillShape->setCurrentItem(comboFillShape->count()-1);
379
                }
380
        }
381
        else
382
        {
2871 cbradney 383
                ColorList* colorList=prefsManager->colorSetPtr();
384
                ColorList::Iterator endOfColorList=colorList->end();
385
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
1195 fschmid 386
                {
3046 fschmid 387
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
2636 cbradney 388
                        comboFillShape->insertItem( *pm, itc.key());
1195 fschmid 389
                        if (itc.key() == prefsData->dBrush)
390
                                comboFillShape->setCurrentItem(comboFillShape->count()-1);
391
                }
392
        }
393
        subTabShapeLayout->addWidget( comboFillShape, 2, 1, Qt::AlignLeft );
394
        textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" );
395
        subTabShapeLayout->addWidget( textLabel9b, 2, 0 );
396
        shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" );
397
        shadingFillShape->setMaxValue( 100 );
398
        shadingFillShape->setSuffix( tr( " %" ) );
399
        shadingFillShape->setMinValue( 0 );
400
        shadingFillShape->setValue(prefsData->dShade);
401
        subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft );
402
        textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" );
403
        subTabShapeLayout->addWidget( textLabel10b, 3, 0 );
404
        comboStyleShape = new LineCombo(subTabShape);
405
        comboStyleShape->setEditable(false);
406
        switch (prefsData->dLineArt)
407
        {
408
        case SolidLine:
409
                comboStyleShape->setCurrentItem(0);
410
                break;
411
        case DashLine:
412
                comboStyleShape->setCurrentItem(1);
413
                break;
414
        case DotLine:
415
                comboStyleShape->setCurrentItem(2);
416
                break;
417
        case DashDotLine:
418
                comboStyleShape->setCurrentItem(3);
419
                break;
420
        case DashDotDotLine:
421
                comboStyleShape->setCurrentItem(4);
422
                break;
423
        default:
424
                comboStyleShape->setCurrentItem(0);
425
                break;
426
        }
427
        subTabShapeLayout->addWidget( comboStyleShape, 4, 1, Qt::AlignLeft );
428
        textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" );
429
        subTabShapeLayout->addWidget( textLabel11b, 4, 0 );
430
        lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 );
431
        lineWidthShape->setSuffix( tr( " pt" ) );
432
        lineWidthShape->setValue(prefsData->dWidth);
433
        subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft );
434
        textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" );
435
        subTabShapeLayout->addWidget( textLabel12b, 5, 0 );
436
        subStackTools->addWidget( subTabShape, 1 );
437
 
438
        subTabLine = new QWidget( subStackTools, "subTabLine" );
439
        subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
440
        subTabLineLayout->setAlignment( Qt::AlignTop );
3457 avox 441
        colorComboLine = new ScComboBox( true, subTabLine, "colorComboLine" );
1195 fschmid 442
        colorComboLine->setEditable(false);
443
        colorComboLine->insertItem( tr("None"));
444
        if (prefsData->dPenLine == "None")
445
                colorComboLine->setCurrentItem(colorComboLine->count()-1);
446
        if (doc != 0)
447
        {
448
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
449
                {
3046 fschmid 450
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
2636 cbradney 451
                        colorComboLine->insertItem( *pm, itc.key());
1195 fschmid 452
                        if (itc.key() == prefsData->dPenLine)
453
                                colorComboLine->setCurrentItem(colorComboLine->count()-1);
454
                }
455
        }
456
        else
457
        {
2871 cbradney 458
                ColorList* colorList=prefsManager->colorSetPtr();
459
                ColorList::Iterator endOfColorList=colorList->end();
460
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
1195 fschmid 461
                {
3046 fschmid 462
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
2636 cbradney 463
                        colorComboLine->insertItem( *pm, itc.key());
1195 fschmid 464
                        if (itc.key() == prefsData->dPenLine)
465
                                colorComboLine->setCurrentItem(colorComboLine->count()-1);
466
                }
467
        }
468
        subTabLineLayout->addMultiCellWidget( colorComboLine, 0, 0, 1, 2, Qt::AlignLeft );
469
        textLabel13b = new QLabel(colorComboLine, tr("&Line Color:"), subTabLine, "textLabel13b" );
470
        subTabLineLayout->addWidget( textLabel13b, 0, 0 );
471
        shadingLine = new QSpinBox( subTabLine, "shadingLine" );
472
        shadingLine->setMaxValue( 100 );
473
        shadingLine->setValue(prefsData->dShadeLine);
474
        shadingLine->setSuffix( tr( " %" ) );
475
        subTabLineLayout->addMultiCellWidget( shadingLine, 1, 1, 1, 2, Qt::AlignLeft );
476
        textLabel14b = new QLabel(shadingLine, tr("&Shading:"), subTabLine, "textLabel14b" );
477
        subTabLineLayout->addWidget( textLabel14b, 1, 0 );
478
        comboStyleLine = new LineCombo(subTabLine);
479
        comboStyleLine->setEditable(false);
480
        switch (prefsData->dLstyleLine)
481
        {
482
        case SolidLine:
483
                comboStyleLine->setCurrentItem(0);
484
                break;
485
        case DashLine:
486
                comboStyleLine->setCurrentItem(1);
487
                break;
488
        case DotLine:
489
                comboStyleLine->setCurrentItem(2);
490
                break;
491
        case DashDotLine:
492
                comboStyleLine->setCurrentItem(3);
493
                break;
494
        case DashDotDotLine:
495
                comboStyleLine->setCurrentItem(4);
496
                break;
497
        default:
498
                comboStyleLine->setCurrentItem(0);
499
                break;
500
        }
501
        subTabLineLayout->addMultiCellWidget( comboStyleLine, 2, 2, 1, 2, Qt::AlignLeft );
502
        textLabel15b = new QLabel(subTabLine, tr("Line S&tyle:"), subTabLine, "textLabel15b" );
503
        subTabLineLayout->addWidget( textLabel15b, 2, 0 );
504
        startArrow = new ArrowChooser(subTabLine, true);
505
        subTabLineLayout->addWidget( startArrow, 4, 1 );
506
        endArrow = new ArrowChooser(subTabLine, false);
507
        subTabLineLayout->addWidget( endArrow, 4, 2 );
508
        if (doc != 0)
509
        {
510
                startArrow->rebuildList(&doc->arrowStyles);
511
                endArrow->rebuildList(&doc->arrowStyles);
512
        }
513
        else
514
        {
2834 cbradney 515
                startArrow->rebuildList(&prefsManager->appPrefs.arrowStyles);
516
                endArrow->rebuildList(&prefsManager->appPrefs.arrowStyles);
1195 fschmid 517
        }
518
        startArrow->setCurrentItem(prefsData->dStartArrow);
519
        endArrow->setCurrentItem(prefsData->dEndArrow);
520
        arrowText = new QLabel( tr( "Arrows:" ), subTabLine, "arrowText" );
521
        subTabLineLayout->addMultiCellWidget( arrowText, 3, 4, 0, 0 );
522
        startArrowText = new QLabel( startArrow, tr( "Start:" ), subTabLine, "startArrowText" );
523
        subTabLineLayout->addWidget( startArrowText, 3, 1 );
524
        endArrowText = new QLabel( endArrow, tr( "End:" ), subTabLine, "endArrowText" );
525
        subTabLineLayout->addWidget( endArrowText, 3, 2 );
526
        lineWidthLine = new MSpinBox( 1, 36, subTabLine, 1 );
527
        lineWidthLine->setSuffix( tr( " pt" ) );
528
        lineWidthLine->setValue(prefsData->dWidthLine);
529
        subTabLineLayout->addMultiCellWidget( lineWidthLine, 5, 5, 1, 2, Qt::AlignLeft );
530
        textLabel16b = new QLabel(lineWidthLine, tr("Line &Width:"), subTabLine, "textLabel16b" );
531
        subTabLineLayout->addWidget( textLabel16b, 5, 0 );
532
        subStackTools->addWidget( subTabLine, 2 );
533
 
534
        subTabImage = new QWidget( subStackTools, "subTabImage" );
535
        subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout");
536
        subTabImageLayout->setAlignment( Qt::AlignTop );
537
        buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" );
538
        buttonGroup3->setCheckable( true );
539
        buttonGroup3->setChecked( prefsData->scaleType );
540
        buttonGroup3->setColumnLayout(0, Qt::Vertical );
541
        buttonGroup3->layout()->setSpacing( 6 );
542
        buttonGroup3->layout()->setMargin( 11 );
543
        buttonGroup3->setTitle( tr( "&Free Scaling" ) );
544
        buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
545
        buttonGroup3Layout->setAlignment( Qt::AlignTop );
546
        scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" );
547
        scalingHorizontal->setMaxValue( 1000 );
548
        scalingHorizontal->setMinValue( 1 );
549
        scalingHorizontal->setValue(qRound(prefsData->scaleX * 100));
550
        scalingHorizontal->setSuffix( tr( " %" ) );
551
        buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1, Qt::AlignRight );
552
        textLabel17b = new QLabel(scalingHorizontal, tr("&Horizontal Scaling:"), buttonGroup3, "textLabel17b" );
553
        buttonGroup3Layout->addWidget( textLabel17b, 0, 0 );
554
        scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" );
555
        scalingVertical->setMaxValue( 1000 );
556
        scalingVertical->setMinValue( 1 );
557
        scalingVertical->setSuffix( tr( " %" ) );
558
        scalingVertical->setValue(qRound(prefsData->scaleY * 100));
559
        buttonGroup3Layout->addWidget( scalingVertical, 1, 1, Qt::AlignRight );
560
        textLabel18b = new QLabel(scalingVertical, tr( "&Vertical Scaling:" ), buttonGroup3, "textLabel18b" );
561
        buttonGroup3Layout->addWidget( textLabel18b, 1, 0 );
562
        chainButton = new LinkButton( buttonGroup3 );
563
        chainButton->setToggleButton( true );
564
        chainButton->setAutoRaise(true);
565
        buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft );
566
        subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 );
567
        buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" );
568
        buttonGroup5->setCheckable( true );
569
        buttonGroup5->setChecked( !prefsData->scaleType );
570
        buttonGroup5->setColumnLayout(0, Qt::Vertical );
571
        buttonGroup5->layout()->setSpacing( 6 );
572
        buttonGroup5->layout()->setMargin( 11 );
573
        buttonGroup5->setTitle( tr( "&Scale Picture to Frame Size" ) );
574
        buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() );
575
        buttonGroup5Layout->setAlignment( Qt::AlignTop );
576
        checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" );
577
        checkRatioImage->setText( tr( "Keep Aspect &Ratio" ) );
578
        checkRatioImage->setChecked(prefsData->aspectRatio);
579
        buttonGroup5Layout->addWidget( checkRatioImage );
580
        subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
3457 avox 581
        comboFillImage = new ScComboBox( true, subTabImage, "comboFillImage" );
1195 fschmid 582
        comboFillImage->setEditable(false);
583
        comboFillImage->insertItem( tr("None"));
584
        if (prefsData->dBrushPict == "None")
585
                comboFillImage->setCurrentItem(comboFillImage->count()-1);
586
        if (doc != 0)
587
        {
588
                for (itc = doc->PageColors.begin(); itc != doc->PageColors.end(); ++itc)
589
                {
3046 fschmid 590
                        QPixmap * pm = getSmallPixmap(doc->PageColors[itc.key()].getRawRGBColor());
2636 cbradney 591
                        comboFillImage->insertItem( *pm, itc.key());
1195 fschmid 592
                        if (itc.key() == prefsData->dBrushPict)
593
                                comboFillImage->setCurrentItem(comboFillImage->count()-1);
594
                }
595
        }
596
        else
597
        {
2871 cbradney 598
                ColorList* colorList=prefsManager->colorSetPtr();
599
                ColorList::Iterator endOfColorList=colorList->end();
600
                for (itc = colorList->begin(); itc != endOfColorList; ++itc)
1195 fschmid 601
                {
3046 fschmid 602
                        QPixmap * pm = getSmallPixmap((*colorList)[itc.key()].getRawRGBColor());
2636 cbradney 603
                        comboFillImage->insertItem( *pm, itc.key());
1195 fschmid 604
                        if (itc.key() == prefsData->dBrushPict)
605
                                comboFillImage->setCurrentItem(comboFillImage->count()-1);
606
                }
607
        }
608
        subTabImageLayout->addWidget( comboFillImage, 2, 1, Qt::AlignLeft );
609
        textLabel19b = new QLabel(comboFillImage, tr( "F&ill Color:" ), subTabImage, "textLabel19b" );
610
        subTabImageLayout->addWidget( textLabel19b, 2, 0 );
611
        shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" );
612
        shadingFillImage->setMaxValue( 100 );
613
        shadingFillImage->setValue( prefsData->shadePict );
614
        shadingFillImage->setSuffix( tr( " %" ) );
615
        subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft );
616
        textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" );
617
        subTabImageLayout->addWidget( textLabel20b, 3, 0 );
2040 fschmid 618
        embeddedPath = new QCheckBox( subTabImage, "embeddedPath" );
619
        embeddedPath->setText( tr( "Use embedded Clipping Path" ) );
620
        embeddedPath->setChecked(prefsData->useEmbeddedPath);
621
        subTabImageLayout->addMultiCellWidget( embeddedPath, 4, 4, 0, 1 );
2025 fschmid 622
        buttonGroupRes = new QButtonGroup( subTabImage, "buttonGroup3" );
623
        buttonGroupRes->setColumnLayout(0, Qt::Vertical );
624
        buttonGroupRes->layout()->setSpacing( 6 );
625
        buttonGroupRes->layout()->setMargin( 11 );
626
        buttonGroupRes->setExclusive( true );
627
        buttonGroupRes->setTitle( tr( "On Screen Preview" ) );
628
        buttonGroupResLayout = new QVBoxLayout( buttonGroupRes->layout() );
629
        buttonGroupResLayout->setAlignment( Qt::AlignTop );
630
        checkFullRes = new QRadioButton( buttonGroupRes, "checkFullRes" );
631
        checkFullRes->setText( tr( "Full Resolution Preview" ) );
632
        buttonGroupResLayout->addWidget( checkFullRes );
633
        checkNormalRes = new QRadioButton( buttonGroupRes, "checkNormalRes" );
634
        checkNormalRes->setText( tr( "Normal Resolution Preview" ) );
635
        buttonGroupResLayout->addWidget( checkNormalRes );
636
        checkHalfRes = new QRadioButton( buttonGroupRes, "checkHalfRes" );
2012 fschmid 637
        checkHalfRes->setText( tr( "Low Resolution Preview" ) );
2025 fschmid 638
        buttonGroupResLayout->addWidget( checkHalfRes );
639
        switch (prefsData->lowResType)
640
        {
641
                case 0:
642
                        checkFullRes->setChecked(true);
643
                        break;
644
                case 1:
645
                        checkNormalRes->setChecked(true);
646
                        break;
647
                case 2:
648
                        checkHalfRes->setChecked(true);
649
                        break;
650
        }
2040 fschmid 651
        subTabImageLayout->addMultiCellWidget( buttonGroupRes, 5, 5, 0, 1 );
1195 fschmid 652
        subStackTools->addWidget( subTabImage, 3 );
653
 
654
        subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
655
        subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout");
656
        subTabPolygonLayout->setAlignment( Qt::AlignTop );
657
        polyWidget = new PolygonWidget(subTabPolygon, prefsData->polyC, prefsData->polyFd, prefsData->polyF, prefsData->polyS, prefsData->polyR);
658
        subTabPolygonLayout->addWidget( polyWidget );
659
        subStackTools->addWidget( subTabPolygon, 4 );
660
 
661
        subTabZoom = new QWidget( subStackTools, "subTabZoom" );
662
        subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout");
663
        subTabZoomLayout->setAlignment( Qt::AlignTop );
664
        minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" );
665
        minimumZoom->setMaxValue( 3200 );
666
        minimumZoom->setMinValue( 10 );
667
        minimumZoom->setValue(prefsData->magMin);
668
        minimumZoom->setSuffix( tr( " %" ) );
669
        subTabZoomLayout->addWidget( minimumZoom, 0, 1, Qt::AlignLeft );
670
        textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" );
671
        subTabZoomLayout->addWidget( textLabel21b, 0, 0);
672
        maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" );
673
        maximumZoom->setMaxValue( 3200 );
674
        maximumZoom->setMinValue( 10 );
675
        maximumZoom->setValue(prefsData->magMax);
676
        maximumZoom->setSuffix( tr( " %" ) );
677
        subTabZoomLayout->addWidget( maximumZoom, 1, 1, Qt::AlignLeft );
678
        textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" );
679
        subTabZoomLayout->addWidget( textLabel22b, 1, 0 );
680
        zoomStep = new QSpinBox( subTabZoom, "zoomStep" );
681
        zoomStep->setMaxValue( 200 );
682
        zoomStep->setMinValue( 1 );
683
        zoomStep->setLineStep( 25 );
684
        zoomStep->setValue( prefsData->magStep );
685
        zoomStep->setSuffix( tr( " %" ) );
686
        subTabZoomLayout->addWidget( zoomStep, 2, 1, Qt::AlignLeft );
687
        textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" );
688
        subTabZoomLayout->addWidget( textLabel23b, 2, 0 );
689
        subStackTools->addWidget( subTabZoom, 5 );
690
        tabToolsLayout->addWidget( subStackTools );
691
        toolText->setOn(true);
692
        setSample();
693
        QToolTip::add( toolText, tr( "Text Frame Properties" ) );
694
        QToolTip::add( toolImage, tr( "Picture Frame Properties" ) );
695
        QToolTip::add( toolShape, tr( "Shape Drawing Properties" ) );
696
        QToolTip::add( toolZoom, tr( "Magnification Level Defaults" ) );
697
        QToolTip::add( toolLine, tr( "Line Drawing Properties" ) );
698
        QToolTip::add( toolPoly, tr( "Polygon Drawing Properties" ) );
699
        QToolTip::add( fontComboText, tr( "Font for new text frames" ) );
700
        QToolTip::add( sizeComboText, tr( "Size of font for new text frames" ) );
701
        QToolTip::add( colorComboText, tr( "Color of font" ) );
702
        QToolTip::add( columnsText, tr( "Number of columns in a text frame" ) );
703
        QToolTip::add( gapText, tr( "Gap between text frame columns" ) );
704
        QToolTip::add( previewText, tr( "Sample of your font" ) );
705
        QToolTip::add( buttonGroup3, tr( "Picture frames allow pictures to scale to any size" ) );
706
        QToolTip::add( scalingHorizontal, tr( "Horizontal scaling of images" ) );
707
        QToolTip::add( scalingVertical, tr( "Vertical scaling of images" ) );
708
        QToolTip::add( chainButton, tr( "Keep horizontal and vertical scaling the same" ) );
709
        QToolTip::add( buttonGroup5, tr( "Pictures in picture frames are scaled to the size of the frame" ) );
710
        QToolTip::add( checkRatioImage, tr( "Automatically scaled pictures keep their original proportions" ) );
711
        QToolTip::add( comboFillImage, tr( "Fill color of picture frames" ) );
712
        QToolTip::add( shadingFillImage, tr( "Saturation of color of fill" ) );
713
        QToolTip::add( colorComboLineShape, tr( "Line color of shapes" ) );
714
        QToolTip::add( shadingLineShape, tr( "Saturation of color of lines" ) );
715
        QToolTip::add( comboFillShape, tr( "Fill color of shapes" ) );
716
        QToolTip::add( shadingFillShape, tr( "Saturation of color of fill" ) );
717
        QToolTip::add( comboStyleShape, tr( "Line style of shapes" ) );
718
        QToolTip::add( lineWidthShape, tr( "Line width of shapes" ) );
719
        QToolTip::add( minimumZoom, tr( "Minimum magnification allowed" ) );
720
        QToolTip::add( maximumZoom, tr( "Maximum magnification allowed" ) );
721
        QToolTip::add( zoomStep, tr( "Change in magnification for each zoom operation" ) );
722
        QToolTip::add( colorComboLine, tr( "Color of lines" ) );
723
        QToolTip::add( shadingLine, tr( "Saturation of color" ) );
724
        QToolTip::add( comboStyleLine, tr( "Style of lines" ) );
725
        QToolTip::add( lineWidthLine, tr( "Width of lines" ) );
726
        connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool()));
727
        connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool()));
728
        connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool()));
729
        connect(toolText, SIGNAL(clicked()), this, SLOT(setTool()));
730
        connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool()));
731
        connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool()));
732
        connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
733
        connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
734
        connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int)));
735
        connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int)));
736
        connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
737
        connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
738
        connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
3629 fschmid 739
        connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
1195 fschmid 740
}
741
 
1828 fschmid 742
void TabTools::restoreDefaults()
743
{
744
}
745
 
2282 fschmid 746
void TabTools::setCustomFillChar(const QString &txt)
747
{
748
        if (txt == tr("Custom:"))
749
                return;
750
        disconnect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
3629 fschmid 751
        disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
2282 fschmid 752
        QString ret = txt.right(1);
753
        if (tabFillCombo->editable())
754
        {
755
                tabFillCombo->setCurrentItem(4);
756
                tabFillCombo->setEditText( tr("Custom: ")+ret);
757
                tabFillCombo->changeItem( tr("Custom: ")+ret, 4);
758
        }
759
        connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
3629 fschmid 760
        connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
2282 fschmid 761
}
762
 
3629 fschmid 763
void TabTools::setFillChar(int act)
2282 fschmid 764
{
765
        disconnect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
3629 fschmid 766
        disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
767
        switch (act)
2282 fschmid 768
        {
769
                case 0:
770
                case 1:
771
                case 2:
772
                case 3:
3629 fschmid 773
                        tabFillCombo->setCurrentItem(act);
2282 fschmid 774
                        tabFillCombo->setEditable(false);
775
                        break;
776
                case 4:
777
                        tabFillCombo->setEditable(true);
3629 fschmid 778
                        tabFillCombo->setEditText( tr("Custom: "));
2282 fschmid 779
                        tabFillCombo->changeItem( tr("Custom: "), 4);
3629 fschmid 780
                        tabFillCombo->lineEdit()->setFocus();
781
                        tabFillCombo->lineEdit()->setCursorPosition( tr("Custom: ").length());
782
                        connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
2282 fschmid 783
                        break;
784
        }
3629 fschmid 785
        connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
2282 fschmid 786
}
787
 
1195 fschmid 788
/*!
789
 \fn void TabTools::ToggleKette()
790
 \author Franz Schmid
791
 \date  
792
 \brief TabTools (Tools, Image Frame), Sets Y Scale value from X Scale value when chain is toggled
793
 \param None
794
 \retval None
795
 */
796
void TabTools::toggleChain()
797
{
798
        if (chainButton->isOn())
799
                scalingVertical->setValue(scalingHorizontal->value());
800
}
801
 
802
/*!
803
 \fn void TabTools::HChange()
804
 \author Franz Schmid
805
 \date  
806
 \brief TabTools (Tools, Image Frame), Sets Y Scale value from X Scale value when X Scale value is changed
807
 \param None
808
 \retval None
809
 */
810
void TabTools::hChange()
811
{
812
        if (chainButton->isOn())
813
                scalingVertical->setValue(scalingHorizontal->value());
814
}
815
 
816
/*!
817
 \fn void TabTools::vChange()
818
 \author Franz Schmid
819
 \date  
820
 \brief TabTools (Tools, Image Frame). Sets X Scale value from Y Scale value when Y Scale value is changed
821
 \param None
822
 \retval None
823
 */
824
void TabTools::vChange()
825
{
826
        if (chainButton->isOn())
827
                scalingHorizontal->setValue(scalingVertical->value());
828
}
829
 
830
void TabTools::changeImageScalingFree(int)
831
{
832
        if (buttonGroup3->isChecked())
833
                buttonGroup5->setChecked(false);
834
        else
835
                buttonGroup5->setChecked(true);
836
}
837
 
838
void TabTools::changeImageScalingRatio(int)
839
{
840
        if (buttonGroup5->isChecked())
841
                buttonGroup3->setChecked(false);
842
        else
843
                buttonGroup3->setChecked(true);
844
}
845
 
846
/*!
847
 \fn void TabTools::SetSample()
848
 \author Franz Schmid
849
 \date  
850
 \brief TabTools (Tools, Text frame), Sets the sample text in selected font in text frame preferences
851
 \param None
852
 \retval None
853
 */
854
void TabTools::setSample()
855
{
856
        QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" );
857
        int s = sizeComboText->currentText().left(2).toInt();
2834 cbradney 858
        QPixmap pm = fontSamples(PrefsManager::instance()->appPrefs.AvailFonts[fontComboText->currentText()], s, ts, paletteBackgroundColor());
1195 fschmid 859
        previewText->setPixmap(pm);
860
}
861
 
862
/*!
863
 \fn void TabTools::SetTool()
864
 \author Franz Schmid
865
 \date  
866
 \brief TabTools (Tools), Raises widget for selected Tool properties
867
 \param None
868
 \retval None
869
 */
870
void TabTools::setTool()
871
{
872
        if (toolText == sender())
873
                subStackTools->raiseWidget(0);
874
        if (toolShape == sender())
875
                subStackTools->raiseWidget(1);
876
        if (toolLine == sender())
877
                subStackTools->raiseWidget(2);
878
        if (toolImage == sender())
879
                subStackTools->raiseWidget(3);
880
        if (toolPoly == sender())
881
                subStackTools->raiseWidget(4);
882
        if (toolZoom == sender())
883
                subStackTools->raiseWidget(5);
884
}