Subversion Repositories Scribus

Rev

Rev 1552 | 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"
1429 subik 5
#include "scribusstructs.h"
3 paul 6
#include <qfont.h>
7
#include <qcolordialog.h>
663 cbradney 8
#include <qcombobox.h>
3 paul 9
#include <qcolor.h>
10
#include <qstringlist.h>
11
#include <qstylefactory.h>
12
#include <qpointarray.h>
13
#include <qpainter.h>
14
#include <qrect.h>
1542 cbradney 15
#include <qstring.h>
3 paul 16
#include <qwmatrix.h>
17
#include <cmath>
1307 fschmid 18
#include "units.h"
663 cbradney 19
#include "langmgr.h"
788 fschmid 20
#include "tabtypography.h"
879 fschmid 21
#include "tabguides.h"
795 fschmid 22
#include "hysettings.h"
23
#include "cmsprefs.h"
24
#include "keymanager.h"
1194 fschmid 25
#include "tabtools.h"
1197 tsoots 26
#include "undomanager.h"
1235 fschmid 27
#include "tabcheckdoc.h"
1307 fschmid 28
#include "tabpdfoptions.h"
1321 fschmid 29
#include "fontprefs.h"
1525 cbradney 30
#include "units.h"
1549 subik 31
#include "pluginmanager.h"
1542 cbradney 32
#include "pagesize.h"
3 paul 33
 
504 cbradney 34
using namespace std;
35
 
3 paul 36
extern QPixmap loadIcon(QString nam);
795 fschmid 37
extern bool CMSavail;
38
extern ProfilesL InputProfiles;
1429 subik 39
extern ScribusApp *ScApp;
3 paul 40
 
1065 cbradney 41
extern "C" void* Run(QWidget *d, ApplicationPrefs *prefsData);
3 paul 42
 
199 Franz 43
/*!
1065 cbradney 44
 \fn void* Run(QWidget *d, ApplicationPrefs *prefsData)
145 Franz 45
 \author Franz Schmid
1030 subik 46
 \date
145 Franz 47
 \brief Creates Preferences dialog and returns pointer to it
202 Franz 48
 \param d QWidget * to Preferences dialog widget
1065 cbradney 49
 \param prefsData ApplicationPrefs * struct
202 Franz 50
 \retval dia * widget pointer
145 Franz 51
 */
1065 cbradney 52
void* Run(QWidget *d, ApplicationPrefs *prefsData)
3 paul 53
{
776 fschmid 54
        Preferences *dia = new Preferences(d, prefsData);
3 paul 55
        return dia;
56
}
57
 
199 Franz 58
/*!
1065 cbradney 59
 \fn Preferences::Preferences( QWidget* parent, ApplicationPrefs *prefsData)
1030 subik 60
 \author Franz Schmid
61
 \date
145 Franz 62
 \brief Constructor for Preferences dialog box
63
 \param parent QWidget pointer to parent window
1065 cbradney 64
 \param prefsData ApplicationPrefs * struct
145 Franz 65
 \retval Preferences dialog
66
 */
