Subversion Repositories Scribus

Rev

Rev 782 | Details | Compare with Previous | Last modification | View Log | RSS feed

<
Rev Author Line No. Line
3 paul 1
#include "prefs.h"
2
#include "prefs.moc"
3
#include "keymanager.h"
263 Franz 4
#include "scribusdoc.h"
3 paul 5
#include <qfont.h>
6
#include <qcolordialog.h>
663 cbradney 7
#include <qcombobox.h>
3 paul 8
#include <qcolor.h>
9
#include <qstringlist.h>
10
#include <qstylefactory.h>
11
#include <qpointarray.h>
12
#include <qpainter.h>
13
#include <qrect.h>
14
#include <qwmatrix.h>
15
#include <cmath>
663 cbradney 16
#include "langmgr.h"
714 cbradney 17
#include "fontcombo.h"
731 fschmid 18
#include "polygonwidget.h"
782 fschmid 19
#include "arrowchooser.h"
788 fschmid 20
#include "tabtypography.h"
3 paul 21
 
504 cbradney 22
using namespace std;
23
 
418 Franz 24
extern QPixmap fontSamples(QString da, int s, QString ts, QColor back);
3 paul 25
extern QPixmap loadIcon(QString nam);
26
 
776 fschmid 27
extern "C" void* Run(QWidget *d, preV *prefsData);
3 paul 28
 
199 Franz 29
/*!
776 fschmid 30
 \fn void* Run(QWidget *d, preV *prefsData)
145 Franz 31
 \author Franz Schmid
32
 \date  
33
 \brief Creates Preferences dialog and returns pointer to it
202 Franz 34
 \param d QWidget * to Preferences dialog widget
776 fschmid 35
 \param prefsData preV * struct
202 Franz 36
 \retval dia * widget pointer
145 Franz 37
 */
776 fschmid 38
void* Run(QWidget *d, preV *prefsData)
3 paul 39
{
776 fschmid 40
        Preferences *dia = new Preferences(d, prefsData);
3 paul 41
        return dia;
42
}
43
 
199 Franz 44
/*!
776 fschmid 45
 \fn Preferences::Preferences( QWidget* parent, preV *prefsData)
145 Franz 46
 \author Franz Schmid
47
 \date  
48
 \brief Constructor for Preferences dialog box
49
 \param parent QWidget pointer to parent window
776 fschmid 50
 \param prefsData preV * struct
145 Franz 51
 \retval Preferences dialog
52
 */