1065 cbradney 67
Preferences::Preferences( QWidget* parent, ApplicationPrefs *prefsData) : PrefsDialogBase( parent )
3 paul 68
{
173 Franz 69
        int decimals;
188 Franz 70
        ap = (ScribusApp*)parent;
199 Franz 71
        Umrech = 1.0;
1065 cbradney 72
        docUnitIndex = prefsData->docUnitIndex;
1525 cbradney 73
        decimals = unitGetPrecisionFromIndex(docUnitIndex);
1549 subik 74
 
776 fschmid 75
        DisScale = prefsData->DisScale;
199 Franz 76
        setCaption( tr( "Preferences" ) );
45 Franz 77
 
776 fschmid 78
        tab = new QWidget( prefsWidgets, "tab" );
199 Franz 79
        tabLayout = new QGridLayout( tab );
80
        tabLayout->setSpacing( 6 );
81
        tabLayout->setMargin( 10 );
776 fschmid 82
        tabLayout->setAlignment( Qt::AlignTop );
663 cbradney 83
 
84
        // GUI Group
341 Franz 85
        ButtonGroup1 = new QButtonGroup( tr( "GUI" ), tab, "ButtonGroup1" );
199 Franz 86
        ButtonGroup1->setColumnLayout(0, Qt::Vertical );
87
        ButtonGroup1->layout()->setSpacing( 0 );
88
        ButtonGroup1->layout()->setMargin( 0 );
89
        ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
90
        ButtonGroup1Layout->setAlignment( Qt::AlignTop );
91
        ButtonGroup1Layout->setSpacing( 6 );
92
        ButtonGroup1Layout->setMargin( 10 );
663 cbradney 93
 
94
        langMgr.init();
95
        QStringList languageList;
96
        langMgr.fillInstalledStringList(&languageList, true);
675 cbradney 97
        languageList.sort();
663 cbradney 98
        guiLangCombo = new QComboBox( false, ButtonGroup1, "guiLangCombo");
99
        guiLangCombo->insertStringList( languageList );
776 fschmid 100
        guiLangCombo->setCurrentText(langMgr.getLangFromAbbrev(prefsData->guiLanguage));
101
        selectedGUILang=prefsData->guiLanguage;
663 cbradney 102
        guiLangLabel = new QLabel(guiLangCombo, tr("&Language:"), ButtonGroup1, "guiLangLabel");
103
        ButtonGroup1Layout->addWidget( guiLangLabel, 0, 0 );
782 fschmid 104
        ButtonGroup1Layout->addWidget( guiLangCombo, 0, 1, Qt::AlignLeft );
105
 
199 Franz 106
        GUICombo = new QComboBox( true, ButtonGroup1, "GUICombo" );
188 Franz 107
        QStringList STtest;
108
        STtest = QStyleFactory::keys();
109
        for (uint stt = 0; stt < STtest.count(); ++stt)
110
                GUICombo->insertItem(STtest[stt]);
199 Franz 111
        GUICombo->setEditable(false);
776 fschmid 112
        GUICombo->setCurrentText(prefsData->GUI);
341 Franz 113
        TextGstil = new QLabel(GUICombo, tr("&Theme:"), ButtonGroup1, "dd");
663 cbradney 114
        ButtonGroup1Layout->addWidget( TextGstil, 1, 0 );
782 fschmid 115
        ButtonGroup1Layout->addWidget( GUICombo, 1, 1, Qt::AlignLeft );
116
 
199 Franz 117
        GFsize = new QSpinBox(ButtonGroup1, "gfs" );
351 Franz 118
        GFsize->setSuffix( tr( " pt" ) );
199 Franz 119
        GFsize->setMaxValue( 22 );
120
        GFsize->setMinValue( 8 );
776 fschmid 121
        GFsize->setValue( prefsData->AppFontSize );
341 Franz 122
        TextGstil2 = new QLabel(GFsize, tr("&Font Size:"), ButtonGroup1, "dd");
663 cbradney 123
        ButtonGroup1Layout->addWidget( TextGstil2, 2, 0 );
782 fschmid 124
        ButtonGroup1Layout->addWidget( GFsize, 2, 1, Qt::AlignLeft );
125
        SpinBox3 = new QSpinBox( ButtonGroup1, "SpinBox3" );
199 Franz 126
        SpinBox3->setMaxValue( 1000 );
127
        SpinBox3->setMinValue( 0 );
128
        SpinBox3->setLineStep( 10 );
776 fschmid 129
        SpinBox3->setValue( prefsData->Wheelval );
782 fschmid 130
        TextLabel1_2 = new QLabel( SpinBox3, tr( "&Wheel Jump:" ), ButtonGroup1, "TextLabel1_2" );
131
        ButtonGroup1Layout->addWidget( TextLabel1_2, 3, 0 );
132
        ButtonGroup1Layout->addWidget( SpinBox3, 3, 1, Qt::AlignLeft );
133
        Recen = new QSpinBox( ButtonGroup1, "Recen" );
199 Franz 134
        Recen->setMaxValue( 30 );
135
        Recen->setMinValue( 1 );
776 fschmid 136
        Recen->setValue( prefsData->RecentDCount );
782 fschmid 137
        TextLabel4c = new QLabel( Recen, tr( "&Recent Documents:" ), ButtonGroup1, "TextLabel4c" );
138
        ButtonGroup1Layout->addWidget( TextLabel4c, 4, 0);
139
        ButtonGroup1Layout->addWidget( Recen, 4, 1, Qt::AlignLeft );
140
        tabLayout->addWidget( ButtonGroup1, 0, 0 );
3 paul 141
 
341 Franz 142
        GroupBox200 = new QGroupBox( tr( "Paths" ), tab, "GroupBox200" );
199 Franz 143
        GroupBox200->setColumnLayout(0, Qt::Horizontal );
144
        GroupBox200->layout()->setSpacing( 0 );
145
        GroupBox200->layout()->setMargin( 0 );
146
        GroupBox200Layout = new QGridLayout( GroupBox200->layout() );
147
        GroupBox200Layout->setAlignment( Qt::AlignTop );
148
        GroupBox200Layout->setSpacing( 0 );
149
        GroupBox200Layout->setMargin( 5 );
782 fschmid 150
 
199 Franz 151
        Docs = new QLineEdit( GroupBox200, "Datei" );
152
        Docs->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 153
        Docs->setText(prefsData->DocDir);
341 Franz 154
        PfadText = new QLabel( Docs, tr("&Documents:"), GroupBox200, "Pfadtext" );
199 Franz 155
        FileC = new QToolButton( GroupBox200, "FileC" );
156
        FileC->setMinimumSize( QSize( 88, 24 ) );
341 Franz 157
        FileC->setText( tr( "&Change..." ) );
158
        GroupBox200Layout->addWidget( PfadText, 0, 0 );
159
        GroupBox200Layout->addWidget( Docs, 0, 1 );
199 Franz 160
        GroupBox200Layout->addWidget( FileC, 0, 2 );
776 fschmid 161
 
199 Franz 162
        ProPfad = new QLineEdit( GroupBox200, "Datei1" );
163
        ProPfad->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 164
        ProPfad->setText(prefsData->ProfileDir);
341 Franz 165
        PfadText2 = new QLabel( ProPfad, tr("&ICC Profiles:"), GroupBox200, "Pfadtext1" );
199 Franz 166
        FileC2 = new QToolButton( GroupBox200, "FileC1" );
167
        FileC2->setMinimumSize( QSize( 88, 24 ) );
341 Franz 168
        FileC2->setText( tr( "C&hange..." ) );
169
        GroupBox200Layout->addWidget( PfadText2, 1, 0 );
170
        GroupBox200Layout->addWidget( ProPfad, 1, 1 );
199 Franz 171
        GroupBox200Layout->addWidget( FileC2, 1, 2 );
91 Franz 172
 
199 Franz 173
        ScriptPfad = new QLineEdit( GroupBox200, "Datei1" );
174
        ScriptPfad->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 175
        ScriptPfad->setText(prefsData->ScriptDir);
341 Franz 176
        PfadText3 = new QLabel( ScriptPfad, tr("&Scripts:"), GroupBox200, "Pfadtext1" );
199 Franz 177
        FileC3 = new QToolButton( GroupBox200, "FileC3" );
178
        FileC3->setMinimumSize( QSize( 88, 24 ) );
341 Franz 179
        FileC3->setText( tr( "Ch&ange..." ) );
180
        GroupBox200Layout->addWidget( PfadText3, 2, 0 );
181
        GroupBox200Layout->addWidget( ScriptPfad, 2, 1 );
199 Franz 182
        GroupBox200Layout->addWidget( FileC3, 2, 2 );
91 Franz 183
 
410 Franz 184
        TemplateDir = new QLineEdit( GroupBox200, "Datei1" );
185
        TemplateDir->setMinimumSize( QSize( 268, 22 ) );
776 fschmid 186
        TemplateDir->setText(prefsData->TemplateDir);
410 Franz 187
        PfadText4 = new QLabel( TemplateDir, tr("T&emplates:"), GroupBox200, "Pfadtext1" );
188
        FileC4 = new QToolButton( GroupBox200, "FileC4" );
189
        FileC4->setMinimumSize( QSize( 88, 24 ) );
190
        FileC4->setText( tr( "Cha&nge..." ) );
191
        GroupBox200Layout->addWidget( PfadText4, 3, 0 );
192
        GroupBox200Layout->addWidget( TemplateDir, 3, 1 );
193
        GroupBox200Layout->addWidget( FileC4, 3, 2 );
782 fschmid 194
        tabLayout->addWidget( GroupBox200, 1, 0 );
776 fschmid 195
        addItem( tr("General"), loadIcon("AppIcon.png"), tab);
410 Franz 196
 
776 fschmid 197
        tab_7 = new QWidget( prefsWidgets, "tab_7" );
199 Franz 198
        tabLayout_7 = new QHBoxLayout( tab_7, 11, 6, "tabLayout_7");
199
        Layout21 = new QVBoxLayout( 0, 0, 6, "Layout21");
341 Franz 200
        GroupSize = new QButtonGroup( tr( "Page Size" ), tab_7, "GroupSize" );
199 Franz 201
        GroupSize->setColumnLayout(0, Qt::Vertical );
202
        GroupSize->layout()->setSpacing( 6 );
203
        GroupSize->layout()->setMargin( 10 );
204
        GroupSizeLayout = new QVBoxLayout( GroupSize->layout() );
205
        GroupSizeLayout->setAlignment( Qt::AlignTop );
206
        Layout6 = new QGridLayout( 0, 1, 1, 0, 6, "Layout6");
782 fschmid 207
 
199 Franz 208
        GZComboF = new QComboBox( true, GroupSize, "GZComboF" );
1542 cbradney 209
        /*
782 fschmid 210
        const QString ar_size[] =
211
            {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3",
850 cbradney 212
             "B4", "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", tr("Executive"),
213
             tr("Folio"), tr("Ledger"), tr("Legal"), tr("Letter"), tr("Tabloid")
782 fschmid 214
            };
188 Franz 215
        size_t ar_s = sizeof(ar_size) / sizeof(*ar_size);
216
        for (uint s = 0; s < ar_s; ++s)
199 Franz 217
                GZComboF->insertItem(ar_size[s]);
1542 cbradney 218
        */
1552 subik 219
 
1542 cbradney 220
        PageSize *ps=new PageSize(prefsData->pageSize);
221
        GZComboF->insertStringList(ps->getTrPageSizeList());
199 Franz 222
        GZComboF->insertItem( tr( "Custom" ) );
188 Franz 223
        GZComboF->setEditable(false);
1552 subik 224
 
1542 cbradney 225
        QStringList pageSizes=ps->getPageSizeList();
226
        int sizeIndex=pageSizes.findIndex(ps->getPageText());
227
        if (sizeIndex!=-1)
228
                GZComboF->setCurrentItem(sizeIndex);
229
        else
230
                GZComboF->setCurrentItem(GZComboF->count()-1);
341 Franz 231
        GZText1 = new QLabel( GZComboF, tr( "&Size:" ), GroupSize, "GZText1" );
232
        Layout6->addWidget( GZText1, 0, 0 );
199 Franz 233
        Layout6->addWidget( GZComboF, 0, 1 );
3 paul 234
 
199 Franz 235
        GZComboO = new QComboBox( true, GroupSize, "GZComboO" );
236
        GZComboO->insertItem( tr( "Portrait" ) );
237
        GZComboO->insertItem( tr( "Landscape" ) );
188 Franz 238
        GZComboO->setEditable(false);
1545 cbradney 239
        GZComboO->setCurrentItem(prefsData->pageOrientation);
341 Franz 240
        GZText2 = new QLabel( GZComboO, tr( "Orie&ntation:" ), GroupSize, "GZText2" );
241
        Layout6->addWidget( GZText2, 1, 0 );
199 Franz 242
        Layout6->addWidget( GZComboO, 1, 1 );
782 fschmid 243
        UnitCombo = new QComboBox( true, GroupSize, "UnitCombo" );
1525 cbradney 244
        UnitCombo->insertStringList(unitGetTextUnitList());
782 fschmid 245
        UnitCombo->setEditable(false);
1065 cbradney 246
        UnitCombo->setCurrentItem(prefsData->docUnitIndex);
782 fschmid 247
        unitComboText = new QLabel( UnitCombo, tr( "Units:" ), GroupSize, "unitComboText" );
248
        Layout6->addWidget( unitComboText, 2, 0 );
249
        Layout6->addWidget( UnitCombo, 2, 1 );
3 paul 250
 
199 Franz 251
        GroupSizeLayout->addLayout( Layout6 );
3 paul 252
 
199 Franz 253
        Layout5_2 = new QHBoxLayout( 0, 0, 6, "Layout5_2");
3 paul 254
 
782 fschmid 255
        pageWidth = new MSpinBox( 1, 10000, GroupSize, decimals );
256
        pageWidth->setEnabled( false );
257
        pageWidth->setMinimumSize( QSize( 70, 20 ) );
1545 cbradney 258
        pageWidth->setValue(prefsData->PageWidth * Umrech);
782 fschmid 259
        GZText3 = new QLabel( pageWidth, tr( "&Width:" ), GroupSize, "GZText3" );
260
        Layout5_2->addWidget( GZText3 );
261
        Layout5_2->addWidget( pageWidth );
3 paul 262
 
782 fschmid 263
        pageHeight = new MSpinBox( 1, 10000, GroupSize, decimals );
264
        pageHeight->setEnabled( false );
265
        pageHeight->setMinimumSize( QSize( 70, 20 ) );
1545 cbradney 266
        pageHeight->setValue(prefsData->PageHeight * Umrech);
782 fschmid 267
        GZText4 = new QLabel( pageHeight, tr( "&Height:" ), GroupSize, "GZText4" );
268
        Layout5_2->addWidget( GZText4 );
269
        Layout5_2->addWidget( pageHeight );
270
 
199 Franz 271
        GroupSizeLayout->addLayout( Layout5_2 );
782 fschmid 272
 
199 Franz 273
        Layout8 = new QHBoxLayout( 0, 0, 6, "Layout8");
3 paul 274
 
782 fschmid 275
        facingPages = new QCheckBox( tr( "&Facing Pages" ), GroupSize, "facingPages" );
1545 cbradney 276
        facingPages->setChecked(prefsData->FacingPages);
782 fschmid 277
        Layout8->addWidget( facingPages );
3 paul 278
 
341 Franz 279
        Linkszuerst = new QCheckBox( tr( "Left &Page First" ), GroupSize, "Linkszuerst" );
1545 cbradney 280
        Linkszuerst->setChecked(prefsData->LeftPageFirst);
782 fschmid 281
        if (!facingPages->isChecked())
188 Franz 282
                Linkszuerst->setEnabled(false);
199 Franz 283
        Layout8->addWidget( Linkszuerst );
284
        GroupSizeLayout->addLayout( Layout8 );
285
        Layout21->addWidget( GroupSize );
3 paul 286
 
341 Franz 287
        GroupRand = new QGroupBox( tr( "Margin Guides" ), tab_7, "GroupRand" );
199 Franz 288
        GroupRand->setColumnLayout(0, Qt::Vertical );
289
        GroupRand->layout()->setSpacing( 5 );
290
        GroupRand->layout()->setMargin( 10 );
291
        GroupRandLayout = new QGridLayout( GroupRand->layout() );
292
        GroupRandLayout->setAlignment( Qt::AlignTop );
3 paul 293
 
333 Franz 294
        TopR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 295
        TopR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 296
        TopR->setValue(prefsData->RandOben * Umrech);
297
        RandT = prefsData->RandOben;
199 Franz 298
        GroupRandLayout->addWidget( TopR, 0, 1 );
333 Franz 299
        BottomR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 300
        BottomR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 301
        BottomR->setValue(prefsData->RandUnten * Umrech);
302
        RandB = prefsData->RandUnten;
199 Franz 303
        GroupRandLayout->addWidget( BottomR, 1, 1 );
333 Franz 304
        RightR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 305
        RightR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 306
        RightR->setValue(prefsData->RandRechts * Umrech);
307
        RandR = prefsData->RandRechts;
199 Franz 308
        GroupRandLayout->addWidget( RightR, 1, 3 );
333 Franz 309
        LeftR = new MSpinBox( 0, 1000, GroupRand, decimals );
199 Franz 310
        LeftR->setMinimumSize( QSize( 70, 20 ) );
776 fschmid 311
        LeftR->setValue(prefsData->RandLinks * Umrech);
312
        RandL = prefsData->RandLinks;
199 Franz 313
        GroupRandLayout->addWidget( LeftR, 0, 3 );
3 paul 314
 
341 Franz 315
        GRText2 = new QLabel( BottomR, tr( "&Bottom:" ), GroupRand, "GRText2" );
199 Franz 316
        GroupRandLayout->addWidget( GRText2, 1, 0 );
341 Franz 317
        GRText1 = new QLabel( TopR, tr( "&Top:" ), GroupRand, "GRText1" );
199 Franz 318
        GroupRandLayout->addWidget( GRText1, 0, 0 );
341 Franz 319
        GRText4 = new QLabel( RightR, tr( "&Right:" ), GroupRand, "GRText4" );
199 Franz 320
        GroupRandLayout->addWidget( GRText4, 1, 2 );
341 Franz 321
        GRText3 = new QLabel( LeftR, tr( "&Left:" ), GroupRand, "GRText3" );
199 Franz 322
        GroupRandLayout->addWidget( GRText3, 0, 2 );
3 paul 323
 
199 Franz 324
        Layout21->addWidget( GroupRand );
1197 tsoots 325
        QBoxLayout *asurLayout = new QHBoxLayout( 0, 0, 6, "asurLayout");
3 paul 326
 
341 Franz 327
        GroupAS = new QGroupBox( tr( "Autosave" ), tab_7, "GroupAS" );
199 Franz 328
        GroupAS->setColumnLayout(0, Qt::Vertical );
329
        GroupAS->layout()->setSpacing( 5 );
330
        GroupAS->layout()->setMargin( 10 );
331
        GroupASLayout = new QGridLayout( GroupAS->layout() );
332
        GroupASLayout->setAlignment( Qt::AlignTop );
341 Franz 333
        ASon = new QCheckBox( tr( "&Enabled" ), GroupAS, "Enable Autosave" );
776 fschmid 334
        ASon->setChecked(prefsData->AutoSave);
199 Franz 335
        GroupASLayout->addMultiCellWidget( ASon, 0, 0, 0, 1 );
336
        ASTime = new QSpinBox( GroupAS, "Time" );
337
        ASTime->setMaxValue( 60 );
338
        ASTime->setMinValue( 1 );
339
        ASTime->setSuffix( " " + tr("min") );
776 fschmid 340
        ASTime->setValue(prefsData->AutoSaveTime / 1000 / 60);
341 Franz 341
        ASText = new QLabel( ASTime, tr( "&Interval:" ), GroupAS, "ASText" );
342
        GroupASLayout->addWidget( ASText, 1, 0 );
199 Franz 343
        GroupASLayout->addWidget( ASTime, 1, 1 );
1197 tsoots 344
        asurLayout->addWidget(GroupAS);
345
 
346
        urGroup = new QGroupBox(tr("Undo/Redo"), tab_7, "urGroup");
347
        urGroup->setColumnLayout(0, Qt::Vertical);
348
        urGroup->layout()->setSpacing(5);
349
        urGroup->layout()->setMargin(10);
350
        QGridLayout *urGroupLayout = new QGridLayout(urGroup->layout());
351
        urGroupLayout->setAlignment(Qt::AlignTop);
352
        urSpinBox = new QSpinBox(urGroup, "urSpinBox");
353
        urSpinBox->setMinValue(0);
354
        urSpinBox->setMaxValue(1000);
355
        int urSBValue = UndoManager::instance()->getHistoryLength();
356
        if (urSBValue == -1)
357
                urSpinBox->setEnabled(false);
358
        else
359
                urSpinBox->setValue(urSBValue);
360
        urLabel = new QLabel(urSpinBox, tr("Action history length"), urGroup, "urLabel");
361
        urGroupLayout->addWidget(urLabel, 0, 0);
362
        urGroupLayout->addWidget(urSpinBox, 0, 1);
363
        asurLayout->addWidget(urGroup);
364
        Layout21->addLayout(asurLayout);
365
 
782 fschmid 366
        tabLayout_7->addLayout( Layout21 );
776 fschmid 367
        addItem( tr("Document"), loadIcon("page.png"), tab_7);
3 paul 368
 
1195 fschmid 369
        tabGuides = new TabGuides(prefsWidgets, &prefsData->guidesSettings, &prefsData->typographicSetttings, Umrech, "");
776 fschmid 370
        addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
1195 fschmid 371
        tabTypo = new TabTypograpy(  prefsWidgets, &prefsData->typographicSetttings);
776 fschmid 372
        addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
1194 fschmid 373
        tabTools = new TabTools(  prefsWidgets, &prefsData->toolSettings, Umrech, "", 0);
782 fschmid 374
        addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
375
 
795 fschmid 376
        tabHyphenator = new HySettings(prefsWidgets, &ap->LangTransl);
377
        tabHyphenator->verbose->setChecked(!prefsData->Automatic);
378
        tabHyphenator->input->setChecked(prefsData->AutoCheck);
379
        tabHyphenator->language->setCurrentText(ap->LangTransl[prefsData->Language]);
380
        tabHyphenator->wordLen->setValue(prefsData->MinWordLen);
381
        tabHyphenator->maxCount->setValue(prefsData->HyCount);
382
        addItem( tr("Hyphenator"), loadIcon("hyphenate.png"), tabHyphenator);
1429 subik 383
 
1321 fschmid 384
        tabFonts = new FontPrefs(  prefsWidgets, ap->Prefs.AvailFonts, false, prefsData, ap->PrefsPfad, 0);
385
        addItem( tr("Fonts"), loadIcon("font.png"), tabFonts);
795 fschmid 386
 
1261 fschmid 387
        tabDocChecker = new TabCheckDoc(  prefsWidgets, prefsData->checkerProfiles, prefsData->curCheckProfile);
1235 fschmid 388
        addItem( tr("Doc-Checker"), loadIcon("checkdoc.png"), tabDocChecker);
389
 
795 fschmid 390
        if (CMSavail)
391
        {
392
                tabColorManagement = new CMSPrefs(prefsWidgets, &prefsData->DCMSset, &InputProfiles, &ap->PrinterProfiles, &ap->MonitorProfiles);
393
                addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
394
        }
1307 fschmid 395
        QMap<QString,QFont> DocFonts;
396
        DocFonts.clear();
397
        tabPDF = new TabPDFOptions( prefsWidgets,
1545 cbradney 398
                                                                &prefsData->PDF_Options,
1525 cbradney 399
                                                                ap->Prefs.AvailFonts,
400
                                                                &ap->PDFXProfiles,
401
                                                                DocFonts,
1545 cbradney 402
                                                                prefsData->PDF_Options.PresentVals,
1525 cbradney 403
                                                                Umrech,
404
                                                                unitGetSuffixFromIndex(prefsData->docUnitIndex),
1545 cbradney 405
                                                                prefsData->PageHeight,
406
                                                                prefsData->PageWidth,
1525 cbradney 407
 
1307 fschmid 408
        addItem( tr("PDF Export"), loadIcon("acroread.png"), tabPDF);
795 fschmid 409
 
1468 fschmid 410
        tabKeys = new KeyManager(prefsWidgets, prefsData->KeyActions);
795 fschmid 411
        addItem( tr("Keyboard Shortcuts"), loadIcon("key_bindings.png"), tabKeys);
412
 
776 fschmid 413
        tab_5 = new QWidget( prefsWidgets, "tab_5" );
188 Franz 414
        tabLayout_5 = new QGridLayout( tab_5 );
415
        tabLayout_5->setSpacing( 6 );
416
        tabLayout_5->setMargin( 11 );
788 fschmid 417
        saving = new QGroupBox( tr( "Other Options" ), tab_5, "Saving" );
418
        saving->setColumnLayout(0, Qt::Vertical );
419
        saving->layout()->setSpacing( 0 );
420
        saving->layout()->setMargin( 0 );
421
        savingLayout = new QHBoxLayout( saving->layout() );
422
        savingLayout->setAlignment( Qt::AlignTop );
423
        savingLayout->setSpacing( 6 );
424
        savingLayout->setMargin( 25 );
425
        SaveAtQuit = new QCheckBox( tr( "Sa&ve Contents on Changes" ), saving, "SaveAtQuit" );
776 fschmid 426
        SaveAtQuit->setChecked(prefsData->SaveAtQ);
788 fschmid 427
        savingLayout->addWidget( SaveAtQuit );
428
        tabLayout_5->addWidget( saving, 1, 0 );
429
        preview = new QGroupBox( tr( "Preview" ), tab_5, "Preview" );
430
        preview->setColumnLayout(0, Qt::Vertical );
431
        preview->layout()->setSpacing( 0 );
432
        preview->layout()->setMargin( 0 );
433
        previewLayout = new QHBoxLayout( preview->layout() );
434
        previewLayout->setAlignment( Qt::AlignTop );
435
        previewLayout->setSpacing( 10 );
436
        previewLayout->setMargin( 24 );
437
        PreviewSize = new QComboBox( true, preview, "PreviewSize" );
188 Franz 438
        PreviewSize->insertItem( tr( "Small" ) );
439
        PreviewSize->insertItem( tr( "Medium" ) );
341 Franz 440
        PreviewSize->insertItem( tr( "Large" ) );
188 Franz 441
        PreviewSize->setEditable(false);
776 fschmid 442
        int sci = prefsData->PSize == 40 ? 0 : prefsData->PSize == 60 ? 1 : 2;
188 Franz 443
        PreviewSize->setCurrentItem(sci);
788 fschmid 444
        textLabelP = new QLabel( PreviewSize, tr( "&Size:" ), preview, "TextLabel1_3" );
445
        previewLayout->addWidget( textLabelP );
446
        previewLayout->addWidget( PreviewSize );
447
        tabLayout_5->addWidget( preview, 0, 0 );
776 fschmid 448
        addItem(  tr("Scrapbook"), loadIcon("scrap.png"), tab_5);
199 Franz 449
 
776 fschmid 450
        tabView = new QWidget( prefsWidgets, "tabView" );
451
        tabViewLayout = new QVBoxLayout( tabView, 10, 5, "tabViewLayout");
452
        tabViewLayout->setAlignment( Qt::AlignTop );
453
        pageBackground = new QButtonGroup( tabView, "pageBackground" );
1195 fschmid 454
        pageBackground->setTitle( tr( "Page Display" ) );
776 fschmid 455
        pageBackground->setColumnLayout(0, Qt::Vertical );
456
        pageBackground->layout()->setSpacing( 5 );
457
        pageBackground->layout()->setMargin( 10 );
1195 fschmid 458
        pageBackgroundLayout = new QVBoxLayout( pageBackground->layout() );
776 fschmid 459
        pageBackgroundLayout->setAlignment( Qt::AlignTop );
1195 fschmid 460
        layout10 = new QHBoxLayout( 0, 0, 5, "layout10");
776 fschmid 461
        textLabel9 = new QLabel( pageBackground, "textLabel9" );
462
        textLabel9->setText( tr( "Color:" ) );
1195 fschmid 463
        layout10->addWidget( textLabel9 );
776 fschmid 464
        backColor = new QPushButton( pageBackground, "backColor" );
465
        backColor->setMinimumSize( QSize( 60, 20 ) );
466
        backColor->setMaximumSize( QSize( 60, 20 ) );
467
        backColor->setFlat( false );
468
        backColor->setAutoDefault( false );
469
        QPixmap pm5 = QPixmap(54, 14);
470
        pm5.fill(prefsData->DpapColor);
471
        colorPaper = prefsData->DpapColor;
472
        backColor->setPixmap(pm5);
473
        backColor->setText( QString::null );
1195 fschmid 474
        layout10->addWidget( backColor );
475
        QSpacerItem* spacer3 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
476
        layout10->addItem( spacer3 );
477
        pageBackgroundLayout->addLayout( layout10 );
776 fschmid 478
        checkUnprintable = new QCheckBox( pageBackground, "checkUnprintable" );
479
        checkUnprintable->setText( tr( "Display &Unprintable Area in Margin Color" ) );
480
        checkUnprintable->setAccel( QKeySequence( tr( "Alt+U" ) ) );
1065 cbradney 481
        checkUnprintable->setChecked( prefsData->marginColored );
776 fschmid 482
        pageBackgroundLayout->addWidget( checkUnprintable );
1195 fschmid 483
        checkPictures = new QCheckBox( pageBackground, "checkPictures" );
484
        checkPictures->setText( tr( "Show Pictures" ) );
485
        checkPictures->setChecked(prefsData->guidesSettings.showPic);
486
        pageBackgroundLayout->addWidget( checkPictures );
487
        checkLink = new QCheckBox( pageBackground, "checkLink" );
488
        checkLink->setText( tr( "Show Text Chains" ) );
489
        checkLink->setChecked(prefsData->guidesSettings.linkShown);
490
        pageBackgroundLayout->addWidget( checkLink );
491
        checkFrame = new QCheckBox( pageBackground, "checkFrame" );
492
        checkFrame->setText( tr( "Show Frames" ) );
493
        checkFrame->setChecked(prefsData->guidesSettings.framesShown);
494
        pageBackgroundLayout->addWidget( checkFrame );
776 fschmid 495
        tabViewLayout->addWidget( pageBackground );
3 paul 496
 
776 fschmid 497
        groupScratch = new QGroupBox( tabView, "GroupBox7" );
498
        groupScratch->setTitle( tr( "Scratch Space" ) );
499
        groupScratch->setColumnLayout(0, Qt::Vertical );
500
        groupScratch->layout()->setSpacing( 0 );
501
        groupScratch->layout()->setMargin( 0 );
502
        groupScratchLayout = new QHBoxLayout( groupScratch->layout() );
503
        groupScratchLayout->setAlignment( Qt::AlignTop );
504
        groupScratchLayout->setSpacing( 0 );
505
        groupScratchLayout->setMargin( 10 );
506
        Layout4s = new QGridLayout;
507
        Layout4s->setSpacing( 6 );
508
        Layout4s->setMargin( 0 );
509
        topScratch = new MSpinBox( groupScratch, 4 );
510
        topScratch->setDecimals( decimals );
511
        topScratch->setMaxValue(1000);
512
        topScratch->setValue(prefsData->ScratchTop * Umrech);
513
        Layout4s->addWidget( topScratch, 0, 1 );
514
        TextLabel5s = new QLabel(topScratch, tr( "&Top:" ), groupScratch, "TextLabel5" );
515
        Layout4s->addWidget( TextLabel5s, 0, 0 );
516
        leftScratch = new MSpinBox( groupScratch, 4 );
517
        leftScratch->setDecimals( decimals );
518
        leftScratch->setMaxValue(1000);
519
        leftScratch->setValue(prefsData->ScratchLeft * Umrech);
520
        Layout4s->addWidget( leftScratch, 0, 3 );
521
        Linkss = new QLabel(leftScratch, tr( "&Left:" ), groupScratch, "Links" );
522
        Layout4s->addWidget( Linkss, 0, 2 );
523
        bottomScratch = new MSpinBox( groupScratch, 4 );
524
        bottomScratch->setDecimals( decimals );
525
        bottomScratch->setMaxValue(1000);
526
        bottomScratch->setValue(prefsData->ScratchBottom * Umrech);
527
        Layout4s->addWidget( bottomScratch, 1, 1 );
528
        TextLabel7s = new QLabel(bottomScratch, tr( "&Bottom:" ), groupScratch, "TextLabel7" );
529
        Layout4s->addWidget( TextLabel7s, 1, 0 );
530
        rightScratch = new MSpinBox( groupScratch, 4 );
531
        rightScratch->setDecimals( decimals );
532
        rightScratch->setMaxValue(1000);
533
        rightScratch->setValue(prefsData->ScratchRight * Umrech);
534
        Layout4s->addWidget( rightScratch, 1, 3 );
535
        Rechtss = new QLabel(rightScratch, tr( "&Right:" ), groupScratch, "Rechts" );
536
        Layout4s->addWidget( Rechtss, 1, 2 );
537
        groupScratchLayout->addLayout( Layout4s );
538
        tabViewLayout->addWidget( groupScratch );
3 paul 539
 
776 fschmid 540
        CaliGroup = new QGroupBox( tr( "&Adjust Display Size" ), tabView, "CaliGroup" );
188 Franz 541
        CaliGroup->setColumnLayout(0, Qt::Vertical );
542
        CaliGroup->layout()->setSpacing( 6 );
543
        CaliGroup->layout()->setMargin( 11 );
544
        CaliGroupLayout = new QVBoxLayout( CaliGroup->layout() );
545
        CaliGroupLayout->setAlignment( Qt::AlignTop );
341 Franz 546
        CaliText = new QLabel( tr( "To adjust the display drag the ruler below with the Slider." ), CaliGroup, "CaliText" );
188 Franz 547
        CaliGroupLayout->addWidget( CaliText );
548
        CaliRuler = new QLabel( CaliGroup, "CaliRuler" );
549
        CaliRuler->setMinimumSize( QSize( 20, 20 ) );
788 fschmid 550
        drawRuler();
188 Franz 551
        CaliRuler->setFrameShape( QLabel::Box );
552
        CaliRuler->setFrameShadow( QLabel::Sunken );
776 fschmid 553
        CaliRuler->setScaledContents( false );
188 Franz 554
        CaliGroupLayout->addWidget( CaliRuler );
555
        layout15ca = new QHBoxLayout( 0, 0, 6, "layout15");
556
        CaliSlider = new QSlider( CaliGroup, "CaliSlider" );
557
        CaliSlider->setMinValue( -100 );
558
        CaliSlider->setMaxValue( 100 );
559
        CaliSlider->setValue(static_cast<int>(100 * DisScale)-100);
560
        CaliSlider->setOrientation( QSlider::Horizontal );
561
        CaliSlider->setTickmarks( QSlider::Right );
562
        CaliSlider->setTickInterval( 10 );
341 Franz 563
        CaliText->setBuddy(CaliGroup);
188 Franz 564
        layout15ca->addWidget( CaliSlider );
565
        CaliAnz = new QLabel( CaliGroup, "CaliAnz" );
566
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
567
        layout15ca->addWidget( CaliAnz );
568
        CaliGroupLayout->addLayout( layout15ca );
776 fschmid 569
        tabViewLayout->addWidget( CaliGroup );
570
        addItem( tr("Display"), loadIcon("screen.png"), tabView);
782 fschmid 571
 
776 fschmid 572
        ExtTool = new QWidget( prefsWidgets, "ExtTool" );
782 fschmid 573
        ExtToolLayout = new QVBoxLayout( ExtTool, 11, 6, "ExtToolLayout");
776 fschmid 574
        ExtToolLayout->setAlignment( Qt::AlignTop );
341 Franz 575
        groupGS = new QGroupBox( tr( "Postscript Interpreter" ), ExtTool, "groupGS" );
220 Franz 576
        groupGS->setColumnLayout(0, Qt::Vertical );
577
        groupGS->layout()->setSpacing( 6 );
578
        groupGS->layout()->setMargin( 10 );
579
        groupGSLayout = new QVBoxLayout( groupGS->layout() );
580
        groupGSLayout->setAlignment( Qt::AlignTop );
782 fschmid 581
        GSlayout = new QHBoxLayout( 0, 0, 6, "GSlayout");
220 Franz 582
        GSName = new QLineEdit( groupGS, "GSName" );
776 fschmid 583
        GSName->setText(prefsData->gs_exe);
341 Franz 584
        GSText = new QLabel( GSName, tr( "&Name of Executable:" ), groupGS, "GSText" );
585
        GSlayout->addWidget( GSText );
220 Franz 586
        GSlayout->addWidget( GSName );
587
        groupGSLayout->addLayout( GSlayout );
341 Franz 588
        GSantiText = new QCheckBox( tr( "Antialias &Text" ), groupGS, "GSantiText" );
1545 cbradney 589
        GSantiText->setChecked(prefsData->gs_AntiAliasText);
220 Franz 590
        groupGSLayout->addWidget( GSantiText );
341 Franz 591
        GSantiGraph = new QCheckBox( tr( "Antialias &Graphics" ), groupGS, "GSantiGraph" );
1545 cbradney 592
        GSantiGraph->setChecked(prefsData->gs_AntiAliasGraphics);
220 Franz 593
        groupGSLayout->addWidget( GSantiGraph );
594
        ExtToolLayout->addWidget( groupGS );
341 Franz 595
        groupGimp = new QGroupBox( tr( "Image Processing Tool" ), ExtTool, "groupGimp" );
220 Franz 596
        groupGimp->setColumnLayout(0, Qt::Vertical );
597
        groupGimp->layout()->setSpacing( 6 );
598
        groupGimp->layout()->setMargin( 10 );
599
        groupGimpLayout = new QHBoxLayout( groupGimp->layout() );
600
        groupGimpLayout->setAlignment( Qt::AlignTop );
601
        GimpName = new QLineEdit( groupGimp, "GimpName" );
776 fschmid 602
        GimpName->setText(prefsData->gimp_exe);
341 Franz 603
        GimpText = new QLabel( GimpName, tr( "Name of &Executable:" ), groupGimp, "GimpText" );
604
        groupGimpLayout->addWidget( GimpText );
220 Franz 605
        groupGimpLayout->addWidget( GimpName );
606
        ExtToolLayout->addWidget( groupGimp );
607
        QSpacerItem* spacer_gs = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
608
        ExtToolLayout->addItem( spacer_gs );
776 fschmid 609
        addItem(  tr("External Tools."), loadIcon("misc.png"), ExtTool);
222 Franz 610
 
776 fschmid 611
        Misc = new QWidget( prefsWidgets, "Misc" );
1468 fschmid 612
        MiscLayout = new QVBoxLayout( Misc, 10, 5, "MiscLayout");
776 fschmid 613
        MiscLayout->setAlignment( Qt::AlignTop );
341 Franz 614
        groupPrint = new QGroupBox( tr( "Printing" ), Misc, "groupPrint" );
222 Franz 615
        groupPrint->setColumnLayout(0, Qt::Vertical );
616
        groupPrint->layout()->setSpacing( 10 );
617
        groupPrint->layout()->setMargin( 10 );
618
        groupPrintLayout = new QVBoxLayout( groupPrint->layout() );
619
        groupPrintLayout->setAlignment( Qt::AlignTop );
341 Franz 620
        ClipMarg = new QCheckBox( tr( "Clip to Page &Margins" ), groupPrint, "ClipMarg" );
776 fschmid 621
        ClipMarg->setChecked(prefsData->ClipMargin);
222 Franz 622
        groupPrintLayout->addWidget( ClipMarg );
344 Franz 623
        DoGCR = new QCheckBox( tr( "Apply &Under Color Removal" ), groupPrint, "ClipMarg" );
776 fschmid 624
        DoGCR->setChecked(prefsData->GCRMode);
344 Franz 625
        groupPrintLayout->addWidget( DoGCR );
222 Franz 626
        MiscLayout->addWidget( groupPrint );
1468 fschmid 627
        AskForSubs = new QCheckBox( tr( "Always ask before Fonts are replaced when loading a Document" ), Misc, "askforSubs" );
628
        AskForSubs->setChecked(prefsData->askBeforeSubstituite);
629
        MiscLayout->addWidget( AskForSubs );
222 Franz 630
        QSpacerItem* spacer_3m = new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
631
        MiscLayout->addItem( spacer_3m );
776 fschmid 632
        addItem(  tr("Misc."), loadIcon("misc.png"), Misc);
222 Franz 633
 
1429 subik 634
        // plugin manager. pv.
635
        pluginManagerWidget = new QWidget(prefsWidgets, "pluginManagerWidget");
1596 subik 636
        pluginMainLayout = new QVBoxLayout( pluginManagerWidget, 10, 5, "pluginMainLayout");
637
        pluginMainLayout->setAlignment( Qt::AlignTop );
638
        plugGroupBox = new QGroupBox(tr("Plugin Manager"), pluginManagerWidget, "plugGroupBox");
639
        plugGroupBox->setColumnLayout(0, Qt::Vertical);
640
        plugGroupBox->layout()->setSpacing(6);
641
        plugGroupBox->layout()->setMargin(11);
642
        plugGroupBoxLayout = new QGridLayout( plugGroupBox->layout() );
643
        plugGroupBoxLayout->setAlignment(Qt::AlignTop);
644
        plugLayout1 = new QVBoxLayout( 0, 0, 6, "plugLayout1");
645
        pluginsList = new QListView(plugGroupBox, "pluginsList");
646
        pluginsList->setAllColumnsShowFocus(true);
647
        pluginsList->setShowSortIndicator(true);
1552 subik 648
        pluginsList->addColumn(tr("Plugin"));
1596 subik 649
        pluginsList->setColumnWidthMode(0, QListView::Maximum);
1552 subik 650
        pluginsList->addColumn(tr("How to run"));
1596 subik 651
        pluginsList->setColumnWidthMode(1, QListView::Maximum);
1552 subik 652
        pluginsList->addColumn(tr("Type"));
1596 subik 653
        pluginsList->setColumnWidthMode(2, QListView::Maximum);
1552 subik 654
        pluginsList->addColumn(tr("Load it?"));
1596 subik 655
        pluginsList->setColumnWidthMode(3, QListView::Maximum);
656
        pluginsList->addColumn(tr("Plugin ID"));
657
        pluginsList->setColumnWidthMode(4, QListView::Maximum);
658
        pluginsList->addColumn(tr("File"));
659
        pluginsList->setColumnWidthMode(5, QListView::Maximum);
1552 subik 660
        for (QMap<int,PluginManager::PluginData>::Iterator it = ap->pluginManager->pluginMap.begin(); it != ap->pluginManager->pluginMap.end(); ++it)
1429 subik 661
        {
1596 subik 662
                QListViewItem *plugItem = new QListViewItem(pluginsList);
663
                plugItem->setText(0, (*it).name.replace('&', "").replace("...", "")); // name
664
                plugItem->setText(1, QString("%1 %2").arg((*it).actMenu).arg((*it).actMenuAfterName)); // menu path
665
                plugItem->setText(2, ap->pluginManager->getPluginType((*it).type)); // type
666
                // load at start?
1552 subik 667
                plugItem->setPixmap(3, (*it).loadPlugin ? loadIcon("ok.png") : loadIcon("DateiClos16.png"));
1596 subik 668
                plugItem->setText(3, (*it).loadPlugin ? tr("Yes") : tr("No"));
669
                plugItem->setText(4, QString("%1").arg(it.key())); // id for developers
670
                plugItem->setText(5, (*it).pluginFile); // file for developers
1429 subik 671
        }
1596 subik 672
        plugLayout1->addWidget(pluginsList);
673
        pluginWarning = new QLabel(plugGroupBox);
674
        pluginWarning->setText("<qt>" + tr("You need to restart the application to promote the changes.") + "</qt>");
675
        plugLayout1->addWidget(pluginWarning);
676
        plugGroupBoxLayout->addLayout(plugLayout1, 0, 0);
677
        pluginMainLayout->addWidget(plugGroupBox);
1468 fschmid 678
        addItem(tr("Plugins"), loadIcon("plugins.png"), pluginManagerWidget);
1429 subik 679
 
188 Franz 680
        setDS();
245 Franz 681
        //tab order
682
        QWidget::setTabOrder( GFsize, SpinBox3 );
776 fschmid 683
        QWidget::setTabOrder( SpinBox3, UnitCombo );
245 Franz 684
        QWidget::setTabOrder( UnitCombo, Recen );
284 Franz 685
        QWidget::setTabOrder( Recen, Docs );
245 Franz 686
        QWidget::setTabOrder( Docs, FileC );
687
        QWidget::setTabOrder( FileC, ProPfad );
688
        QWidget::setTabOrder( ProPfad, FileC2  );
689
        QWidget::setTabOrder( FileC2, ScriptPfad );
690
        QWidget::setTabOrder( ScriptPfad, FileC3 );
410 Franz 691
        QWidget::setTabOrder( FileC3, TemplateDir );
692
        QWidget::setTabOrder( TemplateDir, FileC4 );
228 Franz 693
 
245 Franz 694
 
695
        QWidget::setTabOrder( TopR, BottomR );
696
        QWidget::setTabOrder( BottomR, LeftR );
697
        QWidget::setTabOrder( LeftR, RightR );
698
 
699
        QWidget::setTabOrder( PreviewSize, SaveAtQuit );
700
 
1195 fschmid 701
        QToolTip::add( checkLink, tr("Turns the of linked frames on or off"));
702
        QToolTip::add( checkFrame, tr("Turns the display of frames on or off"));
703
        QToolTip::add( checkPictures, tr("Turns the display of pictures on or off"));
675 cbradney 704
        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 705
        QToolTip::add( GUICombo, tr( "Choose the default window decoration and looks.\nScribus inherits any available KDE or Qt themes" ) );
706
        QToolTip::add( GFsize, tr( "Default font size for the menus and windows" ) );
707
        QToolTip::add( UnitCombo, tr( "Default unit of measurement for document editing" ) );
708
        QToolTip::add( SpinBox3, tr( "Number of lines Scribus will scroll for each move of the mouse wheel" ) );
709
        QToolTip::add( Recen, tr( "Number of recently edited documents to show in the File menu" ) );
710
        QToolTip::add( Docs, tr( "Default documents directory" ) );
711
        QToolTip::add( ProPfad, tr( "Default ICC profiles directory" ) );
712
        QToolTip::add( ScriptPfad, tr( "Default Scripter scripts directory" ) );
410 Franz 713
        QToolTip::add( TemplateDir, tr( "Additional Directory for Document Templates" ) );
228 Franz 714
 
715
        QToolTip::add( GZComboF, tr( "Default page size, either a standard size or a custom size" ) );
716
        QToolTip::add( GZComboO, tr( "Default orientation of document pages" ) );
782 fschmid 717
        QToolTip::add( pageWidth, tr( "Width of document pages, editable if you have chosen a custom page size" ) );
718
        QToolTip::add( pageHeight, tr( "Height of document pages, editable if you have chosen a custom page size" ) );
719
        QToolTip::add( facingPages, tr( "Enable single or spread based layout" ) );
228 Franz 720
        QToolTip::add( Linkszuerst, tr( "Make the first page the left page of a document" ) );
721
        QToolTip::add( TopR, tr( "Distance between the top margin guide and the edge of the page" ) );
722
        QToolTip::add( BottomR, tr( "Distance between the bottom margin guide and the edge of the page" ) );
723
        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 724
        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 725
        QToolTip::add( ASon, tr( "When enabled, Scribus saves a backup copy of your file with the .bak extension\neach time the time period elapses" ) );
726
        QToolTip::add( ASTime, tr( "Time period between saving automatically" ) );
727
 
1197 tsoots 728
        QToolTip::add( urSpinBox, tr("Set the length of the action history in steps.\nIf set to 0 infinite amount of actions will be stored."));
729
 
228 Franz 730
        QToolTip::add( PreviewSize, tr( "Choose the size of the preview in the scrapbook palette" ) );
243 Franz 731
        QToolTip::add( SaveAtQuit, tr( "Save the scrapbook contents everytime after a change" ) );
228 Franz 732
 
776 fschmid 733
        QToolTip::add( backColor, tr( "Color for paper" ) );
734
        QToolTip::add( checkUnprintable, tr( "Mask the area outside the margins in the margin color" ) );
228 Franz 735
        QToolTip::add( CaliSlider, tr( "Set the default zoom level" ) );
736
 
737
        QToolTip::add( GSName, tr( "Filesystem location for the Ghostscript interpreter" ) );
738
        QToolTip::add( GSantiText, tr( "Antialias text for EPS and PDF onscreen rendering" ) );
739
        QToolTip::add( GSantiGraph, tr( "Antialias graphics for EPS and PDF onscreen rendering" ) );
249 Franz 740
        QToolTip::add( GimpName, tr( "Filesystem location for graphics editor" ) );
228 Franz 741
 
742
        QToolTip::add( ClipMarg, tr( "Do not show objects outside the margins on the printed page or exported file" ) );
415 Franz 743
        QToolTip::add( DoGCR, tr( "A way of switching off some of the gray shades which are composed\n"
782 fschmid 744
                                          "of cyan, yellow and magenta and using black instead.\n"
745
                                          "UCR most affects parts of images which are neutral and/or dark tones\n"
746
                                          "which are close to the gray. Use of this may improve printing some images\n"
747
                                          "and some experimentation and testing is need on a case by case basis.\n"
748
                                          "UCR reduces the possibility of over saturation with CMY inks." ) );
228 Franz 749
 
188 Franz 750
        // signals and slots connections
663 cbradney 751
        connect( guiLangCombo, SIGNAL( activated( const QString & ) ), this, SLOT( setSelectedGUILang( const QString & ) ) );
776 fschmid 752
        connect(backColor, SIGNAL(clicked()), this, SLOT(changePaperColor()));
788 fschmid 753
        connect(UnitCombo, SIGNAL(activated(int)), this, SLOT(unitChange()));
782 fschmid 754
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
755
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
188 Franz 756
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
757
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
758
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
759
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
760
        connect(GZComboO, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
1542 cbradney 761
        connect(GZComboF, SIGNAL(activated(const QString &)), this, SLOT(setSize(const QString &)));
782 fschmid 762
        connect(facingPages, SIGNAL(clicked()), this, SLOT(setDS()));
788 fschmid 763
        connect(FileC, SIGNAL(clicked()), this, SLOT(changeDocs()));
764
        connect(FileC2, SIGNAL(clicked()), this, SLOT(changeProfs()));
765
        connect(FileC3, SIGNAL(clicked()), this, SLOT(changeScripts()));
766
        connect(FileC4, SIGNAL(clicked()), this, SLOT(changeTemplates()));
767
        connect(CaliSlider, SIGNAL(valueChanged(int)), this, SLOT(setDisScale()));
1197 tsoots 768
        connect(buttonOk, SIGNAL(clicked()), this, SLOT(setActionHistoryLength()));
1596 subik 769
        connect(pluginsList, SIGNAL(clicked(QListViewItem *, const QPoint &, int)),
770
                        this, SLOT(changePluginLoad(QListViewItem *, const QPoint &, int)));
1307 fschmid 771
        if (CMSavail)
772
                connect(tabColorManagement, SIGNAL(cmsOn(bool )), this, SLOT(switchCMS(bool )));
1552 subik 773
 
1542 cbradney 774
        setSize(prefsData->pageSize);
1545 cbradney 775
        setOrien(prefsData->pageOrientation);
1552 subik 776
 
1545 cbradney 777
        pageWidth->setValue(prefsData->PageWidth * Umrech);
778
        pageHeight->setValue(prefsData->PageHeight * Umrech);
1552 subik 779
 
788 fschmid 780
        unitChange();
1552 subik 781
 
776 fschmid 782
        prefsWidgets->raiseWidget(0);
783
        resize( minimumSizeHint() );
784
        arrangeIcons();
785
        clearWState( WState_Polished );
3 paul 786
}
787
 
199 Franz 788
/*!
145 Franz 789
 \fn Preferences::~Preferences
1030 subik 790
 \author Franz Schmid
791
 \date
145 Franz 792
 \brief Destructor for Preferences dialog box
793
 \param None
794
 \retval None
3 paul 795
 */
796
Preferences::~Preferences()
797
{
199 Franz 798
        // no need to delete child widgets, Qt does it all for us
3 paul 799
}
800
 
263 Franz 801
 
199 Franz 802
/*!
145 Franz 803
 \fn void Preferences::ChangeDocs()
1030 subik 804
 \author Franz Schmid
805
 \date
145 Franz 806
 \brief Runs QFileDialog to get Preferences (General) Path to Documents directory
807
 \param None
808
 \retval None
809
 */
788 fschmid 810
void Preferences::changeDocs()
3 paul 811
{
812
        QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
813
        if (s != "")
814
                Docs->setText(s);
815
}
816
 
199 Franz 817
/*!
145 Franz 818
 \fn void Preferences::ChangeProfs()
1030 subik 819
 \author Franz Schmid
820
 \date
145 Franz 821
 \brief Runs QFileDialog to get Preferences (General) Path to Colour Profiles directory
822
 \param None
823
 \retval None
824
 */
788 fschmid 825
void Preferences::changeProfs()
68 Franz 826
{
788 fschmid 827
        QString s = QFileDialog::getExistingDirectory(ProPfad->text(), this, "d", tr("Choose a Directory"), true);
68 Franz 828
        if (s != "")
829
                ProPfad->setText(s);
830
}
831
 
199 Franz 832
/*!
145 Franz 833
 \fn void Preferences::ChangeScripts()
1030 subik 834
 \author Franz Schmid
835
 \date
145 Franz 836
 \brief Runs QFileDialog to get Preferences (General) Path to Scripts directory
837
 \param None
1030 subik 838
 \retval None
145 Franz 839
 */
788 fschmid 840
void Preferences::changeScripts()
91 Franz 841
{
788 fschmid 842
        QString s = QFileDialog::getExistingDirectory(ScriptPfad->text(), this, "d", tr("Choose a Directory"), true);
91 Franz 843
        if (s != "")
844
                ScriptPfad->setText(s);
845
}
846
 
199 Franz 847
/*!
410 Franz 848
 \fn void Preferences::ChangeTemplates()
1030 subik 849
 \author Riku Leino
850
 \date
410 Franz 851
 \brief Runs QFileDialog to get Preferences (General) Path to Templates directory
852
 \param None
1030 subik 853
 \retval None
410 Franz 854
 */
788 fschmid 855
void Preferences::changeTemplates()
410 Franz 856
{
788 fschmid 857
        QString s = QFileDialog::getExistingDirectory(TemplateDir->text(), this, "d", tr("Choose a Directory"), true);
410 Franz 858
        if (s != "")
859
                TemplateDir->setText(s);
860
}
861
 
862
/*!
145 Franz 863
 \fn void Preferences::setDS()
1030 subik 864
 \author Franz Schmid
865
 \date
145 Franz 866
 \brief Preferences (Document / Page Size), switches default between Facing Pages and swaps text labels for margin guides
867
 \param None
1030 subik 868
 \retval None
145 Franz 869
 */
3 paul 870
void Preferences::setDS()
871
{
782 fschmid 872
        bool m = facingPages->isChecked() ? true : false;
341 Franz 873
        GRText3->setText(m == true ? tr( "&Inside:" ) : tr( "&Left:" ));
874
        GRText4->setText(m == true ? tr( "O&utside:" ) : tr( "&Right:" ));
188 Franz 875
        Linkszuerst->setEnabled(m);
876
        if (m == false)
877
                Linkszuerst->setChecked(false);
3 paul 878
}
879
 
199 Franz 880
/*!
782 fschmid 881
 \fn void Preferences::setPageWidth(int v)
1030 subik 882
 \author Franz Schmid
883
 \date
145 Franz 884
 \brief Preferences (Document / Page Size), sets Page width values
885
 \param v Width value
1030 subik 886
 \retval None
145 Franz 887
 */
782 fschmid 888
void Preferences::setPageWidth(int)
3 paul 889
{
782 fschmid 890
        Pagebr = pageWidth->value() / Umrech;
891
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
892
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
893
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
894
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
3 paul 895
}
896
 
199 Franz 897
/*!
782 fschmid 898
 \fn void Preferences::setPageHeight(int v)
1030 subik 899
 \author Franz Schmid
900
 \date
145 Franz 901
 \brief Preferences (Document / Page Size), sets Page height values
902
 \param v Height value
1030 subik 903
 \retval None
145 Franz 904
 */
782 fschmid 905
void Preferences::setPageHeight(int)
3 paul 906
{
782 fschmid 907
        Pageho = pageHeight->value() / Umrech;
908
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
909
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
910
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
911
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
3 paul 912
}
913
 
199 Franz 914
/*!
145 Franz 915
 \fn void Preferences::setTop(int v)
1030 subik 916
 \author Franz Schmid
917
 \date
145 Franz 918
 \brief Preferences (Document / Page Size), sets Page top values
919
 \param v Top value
1030 subik 920
 \retval None
145 Franz 921
 */
146 Franz 922
void Preferences::setTop(int)
36 Franz 923
{
146 Franz 924
        RandT = TopR->value() / Umrech;
782 fschmid 925
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
36 Franz 926
}
927
 
199 Franz 928
/*!
145 Franz 929
 \fn void Preferences::setBottom(int v)
1030 subik 930
 \author Franz Schmid
931
 \date
145 Franz 932
 \brief Preferences (Document / Page Size), sets Page bottom values
933
 \param v Bottom value
1030 subik 934
 \retval None
145 Franz 935
 */
146 Franz 936
void Preferences::setBottom(int)
36 Franz 937
{
146 Franz 938
        RandB = BottomR->value() / Umrech;
782 fschmid 939
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
36 Franz 940
}
941
 
199 Franz 942
/*!
145 Franz 943
 \fn void Preferences::setLeft(int v)
1030 subik 944
 \author Franz Schmid
945
 \date
145 Franz 946
 \brief Preferences (Document / Page Size), sets Page left values
947
 \param v Top value
1030 subik 948
 \retval None
145 Franz 949
 */
146 Franz 950
void Preferences::setLeft(int)
36 Franz 951
{
146 Franz 952
        RandL = LeftR->value() / Umrech;
782 fschmid 953
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
36 Franz 954
}
955
 
199 Franz 956
/*!
145 Franz 957
 \fn void Preferences::setRight(int v)
1030 subik 958
 \author Franz Schmid
959
 \date
145 Franz 960
 \brief Preferences (Document / Page Size), sets Page right values
961
 \param v Right value
1030 subik 962
 \retval None
145 Franz 963
 */
146 Franz 964
void Preferences::setRight(int)
36 Franz 965
{
146 Franz 966
        RandR = RightR->value() / Umrech;
782 fschmid 967
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
36 Franz 968
}
969
 
199 Franz 970
/*!
1542 cbradney 971
 \fn void Preferences::setSize(QString gr)
1030 subik 972
 \author Franz Schmid
973
 \date
145 Franz 974
 \brief Preferences (Document / Page Size), sets Page size values. Connects signals for setting page dimensions.
975
 \param gr Standard page size value (eg A4)
1030 subik 976
 \retval None
145 Franz 977
 */
1542 cbradney 978
void Preferences::setSize(const QString & gr)
3 paul 979
{
782 fschmid 980
        Pagebr = pageWidth->value() / Umrech;
981
        Pageho = pageHeight->value() / Umrech;
982
        pageWidth->setEnabled(false);
983
        pageHeight->setEnabled(false);
1542 cbradney 984
        PageSize *ps2=new PageSize(gr);
985
 
986
        prefsPageSizeName=ps2->getPageName();
987
        if (gr==tr("Custom"))
188 Franz 988
        {
782 fschmid 989
                pageWidth->setEnabled(true);
990
                pageHeight->setEnabled(true);
188 Franz 991
        }
992
        else
993
        {
1542 cbradney 994
                Pagebr = ps2->getPageWidth();
995
                Pageho = ps2->getPageHeight();
188 Franz 996
        }
782 fschmid 997
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
998
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
999
        pageWidth->setValue(Pagebr * Umrech);
1000
        pageHeight->setValue(Pageho * Umrech);
1001
        RightR->setMaxValue(pageWidth->value() - LeftR->value());
1002
        LeftR->setMaxValue(pageWidth->value() - RightR->value());
1003
        TopR->setMaxValue(pageHeight->value() - BottomR->value());
1004
        BottomR->setMaxValue(pageHeight->value() - TopR->value());
1005
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1006
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
3 paul 1007
}
1008
 
199 Franz 1009
/*!
145 Franz 1010
 \fn void Preferences::setOrien(int ori)
1030 subik 1011
 \author Franz Schmid
1012
 \date
145 Franz 1013
 \brief Preferences (Document / Page Size), sets Page orientation value and page dimensions
1014
 \param ori Orientation value
1030 subik 1015
 \retval None
145 Franz 1016
 */
3 paul 1017
void Preferences::setOrien(int ori)
1018
{
146 Franz 1019
        double br;
1542 cbradney 1020
        setSize(GZComboF->currentText());
782 fschmid 1021
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1022
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
3 paul 1023
        if (ori == 0)
188 Franz 1024
        {
1542 cbradney 1025
                //if (GZComboF->currentItem() == 30)
1026
                if (GZComboF->currentText() == tr("Custom"))
3 paul 1027
                {
782 fschmid 1028
                        br = pageWidth->value();
1029
                        pageWidth->setValue(pageHeight->value());
1030
                        pageHeight->setValue(br);
3 paul 1031
                }
188 Franz 1032
        }
3 paul 1033
        else
188 Franz 1034
        {
782 fschmid 1035
                br = pageWidth->value();
1036
                pageWidth->setValue(pageHeight->value());
1037
                pageHeight->setValue(br);
188 Franz 1038
        }
782 fschmid 1039
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1040
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
3 paul 1041
}
1042
 
199 Franz 1043
/*!
145 Franz 1044
 \fn void Preferences::changePapColor()
1030 subik 1045
 \author Franz Schmid
1046
 \date
1525 cbradney 1047
 \brief Preferences ([dox?], [dox?]), Sets Paper color [dox?]
145 Franz 1048
 \param None
1030 subik 1049
 \retval None
145 Franz 1050
 */
776 fschmid 1051
void Preferences::changePaperColor()
3 paul 1052
{
1053
        QColor neu = QColor();
776 fschmid 1054
        neu = QColorDialog::getColor(colorPaper, this);
3 paul 1055
        if (neu.isValid())
188 Franz 1056
        {
776 fschmid 1057
                QPixmap pm = QPixmap(54, 14);
199 Franz 1058
                pm.fill(neu);
776 fschmid 1059
                colorPaper = neu;
1060
                backColor->setPixmap(pm);
188 Franz 1061
        }
3 paul 1062
}
1063
 
199 Franz 1064
/*!
145 Franz 1065
 \fn void Preferences::UnitChange()
1030 subik 1066
 \author Franz Schmid
1067
 \date
145 Franz 1068
 \brief Preferences (General, Units). Sets scaling factors and units descriptions when default units are changed. Updates preference values
1069
 \param None
1030 subik 1070
 \retval None
145 Franz 1071
 */
788 fschmid 1072
void Preferences::unitChange()
3 paul 1073
{
782 fschmid 1074
        disconnect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1075
        disconnect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
199 Franz 1076
        disconnect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1077
        disconnect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1078
        disconnect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1079
        disconnect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
333 Franz 1080
        int decimals;
80 Franz 1081
        double AltUmrech = Umrech;
782 fschmid 1082
        double oldMin, oldMax, oldB, oldBM, oldH, oldHM, val;
1083
        pageWidth->getValues(&oldB, &oldBM, &decimals, &val);
333 Franz 1084
        oldB /= AltUmrech;
1085
        oldBM /= AltUmrech;
782 fschmid 1086
        pageHeight->getValues(&oldH, &oldHM, &decimals, &val);
333 Franz 1087
        oldH /= AltUmrech;
1088
        oldHM /= AltUmrech;
139 Franz 1089
        QString einh;
1065 cbradney 1090
        docUnitIndex = UnitCombo->currentItem();
1525 cbradney 1091
        Umrech = unitGetRatioFromIndex(docUnitIndex);
1092
        decimals = unitGetDecimalsFromIndex(docUnitIndex);
1093
        einh = unitGetSuffixFromIndex(docUnitIndex);
1549 subik 1094
 
782 fschmid 1095
        pageWidth->setSuffix(einh);
1096
        pageHeight->setSuffix(einh);
188 Franz 1097
        TopR->setSuffix(einh);
1098
        BottomR->setSuffix(einh);
1099
        LeftR->setSuffix(einh);
1100
        RightR->setSuffix(einh);
879 fschmid 1101
        tabGuides->minorSpace->setSuffix(einh);
1102
        tabGuides->majorSpace->setSuffix(einh);
1103
        tabGuides->snapDistance->setSuffix(einh);
1195 fschmid 1104
        tabGuides->baseGrid->setSuffix(einh);
1105
        tabGuides->baseOffset->setSuffix(einh);
1194 fschmid 1106
        tabTools->gapText->setSuffix(einh);
776 fschmid 1107
        topScratch->setSuffix(einh);
1108
        bottomScratch->setSuffix(einh);
1109
        leftScratch->setSuffix(einh);
1110
        rightScratch->setSuffix(einh);
1307 fschmid 1111
        tabPDF->BleedBottom->setSuffix(einh);
1112
        tabPDF->BleedTop->setSuffix(einh);
1113
        tabPDF->BleedRight->setSuffix(einh);
1114
        tabPDF->BleedLeft->setSuffix(einh);
782 fschmid 1115
        pageWidth->setValues(oldB * Umrech, oldBM * Umrech, decimals, Pagebr * Umrech);
1116
        pageHeight->setValues(oldH * Umrech, oldHM * Umrech, decimals, Pageho * Umrech);
1117
        TopR->setValues(0, pageHeight->value() - RandB * Umrech, decimals, RandT * Umrech);
1118
        BottomR->setValues(0, pageHeight->value() - RandT * Umrech, decimals, RandB * Umrech);
1119
        LeftR->setValues(0, pageWidth->value() - RandR * Umrech, decimals, RandL * Umrech);
1120
        RightR->setValues(0, pageWidth->value() - RandL * Umrech, decimals, RandR * Umrech);
1121
        int decimalsOld;
1122
        double invUnitConversion = 1.0 / AltUmrech * Umrech;
879 fschmid 1123
        tabGuides->minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1124
        tabGuides->minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1125
        tabGuides->majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1126
        tabGuides->majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1127
        tabGuides->snapDistance->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1128
        tabGuides->snapDistance->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1195 fschmid 1129
        tabGuides->baseGrid->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1130
        tabGuides->baseGrid->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1131
        tabGuides->baseOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1132
        tabGuides->baseOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1194 fschmid 1133
        tabTools->gapText->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1134
        tabTools->gapText->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
782 fschmid 1135
        topScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1136
        topScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1137
        bottomScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1138
        bottomScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1139
        leftScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1140
        leftScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1141
        rightScratch->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1142
        rightScratch->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1307 fschmid 1143
        tabPDF->BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1144
        tabPDF->BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1145
        tabPDF->BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1146
        tabPDF->BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1147
        tabPDF->BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1148
        tabPDF->BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1149
        tabPDF->BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1150
        tabPDF->BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1151
        tabPDF->unitConv = Umrech;
788 fschmid 1152
        drawRuler();
782 fschmid 1153
        connect(pageWidth, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
1154
        connect(pageHeight, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
43 Franz 1155
        connect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
1156
        connect(BottomR, SIGNAL(valueChanged(int)), this, SLOT(setBottom(int)));
1157
        connect(LeftR, SIGNAL(valueChanged(int)), this, SLOT(setLeft(int)));
1158
        connect(RightR, SIGNAL(valueChanged(int)), this, SLOT(setRight(int)));
3 paul 1159
}
1160
 
199 Franz 1161
/*!
145 Franz 1162
 \fn void Preferences::SetDisScale()
1030 subik 1163
 \author Franz Schmid
1164
 \date
145 Franz 1165
 \brief Preferences (Display, Display Size). Sets Scale for ruler scale
1166
 \param None
1167
 \retval None
1168
 */
788 fschmid 1169
void Preferences::setDisScale()
11 Franz 1170
{
1171
        DisScale = QMAX((100.0 + CaliSlider->value()) / 100.0, 0.01);
788 fschmid 1172
        drawRuler();
11 Franz 1173
        CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
1174
}
1175
 
199 Franz 1176
/*!
145 Franz 1177
 \fn void Preferences::DrawRuler()
1030 subik 1178
 \author Franz Schmid
1179
 \date
145 Franz 1180
 \brief Preferences (Display, Display Size). Draws ruler depending on scaling factor
1181
 \param None
1182
 \retval None
1183
 */
788 fschmid 1184
void Preferences::drawRuler()
11 Franz 1185
{
80 Franz 1186
        double xl, iter, iter2, maxi;
1065 cbradney 1187
        switch (docUnitIndex)
188 Franz 1188
        {
199 Franz 1189
        case 0:
1190
                iter = 10.0;
1191
                iter2 = iter * 10.0;
1192
                maxi = 200.0;
1193
                break;
1194
        case 1:
1195
                iter = (10.0 / 25.4) * 72.0;
1196
                iter2 = iter * 10.0;
1197
                maxi = iter2;
1198
                break;
1199
        case 2:
1200
                iter = 18.0;
1201
                iter2 = 72.0;
1202
                maxi = 2 * iter2;
1203
                break;
1204
        case 3:
1205
                iter = 12.0;
1206
                iter2 = 120.0;
1207
                maxi = 240.0;
1208
                break;
734 fschmid 1209
        default:
1210
                iter = 10.0;
1211
                iter2 = iter * 10.0;
1212
                maxi = 200.0;
1213
                break;
188 Franz 1214
        }
1549 subik 1215
 
11 Franz 1216
        QPixmap pm(static_cast<int>(maxi*DisScale+30), 21);
1217
        pm.fill();
1218
        QPainter p;
1219
        p.begin(&pm);
1220
        p.drawLine(0, 19, width(), 19);
1221
        p.setBrush(black);
1222
        p.setPen(black);
1223
        p.scale(DisScale, 1.0);
1224
        for (xl = 0; xl < maxi; xl += iter)
1225
                p.drawLine(static_cast<int>(xl), 13, static_cast<int>(xl), 19);
1226
        for (xl = 0; xl < maxi+10; xl += iter2)
188 Franz 1227
        {
11 Franz 1228
                p.drawLine(static_cast<int>(xl), 6, static_cast<int>(xl), 19);
1229
                p.save();
1230
                p.scale(1.0 / DisScale, 1.0);
1065 cbradney 1231
                switch (docUnitIndex)
188 Franz 1232
                {
199 Franz 1233
                case 2:
1234
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1235
                                   QString::number(xl / iter2));
1236
                        break;
1237
                case 3:
1238
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1239
                                   QString::number(xl / iter));
1240
                        break;
1241
                default:
1242
                        p.drawText(static_cast<int>((xl+qRound(2/DisScale)) * DisScale), 12,
1243
                                   QString::number(xl / iter * 10));
1244
                        break;
188 Franz 1245
                }
11 Franz 1246
                p.restore();
188 Franz 1247
        }
11 Franz 1248
        p.end();
1249
        CaliRuler->setPixmap(pm);
1250
}
663 cbradney 1251
/*
1252
QString Preferences::getSelectedGUILang( )
1253
{
1254
        return langMgr.getAbbrevFromLang(guiLangCombo->currentText());
1255
}
1256
*/
1257
void Preferences::setSelectedGUILang( const QString &newLang )
1258
{
1259
        selectedGUILang=langMgr.getAbbrevFromLang(newLang);
1260
}
11 Franz 1261
 
1197 tsoots 1262
void Preferences::setActionHistoryLength()
1263
{
1264
  UndoManager::instance()->setHistoryLength(urSpinBox->value());
1265
}
1266
 
1307 fschmid 1267
void Preferences::switchCMS(bool enable)
1268
{
1269
        tabPDF->enableCMS(enable);
1270
}
1596 subik 1271
 
1272
/*! Set selected item(=plugin) un/loadable (petr vanek) */
1273
void Preferences::changePluginLoad(QListViewItem *item, const QPoint &, int column)
1274
{
1275
        if (column != 3)
1276
                return;
1277
        if (item->text(3) == tr("Yes"))
1278
        {
1279
                item->setPixmap(3, loadIcon("DateiClos16.png"));
1280
                item->setText(3, tr("No"));
1281
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = false;
1282
        }
1283
        else
1284
        {
1285
                item->setPixmap(3, loadIcon("ok.png"));
1286
                item->setText(3, tr("Yes"));
1287
                ap->pluginManager->pluginMap[item->text(4).toInt()].loadPlugin = true;
1288
        }
1289
}