776 fschmid 53
Preferences::Preferences( QWidget* parent, preV *prefsData) : PrefsDialogBase( parent )
3 paul 54
{
173 Franz 55
        int decimals;
776 fschmid 56
        fon = &prefsData->AvailFonts;
188 Franz 57
        ap = (ScribusApp*)parent;
199 Franz 58
        Umrech = 1.0;
776 fschmid 59
        Einheit = prefsData->Einheit;
333 Franz 60
        int f[] = {2, 3, 4};
188 Franz 61
        if (Einheit == 3)
62
                decimals = f[0];
63
        else
64
                decimals = f[Einheit];
776 fschmid 65
        DisScale = prefsData->DisScale;
199 Franz 66
        setCaption( tr( "Preferences" ) );
45 Franz 67
 
776 fschmid 68
        tab = new QWidget( prefsWidgets, "tab" );
199 Franz 69
        tabLayout = new QGridLayout( tab );
70
        tabLayout->setSpacing( 6 );
71
        tabLayout->setMargin( 10 );
776 fschmid 72
        tabLayout->setAlignment( Qt::AlignTop );
663 cbradney 73
 
74
        // GUI Group
341 Franz 75
        ButtonGroup1 = new QButtonGroup( tr( "GUI" ), tab, "ButtonGroup1" );
199 Franz 76
        ButtonGroup1->setColumnLayout(0, Qt::Vertical );
77
        ButtonGroup1->layout()->setSpacing( 0 );
78
        ButtonGroup1->layout()->setMargin( 0 );
79
        ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
80
        ButtonGroup1Layout->setAlignment( Qt::AlignTop );
81
        ButtonGroup1Layout->setSpacing( 6 );
82
        ButtonGroup1Layout->setMargin( 10 );
663 cbradney 83
 
84
        langMgr.init();
85
        QStringList languageList;
86
        langMgr.fillInstalledStringList(&languageList, true);
675 cbradney 87
        languageList.sort();
663 cbradney 88
        guiLangCombo = new QComboBox( false, ButtonGroup1, "guiLangCombo");
89
        guiLangCombo->insertStringList( languageList );
776 fschmid 90
        guiLangCombo->setCurrentText(langMgr.getLangFromAbbrev(prefsData->guiLanguage));
91
        selectedGUILang=prefsData->guiLanguage;
663 cbradney 92
        guiLangLabel = new QLabel(guiLangCombo, tr("&Language:"), ButtonGroup1, "guiLangLabel");
93
        ButtonGroup1Layout->addWidget( guiLangLabel, 0, 0 );
782 fschmid 94
        ButtonGroup1Layout->addWidget( guiLangCombo, 0, 1, Qt::AlignLeft );
95
 
199 Franz 96
        GUICombo = new QComboBox( true, ButtonGroup1, "GUICombo" );
188 Franz 97
        QStringList STtest;
98
        STtest = QStyleFactory::keys();
99
        for (uint stt = 0; stt < STtest.count(); ++stt)
100
                GUICombo->insertItem(STtest[stt]);
199 Franz 101
        GUICombo->setEditable(false);
776 fschmid 102
        GUICombo->setCurrentText(prefsData->GUI);
341 Franz 103
        TextGstil = new QLabel(GUICombo, tr("&Theme:"), ButtonGroup1, "dd");
663 cbradney 104
        ButtonGroup1Layout->addWidget( TextGstil, 1, 0 );
782 fschmid 105
        ButtonGroup1Layout->addWidget( GUICombo, 1, 1, Qt::AlignLeft );
106
 
199 Franz 107
        GFsize = new QSpinBox(ButtonGroup1, "gfs" );
351 Franz 108
        GFsize->setSuffix( tr( " pt" ) );
199 Franz 109
        GFsize->setMaxValue( 22 );
110
        GFsize->setMinValue( 8 );
776 fschmid 111
        GFsize->setValue( prefsData->AppFontSize );
341 Franz 112
        TextGstil2 = new QLabel(GFsize, tr("&Font Size:"), ButtonGroup1, "dd");
663 cbradney 113
        ButtonGroup1Layout->addWidget( TextGstil2, 2, 0 );
782 fschmid 114
        ButtonGroup1Layout->addWidget( GFsize, 2, 1, Qt::AlignLeft );
115
        SpinBox3 = new QSpinBox( ButtonGroup1, "SpinBox3" );
199 Franz 116
        SpinBox3->setMaxValue( 1000 );
117
        SpinBox3->setMinValue( 0 );
118
        SpinBox3->setLineStep( 10 );
776 fschmid 119
        SpinBox3->setValue( prefsData->Wheelval );
782 fschmid 120
        TextLabel1_2 = new QLabel( SpinBox3, tr( "&Wheel Jump:" ), ButtonGroup1, "TextLabel1_2" );
121
        ButtonGroup1Layout->addWidget( TextLabel1_2, 3, 0 );
122
        ButtonGroup1Layout->addWidget( SpinBox3, 3, 1, Qt::AlignLeft );
123
        Recen = new QSpinBox( ButtonGroup1, "Recen" );
199 Franz 124
        Recen->setMaxValue( 30 );
125
        Recen->setMinValue( 1 );
776 fschmid 126
        Recen->setValue( prefsData->RecentDCount );
782 fschmid 127
        TextLabel4c = new QLabel( Recen, tr( "&Recent Documents:" ), ButtonGroup1, "TextLabel4c" );
128
        ButtonGroup1Layout->addWidget( TextLabel4c, 4, 0);
129
        ButtonGroup1Layout->addWidget( Recen, 4, 1, Qt::AlignLeft );
130
        tabLayout->addWidget( ButtonGroup1, 0, 0 );
3 paul 131
 
341 Franz 132
        GroupBox200 = new QGroupBox( tr( "Paths" ), tab, "GroupBox200" );
199 Franz 133
        GroupBox200->setColumnLayout(0, Qt::Horizontal );
134
        GroupBox200->layout()->setSpacing( 0 );
135
        GroupBox200->layout()->setMargin( 0 );
136
        GroupBox200Layout = new QGridLayout( GroupBox200->layout() );
137
        GroupBox200Layout->setAlignment( Qt::AlignTop );
138
        GroupBox200Layout->setSpacing( 0 );
139
        GroupBox200Layout->setMargin( 5 );
782 fschmid 140
 
199 Franz 141
        Docs = new QLineEdit( GroupBox200, "Datei" );
142
        Docs->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 143
        Docs->setText(prefsData->DocDir);
341 Franz 144
        PfadText = new QLabel( Docs, tr("&Documents:"), GroupBox200, "Pfadtext" );
199 Franz 145
        FileC = new QToolButton( GroupBox200, "FileC" );
146
        FileC->setMinimumSize( QSize( 88, 24 ) );
341 Franz 147
        FileC->setText( tr( "&Change..." ) );
148
        GroupBox200Layout->addWidget( PfadText, 0, 0 );
149
        GroupBox200Layout->addWidget( Docs, 0, 1 );
199 Franz 150
        GroupBox200Layout->addWidget( FileC, 0, 2 );
776 fschmid 151
 
199 Franz 152
        ProPfad = new QLineEdit( GroupBox200, "Datei1" );
153
        ProPfad->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 154
        ProPfad->setText(prefsData->ProfileDir);
341 Franz 155
        PfadText2 = new QLabel( ProPfad, tr("&ICC Profiles:"), GroupBox200, "Pfadtext1" );
199 Franz 156
        FileC2 = new QToolButton( GroupBox200, "FileC1" );
157
        FileC2->setMinimumSize( QSize( 88, 24 ) );
341 Franz 158
        FileC2->setText( tr( "C&hange..." ) );
159
        GroupBox200Layout->addWidget( PfadText2, 1, 0 );
160
        GroupBox200Layout->addWidget( ProPfad, 1, 1 );
199 Franz 161
        GroupBox200Layout->addWidget( FileC2, 1, 2 );
91 Franz 162
 
199 Franz 163
        ScriptPfad = new QLineEdit( GroupBox200, "Datei1" );
164
        ScriptPfad->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 165
        ScriptPfad->setText(prefsData->ScriptDir);
341 Franz 166
        PfadText3 = new QLabel( ScriptPfad, tr("&Scripts:"), GroupBox200, "Pfadtext1" );
199 Franz 167
        FileC3 = new QToolButton( GroupBox200, "FileC3" );
168
        FileC3->setMinimumSize( QSize( 88, 24 ) );
341 Franz 169
        FileC3->setText( tr( "Ch&ange..." ) );
170
        GroupBox200Layout->addWidget( PfadText3, 2, 0 );
171
        GroupBox200Layout->addWidget( ScriptPfad, 2, 1 );
199 Franz 172
        GroupBox200Layout->addWidget( FileC3, 2, 2 );
91 Franz 173
 
410 Franz 174
        TemplateDir = new QLineEdit( GroupBox200, "Datei1" );
175
        TemplateDir->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 176
        TemplateDir->setText(prefsData->TemplateDir);
410 Franz 177
        PfadText4 = new QLabel( TemplateDir, tr("T&emplates:"), GroupBox200, "Pfadtext1" );
178
        FileC4 = new QToolButton( GroupBox200, "FileC4" );
179
        FileC4->setMinimumSize( QSize( 88, 24 ) );
180
        FileC4->setText( tr( "Cha&nge..." ) );
181
        GroupBox200Layout->addWidget( PfadText4, 3, 0 );
182
        GroupBox200Layout->addWidget( TemplateDir, 3, 1 );
183
        GroupBox200Layout->addWidget( FileC4, 3, 2 );
782 fschmid 184
        tabLayout->addWidget( GroupBox200, 1, 0 );
776 fschmid 185
        addItem( tr("General"), loadIcon("AppIcon.png"), tab);
410 Franz 186
 
776 fschmid 187
        tab_7 = new QWidget( prefsWidgets, "tab_7" );
199 Franz 188
        tabLayout_7 = new QHBoxLayout( tab_7, 11, 6, "tabLayout_7");
189
        Layout21 = new QVBoxLayout( 0, 0, 6, "Layout21");
341 Franz 190
        GroupSize = new QButtonGroup( tr( "Page Size" ), tab_7, "GroupSize" );
199 Franz 191
        GroupSize->setColumnLayout(0, Qt::Vertical );
192
        GroupSize->layout()->setSpacing( 6 );
193
        GroupSize->layout()->setMargin( 10 );
194
        GroupSizeLayout = new QVBoxLayout( GroupSize->layout() );
195
        GroupSizeLayout->setAlignment( Qt::AlignTop );
196
        Layout6 = new QGridLayout( 0, 1, 1, 0, 6, "Layout6");
782 fschmid 197
 
199 Franz 198
        GZComboF = new QComboBox( true, GroupSize, "GZComboF" );
782 fschmid 199
        const QString ar_size[] =
200
            {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3",
201
             "B4", "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive",
202
             "Folio", "Ledger", "Legal", "Letter", "Tabloid"
203
            };
188 Franz 204
        size_t ar_s = sizeof(ar_size) / sizeof(*ar_size);
205
        for (uint s = 0; s < ar_s; ++s)
199 Franz 206
                GZComboF->insertItem(ar_size[s]);
207
        GZComboF->insertItem( tr( "Custom" ) );
188 Franz 208
        GZComboF->setEditable(false);
776 fschmid 209
        GZComboF->setCurrentItem(prefsData->PageFormat);
341 Franz 210
        GZText1 = new QLabel( GZComboF, tr( "&Size:" ), GroupSize, "GZText1" );
211
        Layout6->addWidget( GZText1, 0, 0 );
199 Franz 212
        Layout6->addWidget( GZComboF, 0, 1 );
3 paul 213
 
199 Franz 214
        GZComboO = new QComboBox( true, GroupSize, "GZComboO" );
215
        GZComboO->insertItem( tr( "Portrait" ) );
216
        GZComboO->insertItem( tr( "Landscape" ) );
188 Franz 217
        GZComboO->setEditable(false);
776 fschmid 218
        GZComboO->setCurrentItem(prefsData->Ausrichtung);
341 Franz 219
        GZText2 = new QLabel( GZComboO, tr( "Orie&ntation:" ), GroupSize, "GZText2" );
220
        Layout6->addWidget( GZText2, 1, 0 );
199 Franz 221
        Layout6->addWidget( GZComboO, 1, 1 );
782 fschmid 222
        UnitCombo = new QComboBox( true, GroupSize, "UnitCombo" );
223
        UnitCombo->insertItem( tr( "Points (pt)" ) );
224
        UnitCombo->insertItem( tr( "Millimetres (mm)" ) );
225
        UnitCombo->insertItem( tr( "Inches (in)" ) );
226
        UnitCombo->insertItem( tr( "Picas (p)" ) );
227
        UnitCombo->setEditable(false);
228
        UnitCombo->setCurrentItem(prefsData->Einheit);
229
        unitComboText = new QLabel( UnitCombo, tr( "Units:" ), GroupSize, "unitComboText" );
230
        Layout6->addWidget( unitComboText, 2, 0 );
231
        Layout6->addWidget( UnitCombo, 2, 1 );
3 paul 232
 
199 Franz 233
        GroupSizeLayout->addLayout( Layout6 );
3 paul 234
 
199 Franz 235
        Layout5_2 = new QHBoxLayout( 0, 0, 6, "Layout5_2");
3 paul 236
 
782 fschmid 237
        pageWidth = new MSpinBox( 1, 10000, GroupSize, decimals );
238
        pageWidth->setEnabled( false );
239
        pageWidth->setMinimumSize( QSize( 70, 20 ) );
240
        pageWidth->setValue(prefsData->PageBreite * Umrech);
241
        GZText3 = new QLabel( pageWidth, tr( "&Width:" ), GroupSize, "GZText3" );
242
        Layout5_2->addWidget( GZText3 );
243
        Layout5_2->addWidget( pageWidth );
3 paul 244
 
782 fschmid 245
        pageHeight = new MSpinBox( 1, 10000, GroupSize, decimals );
246
        pageHeight->setEnabled( false );
247
        pageHeight->setMinimumSize( QSize( 70, 20 ) );
248
        pageHeight->setValue(prefsData->PageHoehe * Umrech);
249
        GZText4 = new QLabel( pageHeight, tr( "&Height:" ), GroupSize, "GZText4" );
250
        Layout5_2->addWidget( GZText4 );
251
        Layout5_2->addWidget( pageHeight );
252
 
199 Franz 253
        GroupSizeLayout->addLayout( Layout5_2 );
782 fschmid 254
 
199 Franz 255
        Layout8 = new QHBoxLayout( 0, 0, 6, "Layout8");
3 paul 256
 
782 fschmid 257
        facingPages = new QCheckBox( tr( "&Facing Pages" ), GroupSize, "facingPages" );
258
        facingPages->setChecked(prefsData->DoppelSeiten);
259
        Layout8->addWidget( facingPages );
3 paul 260
 
341 Franz 261
        Linkszuerst = new QCheckBox( tr( "Left &Page First" ), GroupSize, "Linkszuerst" );
776 fschmid 262
        Linkszuerst->setChecked(prefsData->ErsteLinks);
782 fschmid 263
        if (!facingPages->isChecked())
188 Franz 264
                Linkszuerst->setEnabled(false);
199 Franz 265
        Layout8->addWidget( Linkszuerst );
266
        GroupSizeLayout->addLayout( Layout8 );
267
        Layout21->addWidget( GroupSize );
3 paul 268
 
341 Franz 269
        GroupRand = new QGroupBox( tr( "Margin Guides" ), tab_7, "GroupRand" );
199 Franz 270
        GroupRand->setColumnLayout(0, Qt::Vertical );
271
        GroupRand->layout()->setSpacing( 5 );
272
        GroupRand->layout()->setMargin( 10 );
273
        GroupRandLayout = new QGridLayout( GroupRand->layout() );
274
        GroupRandLayout->setAlignment( Qt::AlignTop );
3 paul 275
 
333 Franz 276
        TopR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 277
        TopR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 278
        TopR->setValue(prefsData->RandOben * Umrech);
279
        RandT = prefsData->RandOben;
199 Franz 280
        GroupRandLayout->addWidget( TopR, 0, 1 );
333 Franz 281
        BottomR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 282
        BottomR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 283
        BottomR->setValue(prefsData->RandUnten * Umrech);
284
        RandB = prefsData->RandUnten;
199 Franz 285
        GroupRandLayout->addWidget( BottomR, 1, 1 );
333 Franz 286
        RightR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 287
        RightR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 288
        RightR->setValue(prefsData->RandRechts * Umrech);
289
        RandR = prefsData->RandRechts;
199 Franz 290
        GroupRandLayout->addWidget( RightR, 1, 3 );
333 Franz 291
        LeftR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 292
        LeftR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 293
        LeftR->setValue(prefsData->RandLinks * Umrech);
294
        RandL = prefsData->RandLinks;
199 Franz 295
        GroupRandLayout->addWidget( LeftR, 0, 3 );
3 paul 296
 
341 Franz 297
        GRText2 = new QLabel( BottomR, tr( "&Bottom:" ), GroupRand, "GRText2" );
199 Franz 298
        GroupRandLayout->addWidget( GRText2, 1, 0 );
341 Franz 299
        GRText1 = new QLabel( TopR, tr( "&Top:" ), GroupRand, "GRText1" );
199 Franz 300
        GroupRandLayout->addWidget( GRText1, 0, 0 );
341 Franz 301
        GRText4 = new QLabel( RightR, tr( "&Right:" ), GroupRand, "GRText4" );
199 Franz 302
        GroupRandLayout->addWidget( GRText4, 1, 2 );
341 Franz 303
        GRText3 = new QLabel( LeftR, tr( "&Left:" ), GroupRand, "GRText3" );
199 Franz 304
        GroupRandLayout->addWidget( GRText3, 0, 2 );
3 paul 305
 
199 Franz 306
        Layout21->addWidget( GroupRand );
3 paul 307
 
341 Franz 308
        GroupAS = new QGroupBox( tr( "Autosave" ), tab_7, "GroupAS" );
199 Franz 309
        GroupAS->setColumnLayout(0, Qt::Vertical );
310
        GroupAS->layout()->setSpacing( 5 );
311
        GroupAS->layout()->setMargin( 10 );
312
        GroupASLayout = new QGridLayout( GroupAS->layout() );
313
        GroupASLayout->setAlignment( Qt::AlignTop );
341 Franz 314
        ASon = new QCheckBox( tr( "&Enabled" ), GroupAS, "Enable Autosave" );
776 fschmid 315
        ASon->setChecked(prefsData->AutoSave);
199 Franz 316
        GroupASLayout->addMultiCellWidget( ASon, 0, 0, 0, 1 );
317
        ASTime = new QSpinBox( GroupAS, "Time" );
318
        ASTime->setMaxValue( 60 );
319
        ASTime->setMinValue( 1 );
320
        ASTime->setSuffix( " " + tr("min") );
776 fschmid 321
        ASTime->setValue(prefsData->AutoSaveTime / 1000 / 60);
341 Franz 322
        ASText = new QLabel( ASTime, tr( "&Interval:" ), GroupAS, "ASText" );
323
        GroupASLayout->addWidget( ASText, 1, 0 );
199 Franz 324
        GroupASLayout->addWidget( ASTime, 1, 1 );
782 fschmid 325
        Layout21->addWidget( GroupAS );
326
        tabLayout_7->addLayout( Layout21 );
776 fschmid 327
        addItem( tr("Document"), loadIcon("page.png"), tab_7);
3 paul 328
 
776 fschmid 329
        tabGuides = new QWidget( prefsWidgets, "tabView" );
330
        tabGuidesLayout = new QVBoxLayout( tabGuides, 10, 5, "tabViewLayout");
331
        tabGuidesLayout->setAlignment( Qt::AlignTop );
332
        checkGrid = new QGroupBox( tabGuides, "checkGrid" );
333
        checkGrid->setTitle( tr( "Show Grid" ) );
334
        checkGrid->setCheckable( true );
335
        checkGrid->setChecked(prefsData->GridShown);
336
        checkGrid->setColumnLayout(0, Qt::Vertical );
337
        checkGrid->layout()->setSpacing( 5 );
338
        checkGrid->layout()->setMargin( 10 );
339
        checkGridLayout = new QGridLayout( checkGrid->layout() );
340
        checkGridLayout->setAlignment( Qt::AlignTop );
341
        groupBox1 = new QGroupBox( checkGrid, "groupBox1" );
342
        groupBox1->setColumnLayout(0, Qt::Vertical );
343
        groupBox1->layout()->setSpacing( 5 );
344
        groupBox1->layout()->setMargin( 10 );
345
        groupBox1->setTitle( tr( "Major Grid" ) );
346
        groupBox1Layout = new QGridLayout( groupBox1->layout() );
347
        groupBox1Layout->setAlignment( Qt::AlignTop );
348
        majorGridColor = new QPushButton( groupBox1, "majorGridColor" );
349
        majorGridColor->setMinimumSize( QSize( 60, 20 ) );
350
        majorGridColor->setMaximumSize( QSize( 60, 20 ) );
351
        majorGridColor->setFlat( false );
352
        majorGridColor->setAutoDefault( false );
353
        QPixmap pm1 = QPixmap(54, 14);
354
        pm1.fill(prefsData->DmajColor);
355
        colorMajorGrid = prefsData->DmajColor;
356
        majorGridColor->setPixmap(pm1);
357
        majorGridColor->setText( QString::null );
358
        groupBox1Layout->addWidget( majorGridColor, 1, 1 );
359
        textLabel4 = new QLabel( groupBox1, "textLabel4" );
360
        textLabel4->setText( tr( "Color:" ) );
361
        groupBox1Layout->addWidget( textLabel4, 1, 0 );
362
        textLabel6 = new QLabel( groupBox1, "textLabel6" );
363
        textLabel6->setText( tr( "Spacing:" ) );
364
        groupBox1Layout->addWidget( textLabel6, 0, 0 );
365
        majorSpace = new MSpinBox( 10 * Umrech, 1000 * Umrech, groupBox1, decimals );
366
        majorSpace->setValue( prefsData->DmajGrid * Umrech );
367
        groupBox1Layout->addWidget( majorSpace, 0, 1 );
368
        checkGridLayout->addWidget( groupBox1, 0, 0 );
369
        groupBox2 = new QGroupBox( checkGrid, "groupBox2" );
370
        groupBox2->setColumnLayout(0, Qt::Vertical );
371
        groupBox2->layout()->setSpacing( 5 );
372
        groupBox2->layout()->setMargin( 10 );
373
        groupBox2->setTitle( tr( "Minor Grid" ) );
374
        groupBox2Layout = new QGridLayout( groupBox2->layout() );
375
        groupBox2Layout->setAlignment( Qt::AlignTop );
376
        textLabel5 = new QLabel( groupBox2, "textLabel5" );
377
        textLabel5->setText( tr( "Color:" ) );
378
        groupBox2Layout->addWidget( textLabel5, 1, 0 );
379
        minorGridColor = new QPushButton( groupBox2, "minorGridColor" );
380
        minorGridColor->setMinimumSize( QSize( 60, 20 ) );
381
        minorGridColor->setMaximumSize( QSize( 60, 20 ) );
382
        minorGridColor->setFlat( false );
383
        minorGridColor->setAutoDefault( false );
384
        QPixmap pm = QPixmap(54, 14);
385
        pm.fill(prefsData->DminColor);
386
        colorMinorGrid = prefsData->DminColor;
387
        minorGridColor->setPixmap(pm);
388
        minorGridColor->setText( QString::null );
389
        groupBox2Layout->addWidget( minorGridColor, 1, 1 );
390
        textLabel7 = new QLabel( groupBox2, "textLabel7" );
391
        textLabel7->setText( tr( "Spacing:" ) );
392
        groupBox2Layout->addWidget( textLabel7, 0, 0 );
393
        minorSpace = new MSpinBox(Umrech, 1000 * Umrech, groupBox2, decimals);
394
        minorSpace->setValue(prefsData->DminGrid * Umrech);
395
        groupBox2Layout->addWidget( minorSpace, 0, 1 );
396
        checkGridLayout->addWidget( groupBox2, 0, 1 );
397
        tabGuidesLayout->addWidget( checkGrid );
398
        layout11 = new QGridLayout( 0, 1, 1, 0, 5, "layout11");
399
        textLabel8 = new QLabel( tabGuides, "textLabel8" );
400
        textLabel8->setText( tr( "Guide Snap Distance:" ) );
401
        layout11->addWidget( textLabel8, 0, 0 );
402
        snapDistance = new MSpinBox( Umrech, 1000 * Umrech, tabGuides, decimals );
403
        snapDistance->setValue( prefsData->GuideRad * Umrech );
404
        layout11->addWidget( snapDistance, 0, 1, Qt::AlignLeft );
405
        textLabel82 = new QLabel( tabGuides, "textLabel8" );
406
        textLabel82->setText( tr( "&Grab Radius:" ) );
782 fschmid 407
        layout11->addWidget( textLabel82, 1, 0 );
776 fschmid 408
        grabDistance = new QSpinBox( tabGuides, "grabDistance" );
409
        grabDistance->setMaxValue( 1000 );
410
        grabDistance->setMinValue( 1 );
411
        grabDistance->setLineStep( 1 );
412
        grabDistance->setValue(prefsData->GrabRad );
413
        grabDistance->setSuffix( tr( " px" ) );
414
        layout11->addWidget( grabDistance, 1, 1, Qt::AlignLeft );
415
        checkMargin = new QCheckBox( tabGuides, "checkMargin" );
416
        checkMargin->setText( tr( "Show Margins" ) );
417
        checkMargin->setChecked(prefsData->MarginsShown);
418
        layout11->addWidget( checkMargin, 2, 0 );
419
        checkGuides = new QCheckBox( tabGuides, "checkGuides" );
420
        checkGuides->setText( tr( "Show Guides" ) );
421
        checkGuides->setChecked(prefsData->GuidesShown);
422
        layout11->addWidget( checkGuides, 3, 0 );
423
        checkBaseline = new QCheckBox( tabGuides, "checkBaseline" );
424
        checkBaseline->setText( tr( "Show Baseline Grid" ) );
425
        checkBaseline->setChecked(prefsData->BaseShown);
426
        layout11->addWidget( checkBaseline, 4, 0 );
427
        layout2 = new QHBoxLayout( 0, 0, 5, "layout2");
428
        textLabel2 = new QLabel( tabGuides, "textLabel2" );
429
        textLabel2->setText( tr( "Color:" ) );
430
        layout2->addWidget( textLabel2 );
431
        baselineColor = new QPushButton( tabGuides, "baselineColor" );
432
        baselineColor->setMinimumSize( QSize( 60, 20 ) );
433
        baselineColor->setMaximumSize( QSize( 60, 20 ) );
434
        baselineColor->setFlat( false );
435
        baselineColor->setAutoDefault( false );
436
        QPixmap pm4 = QPixmap(54, 14);
437
        pm4.fill(prefsData->baseColor);
438
        colorBaselineGrid = prefsData->baseColor;
439
        baselineColor->setPixmap(pm4);
440
        baselineColor->setText( QString::null );
441
        layout2->addWidget( baselineColor );
442
        layout11->addLayout( layout2, 4, 1 );
443
        layout3 = new QHBoxLayout( 0, 0, 5, "layout3");
444
        textLabel3 = new QLabel( tabGuides, "textLabel3" );
445
        textLabel3->setText( tr( "Color:" ) );
446
        layout3->addWidget( textLabel3 );
447
        guideColor = new QPushButton( tabGuides, "guideColor" );
448
        guideColor->setMinimumSize( QSize( 60, 20 ) );
449
        guideColor->setMaximumSize( QSize( 60, 20 ) );
450
        guideColor->setFlat( false );
451
        guideColor->setAutoDefault( false );
452
        QPixmap pm3 = QPixmap(54, 14);
453
        pm3.fill(prefsData->guideColor);
454
        colorGuides = prefsData->guideColor;
455
        guideColor->setPixmap(pm3);
456
        guideColor->setText( QString::null );
457
        layout3->addWidget( guideColor );
458
        layout11->addLayout( layout3, 3, 1 );
459
        layout9 = new QHBoxLayout( 0, 0, 5, "layout9");
460
        textLabel1 = new QLabel( tabGuides, "textLabel1" );
461
        textLabel1->setText( tr( "Color:" ) );
462
        layout9->addWidget( textLabel1 );
463
        marginColor = new QPushButton( tabGuides, "marginColor" );
464
        marginColor->setMinimumSize( QSize( 60, 20 ) );
465
        marginColor->setMaximumSize( QSize( 60, 20 ) );
466
        marginColor->setAutoDefault( false );
467
        QPixmap pm6 = QPixmap(54, 14);
468
        pm6.fill(prefsData->DmargColor);
469
        colorMargin = prefsData->DmargColor;
470
        marginColor->setPixmap(pm6);
471
        marginColor->setFlat( false );
472
        marginColor->setText( QString::null );
473
        layout9->addWidget( marginColor );
474
        layout11->addLayout( layout9, 2, 1 );
475
        tabGuidesLayout->addLayout( layout11 );
476
        layout12 = new QGridLayout( 0, 1, 1, 0, 5, "layout12");
477
        checkLink = new QCheckBox( tabGuides, "checkLink" );
478
        checkLink->setText( tr( "Show Text Chains" ) );
479
        checkLink->setChecked(prefsData->linkShown);
480
        layout12->addWidget( checkLink, 1, 0 );
481
        checkFrame = new QCheckBox( tabGuides, "checkFrame" );
482
        checkFrame->setText( tr( "Show Frames" ) );
483
        checkFrame->setChecked(prefsData->FramesShown);
484
        layout12->addWidget( checkFrame, 0, 0 );
485
        checkPictures = new QCheckBox( tabGuides, "checkPictures" );
486
        checkPictures->setText( tr( "Show Pictures" ) );
487
        layout12->addWidget( checkPictures, 0, 1 );
488
        checkPictures->setChecked(prefsData->ShowPic);
489
        tabGuidesLayout->addLayout( layout12 );
490
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
491
 
788 fschmid 492
        tabTypo = new TabTypograpy(  prefsWidgets,
493
                                                                                                                                prefsData->DVTief,
494
                                                                                                                                prefsData->DVTiefSc,
495
                                                                                                                                prefsData->DVHoch,
496
                                                                                                                                prefsData->DVHochSc,
497
                                                                                                                                prefsData->DVKapit,
498
                                                                                                                                prefsData->BaseGrid * Umrech,
499
                                                                                                                                prefsData->BaseOffs * Umrech,
500
                                                                                                                                prefsData->AutoLine,
501
                                                                                                                                "");
776 fschmid 502
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
3 paul 503
 
782 fschmid 504
        tabTools = new QWidget( prefsWidgets, "tabTools" );
505
        tabToolsLayout = new QHBoxLayout( tabTools, 11, 6, "tabToolsLayout");
506
        buttonGroupTools = new QButtonGroup( tabTools, "buttonGroupTools" );
507
        buttonGroupTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, buttonGroupTools->sizePolicy().hasHeightForWidth() ) );
508
        buttonGroupTools->setExclusive( true );
509
        buttonGroupTools->setRadioButtonExclusive( true );
510
        buttonGroupTools->setColumnLayout(0, Qt::Vertical );
511
        buttonGroupTools->layout()->setSpacing( 5 );
512
        buttonGroupTools->layout()->setMargin( 5 );
513
        buttonGroupTools->setTitle( QString::null );
514
        buttonGroupToolsLayout = new QVBoxLayout( buttonGroupTools->layout() );
515
        buttonGroupToolsLayout->setAlignment( Qt::AlignTop );
516
        toolText = new QToolButton( buttonGroupTools, "toolText" );
517
        toolText->setToggleButton( true );
518
        toolText->setText( QString::null );
519
        toolText->setIconSet( QIconSet( loadIcon("Text.xpm") ) );
520
        buttonGroupToolsLayout->addWidget( toolText );
521
        toolImage = new QToolButton( buttonGroupTools, "toolImage" );
522
        toolImage->setToggleButton( true );
523
        toolImage->setText( QString::null );
524
        toolImage->setIconSet( QIconSet( loadIcon("Bild.xpm") ) );
525
        buttonGroupToolsLayout->addWidget( toolImage );
526
        toolShape = new QToolButton( buttonGroupTools, "toolShape" );
527
        toolShape->setToggleButton( true );
528
        toolShape->setText( QString::null );
529
        toolShape->setIconSet( QIconSet( loadIcon("Rechtecke.xpm") ) );
530
        buttonGroupToolsLayout->addWidget( toolShape);
531
        toolPoly = new QToolButton( buttonGroupTools, "toolPoly" );
532
        toolPoly->setToggleButton( true );
533
        toolPoly->setText( QString::null );
534
        toolPoly->setIconSet( QIconSet( loadIcon("spline.png") ) );
535
        buttonGroupToolsLayout->addWidget( toolPoly );
536
        toolLine = new QToolButton( buttonGroupTools, "toolLine" );
537
        toolLine->setToggleButton( true );
538
        toolLine->setText( QString::null );
539
        toolLine->setIconSet( QIconSet( loadIcon("Stift.xpm") ) );
540
        buttonGroupToolsLayout->addWidget( toolLine );
541
        toolZoom = new QToolButton( buttonGroupTools, "toolZoom" );
542
        toolZoom->setToggleButton( true );
543
        toolZoom->setText( QString::null );
544
        toolZoom->setIconSet( QIconSet( loadIcon("Lupe.xpm") ) );
545
        buttonGroupToolsLayout->addWidget( toolZoom );
546
        tabToolsLayout->addWidget( buttonGroupTools );
547
        subStackTools = new QWidgetStack( tabTools, "subStackTools" );
548
        subStackTools->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, subStackTools->sizePolicy().hasHeightForWidth() ) );
549
        subStackTools->setFrameShape( QWidgetStack::GroupBoxPanel );
550
        subStackTools->setFrameShadow( QWidgetStack::Sunken );
199 Franz 551
 
782 fschmid 552
        subTabText = new QWidget( subStackTools, "subTabText" );
553
        subTabTextLayout = new QGridLayout( subTabText, 1, 1, 11, 6, "subTabTextLayout");
554
        fontComboText = new FontCombo(subTabText, prefsData);
555
        for (int fc=0; fc<fontComboText->count(); ++fc)
188 Franz 556
        {
782 fschmid 557
                if (fontComboText->text(fc) == prefsData->DefFont)
199 Franz 558
                {
782 fschmid 559
                        fontComboText->setCurrentItem(fc);
726 fschmid 560
                        break;
199 Franz 561
                }
188 Franz 562
        }
782 fschmid 563
        subTabTextLayout->addMultiCellWidget( fontComboText, 0, 0, 1, 3, Qt::AlignLeft );
564
        textLabel1b = new QLabel( fontComboText, tr( "Font:" ), subTabText, "textLabel1b" );
565
        subTabTextLayout->addWidget( textLabel1b, 0, 0 );
566
        sizeComboText = new QComboBox( true, subTabText, "SizeCombo" );
567
        sizeComboText->setEditable(false);
456 fschmid 568
        QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"};
188 Franz 569
        size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes);
570
        for (uint s = 0; s < f_size; ++s)
782 fschmid 571
                sizeComboText->insertItem(ar_sizes[s] + tr(" pt"));
572
        for (int a = 0; a < sizeComboText->count(); ++a)
188 Franz 573
        {
782 fschmid 574
                if (sizeComboText->text(a).left(2).toInt() == prefsData->DefSize / 10)
575
                        sizeComboText->setCurrentItem(a);
188 Franz 576
        }
782 fschmid 577
        subTabTextLayout->addMultiCellWidget( sizeComboText, 1, 1, 1, 3, Qt::AlignLeft );
578
        textLabel2b = new QLabel(sizeComboText, tr( "Size:" ), subTabText, "textLabel2b" );
579
        subTabTextLayout->addWidget( textLabel2b, 1, 0 );
580
        colorComboText = new QComboBox( true, subTabText, "colorComboText" );
581
        colorComboText->setEditable(false);
582
        QPixmap pmT2;
583
        pmT2 = QPixmap(15, 15);
188 Franz 584
        CListe::Iterator itc;
782 fschmid 585
        colorComboText->insertItem( tr("None"));
586
        if (prefsData->DpenText == "None")
587
                colorComboText->setCurrentItem(colorComboText->count()-1);
776 fschmid 588
        for (itc = prefsData->DColors.begin(); itc != prefsData->DColors.end(); ++itc)
188 Franz 589
        {
782 fschmid 590
                pmT2.fill(prefsData->DColors[itc.key()].getRGBColor());
591
                colorComboText->insertItem(pmT2, itc.key());
776 fschmid 592
                if (itc.key() == prefsData->DpenText)
782 fschmid 593
                        colorComboText->setCurrentItem(colorComboText->count()-1);
188 Franz 594
        }
782 fschmid 595
        subTabTextLayout->addMultiCellWidget( colorComboText, 2, 2, 1, 3, Qt::AlignLeft );
596
        textLabel3b = new QLabel(colorComboText, tr( "Fill Color:" ), subTabText, "textLabel3b" );
597
        subTabTextLayout->addWidget( textLabel3b, 2, 0 );
598
        colorComboStrokeText = new QComboBox( true, subTabText, "colorComboStrokeText" );
599
        colorComboStrokeText->setEditable(false);
600
        colorComboStrokeText->insertItem( tr("None"));
601
        if (prefsData->DstrokeText == "None")
602
                colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
603
        for (itc = prefsData->DColors.begin(); itc != prefsData->DColors.end(); ++itc)
604
        {
605
                pmT2.fill(prefsData->DColors[itc.key()].getRGBColor());
606
                colorComboStrokeText->insertItem(pmT2, itc.key());
607
                if (itc.key() == prefsData->DstrokeText)
608
                        colorComboStrokeText->setCurrentItem(colorComboStrokeText->count()-1);
609
        }
610
        subTabTextLayout->addMultiCellWidget( colorComboStrokeText, 3, 3, 1, 3, Qt::AlignLeft );
611
        textLabel3b2 = new QLabel(colorComboStrokeText, tr( "Stroke Color:" ), subTabText, "textLabel3b2" );
612
        subTabTextLayout->addWidget( textLabel3b2, 3, 0 );
613
        columnsText = new QSpinBox( subTabText, "columnsText" );
614
        columnsText->setMinValue( 1 );
615
        columnsText->setMaxValue(100);
616
        columnsText->setValue(prefsData->DCols);
617
        subTabTextLayout->addWidget( columnsText, 4, 1, Qt::AlignLeft );
618
        textLabel4b = new QLabel(columnsText, tr("Colu&mns:"), subTabText, "TextCol");
619
        subTabTextLayout->addWidget( textLabel4b, 4, 0 );
620
        gapText = new MSpinBox( 0, 200, subTabText, decimals );
621
        gapText->setSuffix( tr( " pt" ) );
622
        gapText->setValue(prefsData->DGap * Umrech);
623
        subTabTextLayout->addWidget( gapText, 4, 3, Qt::AlignLeft );
624
        textLabel5b = new QLabel(gapText, tr("&Gap:"), subTabText, "TextCol");
625
        subTabTextLayout->addWidget( textLabel5b, 4, 2 );
626
        previewText = new QLabel( tr( "Woven silk pyjamas exchanged for blue quartz" ), subTabText, "previewText" );
627
        previewText->setMinimumSize( QSize( 280, 70 ) );
628
        previewText->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
629
        subTabTextLayout->addMultiCellWidget( previewText, 5, 5, 0, 3 );
630
        subStackTools->addWidget( subTabText, 0 );
3 paul 631
 
782 fschmid 632
        subTabShape = new QWidget( subStackTools, "subTabShape" );
633
        subTabShapeLayout = new QGridLayout( subTabShape, 1, 1, 11, 6, "subTabShapeLayout");
634
        subTabShapeLayout->setAlignment( Qt::AlignTop );
635
        colorComboLineShape = new QComboBox( true, subTabShape, "colorComboLineShape" );
636
        colorComboLineShape->setEditable(false);
637
        colorComboLineShape->insertItem( tr("None"));
776 fschmid 638
        if (prefsData->Dpen == "None")
782 fschmid 639
                colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
640
        QPixmap pm2S = QPixmap(15, 15);
776 fschmid 641
        for (itc = prefsData->DColors.begin(); itc != prefsData->DColors.end(); ++itc)
188 Franz 642
        {
782 fschmid 643
                pm2S.fill(prefsData->DColors[itc.key()].getRGBColor());
644
                colorComboLineShape->insertItem(pm2S, itc.key());
776 fschmid 645
                if (itc.key() == prefsData->Dpen)
782 fschmid 646
                        colorComboLineShape->setCurrentItem(colorComboLineShape->count()-1);
188 Franz 647
        }
782 fschmid 648
        subTabShapeLayout->addWidget( colorComboLineShape, 0, 1, Qt::AlignLeft );
649
        textLabel7b = new QLabel( colorComboLineShape, tr( "&Line Color:" ), subTabShape, "textLabel7b" );
650
        subTabShapeLayout->addWidget( textLabel7b, 0, 0 );
651
        shadingLineShape = new QSpinBox( subTabShape, "shadingLineShape" );
652
        shadingLineShape->setMaxValue( 100 );
653
        shadingLineShape->setSuffix( tr( " %" ) );
654
        shadingLineShape->setMinValue( 0 );
655
        shadingLineShape->setValue(prefsData->Dshade2);
656
        subTabShapeLayout->addWidget( shadingLineShape, 1, 1, Qt::AlignLeft );
657
        textLabel8b = new QLabel( shadingLineShape, tr( "&Shading:" ), subTabShape, "textLabel8b" );
658
        subTabShapeLayout->addWidget( textLabel8b, 1, 0 );
659
        comboFillShape = new QComboBox( true, subTabShape, "comboFillShape" );
660
        comboFillShape->setEditable(false);
661
        comboFillShape->insertItem( tr("None"));
776 fschmid 662
        if (prefsData->Dbrush == "None")
782 fschmid 663
                comboFillShape->setCurrentItem(comboFillShape->count()-1);
776 fschmid 664
        for (itc = prefsData->DColors.begin(); itc != prefsData->DColors.end(); ++itc)
188 Franz 665
        {
782 fschmid 666
                pm2S.fill(prefsData->DColors[itc.key()].getRGBColor());
667
                comboFillShape->insertItem(pm2S, itc.key());
776 fschmid 668
                if (itc.key() == prefsData->Dbrush)
782 fschmid 669
                        comboFillShape->setCurrentItem(comboFillShape->count()-1);
188 Franz 670
        }
782 fschmid 671
        subTabShapeLayout->addWidget( comboFillShape, 2, 1, Qt::AlignLeft );
672
        textLabel9b = new QLabel( comboFillShape, tr( "&Fill Color:" ), subTabShape, "textLabel9b" );
673
        subTabShapeLayout->addWidget( textLabel9b, 2, 0 );
674
        shadingFillShape = new QSpinBox( subTabShape, "shadingFillShape" );
675
        shadingFillShape->setMaxValue( 100 );
676
        shadingFillShape->setSuffix( tr( " %" ) );
677
        shadingFillShape->setMinValue( 0 );
678
        shadingFillShape->setValue(prefsData->Dshade);
679
        subTabShapeLayout->addWidget( shadingFillShape, 3, 1, Qt::AlignLeft );
680
        textLabel10b = new QLabel( shadingFillShape, tr( "S&hading:" ), subTabShape, "textLabel10b" );
681
        subTabShapeLayout->addWidget( textLabel10b, 3, 0 );
682
        comboStyleShape = new LineCombo(subTabShape);
683
        comboStyleShape->setEditable(false);
776 fschmid 684
        switch (prefsData->DLineArt)
188 Franz 685
        {
199 Franz 686
        case SolidLine:
782 fschmid 687
                comboStyleShape->setCurrentItem(0);
199 Franz 688
                break;
689
        case DashLine:
782 fschmid 690
                comboStyleShape->setCurrentItem(1);
199 Franz 691
                break;
692
        case DotLine:
782 fschmid 693
                comboStyleShape->setCurrentItem(2);
199 Franz 694
                break;
695
        case DashDotLine:
782 fschmid 696
                comboStyleShape->setCurrentItem(3);
199 Franz 697
                break;
698
        case DashDotDotLine:
782 fschmid 699
                comboStyleShape->setCurrentItem(4);
199 Franz 700
                break;
701
        default:
782 fschmid 702
                comboStyleShape->setCurrentItem(0);
199 Franz 703
                break;
188 Franz 704
        }
782 fschmid 705
        subTabShapeLayout->addWidget( comboStyleShape, 4, 1, Qt::AlignLeft );
706
        textLabel11b = new QLabel( comboStyleShape, tr( "Line Style:" ), subTabShape, "textLabel11b" );
707
        subTabShapeLayout->addWidget( textLabel11b, 4, 0 );
708
        lineWidthShape = new MSpinBox( 0, 36, subTabShape, 1 );
709
        lineWidthShape->setSuffix( tr( " pt" ) );
710
        lineWidthShape->setValue(prefsData->Dwidth);
711
        subTabShapeLayout->addWidget( lineWidthShape, 5, 1, Qt::AlignLeft );
712
        textLabel12b = new QLabel( lineWidthShape, tr( "Line &Width:" ), subTabShape, "TextLabel2_3_4" );
713
        subTabShapeLayout->addWidget( textLabel12b, 5, 0 );
714
        subStackTools->addWidget( subTabShape, 1 );
80 Franz 715
 
782 fschmid 716
        subTabLine = new QWidget( subStackTools, "subTabLine" );
717
        subTabLineLayout = new QGridLayout( subTabLine, 1, 1, 11, 6, "subTabLineLayout");
718
        subTabLineLayout->setAlignment( Qt::AlignTop );
719
        colorComboLine = new QComboBox( true, subTabLine, "colorComboLine" );
720
        colorComboLine->setEditable(false);
721
        QPixmap pm2L = QPixmap(15, 15);
722
        comboFillShape->insertItem( tr("None"));
723
        if (prefsData->DpenLine == "None")
724
                colorComboLine->setCurrentItem(colorComboLine->count()-1);
725
        for (itc = prefsData->DColors.begin(); itc != prefsData->DColors.end(); ++itc)
188 Franz 726
        {
782 fschmid 727
                pm2L.fill(prefsData->DColors[itc.key()].getRGBColor());
728
                colorComboLine->insertItem(pm2L, itc.key());
729
                if (itc.key() == prefsData->DpenLine)
730
                        colorComboLine->setCurrentItem(colorComboLine->count()-1);
188 Franz 731
        }
782 fschmid 732
        subTabLineLayout->addMultiCellWidget( colorComboLine, 0, 0, 1, 2, Qt::AlignLeft );
733
        textLabel13b = new QLabel(colorComboLine, tr("&Line Color:"), subTabLine, "textLabel13b" );
734
        subTabLineLayout->addWidget( textLabel13b, 0, 0 );
735
        shadingLine = new QSpinBox( subTabLine, "shadingLine" );
736
        shadingLine->setMaxValue( 100 );
737
        shadingLine->setValue(prefsData->DshadeLine);
738
        shadingLine->setSuffix( tr( " %" ) );
739
        subTabLineLayout->addMultiCellWidget( shadingLine, 1, 1, 1, 2, Qt::AlignLeft );
740
        textLabel14b = new QLabel(shadingLine, tr("&Shading:"), subTabLine, "textLabel14b" );
741
        subTabLineLayout->addWidget( textLabel14b, 1, 0 );
742
        comboStyleLine = new LineCombo(subTabLine);
743
        comboStyleLine->setEditable(false);
744
        switch (prefsData->DLstyleLine)
188 Franz 745
        {
199 Franz 746
        case SolidLine:
782 fschmid 747
                comboStyleLine->setCurrentItem(0);
199 Franz 748
                break;
749
        case DashLine:
782 fschmid 750
                comboStyleLine->setCurrentItem(1);
199 Franz 751
                break;
752
        case DotLine:
782 fschmid 753
                comboStyleLine->setCurrentItem(2);
199 Franz 754
                break;
755
        case DashDotLine:
782 fschmid 756
                comboStyleLine->setCurrentItem(3);
199 Franz 757
                break;
758
        case DashDotDotLine:
782 fschmid 759
                comboStyleLine->setCurrentItem(4);
199 Franz 760
                break;
761
        default:
782 fschmid 762
                comboStyleLine->setCurrentItem(0);
199 Franz 763
                break;
188 Franz 764
        }
782 fschmid 765
        subTabLineLayout->addMultiCellWidget( comboStyleLine, 2, 2, 1, 2, Qt::AlignLeft );
766
        textLabel15b = new QLabel(subTabLine, tr("Line S&tyle:"), subTabLine, "textLabel15b" );
767
        subTabLineLayout->addWidget( textLabel15b, 2, 0 );
768
        startArrow = new ArrowChooser(subTabLine, true);
769
        subTabLineLayout->addWidget( startArrow, 4, 1 );
770
        endArrow = new ArrowChooser(subTabLine, false);
771
        subTabLineLayout->addWidget( endArrow, 4, 2 );
772
        startArrow->rebuildList(&prefsData->arrowStyles);
773
        endArrow->rebuildList(&prefsData->arrowStyles);
774
        startArrow->setCurrentItem(prefsData->DstartArrow);
775
        endArrow->setCurrentItem(prefsData->DendArrow);
776
        arrowText = new QLabel( tr( "Arrows:" ), subTabLine, "arrowText" );
777
        subTabLineLayout->addMultiCellWidget( arrowText, 3, 4, 0, 0 );
778
        startArrowText = new QLabel( startArrow, tr( "Start:" ), subTabLine, "startArrowText" );
779
        subTabLineLayout->addWidget( startArrowText, 3, 1 );
780
        endArrowText = new QLabel( endArrow, tr( "End:" ), subTabLine, "endArrowText" );
781
        subTabLineLayout->addWidget( endArrowText, 3, 2 );
782
        lineWidthLine = new MSpinBox( 1, 36, subTabLine, 1 );
783
        lineWidthLine->setSuffix( tr( " pt" ) );
784
        lineWidthLine->setValue(prefsData->DwidthLine);
785
        subTabLineLayout->addMultiCellWidget( lineWidthLine, 5, 5, 1, 2, Qt::AlignLeft );
786
        textLabel16b = new QLabel(lineWidthLine, tr("Line &Width:"), subTabLine, "textLabel16b" );
787
        subTabLineLayout->addWidget( textLabel16b, 5, 0 );
788
        subStackTools->addWidget( subTabLine, 2 );
199 Franz 789
 
782 fschmid 790
        subTabImage = new QWidget( subStackTools, "subTabImage" );
791
        subTabImageLayout = new QGridLayout( subTabImage, 1, 1, 11, 6, "subTabImageLayout");
792
        subTabImageLayout->setAlignment( Qt::AlignTop );
793
        buttonGroup3 = new QButtonGroup( subTabImage, "buttonGroup3" );
794
        buttonGroup3->setCheckable( true );
795
        buttonGroup3->setChecked( prefsData->ScaleType );
796
        buttonGroup3->setColumnLayout(0, Qt::Vertical );
797
        buttonGroup3->layout()->setSpacing( 6 );
798
        buttonGroup3->layout()->setMargin( 11 );
799
        buttonGroup3->setTitle( tr( "&Free Scaling" ) );
800
        buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
801
        buttonGroup3Layout->setAlignment( Qt::AlignTop );
802
        scalingHorizontal = new QSpinBox( buttonGroup3, "scalingHorizontal" );
803
        scalingHorizontal->setMaxValue( 1000 );
804
        scalingHorizontal->setMinValue( 1 );
805
        scalingHorizontal->setValue(qRound(prefsData->ScaleX * 100));
806
        scalingHorizontal->setSuffix( tr( " %" ) );
807
        buttonGroup3Layout->addWidget( scalingHorizontal, 0, 1, Qt::AlignRight );
808
        textLabel17b = new QLabel(scalingHorizontal, tr("&Horizontal Scaling:"), buttonGroup3, "textLabel17b" );
809
        buttonGroup3Layout->addWidget( textLabel17b, 0, 0 );
810
        scalingVertical = new QSpinBox( buttonGroup3, "scalingVertical" );
811
        scalingVertical->setMaxValue( 1000 );
812
        scalingVertical->setMinValue( 1 );
813
        scalingVertical->setSuffix( tr( " %" ) );
814
        scalingVertical->setValue(qRound(prefsData->ScaleY * 100));
815
        buttonGroup3Layout->addWidget( scalingVertical, 1, 1, Qt::AlignRight );
816
        textLabel18b = new QLabel(scalingVertical, tr( "&Vertical Scaling:" ), buttonGroup3, "textLabel18b" );
817
        buttonGroup3Layout->addWidget( textLabel18b, 1, 0 );
818
        chainButton = new LinkButton( buttonGroup3 );
819
        chainButton->setToggleButton( true );
820
        chainButton->setAutoRaise(true);
821
        buttonGroup3Layout->addMultiCellWidget( chainButton, 0, 1, 2, 2, Qt::AlignLeft );
822
        subTabImageLayout->addMultiCellWidget( buttonGroup3, 0, 0, 0, 1 );
823
        buttonGroup5 = new QButtonGroup( subTabImage, "buttonGroup5" );
824
        buttonGroup5->setCheckable( true );
825
        buttonGroup5->setChecked( !prefsData->ScaleType );
826
        buttonGroup5->setColumnLayout(0, Qt::Vertical );
827
        buttonGroup5->layout()->setSpacing( 6 );
828
        buttonGroup5->layout()->setMargin( 11 );
829
        buttonGroup5->setTitle( tr( "&Scale Picture to Frame Size" ) );
830
        buttonGroup5Layout = new QHBoxLayout( buttonGroup5->layout() );
831
        buttonGroup5Layout->setAlignment( Qt::AlignTop );
832
        checkRatioImage = new QCheckBox( buttonGroup5, "checkRatioImage" );
833
        checkRatioImage->setText( tr( "Keep Aspect &Ratio" ) );
834
        checkRatioImage->setChecked(prefsData->AspectRatio);
835
        buttonGroup5Layout->addWidget( checkRatioImage );
836
        subTabImageLayout->addMultiCellWidget( buttonGroup5, 1, 1, 0, 1 );
837
        comboFillImage = new QComboBox( true, subTabImage, "comboFillImage" );
838
        comboFillImage->setEditable(false);
839
        QPixmap pm2I = QPixmap(15, 15);
840
        comboFillImage->insertItem( tr("None"));
776 fschmid 841
        if (prefsData->DbrushPict == "None")
782 fschmid 842
                comboFillImage->setCurrentItem(comboFillImage->count()-1);
776 fschmid 843
        for (itc = prefsData->DColors.begin(); itc != prefsData->DColors.end(); ++itc)
188 Franz 844
        {
782 fschmid 845
                pm2I.fill(prefsData->DColors[itc.key()].getRGBColor());
846
                comboFillImage->insertItem(pm2I, itc.key());
776 fschmid 847
                if (itc.key() == prefsData->DbrushPict)
782 fschmid 848
                        comboFillImage->setCurrentItem(comboFillImage->count()-1);
188 Franz 849
        }
782 fschmid 850
        subTabImageLayout->addWidget( comboFillImage, 2, 1, Qt::AlignLeft );
851
        textLabel19b = new QLabel(comboFillImage, tr( "F&ill Color:" ), subTabImage, "textLabel19b" );
852
        subTabImageLayout->addWidget( textLabel19b, 2, 0 );
853
        shadingFillImage = new QSpinBox( subTabImage, "shadingFillImage" );
854
        shadingFillImage->setMaxValue( 100 );
855
        shadingFillImage->setValue( prefsData->ShadePict );
856
        shadingFillImage->setSuffix( tr( " %" ) );
857
        subTabImageLayout->addWidget( shadingFillImage, 3, 1, Qt::AlignLeft );
858
        textLabel20b = new QLabel(shadingFillImage, tr( "S&hading:" ), subTabImage, "textLabel20b" );
859
        subTabImageLayout->addWidget( textLabel20b, 3, 0 );
860
        subStackTools->addWidget( subTabImage, 3 );
199 Franz 861
 
782 fschmid 862
        subTabPolygon = new QWidget( subStackTools, "subTabPolygon" );
863
        subTabPolygonLayout = new QHBoxLayout( subTabPolygon, 11, 6, "subTabPolygonLayout");
864
        subTabPolygonLayout->setAlignment( Qt::AlignTop );
865
        polyWidget = new PolygonWidget(subTabPolygon, prefsData->PolyC, prefsData->PolyFd, prefsData->PolyF, prefsData->PolyS, prefsData->PolyR);
866
        subTabPolygonLayout->addWidget( polyWidget );
867
        subStackTools->addWidget( subTabPolygon, 4 );
3 paul 868
 
782 fschmid 869
        subTabZoom = new QWidget( subStackTools, "subTabZoom" );
870
        subTabZoomLayout = new QGridLayout( subTabZoom, 1, 1, 11, 6, "subTabZoomLayout");
871
        subTabZoomLayout->setAlignment( Qt::AlignTop );
872
        minimumZoom = new QSpinBox( subTabZoom, "minimumZoom" );
873
        minimumZoom->setMaxValue( 3200 );
874
        minimumZoom->setMinValue( 10 );
875
        minimumZoom->setValue(prefsData->MagMin);
876
        minimumZoom->setSuffix( tr( " %" ) );
877
        subTabZoomLayout->addWidget( minimumZoom, 0, 1, Qt::AlignLeft );
878
        textLabel21b = new QLabel( minimumZoom, tr( "Mi&nimum:" ), subTabZoom, "textLabel21b" );
879
        subTabZoomLayout->addWidget( textLabel21b, 0, 0);
880
        maximumZoom = new QSpinBox( subTabZoom, "maximumZoom" );
881
        maximumZoom->setMaxValue( 3200 );
882
        maximumZoom->setMinValue( 10 );
883
        maximumZoom->setValue(prefsData->MagMax);
884
        maximumZoom->setSuffix( tr( " %" ) );
885
        subTabZoomLayout->addWidget( maximumZoom, 1, 1, Qt::AlignLeft );
886
        textLabel22b = new QLabel( maximumZoom, tr( "Ma&ximum:" ), subTabZoom, "textLabel22b" );
887
        subTabZoomLayout->addWidget( textLabel22b, 1, 0 );
888
        zoomStep = new QSpinBox( subTabZoom, "zoomStep" );
889
        zoomStep->setMaxValue( 200 );
890
        zoomStep->setMinValue( 1 );
891
        zoomStep->setLineStep( 25 );
892
        zoomStep->setValue( prefsData->MagStep );
893
        zoomStep->setSuffix( tr( " %" ) );
894
        subTabZoomLayout->addWidget( zoomStep, 2, 1, Qt::AlignLeft );
895
        textLabel23b = new QLabel( zoomStep, tr( "&Stepping:" ), subTabZoom, "textLabel23b" );
896
        subTabZoomLayout->addWidget( textLabel23b, 2, 0 );
897
        subStackTools->addWidget( subTabZoom, 5 );
898
        tabToolsLayout->addWidget( subStackTools );
899
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
900
 
776 fschmid 901
        tab_5 = new QWidget( prefsWidgets, "tab_5" );
188 Franz 902
        tabLayout_5 = new QGridLayout( tab_5 );
903
        tabLayout_5->setSpacing( 6 );
904
        tabLayout_5->setMargin( 11 );
788 fschmid 905
        saving = new QGroupBox( tr( "Other Options" ), tab_5, "Saving" );
906
        saving->setColumnLayout(0, Qt::Vertical );
907
        saving->layout()->setSpacing( 0 );
908
        saving->layout()->setMargin( 0 );
909
        savingLayout = new QHBoxLayout( saving->layout() );
910
        savingLayout->setAlignment( Qt::AlignTop );
911
        savingLayout->setSpacing( 6 );
912
        savingLayout->setMargin( 25 );
913
        SaveAtQuit = new QCheckBox( tr( "Sa&ve Contents on Changes" ), saving, "SaveAtQuit" );
776 fschmid 914
        SaveAtQuit->setChecked(prefsData->SaveAtQ);
788 fschmid 915
        savingLayout->addWidget( SaveAtQuit );
916
        tabLayout_5->addWidget( saving, 1, 0 );
917
        preview = new QGroupBox( tr( "Preview" ), tab_5, "Preview" );
918
        preview->setColumnLayout(0, Qt::Vertical );
919
        preview->layout()->setSpacing( 0 );
920
        preview->layout()->setMargin( 0 );
921
        previewLayout = new QHBoxLayout( preview->layout() );
922
        previewLayout->setAlignment( Qt::AlignTop );
923
        previewLayout->setSpacing( 10 );
924
        previewLayout->setMargin( 24 );
925
        PreviewSize = new QComboBox( true, preview, "PreviewSize" );
188 Franz 926
        PreviewSize->insertItem( tr( "Small" ) );
927
        PreviewSize->insertItem( tr( "Medium" ) );
341 Franz 928
        PreviewSize->insertItem( tr( "Large" ) );
188 Franz 929
        PreviewSize->setEditable(false);
776 fschmid 930
        int sci = prefsData->PSize == 40 ? 0 : prefsData->PSize == 60 ? 1 : 2;
188 Franz 931
        PreviewSize->setCurrentItem(sci);
788 fschmid 932
        textLabelP = new QLabel( PreviewSize, tr( "&Size:" ), preview, "TextLabel1_3" );
933
        previewLayout->addWidget( textLabelP );
934
        previewLayout->addWidget( PreviewSize );
935
        tabLayout_5->addWidget( preview, 0, 0 );
776 fschmid 936
        addItem(  tr("Scrapbook"), loadIcon("scrap.png"), tab_5);
199 Franz 937
 
776 fschmid 938
        tabView = new QWidget( prefsWidgets, "tabView" );
939
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
940
        tabViewLayout->setAlignment( Qt::AlignTop );
941
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
942
        pageBackground->setTitle( tr( "Page Background" ) );
943
        pageBackground->setColumnLayout(0, Qt::Vertical );
944
        pageBackground->layout()->setSpacing( 5 );
945
        pageBackground->layout()->setMargin( 10 );
946
        pageBackgroundLayout = new QHBoxLayout( pageBackground->layout() );
947
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
948
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
949
        textLabel9->setText( tr( "Color:" ) );
950
        pageBackgroundLayout->addWidget( textLabel9 );
951
        backColor = new QPushButton( pageBackground, "backColor" );
952
        backColor->setMinimumSize( QSize( 60, 20 ) );
953
        backColor->setMaximumSize( QSize( 60, 20 ) );
954
        backColor->setFlat( false );
955
        backColor->setAutoDefault( false );
956
        QPixmap pm5 = QPixmap(54, 14);
957
        pm5.fill(prefsData->DpapColor);
958
        colorPaper = prefsData->DpapColor;
959
        backColor->setPixmap(pm5);
960
        backColor->setText( QString::null );
961
        pageBackgroundLayout->addWidget( backColor );
962
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
963
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
964
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
965
        checkUnprintable->setChecked( prefsData->RandFarbig );
966
        pageBackgroundLayout->addWidget( checkUnprintable );
967
        tabViewLayout->addWidget( pageBackground );
3 paul 968
 
776 fschmid 969
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
970
        groupScratch->setTitle( tr( "Scratch Space" ) );
971
        groupScratch->setColumnLayout(0, Qt::Vertical );
972
        groupScratch->layout()->setSpacing( 0 );
973
        groupScratch->layout()->setMargin( 0 );
974
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
975
        groupScratchLayout->setAlignment( Qt::AlignTop );
976
        groupScratchLayout->setSpacing( 0 );
977
        groupScratchLayout->setMargin( 10 );
978
        Layout4s = new QGridLayout;
979
        Layout4s->setSpacing( 6 );
980
        Layout4s->setMargin( 0 );
981
        topScratch = new MSpinBox( groupScratch, 4 );
982
        topScratch->setDecimals( decimals );
983
        topScratch->setMaxValue(1000);
984
        topScratch->setValue(prefsData->ScratchTop * Umrech);
985
        Layout4s->addWidget( topScratch, 0, 1 );
986
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
987
        Layout4s->addWidget( TextLabel5s, 0, 0 );
988
        leftScratch = new MSpinBox( groupScratch, 4 );
989
        leftScratch->setDecimals( decimals );
990
        leftScratch->setMaxValue(1000);
991
        leftScratch->setValue(prefsData->ScratchLeft * Umrech);
992
        Layout4s->addWidget( leftScratch, 0, 3 );
993
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
994
        Layout4s->addWidget( Linkss, 0, 2 );
995
        bottomScratch = new MSpinBox( groupScratch, 4 );
996
        bottomScratch->setDecimals( decimals );
997
        bottomScratch->setMaxValue(1000);
998
        bottomScratch->setValue(prefsData->ScratchBottom * Umrech);
999
        Layout4s->addWidget( bottomScratch, 1, 1 );
1000
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
1001
        Layout4s->addWidget( TextLabel7s, 1, 0 );
1002
        rightScratch = new MSpinBox( groupScratch, 4 );
1003
        rightScratch->setDecimals( decimals );
1004
        rightScratch->setMaxValue(1000);
1005
        rightScratch->setValue(prefsData->ScratchRight * Umrech);
1006
        Layout4s->addWidget( rightScratch, 1, 3 );
1007
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
1008
        Layout4s->addWidget( Rechtss, 1, 2 );
1009
        groupScratchLayout->addLayout( Layout4s );
1010
        tabViewLayout->addWidget( groupScratch );
3 paul 1011
 
776 fschmid 1012
        buttonGroup1 = new QButtonGroup( tabView, "buttonGroup1" );
1013
        buttonGroup1->setExclusive( true );
1014
        buttonGroup1->setColumnLayout(0, Qt::Vertical );
1015
        buttonGroup1->layout()->setSpacing( 5 );
1016
        buttonGroup1->layout()->setMargin( 10 );
1017
        buttonGroup1->setTitle( tr( "Placing of Guides" ) );
1018
        buttonGroup1Layout = new QHBoxLayout( buttonGroup1->layout() );
1019
        buttonGroup1Layout->setAlignment( Qt::AlignTop );
1020
        inBackground = new QRadioButton( buttonGroup1, "inBackground" );
1021
        inBackground->setText( tr( "In the Background" ) );
1022
        buttonGroup1Layout->addWidget( inBackground );
1023
        inForeground = new QRadioButton( buttonGroup1, "inForeground" );
1024
        inForeground->setText( tr( "In the Foreground" ) );
1025
        buttonGroup1Layout->addWidget( inForeground );
1026
        inBackground->setChecked( prefsData->Before );
1027
        inForeground->setChecked( !prefsData->Before );
1028
        tabViewLayout->addWidget( buttonGroup1 );
1029
        CaliGroup = new QGroupBox( tr( "&Adjust Display Size" ), tabView, "CaliGroup" );
188 Franz 1030
        CaliGroup->setColumnLayout(0, Qt::Vertical );
1031
        CaliGroup->layout()->setSpacing( 6 );
1032
        CaliGroup->layout()->setMargin( 11 );
1033
        CaliGroupLayout = new QVBoxLayout( CaliGroup->layout() );
1034
        CaliGroupLayout->setAlignment( Qt::AlignTop );
341 Franz 1035
        CaliText = new QLabel( tr( "To adjust the display drag the ruler below with the Slider." ), CaliGroup, "CaliText" );
188 Franz 1036
        CaliGroupLayout->addWidget( CaliText );
1037
        CaliRuler = new QLabel( CaliGroup, "CaliRuler" );
1038
        CaliRuler->setMinimumSize( QSize( 20, 20 ) );
788 fschmid 1039
        drawRuler();
188 Franz 1040
        CaliRuler->setFrameShape( QLabel::Box );
1041
        CaliRuler->setFrameShadow( QLabel::Sunken );
776 fschmid 1042
        CaliRuler->setScaledContents( false );
188 Franz 1043
        CaliGroupLayout->addWidget( CaliRuler );
1044
        layout15ca = new QHBoxLayout( 0, 0, 6, "layout15");
1045
        CaliSlider = new QSlider( CaliGroup, "CaliSlider" );
1046
        CaliSlider->setMinValue( -100 );
1047
        CaliSlider->setMaxValue( 100 );
1048
        CaliSlider->setValue(static_cast<int>(100 * DisScale)-100);
1049
        CaliSlider->setOrientation( QSlider::Horizontal );
1050
        CaliSlider->setTickmarks( QSlider::Right );
1051
        CaliSlider->setTickInterval( 10 );
341 Franz 1052
        CaliText->setBuddy(CaliGroup);
188 Franz 1053
        layout15ca->addWidget( CaliSlider );
1054
        CaliAnz = new QLabel( CaliGroup, "CaliAnz" );
1055
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
1056
        layout15ca->addWidget( CaliAnz );
1057
        CaliGroupLayout->addLayout( layout15ca );
776 fschmid 1058
        tabViewLayout->addWidget( CaliGroup );
1059
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
782 fschmid 1060
 
776 fschmid 1061
        ExtTool = new QWidget( prefsWidgets, "ExtTool" );
782 fschmid 1062
        ExtToolLayout = new QVBoxLayout( ExtTool, 11, 6, "ExtToolLayout");
776 fschmid 1063
        ExtToolLayout->setAlignment( Qt::AlignTop );
341 Franz 1064
        groupGS = new QGroupBox( tr( "Postscript Interpreter" ), ExtTool, "groupGS" );
220 Franz 1065
        groupGS->setColumnLayout(0, Qt::Vertical );
1066
        groupGS->layout()->setSpacing( 6 );
1067
        groupGS->layout()->setMargin( 10 );
1068
        groupGSLayout = new QVBoxLayout( groupGS->layout() );
1069
        groupGSLayout->setAlignment( Qt::AlignTop );
782 fschmid 1070
        GSlayout = new QHBoxLayout( 0, 0, 6, "GSlayout");
220 Franz 1071
        GSName = new QLineEdit( groupGS, "GSName" );
776 fschmid 1072
        GSName->setText(prefsData->gs_exe);
341 Franz 1073
        GSText = new QLabel( GSName, tr( "&Name of Executable:" ), groupGS, "GSText" );
1074
        GSlayout->addWidget( GSText );
220 Franz 1075
        GSlayout->addWidget( GSName );
1076
        groupGSLayout->addLayout( GSlayout );
341 Franz 1077
        GSantiText = new QCheckBox( tr( "Antialias &Text" ), groupGS, "GSantiText" );
776 fschmid 1078
        GSantiText->setChecked(prefsData->gs_antiText);
220 Franz 1079
        groupGSLayout->addWidget( GSantiText );
341 Franz 1080
        GSantiGraph = new QCheckBox( tr( "Antialias &Graphics" ), groupGS, "GSantiGraph" );
776 fschmid 1081
        GSantiGraph->setChecked(prefsData->gs_antiGraph);
220 Franz 1082
        groupGSLayout->addWidget( GSantiGraph );
1083
        ExtToolLayout->addWidget( groupGS );
341 Franz 1084
        groupGimp = new QGroupBox( tr( "Image Processing Tool" ), ExtTool, "groupGimp" );
220 Franz 1085
        groupGimp->setColumnLayout(0, Qt::Vertical );
1086
        groupGimp->layout()->setSpacing( 6 );
1087
        groupGimp->layout()->setMargin( 10 );
1088
        groupGimpLayout = new QHBoxLayout( groupGimp->layout() );
1089
        groupGimpLayout->setAlignment( Qt::AlignTop );
1090
        GimpName = new QLineEdit( groupGimp, "GimpName" );
776 fschmid 1091
        GimpName->setText(prefsData->gimp_exe);
341 Franz 1092
        GimpText = new QLabel( GimpName, tr( "Name of &Executable:" ), groupGimp, "GimpText" );
1093
        groupGimpLayout->addWidget( GimpText );
220 Franz 1094
        groupGimpLayout->addWidget( GimpName );
1095
        ExtToolLayout->addWidget( groupGimp );
1096
        QSpacerItem* spacer_gs = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
1097
        ExtToolLayout->addItem( spacer_gs );
776 fschmid 1098
        addItem(  tr("External Tools."), loadIcon("misc.png"), ExtTool);
222 Franz 1099
 
776 fschmid 1100
        Misc = new QWidget( prefsWidgets, "Misc" );
782 fschmid 1101
        MiscLayout = new QVBoxLayout( Misc, 11, 6, "MiscLayout");
776 fschmid 1102
        MiscLayout->setAlignment( Qt::AlignTop );
341 Franz 1103
        groupPrint = new QGroupBox( tr( "Printing" ), Misc, "groupPrint" );
222 Franz 1104
        groupPrint->setColumnLayout(0, Qt::Vertical );
1105
        groupPrint->layout()->setSpacing( 10 );
1106
        groupPrint->layout()->setMargin( 10 );
1107
        groupPrintLayout = new QVBoxLayout( groupPrint->layout() );
1108
        groupPrintLayout->setAlignment( Qt::AlignTop );
341 Franz 1109
        ClipMarg = new QCheckBox( tr( "Clip to Page &Margins" ), groupPrint, "ClipMarg" );
776 fschmid 1110
        ClipMarg->setChecked(prefsData->ClipMargin);
222 Franz 1111
        groupPrintLayout->addWidget( ClipMarg );
344 Franz 1112
        DoGCR = new QCheckBox( tr( "Apply &Under Color Removal" ), groupPrint, "ClipMarg" );
776 fschmid 1113
        DoGCR->setChecked(prefsData->GCRMode);
344 Franz 1114
        groupPrintLayout->addWidget( DoGCR );
222 Franz 1115
        MiscLayout->addWidget( groupPrint );
1116
        QSpacerItem* spacer_3m = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
1117
        MiscLayout->addItem( spacer_3m );
776 fschmid 1118
        addItem(  tr("Misc."), loadIcon("misc.png"), Misc);
222 Franz 1119
 
188 Franz 1120
        setDS();
245 Franz 1121
        //tab order
1122
        QWidget::setTabOrder( GFsize, SpinBox3 );
776 fschmid 1123
        QWidget::setTabOrder( SpinBox3, UnitCombo );
245 Franz 1124
        QWidget::setTabOrder( UnitCombo, Recen );
284 Franz 1125
        QWidget::setTabOrder( Recen, Docs );
245 Franz 1126
        QWidget::setTabOrder( Docs, FileC );
1127
        QWidget::setTabOrder( FileC, ProPfad );
1128
        QWidget::setTabOrder( ProPfad, FileC2  );
1129
        QWidget::setTabOrder( FileC2, ScriptPfad );
1130
        QWidget::setTabOrder( ScriptPfad, FileC3 );
410 Franz 1131
        QWidget::setTabOrder( FileC3, TemplateDir );
1132
        QWidget::setTabOrder( TemplateDir, FileC4 );
228 Franz 1133
 
245 Franz 1134
 
1135
        QWidget::setTabOrder( TopR, BottomR );
1136
        QWidget::setTabOrder( BottomR, LeftR );
1137
        QWidget::setTabOrder( LeftR, RightR );
1138
 
1139
        QWidget::setTabOrder( PreviewSize, SaveAtQuit );
1140
 
675 cbradney 1141
        QToolTip::add( guiLangCombo, tr( "Select your default language for Scribus to run with.\nLeave this blank to choose based on environment variables.\nYou can still override this by passing a command line option when starting Scribus" ) );
228 Franz 1142
        QToolTip::add( GUICombo, tr( "Choose the default window decoration and looks.\nScribus inherits any available KDE or Qt themes" ) );
1143
        QToolTip::add( GFsize, tr( "Default font size for the menus and windows" ) );
1144
        QToolTip::add( UnitCombo, tr( "Default unit of measurement for document editing" ) );
1145
        QToolTip::add( SpinBox3, tr( "Number of lines Scribus will scroll for each move of the mouse wheel" ) );
1146
        QToolTip::add( Recen, tr( "Number of recently edited documents to show in the File menu" ) );
1147
        QToolTip::add( Docs, tr( "Default documents directory" ) );
1148
        QToolTip::add( ProPfad, tr( "Default ICC profiles directory" ) );
1149
        QToolTip::add( ScriptPfad, tr( "Default Scripter scripts directory" ) );
410 Franz 1150
        QToolTip::add( TemplateDir, tr( "Additional Directory for Document Templates" ) );
228 Franz 1151
 
1152
        QToolTip::add( GZComboF, tr( "Default page size, either a standard size or a custom size" ) );
1153
        QToolTip::add( GZComboO, tr( "Default orientation of document pages" ) );
782 fschmid 1154
        QToolTip::add( pageWidth, tr( "Width of document pages, editable if you have chosen a custom page size" ) );
1155
        QToolTip::add( pageHeight, tr( "Height of document pages, editable if you have chosen a custom page size" ) );
1156
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
228 Franz 1157
        QToolTip::add( Linkszuerst, tr( "Make the first page the left page of a document" ) );
1158
        QToolTip::add( TopR, tr( "Distance between the top margin guide and the edge of the page" ) );
1159
        QToolTip::add( BottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
1160
        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" ) );
236 Franz 1161
        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" ) );
228 Franz 1162
        QToolTip::add( ASon, tr( "When enabled, Scribus saves a backup copy of your file with the .bak extension\neach time the time period elapses" ) );
1163
        QToolTip::add( ASTime, tr( "Time period between saving automatically" ) );
1164
 
776 fschmid 1165
        QToolTip::add( minorSpace, tr( "Distance between the minor grid lines" ) );
1166
        QToolTip::add( majorSpace, tr( "Distance between the major grid lines" ) );
1167
        QToolTip::add( snapDistance, tr( "Distance within which an object will snap to your placed guides" ) );
1168
        QToolTip::add( grabDistance, tr( "Radius of the area where Scribus will allow you to grab an objects handles" ) );
1169
        QToolTip::add( minorGridColor, tr( "Color of the minor grid lines" ) );
1170
        QToolTip::add( majorGridColor, tr( "Color of the major grid lines" ) );
1171
        QToolTip::add( guideColor, tr( "Color of the guide lines you insert" ) );
1172
        QToolTip::add( marginColor, tr( "Color for the margin lines" ) );
1173
        QToolTip::add( baselineColor, tr( "Color for the basegrid lines" ) );
1174
        QToolTip::add( checkBaseline, tr("Turns the basegrid on or off"));
1175
        QToolTip::add( checkGrid, tr("Turns the gridlines on or off"));
1176
        QToolTip::add( checkGuides, tr("Turns the guides on or off"));
1177
        QToolTip::add( checkMargin, tr("Turns the margins on or off"));
1178
        QToolTip::add( checkLink, tr("Turns the of linked frames on or off"));
1179
        QToolTip::add( checkFrame, tr("Turns the display of frames on or off"));
1180
        QToolTip::add( checkPictures, tr("Turns the display of pictures on or off"));
1181
        QToolTip::add( inBackground, tr( "Place the grid behind your page objects" ) );
1182
        QToolTip::add( inForeground, tr( "Place the grid in front of your page objects" ) );
228 Franz 1183
 
782 fschmid 1184
        QToolTip::add( toolText, tr( "Text Frame Properties" ) );
1185
        QToolTip::add( toolImage, tr( "Picture Frame Properties" ) );
1186
        QToolTip::add( toolShape, tr( "Shape Drawing Properties" ) );
1187
        QToolTip::add( toolZoom, tr( "Magnification Level Defaults" ) );
1188
        QToolTip::add( toolLine, tr( "Line Drawing Properties" ) );
1189
        QToolTip::add( toolPoly, tr( "Polygon Drawing Properties" ) );
1190
        QToolTip::add( fontComboText, tr( "Font for new text frames" ) );
1191
        QToolTip::add( sizeComboText, tr( "Size of font for new text frames" ) );
1192
        QToolTip::add( colorComboText, tr( "Color of font" ) );
1193
        QToolTip::add( columnsText, tr( "Number of columns in a text frame" ) );
1194
        QToolTip::add( gapText, tr( "Gap between text frame columns" ) );
1195
        QToolTip::add( previewText, tr( "Sample of your font" ) );
1196
        QToolTip::add( buttonGroup3, tr( "Picture frames allow pictures to scale to any size" ) );
1197
        QToolTip::add( scalingHorizontal, tr( "Horizontal scaling of images" ) );
1198
        QToolTip::add( scalingVertical, tr( "Vertical scaling of images" ) );
1199
        QToolTip::add( chainButton, tr( "Keep horizontal and vertical scaling the same" ) );
1200
        QToolTip::add( buttonGroup5, tr( "Pictures in picture frames are scaled to the size of the frame" ) );
1201
        QToolTip::add( checkRatioImage, tr( "Automatically scaled pictures keep their original proportions" ) );
1202
        QToolTip::add( comboFillImage, tr( "Fill color of picture frames" ) );
1203
        QToolTip::add( shadingFillImage, tr( "Saturation of color of fill" ) );
1204
        QToolTip::add( colorComboLineShape, tr( "Line color of shapes" ) );
1205
        QToolTip::add( shadingLineShape, tr( "Saturation of color of lines" ) );
1206
        QToolTip::add( comboFillShape, tr( "Fill color of shapes" ) );
1207
        QToolTip::add( shadingFillShape, tr( "Saturation of color of fill" ) );
1208
        QToolTip::add( comboStyleShape, tr( "Line style of shapes" ) );
1209
        QToolTip::add( lineWidthShape, tr( "Line width of shapes" ) );
1210
        QToolTip::add( minimumZoom, tr( "Minimum magnification allowed" ) );
1211
        QToolTip::add( maximumZoom, tr( "Maximum magnification allowed" ) );
1212
        QToolTip::add( zoomStep, tr( "Change in magnification for each zoom operation" ) );
1213
        QToolTip::add( colorComboLine, tr( "Color of lines" ) );
1214
        QToolTip::add( shadingLine, tr( "Saturation of color" ) );
1215
        QToolTip::add( comboStyleLine, tr( "Style of lines" ) );
1216
        QToolTip::add( lineWidthLine, tr( "Width of lines" ) );
228 Franz 1217
 
1218
        QToolTip::add( PreviewSize, tr( "Choose the size of the preview in the scrapbook palette" ) );
243 Franz 1219
        QToolTip::add( SaveAtQuit, tr( "Save the scrapbook contents everytime after a change" ) );
228 Franz 1220
 
776 fschmid 1221
        QToolTip::add( backColor, tr( "Color for paper" ) );
1222
        QToolTip::add( checkUnprintable, tr( "Mask the area outside the margins in the margin color" ) );
228 Franz 1223
        QToolTip::add( CaliSlider, tr( "Set the default zoom level" ) );
1224
 
1225
        QToolTip::add( GSName, tr( "Filesystem location for the Ghostscript interpreter" ) );
1226
        QToolTip::add( GSantiText, tr( "Antialias text for EPS and PDF onscreen rendering" ) );
1227
        QToolTip::add( GSantiGraph, tr( "Antialias graphics for EPS and PDF onscreen rendering" ) );
249 Franz 1228
        QToolTip::add( GimpName, tr( "Filesystem location for graphics editor" ) );
228 Franz 1229
 
1230
        QToolTip::add( ClipMarg, tr( "Do not show objects outside the margins on the printed page or exported file" ) );
415 Franz 1231
        QToolTip::add( DoGCR, tr( "A way of switching off some of the gray shades which are composed\n"
782 fschmid 1232
                                          "of cyan, yellow and magenta and using black instead.\n"
1233
                                          "UCR most affects parts of images which are neutral and/or dark tones\n"
1234
                                          "which are close to the gray. Use of this may improve printing some images\n"
1235
                                          "and some experimentation and testing is need on a case by case basis.\n"
1236
                                          "UCR reduces the possibility of over saturation with CMY inks." ) );
228 Franz 1237
 
188 Franz 1238
        // signals and slots connections
663 cbradney 1239
        connect( guiLangCombo, SIGNAL( activated( const QString & ) ), this, SLOT( setSelectedGUILang( const QString & ) ) );
776 fschmid 1240
        connect(majorGridColor, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
1241
        connect(minorGridColor, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
1242
        connect(baselineColor, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
1243
        connect(guideColor, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
1244
        connect(marginColor, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
1245
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
788 fschmid 1246
        connect(UnitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
782 fschmid 1247
        connect(toolShape, SIGNAL(clicked()), this, SLOT(setTool()));
1248
        connect(toolPoly, SIGNAL(clicked()), this, SLOT(setTool()));
1249
        connect(toolImage, SIGNAL(clicked()), this, SLOT(setTool()));
1250
        connect(toolText, SIGNAL(clicked()), this, SLOT(setTool()));
1251
        connect(toolLine, SIGNAL(clicked()), this, SLOT(setTool()));
1252
        connect(toolZoom, SIGNAL(clicked()), this, SLOT(setTool()));
1253
        connect(fontComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
1254
        connect(sizeComboText, SIGNAL(activated(int)), this, SLOT(setSample()));
1255
        connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(changeImageScalingFree(int)));
1256
        connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(changeImageScalingRatio(int)));
1257
        connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
1258
        connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
1259
        connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
1260
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1261
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
188 Franz 1262
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1263
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1264
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1265
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
1266
        connect(GZComboO, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
1267
        connect(GZComboF, SIGNAL(activated(int)), this, SLOT(setSize(int)));
782 fschmid 1268
        connect(facingPages, SIGNAL(clicked()), this, SLOT(setDS()));
788 fschmid 1269
        connect(FileC, SIGNAL(clicked()), this, SLOT(changeDocs()));
1270
        connect(FileC2, SIGNAL(clicked()), this, SLOT(changeProfs()));
1271
        connect(FileC3, SIGNAL(clicked()), this, SLOT(changeScripts()));
1272
        connect(FileC4, SIGNAL(clicked()), this, SLOT(changeTemplates()));
1273
        connect(CaliSlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
776 fschmid 1274
        setSize(prefsData->PageFormat);
1275
        setOrien(prefsData->Ausrichtung);
782 fschmid 1276
        pageWidth->setValue(prefsData->PageBreite * Umrech);
1277
        pageHeight->setValue(prefsData->PageHoehe * Umrech);
788 fschmid 1278
        unitChange();
776 fschmid 1279
        prefsWidgets->raiseWidget(0);
782 fschmid 1280
        toolText->setOn(true);
1281
        setSample();
776 fschmid 1282
        resize( minimumSizeHint() );
1283
        arrangeIcons();
1284
        clearWState( WState_Polished );
3 paul 1285
}
1286
 
199 Franz 1287
/*!
145 Franz 1288
 \fn Preferences::~Preferences
1289
 \author Franz Schmid
1290
 \date  
1291
 \brief Destructor for Preferences dialog box
1292
 \param None
1293
 \retval None
3 paul 1294
 */
1295
Preferences::~Preferences()
1296
{
199 Franz 1297
        // no need to delete child widgets, Qt does it all for us
3 paul 1298
}
1299
 
263 Franz 1300
 
199 Franz 1301
/*!
145 Franz 1302
 \fn void Preferences::ChangeDocs()
1303
 \author Franz Schmid
1304
 \date  
1305
 \brief Runs QFileDialog to get Preferences (General) Path to Documents directory
1306
 \param None
1307
 \retval None
1308
 */
788 fschmid 1309
void Preferences::changeDocs()
3 paul 1310
{
1311
        QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
1312
        if (s != "")
1313
                Docs->setText(s);
1314
}
1315
 
199 Franz 1316
/*!
145 Franz 1317
 \fn void Preferences::ChangeProfs()
1318
 \author Franz Schmid
1319
 \date  
1320
 \brief Runs QFileDialog to get Preferences (General) Path to Colour Profiles directory
1321
 \param None
1322
 \retval None
1323
 */
788 fschmid 1324
void Preferences::changeProfs()
68 Franz 1325
{
788 fschmid 1326
        QString s = QFileDialog::getExistingDirectory(ProPfad->text(), this, "d", tr("Choose a Directory"), true);
68 Franz 1327
        if (s != "")
1328
                ProPfad->setText(s);
1329
}
1330
 
199 Franz 1331
/*!
145 Franz 1332
 \fn void Preferences::ChangeScripts()
1333
 \author Franz Schmid
1334
 \date  
1335
 \brief Runs QFileDialog to get Preferences (General) Path to Scripts directory
1336
 \param None
1337
 \retval None
1338
 */
788 fschmid 1339
void Preferences::changeScripts()
91 Franz 1340
{
788 fschmid 1341
        QString s = QFileDialog::getExistingDirectory(ScriptPfad->text(), this, "d", tr("Choose a Directory"), true);
91 Franz 1342
        if (s != "")
1343
                ScriptPfad->setText(s);
1344
}
1345
 
199 Franz 1346
/*!
410 Franz 1347
 \fn void Preferences::ChangeTemplates()
1348
 \author Riku Leino
1349
 \date  
1350
 \brief Runs QFileDialog to get Preferences (General) Path to Templates directory
1351
 \param None
1352
 \retval None
1353
 */
788 fschmid 1354
void Preferences::changeTemplates()
410 Franz 1355
{
788 fschmid 1356
        QString s = QFileDialog::getExistingDirectory(TemplateDir->text(), this, "d", tr("Choose a Directory"), true);
410 Franz 1357
        if (s != "")
1358
                TemplateDir->setText(s);
1359
}
1360
 
1361
/*!
782 fschmid 1362
 \fn void Preferences::ToggleKette()
145 Franz 1363
 \author Franz Schmid
1364
 \date  
782 fschmid 1365
 \brief Preferences (Tools, Image Frame), Sets Y Scale value from X Scale value when chain is toggled
145 Franz 1366
 \param None
1367
 \retval None
1368
 */
782 fschmid 1369
void Preferences::toggleChain()
3 paul 1370
{
782 fschmid 1371
        if (chainButton->isOn())
1372
                scalingVertical->setValue(scalingHorizontal->value());
3 paul 1373
}
1374
 
199 Franz 1375
/*!
782 fschmid 1376
 \fn void Preferences::HChange()
1377
 \author Franz Schmid
1378
 \date  
1379
 \brief Preferences (Tools, Image Frame), Sets Y Scale value from X Scale value when X Scale value is changed
1380
 \param None
1381
 \retval None
1382
 */
1383
void Preferences::hChange()
1384
{
1385
        if (chainButton->isOn())
1386
                scalingVertical->setValue(scalingHorizontal->value());
1387
}
1388
 
1389
/*!
1390
 \fn void Preferences::vChange()
1391
 \author Franz Schmid
1392
 \date  
1393
 \brief Preferences (Tools, Image Frame). Sets X Scale value from Y Scale value when Y Scale value is changed
1394
 \param None
1395
 \retval None
1396
 */
1397
void Preferences::vChange()
1398
{
1399
        if (chainButton->isOn())
1400
                scalingHorizontal->setValue(scalingVertical->value());
1401
}
1402
 
1403
void Preferences::changeImageScalingFree(int)
1404
{
1405
        if (buttonGroup3->isChecked())
1406
                buttonGroup5->setChecked(false);
1407
        else
1408
                buttonGroup5->setChecked(true);
1409
}
1410
 
1411
void Preferences::changeImageScalingRatio(int)
1412
{
1413
        if (buttonGroup5->isChecked())
1414
                buttonGroup3->setChecked(false);
1415
        else
1416
                buttonGroup3->setChecked(true);
1417
}
1418
 
1419
/*!
1420
 \fn void Preferences::SetSample()
1421
 \author Franz Schmid
1422
 \date  
1423
 \brief Preferences (Tools, Text frame), Sets the sample text in selected font in text frame preferences
1424
 \param None
1425
 \retval None
1426
 */
1427
void Preferences::setSample()
1428
{
1429
        QString ts = tr( "Woven silk pyjamas exchanged for blue quartz" );
1430
        QString da = (*fon)[fontComboText->currentText()]->Datei;
1431
        int s = sizeComboText->currentText().left(2).toInt();
1432
        QPixmap pm = fontSamples(da, s, ts, paletteBackgroundColor());
1433
        previewText->setPixmap(pm);
1434
}
1435
 
1436
/*!
1437
 \fn void Preferences::SetTool()
1438
 \author Franz Schmid
1439
 \date  
1440
 \brief Preferences (Tools), Raises widget for selected Tool properties
1441
 \param None
1442
 \retval None
1443
 */
1444
void Preferences::setTool()
1445
{
1446
        if (toolText == sender())
1447
                subStackTools->raiseWidget(0);
1448
        if (toolShape == sender())
1449
                subStackTools->raiseWidget(1);
1450
        if (toolLine == sender())
1451
                subStackTools->raiseWidget(2);
1452
        if (toolImage == sender())
1453
                subStackTools->raiseWidget(3);
1454
        if (toolPoly == sender())
1455
                subStackTools->raiseWidget(4);
1456
        if (toolZoom == sender())
1457
                subStackTools->raiseWidget(5);
1458
}
1459
 
1460
/*!
145 Franz 1461
 \fn void Preferences::setDS()
1462
 \author Franz Schmid
1463
 \date  
1464
 \brief Preferences (Document / Page Size), switches default between Facing Pages and swaps text labels for margin guides
1465
 \param None
1466
 \retval None
1467
 */
3 paul 1468
void Preferences::setDS()
1469
{
782 fschmid 1470
        bool m = facingPages->isChecked() ? true : false;
341 Franz 1471
        GRText3->setText(m == true ? tr( "&Inside:" ) : tr( "&Left:" ));
1472
        GRText4->setText(m == true ? tr( "O&utside:" ) : tr( "&Right:" ));
188 Franz 1473
        Linkszuerst->setEnabled(m);
1474
        if (m == false)
1475
                Linkszuerst->setChecked(false);
3 paul 1476
}
1477
 
199 Franz 1478
/*!
782 fschmid 1479
 \fn void Preferences::setPageWidth(int v)
145 Franz 1480
 \author Franz Schmid
1481
 \date  
1482
 \brief Preferences (Document / Page Size), sets Page width values
1483
 \param v Width value
1484
 \retval None
1485
 */
782 fschmid 1486
void Preferences::setPageWidth(int)
3 paul 1487
{
782 fschmid 1488
        Pagebr = pageWidth->value() / Umrech;
1489
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
1490
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
1491
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
1492
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
3 paul 1493
}
1494
 
199 Franz 1495
/*!
782 fschmid 1496
 \fn void Preferences::setPageHeight(int v)
145 Franz 1497
 \author Franz Schmid
1498
 \date  
1499
 \brief Preferences (Document / Page Size), sets Page height values
1500
 \param v Height value
1501
 \retval None
1502
 */
782 fschmid 1503
void Preferences::setPageHeight(int)
3 paul 1504
{
782 fschmid 1505
        Pageho = pageHeight->value() / Umrech;
1506
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
1507
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
1508
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
1509
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
3 paul 1510
}
1511
 
199 Franz 1512
/*!
145 Franz 1513
 \fn void Preferences::setTop(int v)
1514
 \author Franz Schmid
1515
 \date  
1516
 \brief Preferences (Document / Page Size), sets Page top values
1517
 \param v Top value
1518
 \retval None
1519
 */
146 Franz 1520
void Preferences::setTop(int)
36 Franz 1521
{
146 Franz 1522
        RandT = TopR->value() / Umrech;
782 fschmid 1523
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
36 Franz 1524
}
1525
 
199 Franz 1526
/*!
145 Franz 1527
 \fn void Preferences::setBottom(int v)
1528
 \author Franz Schmid
1529
 \date  
1530
 \brief Preferences (Document / Page Size), sets Page bottom values
1531
 \param v Bottom value
1532
 \retval None
1533
 */
146 Franz 1534
void Preferences::setBottom(int)
36 Franz 1535
{
146 Franz 1536
        RandB = BottomR->value() / Umrech;
782 fschmid 1537
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
36 Franz 1538
}
1539
 
199 Franz 1540
/*!
145 Franz 1541
 \fn void Preferences::setLeft(int v)
1542
 \author Franz Schmid
1543
 \date  
1544
 \brief Preferences (Document / Page Size), sets Page left values
1545
 \param v Top value
1546
 \retval None
1547
 */
146 Franz 1548
void Preferences::setLeft(int)
36 Franz 1549
{
146 Franz 1550
        RandL = LeftR->value() / Umrech;
782 fschmid 1551
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
36 Franz 1552
}
1553
 
199 Franz 1554
/*!
145 Franz 1555
 \fn void Preferences::setRight(int v)
1556
 \author Franz Schmid
1557
 \date  
1558
 \brief Preferences (Document / Page Size), sets Page right values
1559
 \param v Right value
1560
 \retval None
1561
 */
146 Franz 1562
void Preferences::setRight(int)
36 Franz 1563
{
146 Franz 1564
        RandR = RightR->value() / Umrech;
782 fschmid 1565
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
36 Franz 1566
}
1567
 
199 Franz 1568
/*!
145 Franz 1569
 \fn void Preferences::setSize(int gr)
1570
 \author Franz Schmid
1571
 \date  
1572
 \brief Preferences (Document / Page Size), sets Page size values. Connects signals for setting page dimensions.
1573
 \param gr Standard page size value (eg A4)
1574
 \retval None
1575
 */
3 paul 1576
void Preferences::setSize(int gr)
1577
{
782 fschmid 1578
        Pagebr = pageWidth->value() / Umrech;
1579
        Pageho = pageHeight->value() / Umrech;
1580
        pageWidth->setEnabled(false);
1581
        pageHeight->setEnabled(false);
188 Franz 1582
        int br[] = {2380, 1684, 1190, 842, 595, 421, 297, 210, 148, 105, 2836, 2004, 1418, 1002, 709, 501, 355,
199 Franz 1583
                    250, 178, 125, 89, 462, 298, 312, 542, 595, 1224, 612, 612, 792};
188 Franz 1584
        int ho[] = {3368, 2380, 1684, 1190, 842, 595, 421, 297, 210, 148, 4008, 2836, 2004, 1418, 1002, 709, 501,
199 Franz 1585
                    355, 250, 178, 125, 649, 683, 624, 720, 935, 792, 1008, 792, 1224};
188 Franz 1586
        if (gr == 30)
1587
        {
782 fschmid 1588
                pageWidth->setEnabled(true);
1589
                pageHeight->setEnabled(true);
188 Franz 1590
        }
1591
        else
1592
        {
1593
                Pagebr = br[gr];
1594
                Pageho = ho[gr];
1595
        }
782 fschmid 1596
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1597
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
1598
        pageWidth->setValue(Pagebr * Umrech);
1599
        pageHeight->setValue(Pageho * Umrech);
1600
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
1601
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
1602
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
1603
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
1604
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1605
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
3 paul 1606
}
1607
 
199 Franz 1608
/*!
145 Franz 1609
 \fn void Preferences::setOrien(int ori)
1610
 \author Franz Schmid
1611
 \date  
1612
 \brief Preferences (Document / Page Size), sets Page orientation value and page dimensions
1613
 \param ori Orientation value
1614
 \retval None
1615
 */
3 paul 1616
void Preferences::setOrien(int ori)
1617
{
146 Franz 1618
        double br;
3 paul 1619
        setSize(GZComboF->currentItem());
782 fschmid 1620
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1621
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
3 paul 1622
        if (ori == 0)
188 Franz 1623
        {
1624
                if (GZComboF->currentItem() == 30)
3 paul 1625
                {
782 fschmid 1626
                        br = pageWidth->value();
1627
                        pageWidth->setValue(pageHeight->value());
1628
                        pageHeight->setValue(br);
3 paul 1629
                }
188 Franz 1630
        }
3 paul 1631
        else
188 Franz 1632
        {
782 fschmid 1633
                br = pageWidth->value();
1634
                pageWidth->setValue(pageHeight->value());
1635
                pageHeight->setValue(br);
188 Franz 1636
        }
782 fschmid 1637
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1638
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
3 paul 1639
}
1640
 
199 Franz 1641
/*!
145 Franz 1642
 \fn void Preferences::changeMaColor()
1643
 \author Franz Schmid
1644
 \date  
1645
 \brief Preferences ([dox?], [dox?]), Sets Maximum colour [dox?]
1646
 \param None
1647
 \retval None
1648
 */
776 fschmid 1649
 
1650
void Preferences::changeMajorColor()
3 paul 1651
{
1652
        QColor neu = QColor();
776 fschmid 1653
        neu = QColorDialog::getColor(colorMajorGrid, this);
3 paul 1654
        if (neu.isValid())
188 Franz 1655
        {
776 fschmid 1656
                QPixmap pm = QPixmap(54, 14);
199 Franz 1657
                pm.fill(neu);
776 fschmid 1658
                colorMajorGrid = neu;
1659
                majorGridColor->setPixmap(pm);
188 Franz 1660
        }
3 paul 1661
}
1662
 
199 Franz 1663
/*!
145 Franz 1664
 \fn void Preferences::changeMicolor()
1665
 \author Franz Schmid
1666
 \date  
1667
 \brief Preferences ([dox?], [dox?]), Sets Minimum colour [dox?]
1668
 \param None
1669
 \retval None
1670
 */
776 fschmid 1671
 
1672
void Preferences::changeMinorColor()
3 paul 1673
{
1674
        QColor neu = QColor();
776 fschmid 1675
        neu = QColorDialog::getColor(colorMinorGrid, this);
3 paul 1676
        if (neu.isValid())
188 Franz 1677
        {
776 fschmid 1678
                QPixmap pm = QPixmap(54, 14);
199 Franz 1679
                pm.fill(neu);
776 fschmid 1680
                colorMinorGrid = neu;
1681
                minorGridColor->setPixmap(pm);
188 Franz 1682
        }
3 paul 1683
}
1684
 
199 Franz 1685
/*!
145 Franz 1686
 \fn void Preferences::changePapColor()
1687
 \author Franz Schmid
1688
 \date  
1689
 \brief Preferences ([dox?], [dox?]), Sets Paper colour [dox?]
1690
 \param None
1691
 \retval None
1692
 */
776 fschmid 1693
void Preferences::changePaperColor()
3 paul 1694
{
1695
        QColor neu = QColor();
776 fschmid 1696
        neu = QColorDialog::getColor(colorPaper, this);
3 paul 1697
        if (neu.isValid())
188 Franz 1698
        {
776 fschmid 1699
                QPixmap pm = QPixmap(54, 14);
199 Franz 1700
                pm.fill(neu);
776 fschmid 1701
                colorPaper = neu;
1702
                backColor->setPixmap(pm);
188 Franz 1703
        }
3 paul 1704
}
1705
 
199 Franz 1706
/*!
145 Franz 1707
 \fn void Preferences::changeRandColor()
1708
 \author Franz Schmid
1709
 \date  
1710
 \brief Preferences ([dox?], [dox?]), Sets Rand colour [dox?]
1711
 \param None
1712
 \retval None
1713
 */
776 fschmid 1714
void Preferences::changeMarginColor()
3 paul 1715
{
1716
        QColor neu = QColor();
776 fschmid 1717
        neu = QColorDialog::getColor(colorMargin, this);
3 paul 1718
        if (neu.isValid())
188 Franz 1719
        {
776 fschmid 1720
                QPixmap pm = QPixmap(54, 14);
199 Franz 1721
                pm.fill(neu);
776 fschmid 1722
                colorMargin = neu;
1723
                marginColor->setPixmap(pm);
188 Franz 1724
        }
3 paul 1725
}
1726
 
199 Franz 1727
/*!
145 Franz 1728
 \fn void Preferences::changeGuideColor()
1729
 \author Franz Schmid
1730
 \date  
1731
 \brief Preferences ([dox?], [dox?]), Sets Guide colour [dox?]
1732
 \param None
1733
 \retval None
1734
 */
3 paul 1735
void Preferences::changeGuideColor()
1736
{
1737
        QColor neu = QColor();
776 fschmid 1738
        neu = QColorDialog::getColor(colorGuides, this);
3 paul 1739
        if (neu.isValid())
188 Franz 1740
        {
776 fschmid 1741
                QPixmap pm = QPixmap(54, 14);
199 Franz 1742
                pm.fill(neu);
776 fschmid 1743
                colorGuides = neu;
1744
                guideColor->setPixmap(pm);
188 Franz 1745
        }
3 paul 1746
}
776 fschmid 1747
 
1748
void Preferences::changeBaselineColor()
338 Franz 1749
{
1750
        QColor neu = QColor();
776 fschmid 1751
        neu = QColorDialog::getColor(colorBaselineGrid, this);
338 Franz 1752
        if (neu.isValid())
1753
        {
776 fschmid 1754
                QPixmap pm = QPixmap(54, 14);
338 Franz 1755
                pm.fill(neu);
776 fschmid 1756
                colorBaselineGrid = neu;
1757
                baselineColor->setPixmap(pm);
338 Franz 1758
        }
1759
}
3 paul 1760
 
199 Franz 1761
/*!
145 Franz 1762
 \fn void Preferences::UnitChange()
1763
 \author Franz Schmid
1764
 \date  
1765
 \brief Preferences (General, Units). Sets scaling factors and units descriptions when default units are changed. Updates preference values
1766
 \param None
1767
 \retval None
1768
 */
788 fschmid 1769
void Preferences::unitChange()
3 paul 1770
{
782 fschmid 1771
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1772
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
199 Franz 1773
        disconnect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1774
        disconnect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1775
        disconnect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1776
        disconnect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
333 Franz 1777
        int decimals;
80 Franz 1778
        double AltUmrech = Umrech;
782 fschmid 1779
        double oldMin, oldMax, oldB, oldBM, oldH, oldHM, val;
1780
        pageWidth->getValues(&oldB, &oldBM, &decimals, &val);
333 Franz 1781
        oldB /= AltUmrech;
1782
        oldBM /= AltUmrech;
782 fschmid 1783
        pageHeight->getValues(&oldH, &oldHM, &decimals, &val);
333 Franz 1784
        oldH /= AltUmrech;
1785
        oldHM /= AltUmrech;
139 Franz 1786
        QString einh;
11 Franz 1787
        Einheit = UnitCombo->currentItem();
3 paul 1788
        switch (UnitCombo->currentItem())
188 Franz 1789
        {
199 Franz 1790
        case 0:
1791
                Umrech = 1.0;
1792
                decimals = 100;
1793
                einh = tr( " pt" );
1794
                break;
1795
        case 1:
1796
                Umrech = 0.3527777;
1797
                decimals = 1000;
1798
                einh = tr( " mm" );
1799
                break;
1800
        case 2:
1801
                Umrech = 1.0 / 72.0;
1802
                decimals = 10000;
1803
                einh = tr( " in" );
1804
                break;
1805
        case 3:
1806
                Umrech = 1.0 / 12.0;
1807
                decimals = 100;
1808
                einh = tr( " p" );
1809
                break;
188 Franz 1810
        }
782 fschmid 1811
        pageWidth->setSuffix(einh);
1812
        pageHeight->setSuffix(einh);
188 Franz 1813
        TopR->setSuffix(einh);
1814
        BottomR->setSuffix(einh);
1815
        LeftR->setSuffix(einh);
1816
        RightR->setSuffix(einh);
782 fschmid 1817
        minorSpace->setSuffix(einh);
1818
        majorSpace->setSuffix(einh);
1819
        snapDistance->setSuffix(einh);
788 fschmid 1820
        tabTypo->baseGrid->setSuffix(einh);
1821
        tabTypo->baseOffset->setSuffix(einh);
782 fschmid 1822
        gapText->setSuffix(einh);
776 fschmid 1823
        topScratch->setSuffix(einh);
1824
        bottomScratch->setSuffix(einh);
1825
        leftScratch->setSuffix(einh);
1826
        rightScratch->setSuffix(einh);
782 fschmid 1827
        pageWidth->setValues(oldB * Umrech, oldBM * Umrech, decimals, Pagebr * Umrech);
1828
        pageHeight->setValues(oldH * Umrech, oldHM * Umrech, decimals, Pageho * Umrech);
1829
        TopR->setValues(0, pageHeight->value() - RandB * Umrech, decimals, RandT * Umrech);
1830
        BottomR->setValues(0, pageHeight->value() - RandT * Umrech, decimals, RandB * Umrech);
1831
        LeftR->setValues(0, pageWidth->value() - RandR * Umrech, decimals, RandL * Umrech);
1832
        RightR->setValues(0, pageWidth->value() - RandL * Umrech, decimals, RandR * Umrech);
1833
        int decimalsOld;
1834
        double invUnitConversion = 1.0 / AltUmrech * Umrech;
776 fschmid 1835
        minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
782 fschmid 1836
        minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
776 fschmid 1837
        majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
782 fschmid 1838
        majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
776 fschmid 1839
        snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
782 fschmid 1840
        snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
788 fschmid 1841
        tabTypo->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1842
        tabTypo->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1843
        tabTypo->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1844
        tabTypo->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
782 fschmid 1845
        gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1846
        gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1847
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1848
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1849
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1850
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1851
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1852
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1853
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1854
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
788 fschmid 1855
        drawRuler();
782 fschmid 1856
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1857
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
43 Franz 1858
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1859
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1860
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1861
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
3 paul 1862
}
1863
 
199 Franz 1864
/*!
145 Franz 1865
 \fn void Preferences::SetDisScale()
1866
 \author Franz Schmid
1867
 \date  
1868
 \brief Preferences (Display, Display Size). Sets Scale for ruler scale
1869
 \param None
1870
 \retval None
1871
 */
788 fschmid 1872
void Preferences::setDisScale()
11 Franz 1873
{
1874
        DisScale = QMAX((100.0 + CaliSlider->value()) / 100.0, 0.01);
788 fschmid 1875
        drawRuler();
11 Franz 1876
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
1877
}
1878
 
199 Franz 1879
/*!
145 Franz 1880
 \fn void Preferences::DrawRuler()
1881
 \author Franz Schmid
1882
 \date  
1883
 \brief Preferences (Display, Display Size). Draws ruler depending on scaling factor
1884
 \param None
1885
 \retval None
1886
 */
788 fschmid 1887
void Preferences::drawRuler()
11 Franz 1888
{
80 Franz 1889
        double xl, iter, iter2, maxi;
11 Franz 1890
        switch (Einheit)
188 Franz 1891
        {
199 Franz 1892
        case 0:
1893
                iter = 10.0;
1894
                iter2 = iter * 10.0;
1895
                maxi = 200.0;
1896
                break;
1897
        case 1:
1898
                iter = (10.0 / 25.4) * 72.0;
1899
                iter2 = iter * 10.0;
1900
                maxi = iter2;
1901
                break;
1902
        case 2:
1903
                iter = 18.0;
1904
                iter2 = 72.0;
1905
                maxi = 2 * iter2;
1906
                break;
1907
        case 3:
1908
                iter = 12.0;
1909
                iter2 = 120.0;
1910
                maxi = 240.0;
1911
                break;
734 fschmid 1912
        default:
1913
                iter = 10.0;
1914
                iter2 = iter * 10.0;
1915
                maxi = 200.0;
1916
                break;
188 Franz 1917
        }
11 Franz 1918
        QPixmap pm(static_cast<int>(maxi*DisScale+30), 21);
1919
        pm.fill();
1920
        QPainter p;
1921
        p.begin(&pm);
1922
        p.drawLine(0, 19, width(), 19);
1923
        p.setBrush(black);
1924
        p.setPen(black);
1925
        p.scale(DisScale, 1.0);
1926
        for (xl = 0; xl < maxi; xl += iter)
1927
                p.drawLine(static_cast<int>(xl), 13, static_cast<int>(xl), 19);
1928
        for (xl = 0; xl < maxi+10; xl += iter2)
188 Franz 1929
        {
11 Franz 1930
                p.drawLine(static_cast<int>(xl), 6, static_cast<int>(xl), 19);
1931
                p.save();
1932
                p.scale(1.0 / DisScale, 1.0);
1933
                switch (Einheit)
188 Franz 1934
                {
199 Franz 1935
                case 2:
1936
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1937
                                   QString::number(xl / iter2));
1938
                        break;
1939
                case 3:
1940
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1941
                                   QString::number(xl / iter));
1942
                        break;
1943
                default:
1944
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1945
                                   QString::number(xl / iter * 10));
1946
                        break;
188 Franz 1947
                }
11 Franz 1948
                p.restore();
188 Franz 1949
        }
11 Franz 1950
        p.end();