Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
1307 fschmid 7
/***************************************************************************
8
 *                                                                         *
9
 *   This program is free software; you can redistribute it and/or modify  *
10
 *   it under the terms of the GNU General Public License as published by  *
11
 *   the Free Software Foundation; either version 2 of the License, or     *
12
 *   (at your option) any later version.                                   *
13
 *                                                                         *
14
 ***************************************************************************/
15
#include "tabpdfoptions.h"
16
#include "tabpdfoptions.moc"
17
 
18
#include <qpainter.h>
6657 cbradney 19
#include "createrange.h"
1972 craig 20
#include "pdfoptions.h"
2834 cbradney 21
#include "prefsmanager.h"
5880 jghali 22
#include "scribuscore.h"
2688 craig 23
#include "scconfig.h"
6657 cbradney 24
#include "units.h"
25
#include "usertaskstructs.h"
1307 fschmid 26
 
27
extern QPixmap loadIcon(QString nam);
5243 cbradney 28
#include "scribuscore.h"
1307 fschmid 29
 
4260 craig 30
TabPDFOptions::TabPDFOptions(   QWidget* parent, PDFOptions & Optionen,
31
                                const SCFonts &AllFonts,
32
                                const ProfilesL & PDFXProfiles,
5387 avox 33
                                const QMap<QString, int> & DocFonts,
4260 craig 34
                                const QValueList<PDFPresentationData> & Eff,
35
                                int unitIndex, double PageH, double PageB,
5881 jghali 36
                                ScribusDoc * mdoc, bool exporting )
4252 craig 37
        : QTabWidget( parent, "pdf" ),
4253 craig 38
        // Initialize all those darn pointer members so we catch unitialized
4255 craig 39
        // accesses. I (CR) use the following command to generate these based on
40
        // the header excerpt:
41
        //    !cut -d \* -f 2 | sed -r 's/ ?(.*);/\t\1\(0\),/g'
42
        // Public GUI member pointers:
4253 craig 43
        AddSec(0),
44
        Article(0),
45
        BleedBottom(0),
46
        BleedLeft(0),
47
        BleedRight(0),
48
        BleedTop(0),
49
        CheckBM(0),
50
        CheckBox1(0),
51
        CMethod(0),
4649 fschmid 52
        ClipMarg(0),
4253 craig 53
        ComboBind(0),
54
        Compression(0),
55
        continuousPages(0),
56
        CopySec(0),
57
        CQuality(0),
58
        doublePageLeft(0),
59
        doublePageRight(0),
60
        DSColor(0),
61
        EmbedProfs(0),
62
        EmbedProfs2(0),
63
        Encry(0),
64
        ImageP(0),
65
        IntendI(0),
66
        IntendS(0),
67
        MirrorH(0),
68
        MirrorV(0),
69
        ModifySec(0),
70
        NoEmbedded(0),
71
        OutCombo(0),
72
        Pages(0),
73
        PassOwner(0),
74
        PassUser(0),
75
        PDFVersionCombo(0),
4255 craig 76
        PrintProfC(0),
77
        PrintSec(0),
78
        Resolution(0),
79
        RotateDeg(0),
80
        singlePage(0),
81
        SolidPr(0),
82
        useBookmarks(0),
83
        useFullScreen(0),
84
        useLayers(0),
85
        useLayers2(0),
86
        UseLPI(0),
87
        useSpot(0),
5320 fschmid 88
        overprintMode(0),
4255 craig 89
        useThumbnails(0),
90
        ValC(0),
4258 craig 91
        // Protected members other than GUI member pointers
92
        // End GUI member pointers
4259 craig 93
        // Protected non-gui members
94
        PgSel(0),
95
        EffVal(Eff),
96
        // Protected GUI member pointers
97
        actionCombo(0),
98
        AllPages(0),
99
        CheckBox10(0),
100
        EDirection(0),
101
        EDirection_2(0),
102
        EDirection_2_2(0),
103
        EffectTime(0),
104
        EffectType(0),
105
        fitWindow(0),
106
        hideMenuBar(0),
107
        hideToolBar(0),
108
        InfoString(0),
109
        LPIangle(0),
110
        LPIfreq(0),
111
        LPIfunc(0),
112
        PageNr(0),
113
        PageTime(0),
114
        // End protected gui member pointers
115
        // Private member gui pointers
4255 craig 116
        actionLabel(0),
117
        AvailFlist(0),
118
        BleedGroup(0),
119
        BleedGroupLayout(0),
6921 fschmid 120
//      BleedIcon(0),
4255 craig 121
        CBox(0),
122
        CBoxLayout(0),
123
        ColorGroup(0),
124
        ColorGroupLayout(0),
125
        ColorText1(0),
126
        Effects(0),
127
        EffectsLayout(0),
128
        EmbedFonts(0),
129
        EmbedList(0),
130
        EonAllPg(0),
131
        FromEmbed(0),
132
        FromSubset(0),
133
        GroupBox1(0),
134
        GroupBox1Layout(0),
135
        GroupBox2Layout(0),
136
        GroupBox9(0),
137
        GroupBox9Layout(0),
138
        groupDisplay(0),
139
        groupDisplayLayout(0),
140
        GroupFont(0),
141
        GroupFontLayout(0),
142
        groupJava(0),
143
        groupJavaLayout(0),
144
        groupNavigation(0),
145
        groupNavigationLayout(0),
146
        GroupPass(0),
147
        GroupPassLayout(0),
148
        GroupSecSet(0),
149
        GroupSecSetLayout(0),
6921 fschmid 150
        Layout11(0),
6657 cbradney 151
        pageNumberSelectorLayout(0),
4255 craig 152
        Layout11a(0),
153
        Layout13(0),
154
        Layout2(0),
155
        Layout3(0),
156
        Layout4_2(0),
157
        Layout5_2(0),
158
        Layout5_2a(0),
159
        Layout6(0),
160
        LayoutSpecial(0),
161
        LPIcolor(0),
162
        LPIgroup(0),
163
        LPIgroupLayout(0),
164
        OnlySome(0),
165
        pageLayout(0),
166
        pageLayoutLayout(0),
167
        PagePrev(0),
4253 craig 168
        PDFX1(0),
169
        PDFX2(0),
170
        PrintSec2(0),
171
        ProfsGroup(0),
4255 craig 172
        ProfsGroupLayout(0),
4253 craig 173
        ProfsTxt1(0),
174
        ProfsTxt2(0),
175
        ProfsTxt3(0),
176
        ProfsTxt4(0),
177
        RangeGroup(0),
4255 craig 178
        RangeGroupLayout(0),
4253 craig 179
        SubsetFonts(0),
180
        SubsetList(0),
181
        tabColor(0),
4255 craig 182
        tabColorLayout(0),
4253 craig 183
        tabFonts(0),
184
        tabGeneral(0),
4255 craig 185
        tabLayout(0),
186
        tabLayout_3(0),
187
        tabLayout_5(0),
188
        tabOptionsGridLayout(0),
4253 craig 189
        tabPDFX(0),
4255 craig 190
        tabPDFXLayout(0),
4253 craig 191
        tabPresentation(0),
192
        tabSecurity(0),
4255 craig 193
        tabSecurityLayout(0),
4253 craig 194
        tabSpecial(0),
4255 craig 195
        tabSpecialLayout(0),
4253 craig 196
        TextCom1(0),
197
        TextCom2(0),
198
        TextFont1(0),
199
        TextFont1_2(0),
200
        TextFont1_2a(0),
201
        TextLabel1(0),
202
        TextLabel1e(0),
203
        TextLabel1x(0),
204
        TextLabel2(0),
205
        TextLabel2e(0),
206
        TextLabel3(0),
207
        TextLabel3e(0),
208
        TextLabel4e(0),
209
        TextLabel5e(0),
210
        TextLabel6e(0),
211
        textLPI1(0),
212
        textLPI2(0),
213
        textLPI3(0),
214
        TextSec1(0),
215
        TextSec2(0),
6657 cbradney 216
        pageNrButton(0),
4253 craig 217
        ToEmbed(0),
218
        ToSubset(0),
219
        useViewDefault(0),
220
        X3Group(0),
4259 craig 221
        X3GroupLayout(0),
4255 craig 222
        // end protected member gui pointers
4259 craig 223
        // Private members
224
        unit(unitGetSuffixFromIndex(unitIndex)),
225
        precision(unitGetPrecisionFromIndex(unitIndex)),
226
        unitRatio(unitGetRatioFromIndex(unitIndex)),
5882 mrdocs 227
        pdfExport(exporting),
5880 jghali 228
        doc(mdoc),
4260 craig 229
        AllFonts(AllFonts),
4259 craig 230
        Opts(Optionen),
231
        pageH(PageH),
232
        pageB(PageB),
233
        cms(false)
1307 fschmid 234
{
1792 cbradney 235
 
1307 fschmid 236
        tabGeneral = new QWidget( this, "tabGeneral" );
237
        tabLayout = new QVBoxLayout( tabGeneral );
238
        tabLayout->setSpacing( 5 );
6927 subik 239
        tabLayout->setMargin( 11 );
1307 fschmid 240
        Layout13 = new QHBoxLayout( 0, 0, 5, "Layout13");
241
        RangeGroup = new QButtonGroup( tabGeneral, "RangeGroup" );
242
        RangeGroup->setTitle( tr( "Export Range" ) );
243
        RangeGroup->setColumnLayout(0, Qt::Vertical );
244
        RangeGroup->layout()->setSpacing( 5 );
245
        RangeGroup->layout()->setMargin( 10 );
246
        RangeGroupLayout = new QVBoxLayout( RangeGroup->layout() );
247
        RangeGroupLayout->setAlignment( Qt::AlignTop );
248
        AllPages = new QRadioButton( tr( "&All Pages" ), RangeGroup, "AllPages" );
249
        RangeGroupLayout->addWidget( AllPages );
250
        Layout11 = new QGridLayout( 0, 1, 1, 0, 5, "Layout11");
251
        OnlySome = new QRadioButton( tr( "C&hoose Pages" ), RangeGroup, "OnlySome" );
252
        Layout11->addWidget( OnlySome, 0, 0 );
6657 cbradney 253
        pageNumberSelectorLayout = new QHBoxLayout( 0, 0, 5, "pageNumberSelectorLayout" );
1307 fschmid 254
        PageNr = new QLineEdit( RangeGroup, "PageNr" );
6657 cbradney 255
        pageNumberSelectorLayout->addWidget( PageNr );
256
        pageNrButton = new QPushButton( QString::fromUtf8("…"), RangeGroup, "PageNrButton" );
6662 cbradney 257
        pageNrButton->setPixmap(loadIcon("ellipsis.png"));
6657 cbradney 258
        pageNumberSelectorLayout->addWidget( pageNrButton );
259
        Layout11->addLayout( pageNumberSelectorLayout, 1, 0 );
1307 fschmid 260
        RangeGroupLayout->addLayout( Layout11 );
261
        TextLabel3 = new QLabel( tr( "&Rotation:" ), RangeGroup, "TextLabel3" );
262
        RangeGroupLayout->addWidget( TextLabel3 );
263
        RotateDeg = new QComboBox( true, RangeGroup, "RotateDeg" );
264
        RotateDeg->insertItem(QString::fromUtf8("0 °"));
265
        RotateDeg->insertItem(QString::fromUtf8("90 °"));
266
        RotateDeg->insertItem(QString::fromUtf8("180 °"));
267
        RotateDeg->insertItem(QString::fromUtf8("270 °"));
268
        RotateDeg->setEditable(false);
269
        TextLabel3->setBuddy(RotateDeg);
270
        RangeGroupLayout->addWidget( RotateDeg );
271
        Layout11a = new QGridLayout( 0, 1, 1, 0, 5, "Layout11a");
272
        MirrorH = new QToolButton( RangeGroup, "MirrorH" );
273
        MirrorH->setPixmap(loadIcon("FlipH.xpm"));
274
        MirrorH->setToggleButton( true );
275
        Layout11a->addWidget( MirrorH, 0, 0 );
276
        MirrorV = new QToolButton( RangeGroup, "MirrorH" );
277
        MirrorV->setPixmap(loadIcon("FlipV.xpm"));
278
        MirrorV->setToggleButton( true );
279
        Layout11a->addWidget( MirrorV, 0, 1 );
280
        RangeGroupLayout->addLayout( Layout11a );
4649 fschmid 281
        ClipMarg = new QCheckBox( tr( "Clip to Page Margins" ), RangeGroup, "ClipMarg" );
282
        RangeGroupLayout->addWidget( ClipMarg );
1307 fschmid 283
        Layout13->addWidget( RangeGroup );
284
 
285
        GroupBox1 = new QGroupBox( tr( "File Options" ), tabGeneral, "GroupBox1" );
286
        GroupBox1->setColumnLayout(0, Qt::Vertical );
287
        GroupBox1->layout()->setSpacing( 0 );
288
        GroupBox1->layout()->setMargin( 0 );
289
        GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
290
        GroupBox1Layout->setAlignment( Qt::AlignTop );
291
        GroupBox1Layout->setSpacing( 5 );
292
        GroupBox1Layout->setMargin( 10 );
293
        TextLabel1 = new QLabel( tr( "Compatibilit&y:" ), GroupBox1, "TextLabel1" );
294
        TextLabel1->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
295
        GroupBox1Layout->addWidget( TextLabel1, 0, 0 );
1973 craig 296
        PDFVersionCombo = new QComboBox( true, GroupBox1, "PDFVersionCombo" );
297
        PDFVersionCombo->setEditable(false);
298
        TextLabel1->setBuddy(PDFVersionCombo);
5839 cbradney 299
        PDFVersionCombo->insertItem("PDF 1.3 (Acrobat 4)");
300
        PDFVersionCombo->insertItem("PDF 1.4 (Acrobat 5)");
301
        PDFVersionCombo->insertItem("PDF 1.5 (Acrobat 6)");
5880 jghali 302
        cms = doc ? (ScCore->haveCMS() && doc->HasCMS) : false;
303
        if (cms && (!PDFXProfiles.isEmpty()))
1973 craig 304
                PDFVersionCombo->insertItem("PDF/X-3");
2439 cbradney 305
        GroupBox1Layout->addMultiCellWidget( PDFVersionCombo, 0, 0, 1, 2 );
1307 fschmid 306
        TextLabel1x = new QLabel( tr( "&Binding:" ), GroupBox1, "TextLabel1" );
307
        TextLabel1x->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
308
        GroupBox1Layout->addWidget( TextLabel1x, 1, 0 );
309
        ComboBind = new QComboBox( true, GroupBox1, "ComboBind" );
310
        ComboBind->insertItem( tr("Left Margin"));
311
        ComboBind->insertItem( tr("Right Margin"));
312
        ComboBind->setEditable(false);
313
        TextLabel1x->setBuddy(ComboBind);
2439 cbradney 314
        GroupBox1Layout->addMultiCellWidget( ComboBind, 1, 1, 1, 2 );
1307 fschmid 315
        CheckBox1 = new QCheckBox( tr( "Generate &Thumbnails" ), GroupBox1, "CheckBox1" );
316
        GroupBox1Layout->addMultiCellWidget( CheckBox1, 2, 2, 0, 2 );
317
        Article = new QCheckBox( tr( "Save &Linked Text Frames as PDF Articles" ), GroupBox1, "CheckBox1" );
318
        GroupBox1Layout->addMultiCellWidget( Article, 3, 3, 0, 2 );
319
        CheckBM = new QCheckBox( tr( "&Include Bookmarks" ), GroupBox1, "E" );
320
        GroupBox1Layout->addMultiCellWidget( CheckBM, 4, 4, 0, 2 );
4014 cbradney 321
        useLayers = new QCheckBox( tr( "Include La&yers" ), GroupBox1, "LI" );
1738 fschmid 322
        GroupBox1Layout->addMultiCellWidget( useLayers, 5, 5, 0, 2 );
1307 fschmid 323
        Resolution = new QSpinBox( GroupBox1, "Resolution" );
324
        Resolution->setMaxValue( 4000 );
325
        Resolution->setMinValue( 35 );
326
        Resolution->setSuffix( tr( " dpi" ) );
1799 cbradney 327
        TextLabel2 = new QLabel( Resolution, tr( "&Resolution for EPS Graphics:" ), GroupBox1, "TextLabel2" );
1307 fschmid 328
        TextLabel2->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
1738 fschmid 329
        GroupBox1Layout->addWidget( TextLabel2, 6, 0 );
330
        GroupBox1Layout->addWidget( Resolution, 6, 1, AlignLeft );
1307 fschmid 331
        Layout13->addWidget( GroupBox1 );
332
        tabLayout->addLayout( Layout13 );
333
        Compression = new QCheckBox( tr( "Com&press Text and Vector Graphics" ), tabGeneral, "Compression" );
334
        tabLayout->addWidget( Compression );
4824 mrdocs 335
        CBox = new QGroupBox( tr( "Image Compression Method" ), tabGeneral, "CBox" );
1307 fschmid 336
        CBox->setColumnLayout(0, Qt::Vertical );
337
        CBox->layout()->setSpacing( 5 );
338
        CBox->layout()->setMargin( 11 );
339
        CBoxLayout = new QGridLayout( CBox->layout() );
340
        CBoxLayout->setAlignment( Qt::AlignTop );
341
        CMethod = new QComboBox( true, CBox, "CMethod" );
342
        CMethod->clear();
343
        CMethod->insertItem( tr( "Automatic" ) );
4576 mrdocs 344
        CMethod->insertItem( tr( "Lossy - JPEG" ) );
345
        CMethod->insertItem( tr( "Lossless - Zip" ) );
1307 fschmid 346
        CMethod->insertItem( tr( "None" ) );
347
        CMethod->setEditable(false);
4014 cbradney 348
        TextCom1 = new QLabel( CMethod, tr( "Compression Metho&d:" ), CBox, "TextCom1" );
3849 subik 349
        CBoxLayout->addWidget( TextCom1, 0, 0 );
3798 cbradney 350
        CBoxLayout->addWidget( CMethod, 0, 1 );
1307 fschmid 351
        CQuality = new QComboBox( true, CBox, "CQuality" );
352
        CQuality->clear();
353
        CQuality->insertItem( tr( "Maximum" ) );
354
        CQuality->insertItem( tr( "High" ) );
355
        CQuality->insertItem( tr( "Medium" ) );
356
        CQuality->insertItem( tr( "Low" ) );
357
        CQuality->insertItem( tr( "Minimum" ) );
358
        CQuality->setEditable(false);
3798 cbradney 359
        TextCom2 = new QLabel( CQuality, tr( "Compression &Quality:" ), CBox, "TextCom2" );
360
        CBoxLayout->addWidget( TextCom2, 1, 0 );
1307 fschmid 361
        CBoxLayout->addWidget( CQuality, 1, 1 );
4014 cbradney 362
        DSColor = new QCheckBox( tr( "Resa&mple Images to:" ), CBox, "DSColor" );
1307 fschmid 363
        CBoxLayout->addWidget( DSColor, 2, 0 );
364
        ValC = new QSpinBox( CBox, "ValC" );
365
        ValC->setSuffix( tr( " dpi" ) );
366
        ValC->setMaxValue( 4000 );
367
        ValC->setMinValue( 35 );
368
        CBoxLayout->addWidget( ValC, 2, 1, AlignLeft );
369
        tabLayout->addWidget( CBox );
370
        insertTab( tabGeneral, tr( "&General" ) );
5881 jghali 371
        if (doc != 0 && exporting)
1307 fschmid 372
        {
373
                tabFonts = new QWidget( this, "tabFonts" );
374
                tabLayout_3 = new QVBoxLayout( tabFonts );
375
                tabLayout_3->setSpacing( 5 );
376
                tabLayout_3->setMargin( 11 );
377
                EmbedFonts = new QCheckBox( tr( "&Embed all Fonts" ), tabFonts, "EmbedFonts" );
378
                tabLayout_3->addWidget( EmbedFonts );
379
                SubsetFonts = new QCheckBox( tr( "&Subset all Fonts" ), tabFonts, "SubsetFonts" );
380
                tabLayout_3->addWidget( SubsetFonts );
381
                GroupFont = new QGroupBox( tr( "Embedding" ), tabFonts, "GroupFont" );
382
                GroupFont->setColumnLayout(0, Qt::Vertical );
383
                GroupFont->layout()->setSpacing( 0 );
384
                GroupFont->layout()->setMargin( 0 );
385
                GroupFontLayout = new QHBoxLayout( GroupFont->layout() );
386
                GroupFontLayout->setAlignment( Qt::AlignTop );
387
                GroupFontLayout->setSpacing( 5 );
388
                GroupFontLayout->setMargin( 10 );
389
                Layout4_2 = new QVBoxLayout;
390
                Layout4_2->setSpacing( 5 );
391
                Layout4_2->setMargin( 0 );
392
                TextFont1 = new QLabel( tr( "Available Fonts:" ), GroupFont, "TextFont1" );
393
                Layout4_2->addWidget( TextFont1 );
394
                AvailFlist = new QListBox( GroupFont, "AvailFlist" );
395
                AvailFlist->setMinimumSize(QSize(150, 140));
396
                Layout4_2->addWidget( AvailFlist );
397
                GroupFontLayout->addLayout( Layout4_2 );
398
                Layout5_2 = new QVBoxLayout;
399
                Layout5_2->setSpacing( 5 );
400
                Layout5_2->setMargin( 0 );
1321 fschmid 401
                QSpacerItem* spacerS3a = new QSpacerItem( 20, 30, QSizePolicy::Minimum, QSizePolicy::Minimum );
402
                Layout5_2->addItem( spacerS3a );
1307 fschmid 403
                ToEmbed = new QPushButton( tr( "&>>" ), GroupFont, "ToEmbed" );
404
                Layout5_2->addWidget( ToEmbed );
405
                FromEmbed = new QPushButton( tr( "&<<" ), GroupFont, "FromEmbed" );
406
                Layout5_2->addWidget( FromEmbed );
1321 fschmid 407
                QSpacerItem* spacerS3 = new QSpacerItem( 20, 30, QSizePolicy::Minimum, QSizePolicy::Expanding );
408
                Layout5_2->addItem( spacerS3 );
1307 fschmid 409
                GroupFontLayout->addLayout( Layout5_2 );
410
                Layout6 = new QVBoxLayout;
411
                Layout6->setSpacing( 5 );
412
                Layout6->setMargin( 0 );
413
                TextFont1_2 = new QLabel( tr( "Fonts to embed:" ), GroupFont, "TextFont1_2" );
414
                Layout6->addWidget( TextFont1_2 );
415
                EmbedList = new QListBox( GroupFont, "EmbedList" );
416
                EmbedList->setMinimumSize(QSize(150, 40));
417
                Layout6->addWidget( EmbedList );
3849 subik 418
 
1307 fschmid 419
                Layout5_2a = new QHBoxLayout;
420
                Layout5_2a->setSpacing( 5 );
421
                Layout5_2a->setMargin( 0 );
422
                QSpacerItem* spacerS1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
423
                Layout5_2a->addItem( spacerS1 );
424
                ToSubset = new QPushButton( "", GroupFont, "ToSubset" );
425
                ToSubset->setPixmap(loadIcon("down.png"));
426
                Layout5_2a->addWidget( ToSubset );
427
                FromSubset = new QPushButton( "", GroupFont, "FromSubset" );
428
                FromSubset->setPixmap(loadIcon("up.png"));
429
                Layout5_2a->addWidget( FromSubset );
430
                QSpacerItem* spacerS2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
431
                Layout5_2a->addItem( spacerS2 );
432
                Layout6->addLayout( Layout5_2a );
433
                TextFont1_2a = new QLabel( tr( "Fonts to subset:" ), GroupFont, "TextFont1_2a" );
434
                Layout6->addWidget( TextFont1_2a );
435
                SubsetList = new QListBox( GroupFont, "SubsetList" );
436
                SubsetList->setMinimumSize(QSize(150, 40));
437
                Layout6->addWidget( SubsetList );
438
                GroupFontLayout->addLayout( Layout6 );
439
                tabLayout_3->addWidget( GroupFont );
440
                insertTab( tabFonts, tr( "&Fonts" ) );
441
                tabPresentation = new QWidget( this, "tabPresentation" );
442
                tabLayout_5 = new QGridLayout( tabPresentation );
443
                tabLayout_5->setSpacing( 5 );
444
                tabLayout_5->setMargin( 11 );
445
                CheckBox10 = new QCheckBox( tr( "Enable &Presentation Effects" ), tabPresentation, "CheckBox10" );
446
                tabLayout_5->addMultiCellWidget( CheckBox10, 0, 0, 0, 1 );
447
                Pages = new QListBox( tabPresentation, "Pages" );
448
                Pages->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, Pages->sizePolicy().hasHeightForWidth() ) );
449
                tabLayout_5->addWidget( Pages, 1, 0 );
450
                PagePrev = new QCheckBox( tr( "Show Page Pre&views" ), tabPresentation, "CheckBox10" );
451
                tabLayout_5->addWidget( PagePrev, 2, 0 );
452
                Effects = new QGroupBox( tr( "Effects" ), tabPresentation, "Effects" );
453
                Effects->setColumnLayout(0, Qt::Vertical );
454
                Effects->layout()->setSpacing( 0 );
455
                Effects->layout()->setMargin( 0 );
456
                EffectsLayout = new QGridLayout( Effects->layout() );
457
                EffectsLayout->setAlignment( Qt::AlignTop );
458
                EffectsLayout->setSpacing( 5 );
459
                EffectsLayout->setMargin( 11 );
460
                TextLabel1e = new QLabel( tr( "&Display Duration:" ), Effects, "TextLabel1_2" );
461
                EffectsLayout->addWidget( TextLabel1e, 0, 0 );
462
                TextLabel2e = new QLabel( tr( "Effec&t Duration:" ), Effects, "TextLabel2_2" );
463
                EffectsLayout->addWidget( TextLabel2e, 1, 0 );
464
                TextLabel3e = new QLabel( tr( "Effect T&ype:" ), Effects, "TextLabel3_2" );
465
                EffectsLayout->addWidget( TextLabel3e, 2, 0 );
466
                TextLabel4e = new QLabel( tr( "&Moving Lines:" ), Effects, "TextLabel4_2" );
467
                EffectsLayout->addWidget( TextLabel4e, 3, 0 );
468
                TextLabel5e = new QLabel( tr( "F&rom the:" ), Effects, "TextLabel6" );
469
                EffectsLayout->addWidget( TextLabel5e, 4, 0 );
470
                TextLabel6e = new QLabel( tr( "D&irection:" ), Effects, "TextLabel5" );
471
                EffectsLayout->addWidget( TextLabel6e, 5, 0 );
472
                PageTime = new QSpinBox( Effects, "PageTime" );
473
                PageTime->setSuffix( tr( " sec" ) );
474
                PageTime->setMaxValue( 3600 );
4932 fschmid 475
                PageTime->setMinValue( 0 );
1307 fschmid 476
                TextLabel1e->setBuddy(PageTime);
477
                EffectsLayout->addWidget( PageTime, 0, 1 );
478
                EffectTime = new QSpinBox( Effects, "EffectTime" );
479
                EffectTime->setSuffix( tr( " sec" ) );
480
                EffectTime->setMaxValue( 3600 );
481
                EffectTime->setMinValue( 1 );
482
                TextLabel2e->setBuddy(EffectTime);
483
                EffectsLayout->addWidget( EffectTime, 1, 1 );
484
                EffectType = new QComboBox( true, Effects, "EffectType" );
485
                QString tmpc[] = { tr("No Effect"), tr("Blinds"), tr("Box"), tr("Dissolve"), tr("Glitter"), tr("Split"), tr("Wipe")};
486
                size_t ar = sizeof(tmpc) / sizeof(*tmpc);
487
                for (uint a = 0; a < ar; ++a)
488
                        EffectType->insertItem(tmpc[a]);
489
                EffectType->setEditable(false);
490
                TextLabel3e->setBuddy(EffectType);
491
                EffectsLayout->addWidget( EffectType, 2, 1 );
492
                EDirection = new QComboBox( true, Effects, "EDirection" );
493
                EDirection->insertItem( tr( "Horizontal" ) );
494
                EDirection->insertItem( tr( "Vertical" ) );
495
                EDirection->setEditable(false);
496
                TextLabel4e->setBuddy(EDirection);
497
                EffectsLayout->addWidget( EDirection, 3, 1 );
498
                EDirection_2 = new QComboBox( true, Effects, "EDirection_2" );
499
                EDirection_2->insertItem( tr( "Inside" ) );
500
                EDirection_2->insertItem( tr( "Outside" ) );
501
                EDirection_2->setEditable(false);
502
                TextLabel5e->setBuddy(EDirection_2);
503
                EffectsLayout->addWidget( EDirection_2, 4, 1 );
504
                EDirection_2_2 = new QComboBox( true, Effects, "EDirection_2_2" );
505
                QString tmp_ed[] = { tr("Left to Right"), tr("Top to Bottom"), tr("Bottom to Top"), tr("Right to Left"),
4197 fschmid 506
                                     tr("Top-left to Bottom-Right")};
1307 fschmid 507
                size_t ar_ed = sizeof(tmp_ed) / sizeof(*tmp_ed);
508
                for (uint a = 0; a < ar_ed; ++a)
509
                        EDirection_2_2->insertItem(tmp_ed[a]);
510
                EDirection_2_2->setEditable(false);
511
                TextLabel6e->setBuddy(EDirection_2_2);
512
                EffectsLayout->addWidget( EDirection_2_2, 5, 1 );
513
                EonAllPg = new QPushButton( tr( "&Apply Effect on all Pages" ), Effects, "Eon" );
514
                EffectsLayout->addMultiCellWidget( EonAllPg, 6, 6, 0, 1 );
515
                tabLayout_5->addMultiCellWidget( Effects, 1, 2, 1, 1 );
516
                insertTab( tabPresentation, tr( "E&xtras" ) );
4256 craig 517
                tabSpecial = new QWidget( this, "tabSpecial" );
518
                tabSpecialLayout = new QVBoxLayout( tabSpecial, 11, 6, "tabSpecialLayout");
519
                groupDisplay = new QGroupBox( tabSpecial, "groupDisplay" );
520
                groupDisplay->setTitle( tr( "Display Settings" ) );
521
                groupDisplay->setColumnLayout(0, Qt::Vertical );
522
                groupDisplay->layout()->setSpacing( 5 );
523
                groupDisplay->layout()->setMargin( 10 );
524
                groupDisplayLayout = new QVBoxLayout( groupDisplay->layout() );
525
                groupDisplayLayout->setAlignment( Qt::AlignTop );
526
                LayoutSpecial = new QHBoxLayout( 0, 0, 5, "LayoutSpecial");
527
                pageLayout = new QButtonGroup( groupDisplay, "pageLayout" );
528
                pageLayout->setTitle( tr( "Page Layout" ) );
529
                pageLayout->setColumnLayout(0, Qt::Vertical );
530
                pageLayout->layout()->setSpacing( 5 );
531
                pageLayout->layout()->setMargin( 10 );
532
                pageLayoutLayout = new QVBoxLayout( pageLayout->layout() );
533
                pageLayoutLayout->setAlignment( Qt::AlignTop );
534
                singlePage = new QRadioButton( pageLayout, "singlePage" );
535
                singlePage->setText( tr( "Single Page" ) );
536
                pageLayoutLayout->addWidget( singlePage );
537
                continuousPages = new QRadioButton( pageLayout, "continuousPages" );
538
                continuousPages->setText( tr( "Continuous" ) );
539
                pageLayoutLayout->addWidget( continuousPages );
540
                doublePageLeft = new QRadioButton( pageLayout, "doublePageLeft" );
541
                doublePageLeft->setText( tr( "Double Page Left" ) );
542
                pageLayoutLayout->addWidget( doublePageLeft );
543
                doublePageRight = new QRadioButton( pageLayout, "doublePageRight" );
544
                doublePageRight->setText( tr( "Double Page Right" ) );
545
                pageLayoutLayout->addWidget( doublePageRight );
546
                LayoutSpecial->addWidget( pageLayout );
547
                groupNavigation = new QButtonGroup( groupDisplay, "groupNavigation" );
6063 fschmid 548
                groupNavigation->setRadioButtonExclusive(true);
4256 craig 549
                groupNavigation->setTitle( tr( "Visual Appearance" ) );
550
                groupNavigation->setColumnLayout(0, Qt::Vertical );
551
                groupNavigation->layout()->setSpacing( 5 );
552
                groupNavigation->layout()->setMargin( 10 );
553
                groupNavigationLayout = new QVBoxLayout( groupNavigation->layout() );
554
                groupNavigationLayout->setAlignment( Qt::AlignTop );
555
                useViewDefault = new QRadioButton( groupNavigation, "useViewDefault" );
556
                useViewDefault->setText( tr( "Use Viewers Defaults" ) );
557
                groupNavigationLayout->addWidget( useViewDefault );
558
                useFullScreen = new QRadioButton( groupNavigation, "useFullScreen" );
559
                useFullScreen->setText( tr( "Use Full Screen Mode" ) );
560
                groupNavigationLayout->addWidget( useFullScreen );
561
                useBookmarks = new QRadioButton( groupNavigation, "useBookmarks" );
562
                useBookmarks->setText( tr( "Display Bookmarks Tab" ) );
563
                groupNavigationLayout->addWidget( useBookmarks );
564
                useThumbnails = new QRadioButton( groupNavigation, "useThumbnails" );
565
                useThumbnails->setText( tr( "Display Thumbnails" ) );
566
                groupNavigationLayout->addWidget( useThumbnails );
567
                useLayers2 = new QRadioButton( groupNavigation, "useLayers" );
568
                useLayers2->setText( tr( "Display Layers Tab" ) );
569
                groupNavigationLayout->addWidget( useLayers2 );
570
                hideToolBar = new QCheckBox( tr( "Hide Viewers Toolbar" ), groupNavigation, "hideToolBar" );
571
                groupNavigationLayout->addWidget( hideToolBar );
572
                hideMenuBar = new QCheckBox( tr( "Hide Viewers Menubar" ), groupNavigation, "hideMenuBar" );
573
                groupNavigationLayout->addWidget( hideMenuBar );
574
                fitWindow = new QCheckBox( tr( "Zoom Pages to fit Viewer Window" ), groupNavigation, "fitWindow" );
575
                groupNavigationLayout->addWidget( fitWindow );
6063 fschmid 576
                groupNavigation->setRadioButtonExclusive(true);
4256 craig 577
                LayoutSpecial->addWidget( groupNavigation );
578
                groupDisplayLayout->addLayout( LayoutSpecial );
579
                tabSpecialLayout->addWidget( groupDisplay );
580
                groupJava = new QGroupBox( tabSpecial, "groupJava" );
581
                groupJava->setTitle( tr( "Special Actions" ) );
582
                groupJava->setColumnLayout(0, Qt::Vertical );
583
                groupJava->layout()->setSpacing( 5 );
584
                groupJava->layout()->setMargin( 10 );
585
                groupJavaLayout = new QHBoxLayout( groupJava->layout() );
586
                groupJavaLayout->setAlignment( Qt::AlignTop );
587
                actionLabel = new QLabel( groupJava, "actionLabel" );
4810 mrdocs 588
                actionLabel->setText( tr( "Javascript to be executed\nwhen PDF document is opened:" ) );
4256 craig 589
                groupJavaLayout->addWidget( actionLabel );
590
                actionCombo = new QComboBox( true, groupJava, "actionCombo" );
591
                actionCombo->setEditable(false);
592
                actionCombo->insertItem( tr("No Script"));
593
                groupJavaLayout->addWidget( actionCombo );
594
                tabSpecialLayout->addWidget( groupJava );
595
                insertTab( tabSpecial, tr("Viewer") );
1307 fschmid 596
        }
4197 fschmid 597
 
1307 fschmid 598
        tabSecurity = new QWidget( this, "tabSecurity" );
599
        tabSecurityLayout = new QVBoxLayout( tabSecurity, 11, 5, "tabSecurityLayout");
600
        Encry = new QCheckBox( tr( "&Use Encryption" ), tabSecurity, "Enc" );
601
        tabSecurityLayout->addWidget( Encry );
602
        GroupPass = new QGroupBox( tr( "Passwords" ), tabSecurity, "GroupPass" );
603
        GroupPass->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0,
604
                                               GroupPass->sizePolicy().hasHeightForWidth() ) );
605
        GroupPass->setColumnLayout(0, Qt::Vertical );
606
        GroupPass->layout()->setSpacing( 5 );
607
        GroupPass->layout()->setMargin( 10 );
608
        GroupPassLayout = new QGridLayout( GroupPass->layout() );
609
        GroupPassLayout->setAlignment( Qt::AlignTop );
610
        TextSec2 = new QLabel( tr( "&User:" ), GroupPass, "TextSec2" );
611
        GroupPassLayout->addWidget( TextSec2, 1, 0 );
612
        TextSec1 = new QLabel( tr( "&Owner:" ), GroupPass, "TextSec1" );
613
        GroupPassLayout->addWidget( TextSec1, 0, 0 );
614
        PassOwner = new QLineEdit( GroupPass, "PassOwner" );
615
        PassOwner->setEchoMode( QLineEdit::Password );
616
        TextSec1->setBuddy(PassOwner);
617
        GroupPassLayout->addWidget( PassOwner, 0, 1 );
618
        PassUser = new QLineEdit( GroupPass, "PassUser" );
619
        PassUser->setEchoMode( QLineEdit::Password );
620
        TextSec2->setBuddy(PassUser);
621
        GroupPassLayout->addWidget( PassUser, 1, 1 );
622
        tabSecurityLayout->addWidget( GroupPass );
623
 
624
        GroupSecSet = new QGroupBox( tr( "Settings" ), tabSecurity, "GroupSecSet" );
625
        GroupSecSet->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0,
626
                                    GroupSecSet->sizePolicy().hasHeightForWidth() ) );
627
        GroupSecSet->setColumnLayout(0, Qt::Vertical );
628
        GroupSecSet->layout()->setSpacing( 5 );
629
        GroupSecSet->layout()->setMargin( 10 );
630
        GroupSecSetLayout = new QVBoxLayout( GroupSecSet->layout() );
631
        GroupSecSetLayout->setAlignment( Qt::AlignTop );
632
        PrintSec = new QCheckBox( tr( "Allow &Printing the Document" ), GroupSecSet, "PrintSec" );
633
        GroupSecSetLayout->addWidget( PrintSec );
634
        ModifySec = new QCheckBox( tr( "Allow &Changing the Document" ), GroupSecSet, "ModifySec" );
635
        GroupSecSetLayout->addWidget( ModifySec );
636
        CopySec = new QCheckBox( tr( "Allow Cop&ying Text and Graphics" ), GroupSecSet, "CopySec" );
637
        GroupSecSetLayout->addWidget( CopySec );
638
        AddSec = new QCheckBox( tr( "Allow Adding &Annotations and Fields" ), GroupSecSet, "AddSec" );
639
        GroupSecSetLayout->addWidget( AddSec );
640
        tabSecurityLayout->addWidget( GroupSecSet );
641
        insertTab( tabSecurity, tr( "S&ecurity" ) );
642
 
643
        tabColor = new QWidget( this, "tabColor" );
644
        tabColorLayout = new QVBoxLayout( tabColor, 11, 5, "tabColorLayout");
645
        ColorGroup = new QGroupBox( tr( "General" ), tabColor, "ColorGroup" );
646
        ColorGroup->setColumnLayout(0, Qt::Vertical );
647
        ColorGroup->layout()->setSpacing( 5 );
648
        ColorGroup->layout()->setMargin( 10 );
649
        ColorGroupLayout = new QHBoxLayout( ColorGroup->layout() );
650
        ColorGroupLayout->setAlignment( Qt::AlignTop );
651
        ColorText1 = new QLabel( tr( "Output &Intended For:" ), ColorGroup, "ColorText1" );
652
        ColorGroupLayout->addWidget( ColorText1 );
653
        OutCombo = new QComboBox( true, ColorGroup, "OutCombo" );
654
        OutCombo->insertItem( tr( "Screen / Web" ) );
655
        OutCombo->insertItem( tr( "Printer" ) );
1476 fschmid 656
        OutCombo->insertItem( tr( "Grayscale" ) );
1307 fschmid 657
        OutCombo->setEditable(false);
658
        ColorText1->setBuddy(OutCombo);
659
        ColorGroupLayout->addWidget( OutCombo );
660
        tabColorLayout->addWidget( ColorGroup );
661
 
3079 fschmid 662
        useSpot = new QCheckBox( tr( "Convert Spot Colors to Process Colors" ), tabColor, "useSpot" );
663
        tabColorLayout->addWidget( useSpot );
664
 
5320 fschmid 665
        overprintMode = new QCheckBox( tr( "Force Overprint Mode" ), tabColor, "overprintMode" );
666
        tabColorLayout->addWidget( overprintMode );
667
 
1307 fschmid 668
        UseLPI = new QCheckBox( tr( "&Use Custom Rendering Settings" ), tabColor, "UseLPI" );
669
        tabColorLayout->addWidget( UseLPI );
670
        LPIgroup = new QGroupBox( tr( "Rendering Settings" ), tabColor, "LPIgroup" );
671
        LPIgroup->setColumnLayout(0, Qt::Vertical );
672
        LPIgroup->layout()->setSpacing( 5 );
673
        LPIgroup->layout()->setMargin( 10 );
674
        LPIgroupLayout = new QGridLayout( LPIgroup->layout() );
675
        LPIgroupLayout->setAlignment( Qt::AlignTop );
676
        LPIcolor = new QComboBox( true, LPIgroup, "LPIcolor" );
677
        LPIcolor->setEditable(false);
678
        LPIgroupLayout->addWidget( LPIcolor, 0, 0 );
679
        textLPI1 = new QLabel( tr( "Fre&quency:" ), LPIgroup, "textLPI1" );
680
        LPIgroupLayout->addWidget( textLPI1, 0, 1 );
681
        LPIfreq = new QSpinBox( LPIgroup, "LPIfreq" );
682
        LPIfreq->setMinValue(10);
683
        LPIfreq->setMaxValue(1000);
684
        textLPI1->setBuddy(LPIfreq);
685
        LPIgroupLayout->addWidget( LPIfreq, 0, 2 );
686
        textLPI2 = new QLabel( tr( "&Angle:" ), LPIgroup, "textLPI2" );
687
        LPIgroupLayout->addWidget( textLPI2, 1, 1 );
688
        LPIangle = new QSpinBox( LPIgroup, "LPIangle" );
689
        LPIangle->setSuffix( QString::fromUtf8(" °"));
690
        LPIangle->setMinValue(-180);
691
        LPIangle->setMaxValue(180);
692
        textLPI2->setBuddy(LPIangle);
693
        LPIgroupLayout->addWidget( LPIangle, 1, 2 );
694
        textLPI3 = new QLabel( tr( "S&pot Function:" ), LPIgroup, "textLPI3" );
695
        LPIgroupLayout->addWidget( textLPI3, 2, 1 );
696
        LPIfunc = new QComboBox( true, LPIgroup, "LPIfunc" );
697
        LPIfunc->setEditable(false);
698
        LPIfunc->insertItem( tr( "Simple Dot" ) );
699
        LPIfunc->insertItem( tr( "Line" ) );
700
        LPIfunc->insertItem( tr( "Round" ) );
701
        LPIfunc->insertItem( tr( "Ellipse" ) );
702
        textLPI3->setBuddy(LPIfunc);
703
        LPIgroupLayout->addWidget( LPIfunc, 2, 2 );
704
        tabColorLayout->addWidget( LPIgroup );
705
        SelLPIcolor = LPIcolor->currentText();
706
 
707
        GroupBox9 = new QGroupBox( tr( "Solid Colors:" ), tabColor, "GroupBox9" );
708
        GroupBox9->setColumnLayout(0, Qt::Vertical );
709
        GroupBox9->layout()->setSpacing( 5 );
710
        GroupBox9->layout()->setMargin( 10 );
711
        GroupBox9Layout = new QGridLayout( GroupBox9->layout() );
712
        GroupBox9Layout->setAlignment( Qt::AlignTop );
713
        EmbedProfs = new QCheckBox( GroupBox9, "EmbedProfs" );
714
        EmbedProfs->setText( tr( "Use ICC Profile" ) );
715
        GroupBox9Layout->addMultiCellWidget( EmbedProfs, 0, 0, 0, 1 );
716
        ProfsTxt1 = new QLabel(GroupBox9, "ProfsTxt1");
717
        ProfsTxt1->setText( tr( "Profile:" ) );
718
        GroupBox9Layout->addWidget( ProfsTxt1, 1, 0 );
719
        ProfsTxt2 = new QLabel( GroupBox9, "ProfsTxt2_2" );
720
        ProfsTxt2->setText( tr( "Rendering-Intent:" ) );
721
        GroupBox9Layout->addWidget( ProfsTxt2, 1, 1 );
722
        SolidPr = new QComboBox(true, GroupBox9, "SolidPr" );
723
        SolidPr->setEditable(false);
724
        GroupBox9Layout->addWidget( SolidPr, 2, 0 );
725
        IntendS = new QComboBox( true, GroupBox9, "IntendS" );
726
        QString tmp_ip[] = { tr("Perceptual"), tr("Relative Colorimetric"), tr("Saturation"), tr("Absolute Colorimetric")};
727
        size_t ar_ip = sizeof(tmp_ip) / sizeof(*tmp_ip);
728
        for (uint a = 0; a < ar_ip; ++a)
729
                IntendS->insertItem(tmp_ip[a]);
730
        IntendS->setEditable(false);
731
        GroupBox9Layout->addWidget( IntendS, 2, 1 );
732
        tabColorLayout->addWidget( GroupBox9 );
733
        ProfsGroup = new QGroupBox( tr( "Images:" ), tabColor, "ProfsGroup" );
734
        ProfsGroup->setColumnLayout(0, Qt::Vertical );
735
        ProfsGroup->layout()->setSpacing( 5 );
736
        ProfsGroup->layout()->setMargin( 10 );
737
        ProfsGroupLayout = new QGridLayout( ProfsGroup->layout() );
738
        ProfsGroupLayout->setAlignment( Qt::AlignTop );
739
        EmbedProfs2 = new QCheckBox( tr( "Use ICC Profile" ), ProfsGroup, "EmbedProfs" );
740
        ProfsGroupLayout->addMultiCellWidget( EmbedProfs2, 0, 0, 0, 1 );
741
        NoEmbedded = new QCheckBox( ProfsGroup, "NoEmbedded" );
742
        NoEmbedded->setText( tr( "Don't use embedded ICC profiles" ) );
743
        ProfsGroupLayout->addMultiCellWidget( NoEmbedded, 1, 1, 0, 1 );
744
        ProfsTxt3 = new QLabel( ProfsGroup, "ProfsTxt3" );
745
        ProfsTxt3->setText( tr( "Profile:" ) );
746
        ProfsGroupLayout->addWidget( ProfsTxt3, 2, 0 );
747
        ProfsTxt4 = new QLabel( ProfsGroup, "ProfsTxt2_2" );
748
        ProfsTxt4->setText( tr( "Rendering-Intent:" ) );
749
        ProfsGroupLayout->addWidget( ProfsTxt4, 2, 1 );
750
        ImageP = new QComboBox( true, ProfsGroup, "ImageP" );
751
        ImageP->setEditable(false);
752
        ProfsGroupLayout->addWidget( ImageP, 3, 0 );
753
        IntendI = new QComboBox( true, ProfsGroup, "IntendS" );
754
        for (uint a = 0; a < ar_ip; ++a)
755
                IntendI->insertItem(tmp_ip[a]);
756
        IntendI->setEditable(false);
757
        ProfsGroupLayout->addWidget( IntendI, 3, 1 );
758
        tabColorLayout->addWidget( ProfsGroup );
759
 
760
        QSpacerItem* spacerCG = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
761
        tabColorLayout->addItem( spacerCG );
762
        insertTab( tabColor, tr( "C&olor" ) );
763
 
764
        tabPDFX = new QWidget( this, "tabPDFX" );
6921 fschmid 765
        tabPDFXLayout = new QVBoxLayout( tabPDFX, 10, 5, "tabPDFXLayout");
766
 
767
        MarkGroup = new QGroupBox( tabPDFX, "MarkGroup" );
768
        MarkGroup->setTitle( tr( "Printer Marks" ) );
769
        MarkGroup->setColumnLayout(0, Qt::Vertical );
770
        MarkGroup->layout()->setSpacing( 5 );
771
        MarkGroup->layout()->setMargin( 10 );
772
        MarkGroupLayout = new QGridLayout( MarkGroup->layout() );
773
        MarkGroupLayout->setAlignment( Qt::AlignTop );
774
        cropMarks = new QCheckBox( tr( "Crop Marks" ), MarkGroup, "cropMarks" );
775
        MarkGroupLayout->addWidget( cropMarks, 0, 0 );
776
        bleedMarks = new QCheckBox( tr( "Bleed Marks" ), MarkGroup, "bleedMarks" );
777
        MarkGroupLayout->addWidget( bleedMarks, 1, 0 );
778
        registrationMarks = new QCheckBox( tr( "Registration Marks" ), MarkGroup, "registrationMarks" );
779
        MarkGroupLayout->addWidget( registrationMarks, 2, 0 );
780
        colorMarks = new QCheckBox( tr( "Color Bars" ), MarkGroup, "colorMarks" );
781
        MarkGroupLayout->addMultiCellWidget( colorMarks, 0, 0, 1, 2 );
782
        docInfoMarks = new QCheckBox( tr( "Page Information" ), MarkGroup, "docInfoMarks" );
783
        MarkGroupLayout->addMultiCellWidget( docInfoMarks, 1, 1, 1, 2 );
784
        MarkTxt1 = new QLabel( MarkGroup, "MarkTxt1" );
785
        MarkTxt1->setText( tr( "Offset:" ) );
786
        MarkGroupLayout->addWidget( MarkTxt1, 2, 1 );
787
        markOffset = new MSpinBox( MarkGroup, precision );
788
        MarkGroupLayout->addWidget( markOffset, 2, 2 );
789
        markOffset->setSuffix( unit );
790
        markOffset->setMinValue(0);
791
        markOffset->setMaxValue(3000 * unitRatio);
792
        tabPDFXLayout->addWidget( MarkGroup );
793
 
794
        BleedGroup = new QGroupBox( tabPDFX, "BleedGroup" );
795
        BleedGroup->setTitle( tr( "Bleed Settings" ) );
796
        BleedGroup->setColumnLayout(0, Qt::Vertical );
797
        BleedGroup->layout()->setSpacing( 5 );
798
        BleedGroup->layout()->setMargin( 10 );
799
        BleedGroupLayout = new QGridLayout( BleedGroup->layout() );
800
        BleedGroupLayout->setAlignment( Qt::AlignTop );
801
        BleedTxt1 = new QLabel( BleedGroup, "BleedTxt1" );
802
        BleedTxt1->setText( tr( "Top:" ) );
803
        BleedGroupLayout->addWidget( BleedTxt1, 0, 0 );
804
        BleedTop = new MSpinBox( BleedGroup, precision );
805
        BleedGroupLayout->addWidget( BleedTop, 0, 1 );
806
        BleedTxt2 = new QLabel( BleedGroup, "BleedTxt2" );
807
        BleedTxt2->setText( tr( "Bottom:" ) );
808
        BleedGroupLayout->addWidget( BleedTxt2, 1, 0 );
809
        BleedBottom = new MSpinBox( BleedGroup, precision );
810
        BleedGroupLayout->addWidget( BleedBottom, 1, 1 );
811
        BleedTxt3 = new QLabel( BleedGroup, "BleedTxt3" );
812
        BleedTxt3->setText( tr( "Left:" ) );
813
        BleedGroupLayout->addWidget( BleedTxt3, 0, 2 );
814
        BleedRight = new MSpinBox( BleedGroup, precision );
815
        BleedGroupLayout->addWidget( BleedRight, 0, 3 );
816
        BleedTxt4 = new QLabel( BleedGroup, "BleedTxt4" );
817
        BleedTxt4->setText( tr( "Right:" ) );
818
        BleedGroupLayout->addWidget( BleedTxt4, 1, 2 );
819
        BleedLeft = new MSpinBox( BleedGroup, precision );
820
        BleedGroupLayout->addWidget( BleedLeft, 1, 3 );
6944 fschmid 821
        docBleeds = new QCheckBox( tr( "Use Document Bleeds" ), BleedGroup, "docBleeds" );
822
        BleedGroupLayout->addMultiCellWidget( docBleeds, 2, 2, 0, 3 );
6921 fschmid 823
        tabPDFXLayout->addWidget( BleedGroup );
824
 
1307 fschmid 825
        X3Group = new QGroupBox( tabPDFX, "X3Group" );
826
        X3Group->setTitle( tr( "PDF/X-3 Output Intent" ) );
827
        X3Group->setColumnLayout(0, Qt::Vertical );
828
        X3Group->layout()->setSpacing( 5 );
829
        X3Group->layout()->setMargin( 10 );
830
        X3GroupLayout = new QGridLayout( X3Group->layout() );
831
        X3GroupLayout->setAlignment( Qt::AlignTop );
832
        PrintProfC = new QComboBox( true, X3Group, "PrintProfC" );
833
        PrintProfC->setEditable(false);
834
        X3GroupLayout->addWidget( PrintProfC, 0, 1 );
835
        InfoString = new QLineEdit( X3Group, "InfoString" );
836
        X3GroupLayout->addWidget( InfoString, 1, 1 );
837
        PDFX2 = new QLabel( InfoString, tr( "&Info String:" ), X3Group, "PDFX2" );
838
        X3GroupLayout->addWidget( PDFX2, 1, 0 );
839
        PDFX1 = new QLabel( PrintProfC, tr( "Output &Profile:" ), X3Group, "PDFX1" );
840
        X3GroupLayout->addWidget( PDFX1, 0, 0 );
841
        tabPDFXLayout->addWidget( X3Group );
6921 fschmid 842
 
843
        QSpacerItem* spacerPX2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
844
        tabPDFXLayout->addItem( spacerPX2 );
845
 
6928 fschmid 846
        insertTab( tabPDFX, tr( "Pre-Press" ) );
1307 fschmid 847
        BleedTop->setSuffix( unit );
848
        BleedTop->setMinValue(0);
6921 fschmid 849
        BleedTop->setMaxValue(3000*unitRatio);
1307 fschmid 850
        BleedBottom->setSuffix( unit );
851
        BleedBottom->setMinValue(0);
6921 fschmid 852
        BleedBottom->setMaxValue(3000*unitRatio);
1307 fschmid 853
        BleedRight->setSuffix( unit );
854
        BleedRight->setMinValue(0);
6921 fschmid 855
        BleedRight->setMaxValue(3000*unitRatio);
1307 fschmid 856
        BleedLeft->setSuffix( unit );
857
        BleedLeft->setMinValue(0);
6921 fschmid 858
        BleedLeft->setMaxValue(3000*unitRatio);
5711 subik 859
 
6921 fschmid 860
        restoreDefaults(Optionen, AllFonts, PDFXProfiles, DocFonts, Eff, unitIndex, PageH, PageB, doc, pdfExport);
5711 subik 861
 
5881 jghali 862
        if (doc != 0 && exporting)
1307 fschmid 863
        {
864
                connect(EmbedFonts, SIGNAL(clicked()), this, SLOT(EmbedAll()));
865
                connect(AvailFlist, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelAFont(QListBoxItem*)));
866
                connect(EmbedList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelEFont(QListBoxItem*)));
867
                connect(ToEmbed, SIGNAL(clicked()), this, SLOT(PutToEmbed()));
868
                connect(FromEmbed, SIGNAL(clicked()), this, SLOT(RemoveEmbed()));
869
                connect(SubsetFonts, SIGNAL(clicked()), this, SLOT(SubsetAll()));
870
                connect(SubsetList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelSFont(QListBoxItem*)));
871
                connect(ToSubset, SIGNAL(clicked()), this, SLOT(PutToSubset()));
872
                connect(FromSubset, SIGNAL(clicked()), this, SLOT(RemoveSubset()));
873
                connect(PagePrev, SIGNAL(clicked()), this, SLOT(PagePr()));
874
                connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
875
                connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
876
                connect(EDirection_2_2, SIGNAL(activated(int)), this, SLOT(ValidDI(int)));
877
                connect(CheckBox10, SIGNAL(clicked()), this, SLOT(DoEffects()));
878
                connect(EonAllPg, SIGNAL(clicked()), this, SLOT(EffectOnAll()));
3388 fschmid 879
                connect(InfoString, SIGNAL(textChanged(const QString &)), this, SLOT(checkInfo()));
880
                connect(InfoString, SIGNAL(returnPressed()), this, SLOT(checkInfo()));
881
                connect(InfoString, SIGNAL(lostFocus()), this, SLOT(checkInfo()));
6944 fschmid 882
                connect(docBleeds, SIGNAL(clicked()), this, SLOT(doDocBleeds()));
3849 subik 883
                QToolTip::add( EmbedFonts, "<qt>" + tr( "Embed fonts into the PDF. Embedding the fonts will preserve the layout and appearance of your document." ) + "</qt>");
4824 mrdocs 884
                QToolTip::add( CheckBox10, "<qt>" + tr( "Enables presentation effects when using Adobe&#174; Reader&#174; and other PDF viewers which support this in full screen mode." ) + "</qt>");
3849 subik 885
                QToolTip::add( PagePrev, "<qt>" + tr( "Show page previews of each page listed above." ) + "</qt>");
4964 cbradney 886
                QToolTip::add( PageTime, "<qt>" + tr( "Length of time the page is shown before the presentation starts on the selected page. Setting 0 will disable automatic page transition." ) + "</qt>" );
3849 subik 887
                QToolTip::add( EffectTime, "<qt>" + tr( "Length of time the effect runs. A shorter time will speed up the effect, a longer one will slow it down." ) + "</qt>" );
888
                QToolTip::add( EffectType, "<qt>" + tr( "Type of the display effect." ) + "</qt>" );
889
                QToolTip::add( EDirection, "<qt>" + tr( "Direction of the effect of moving lines for the split and blind effects." ) + "</qt>" );
890
                QToolTip::add( EDirection_2, "<qt>" + tr( "Starting position for the box and split effects." ) + "</qt>" );
891
                QToolTip::add( EDirection_2_2, "<qt>" + tr( "Direction of the glitter or wipe effects." ) + "</qt>" );
892
                QToolTip::add( EonAllPg, "<qt>" + tr( "Apply the selected effect to all pages." ) + "</qt>" );
1307 fschmid 893
        }
6944 fschmid 894
        else
895
                docBleeds->hide();
1307 fschmid 896
        connect(AllPages, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
6657 cbradney 897
        connect(pageNrButton, SIGNAL(clicked()), this, SLOT(createPageNumberRange()));
1307 fschmid 898
        connect(DSColor, SIGNAL(clicked()), this, SLOT(DoDownsample()));
899
        connect(MirrorH, SIGNAL(clicked()), this, SLOT(PDFMirror()));
900
        connect(MirrorV, SIGNAL(clicked()), this, SLOT(PDFMirror()));
901
        connect(RotateDeg, SIGNAL(activated(int)), this, SLOT(Rotation(int)));
902
        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
903
        connect(EmbedProfs, SIGNAL(clicked()), this, SLOT(EnablePG()));
904
        connect(EmbedProfs2, SIGNAL(clicked()), this, SLOT(EnablePGI()));
905
        connect(NoEmbedded, SIGNAL(clicked()), this, SLOT(EnablePGI2()));
1973 craig 906
        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1307 fschmid 907
        connect(Encry, SIGNAL(clicked()), this, SLOT(ToggleEncr()));
908
        connect(UseLPI, SIGNAL(clicked()), this, SLOT(EnableLPI2()));
909
        connect(LPIcolor, SIGNAL(activated(int)), this, SLOT(SelLPIcol(int)));
910
        //tooltips
3849 subik 911
        QToolTip::add( AllPages, "<qt>" + tr( "Export all pages to PDF" ) + "</qt>" );
912
        QToolTip::add( OnlySome, "<qt>" + tr( "Export a range of pages to PDF" ) );
913
        QToolTip::add( PageNr, "<qt>" + tr( "Insert a comma separated list of tokens where "
4197 fschmid 914
                                                    "a token can be * for all the pages, 1-5 for "
915
                                                    "a range of pages or a single page number.") + "</qt>" );
1307 fschmid 916
 
5839 cbradney 917
        QToolTip::add( PDFVersionCombo, "<qt>" + tr( "Determines the PDF compatibility.<br/>The default is <b>PDF 1.3</b> which gives the widest compatibility.<br/>Choose <b>PDF 1.4</b> if your file uses features such as transparency or you require 128 bit encryption.<br/><b>PDF 1.5</b> is necessary when you wish to preserve objects in separate layers within the PDF.<br/><b>PDF/X-3</b> is for exporting the PDF when you want color managed RGB for commercial printing and is selectable when you have activated color management. Use only when advised by your printer or in some cases printing to a 4 color digital color laser printer." ) + "</qt>");
3849 subik 918
        QToolTip::add( ComboBind, "<qt>" + tr( "Determines the binding of pages in the PDF. Unless you know you need to change it leave the default choice - Left." ) + "</qt>" );
919
        QToolTip::add( CheckBox1, "<qt>" + tr( "Generates thumbnails of each page in the PDF. Some viewers can use the thumbnails for navigation." ) + "</qt>" );
920
        QToolTip::add( Article, "<qt>" + tr( "Generate PDF Articles, which is useful for navigating linked articles in a PDF." ) + "</qt>" );
4810 mrdocs 921
        QToolTip::add( useLayers, "<qt>" + tr( "Layers in your document are exported to the PDF Only available if PDF 1.5 is chosen." ) + "</qt>" );
3849 subik 922
        QToolTip::add( CheckBM, "<qt>" + tr( "Embed the bookmarks you created in your document. These are useful for navigating long PDF documents." ) + "</qt>" );
923
        QToolTip::add( Resolution, "<qt>" + tr( "Export resolution of text and vector graphics. This does not affect the resolution of bitmap images like photos." ) + "</qt>" );
924
        QToolTip::add( Compression, "<qt>" + tr( "Enables lossless compression of text and graphics. Unless you have a reason, leave this checked. This reduces PDF file size." ) + "</qt>" );
6778 mrdocs 925
        QToolTip::add( CMethod, "<qt>" + tr( "Method of compression to use for images. Automatic allows Scribus to choose the best method. ZIP is lossless and good for images with solid colors. JPEG is better at creating smaller PDF files which have many photos (with slight image quality loss possible). Leave it set to Automatic unless you have a need for special compression options." ) + "</qt>");
926
        QToolTip::add( CQuality, "<qt>" + tr( "Compression quality levels for lossy compression methods: Minimum (25%), Low (50%), Medium (75%), High (85%), Maximum (95%). Note that a quality level does not directly determine the size of the resulting image - both size and quality loss vary from image to image at any given quality level. Even with Maximum selected, there is always some quality loss with jpeg." ) + "</qt>");
4824 mrdocs 927
        QToolTip::add( DSColor, "<qt>" + tr( "Re-sample your bitmap images to the selected DPI. Leaving this unchecked will render them at their native resolution. Enabling this will increase memory usage and slow down export." ) + "</qt>" );
3849 subik 928
        QToolTip::add( ValC, "<qt>" + tr( "DPI (Dots Per Inch) for image export.") + "</qt>" );
929
        QToolTip::add( Encry, "<qt>" + tr( "Enable the security features in your exported PDF. If you selected PDF 1.3, the PDF will be protected by 40 bit encryption. If you selected PDF 1.4, the PDF will be protected by 128 bit encryption. Disclaimer: PDF encryption is not as reliable as GPG or PGP encryption and does have some limitations." ) + "</qt>" );
930
        QToolTip::add( PassOwner, "<qt>" + tr( "Choose a master password which enables or disables all the security features in your exported PDF" ) + "</qt>" );
931
        QToolTip::add( PassUser, "<qt>" + tr( "Choose a password for users to be able to read your PDF." ) + "</qt>" );
932
        QToolTip::add( PrintSec, "<qt>" + tr( "Allow printing of the PDF. If un-checked, printing is prevented. " ) + "</qt>" );
933
        QToolTip::add( ModifySec, "<qt>" + tr( "Allow modifying of the PDF. If un-checked, modifying the PDF is prevented." ) + "</qt>" );
3798 cbradney 934
        QToolTip::add( CopySec, "<qt>" + tr( "Allow copying of text or graphics from the PDF. If unchecked, text and graphics cannot be copied." ) + "</qt>" );
935
        QToolTip::add( AddSec, "<qt>" + tr( "Allow adding annotations and fields to the PDF. If unchecked, editing annotations and fields is prevented." ) + "</qt>" );
4810 mrdocs 936
        QToolTip::add( OutCombo, "<qt>" + tr( "Color model for the output of your PDF. Choose Screen/Web for PDFs which are used for screen display and for printing on typical inkjets. Choose Printer when printing to a true 4 color CMYK printer. Choose Grayscale when you want a grey scale PDF." ) + "</qt>" );
3849 subik 937
        QToolTip::add( UseLPI, "<qt>" + tr( "This is an advanced setting which is not enabled by default. This should only be enabled when specifically requested by your printer and they have given you the exact details needed. Otherwise, your exported PDF may not print properly and is truly not portable across systems." ) + "</qt>" );
938
        QToolTip::add( EmbedProfs, "<qt>" + tr( "Embed a color profile for solid colors" ) + "</qt>" );
939
        QToolTip::add( SolidPr, "<qt>" + tr( "Color profile for solid colors" ) + "</qt>" );
940
        QToolTip::add( IntendS, "<qt>" + tr( "Rendering intent for solid colors" ) + "</qt>" );
941
        QToolTip::add( EmbedProfs2, "<qt>" + tr( "Embed a color profile for images" ) + "</qt>" );
942
        QToolTip::add( NoEmbedded, "<qt>" + tr( "Do not use color profiles that are embedded in source images" ) + "</qt>" );
943
        QToolTip::add( ImageP, "<qt>" + tr( "Color profile for images" ) + "</qt>" );
944
        QToolTip::add( IntendI, "<qt>" + tr( "Rendering intent for images" ) + "</qt>" );
945
        QToolTip::add( PrintProfC, "<qt>" + tr( "Output profile for printing. If possible, get some guidance from your printer on profile selection." ) + "</qt>" );
946
        QToolTip::add( InfoString, "<qt>" + tr( "Mandatory string for PDF/X-3 or the PDF will fail PDF/X-3 conformance. We recommend you use the title of the document." ) + "</qt>" );
947
        QToolTip::add( BleedTop, "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" );
948
        QToolTip::add( BleedBottom, "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" );
949
        QToolTip::add( BleedLeft, "<qt>" + tr( "Distance for bleed from the left of the physical page" ) + "</qt>" );
950
        QToolTip::add( BleedRight, "<qt>" + tr( "Distance for bleed from the right of the physical page" )  + "</qt>");
951
        QToolTip::add( MirrorH, "<qt>" + tr( "Mirror Page(s) horizontally" ) + "</qt>" );
952
        QToolTip::add( MirrorV, "<qt>" + tr( "Mirror Page(s) vertically" ) + "</qt>" );
5320 fschmid 953
        QToolTip::add(overprintMode, "<qt>"+ tr("Enables global Overprint Mode for this document, overrides object settings") + "<qt>");
4197 fschmid 954
        QToolTip::add( useSpot,"<qt>" + tr( "Enables Spot Colors to be converted to composite colors. Unless you are planning to print spot colors at a commercial printer, this is probably best left enabled." ) + "</qt>");
4836 cbradney 955
        QToolTip::add( ClipMarg, "<qt>" + tr( "Do not show objects outside the margins in the exported file" ) + "</qt>" );
1307 fschmid 956
}
957
 
5553 subik 958
void TabPDFOptions::restoreDefaults(PDFOptions & Optionen,
959
                                                                        const SCFonts &AllFonts,
960
                                                                        const ProfilesL & PDFXProfiles,
961
                                                                        const QMap<QString, int> & DocFonts,
962
                                                                        const QValueList<PDFPresentationData> & Eff,
963
                                                                        int unitIndex, double PageH, double PageB,
5881 jghali 964
                                                                        ScribusDoc * mdoc, bool exporting)
5553 subik 965
{
966
        AllPages->setChecked( true );
967
        PageNr->setEnabled(false);
6657 cbradney 968
        pageNrButton->setEnabled(false);
5553 subik 969
        RotateDeg->setCurrentItem(Opts.RotateDeg / 90);
970
        MirrorH->setOn(Opts.MirrorH);
971
        MirrorV->setOn(Opts.MirrorV);
972
        ClipMarg->setChecked(Opts.doClip);
5880 jghali 973
        bool cmsUse = mdoc ? (ScCore->haveCMS() && mdoc->HasCMS) : false;
974
        if (cmsUse)
5553 subik 975
        {
976
                if (Opts.Version == PDFOptions::PDFVersion_X3)
977
                        PDFVersionCombo->setCurrentItem(3);
978
        }
979
        else
980
                PDFVersionCombo->setCurrentItem(0);
981
        if (Opts.Version == PDFOptions::PDFVersion_13)
982
                PDFVersionCombo->setCurrentItem(0);
983
        if (Opts.Version == PDFOptions::PDFVersion_14)
984
                PDFVersionCombo->setCurrentItem(1);
985
        if (Opts.Version == PDFOptions::PDFVersion_15)
986
                PDFVersionCombo->setCurrentItem(2);
987
        ComboBind->setCurrentItem(Opts.Binding);
988
        CheckBox1->setChecked(Opts.Thumbnails);
989
        Article->setChecked(Opts.Articles);
990
        CheckBM->setChecked(Opts.Bookmarks);
991
        useLayers->setChecked(Opts.useLayers);
992
        if (Opts.Version == 15)
993
                useLayers->setEnabled(true);
994
        else
995
                useLayers->setEnabled(false);
996
        Resolution->setValue(Opts.Resolution);
997
        Compression->setChecked( Opts.Compress );
998
        CMethod->setCurrentItem(Opts.CompressMethod);
999
        CQuality->setCurrentItem(Opts.Quality);
1000
        DSColor->setChecked(Opts.RecalcPic);
1001
        ValC->setValue(Opts.PicRes);
1002
        ValC->setEnabled(DSColor->isChecked() ? true : false);
5881 jghali 1003
        if (mdoc != 0 && exporting)
5553 subik 1004
        {
1005
                QMap<QString,int>::const_iterator it;
1006
                AvailFlist->clear();
1007
                for (it = DocFonts.constBegin(); it != DocFonts.constEnd(); ++it)
1008
                {
5980 avox 1009
                        if (AllFonts[it.key()].type() == ScFace::TYPE1)
5553 subik 1010
                                AvailFlist->insertItem(loadIcon("font_type1_16.png"), it.key());
5980 avox 1011
                        else if (AllFonts[it.key()].type() == ScFace::TTF)
5553 subik 1012
                                AvailFlist->insertItem(loadIcon("font_truetype16.png"), it.key());
5980 avox 1013
                        else if (AllFonts[it.key()].type() == ScFace::OTF)
5553 subik 1014
                                AvailFlist->insertItem(loadIcon("font_otf16.png"), it.key());
1015
                }
1016
                ToEmbed->setEnabled(false);
1017
                FromEmbed->setEnabled(false);
1018
                ToSubset->setEnabled(false);
1019
                FromSubset->setEnabled(false);
6493 fschmid 1020
                if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
5553 subik 1021
                {
1022
                        EmbedFonts->setChecked(true);
1023
                        EmbedAll();
1024
                }
1025
                else
1026
                {
1027
                        EmbedList->clear();
1028
                        FontsToEmbed.clear();
1029
                        for (uint fe = 0; fe < Opts.EmbedList.count(); ++fe)
1030
                        {
1031
                                EmbedList->insertItem(Opts.EmbedList[fe]);
1032
                                FontsToEmbed.append(Opts.EmbedList[fe]);
1033
                        }
6493 fschmid 1034
                        if (Opts.SubsetList.count() != 0)
5553 subik 1035
                        {
6493 fschmid 1036
                                SubsetList->clear();
1037
                                FontsToSubset.clear();
1038
                                for (uint fe = 0; fe < Opts.SubsetList.count(); ++fe)
1039
                                {
1040
                                        SubsetList->insertItem(Opts.SubsetList[fe]);
1041
                                        FontsToSubset.append(Opts.SubsetList[fe]);
1042
                                }
5553 subik 1043
                        }
1044
                }
1045
                CheckBox10->setChecked(Opts.PresentMode);
1046
                QString tmp;
1047
                struct PDFPresentationData ef;
1048
                Pages->clear();
1049
                EffVal.clear();
1050
                if (EffVal.count() != 0)
1051
                {
5880 jghali 1052
                        for (uint pg2 = 0; pg2 < doc->Pages->count(); ++pg2)
5553 subik 1053
                        {
1054
                                Pages->insertItem( tr("Page")+" "+tmp.setNum(pg2+1));
1055
                                if (EffVal.count()-1 < pg2)
1056
                                {
1057
                                        ef.pageEffectDuration = 1;
1058
                                        ef.pageViewDuration = 1;
1059
                                        ef.effectType = 0;
1060
                                        ef.Dm = 0;
1061
                                        ef.M = 0;
1062
                                        ef.Di = 0;
1063
                                        EffVal.append(ef);
1064
                                }
1065
                        }
1066
                }
1067
                else
1068
                {
5880 jghali 1069
                        for (uint pg = 0; pg < doc->Pages->count(); ++pg)
5553 subik 1070
                        {
1071
                                Pages->insertItem( tr("Page")+" "+tmp.setNum(pg+1));
1072
                                ef.pageEffectDuration = 1;
1073
                                ef.pageViewDuration = 1;
1074
                                ef.effectType = 0;
1075
                                ef.Dm = 0;
1076
                                ef.M = 0;
1077
                                ef.Di = 0;
1078
                                EffVal.append(ef);
1079
                        }
1080
                }
1081
                PagePrev->setChecked(false);
1082
                PageTime->setValue(EffVal[0].pageViewDuration);
1083
                EffectTime->setValue(EffVal[0].pageEffectDuration);
1084
                bool df = true;
1085
                if ((Opts.displayBookmarks) || (Opts.displayFullscreen) || (Opts.displayLayers) || (Opts.displayThumbs))
1086
                        df = false;
6063 fschmid 1087
                if (df)
1088
                        useViewDefault->setChecked(df);
5553 subik 1089
                useFullScreen->setChecked(Opts.displayFullscreen);
1090
                useBookmarks->setChecked(Opts.displayBookmarks);
1091
                useThumbnails->setChecked(Opts.displayThumbs);
1092
                useLayers2->setChecked(Opts.displayLayers);
1093
                hideToolBar->setChecked(Opts.hideToolBar);
1094
                hideMenuBar->setChecked(Opts.hideMenuBar);
1095
                fitWindow->setChecked(Opts.fitWindow);
1096
                QMap<QString,QString>::Iterator itja;
1097
                actionCombo->clear();
5880 jghali 1098
                for (itja = doc->JavaScripts.begin(); itja != doc->JavaScripts.end(); ++itja)
5553 subik 1099
                        actionCombo->insertItem(itja.key());
5880 jghali 1100
                if (doc->JavaScripts.contains(Opts.openAction))
5553 subik 1101
                        actionCombo->setCurrentText(Opts.openAction);
1102
                if (Opts.PageLayout == PDFOptions::SinglePage)
1103
                        singlePage->setChecked(true);
1104
                else if (Opts.PageLayout == PDFOptions::OneColumn)
1105
                        continuousPages->setChecked(true);
1106
                else if (Opts.PageLayout == PDFOptions::TwoColumnLeft)
1107
                        doublePageLeft->setChecked(true);
1108
                else if (Opts.PageLayout == PDFOptions::TwoColumnRight)
1109
                        doublePageRight->setChecked(true);
1110
                if (Opts.Version == 15)
1111
                        useLayers2->setEnabled(true);
1112
                else
1113
                        useLayers2->setEnabled(false);
1114
        }
1828 fschmid 1115
 
5553 subik 1116
        Encry->setChecked( Opts.Encrypt );
1117
        PassOwner->setText(Opts.PassOwner);
1118
        PassUser->setText(Opts.PassUser);
1119
        PrintSec->setChecked( Opts.Permissions & 4 );
1120
        ModifySec->setChecked( Opts.Permissions & 8 );
1121
        CopySec->setChecked( Opts.Permissions & 16 );
1122
        AddSec->setChecked( Opts.Permissions & 32 );
1123
        if (!Encry->isChecked())
1124
        {
1125
                GroupSecSet->setEnabled(false);
1126
                GroupPass->setEnabled(false);
1127
        }
1128
 
1129
        if (Opts.UseRGB)
1130
                OutCombo->setCurrentItem(0);
1131
        else
1132
        {
1133
                if (Opts.isGrayscale)
1134
                        OutCombo->setCurrentItem(2);
1135
                else
1136
                        OutCombo->setCurrentItem(1);
1137
        }
1138
        useSpot->setChecked(!Opts.UseSpotColors);
1139
        overprintMode->setChecked(Opts.doOverprint);
1140
        UseLPI->setChecked(Opts.UseLPI);
1141
        QMap<QString,LPIData>::Iterator itlp;
1142
        LPIcolor->clear();
1143
        for (itlp = Opts.LPISettings.begin(); itlp != Opts.LPISettings.end(); ++itlp)
1144
                LPIcolor->insertItem( itlp.key() );
1145
        LPIcolor->setCurrentItem(0);
5711 subik 1146
 
5553 subik 1147
        LPIfreq->setValue(Opts.LPISettings[LPIcolor->currentText()].Frequency);
1148
        LPIangle->setValue(Opts.LPISettings[LPIcolor->currentText()].Angle);
1149
        LPIfunc->setCurrentItem(Opts.LPISettings[LPIcolor->currentText()].SpotFunc);
1150
        EmbedProfs->setChecked(Opts.UseProfiles);
1151
        EmbedProfs2->setChecked(Opts.UseProfiles2);
1152
        NoEmbedded->setChecked(Opts.EmbeddedI);
1153
        if ((Opts.UseRGB) || (Opts.isGrayscale))
1154
        {
1155
                ProfsGroup->setEnabled(false);
1156
                GroupBox9->setEnabled(false);
1157
                EnablePr(0);
1158
        }
1159
        else
1160
                EnablePr(1);
1161
        EnablePG();
1162
        EnablePGI();
1163
        QString tp = Opts.SolidProf;
1164
        if (!ScCore->InputProfiles.contains(tp))
1165
        {
5881 jghali 1166
                if (mdoc != 0 && exporting)
5880 jghali 1167
                        tp = mdoc->CMSSettings.DefaultSolidColorRGBProfile;
5553 subik 1168
                else
1169
                        tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
1170
        }
1171
        ProfilesL::Iterator itp;
1172
        ProfilesL::Iterator itpend=ScCore->InputProfiles.end();
1173
        SolidPr->clear();
1174
        for (itp = ScCore->InputProfiles.begin(); itp != itpend; ++itp)
1175
        {
1176
                SolidPr->insertItem(itp.key());
1177
                if (itp.key() == tp)
1178
                {
5880 jghali 1179
                        if (cmsUse)
5553 subik 1180
                                SolidPr->setCurrentItem(SolidPr->count()-1);
1181
                }
1182
        }
5880 jghali 1183
        if (cmsUse)
5553 subik 1184
                IntendS->setCurrentItem(Opts.Intent);
1185
        QString tp1 = Opts.ImageProf;
1186
        if (!ScCore->InputProfiles.contains(tp1))
1187
        {
5881 jghali 1188
                if (mdoc != 0 && exporting)
5880 jghali 1189
                        tp1 = mdoc->CMSSettings.DefaultSolidColorRGBProfile;
5553 subik 1190
                else
1191
                        tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
1192
        }
1193
        ProfilesL::Iterator itp2;
1194
        ProfilesL::Iterator itp2end=ScCore->InputProfiles.end();
1195
        ImageP->clear();
1196
        for (itp2 = ScCore->InputProfiles.begin(); itp2 != itp2end; ++itp2)
1197
        {
1198
                ImageP->insertItem(itp2.key());
1199
                if (itp2.key() == tp1)
1200
                {
5880 jghali 1201
                        if (cmsUse)
5553 subik 1202
                                ImageP->setCurrentItem(ImageP->count()-1);
1203
                }
1204
        }
5880 jghali 1205
        if (cmsUse)
5553 subik 1206
                IntendI->setCurrentItem(Opts.Intent2);
5880 jghali 1207
        if (!cmsUse)
5553 subik 1208
        {
1209
                GroupBox9->hide();
1210
                ProfsGroup->hide();
1211
        }
1212
 
1213
        ProfilesL::const_iterator itp3;
1214
        QString tp3 = Opts.PrintProf;
1215
        if (!PDFXProfiles.contains(tp3))
1216
        {
5881 jghali 1217
                if (mdoc != 0 && exporting)
5880 jghali 1218
                        tp3 = mdoc->CMSSettings.DefaultPrinterProfile;
5553 subik 1219
                else
1220
                        tp3 = PrefsManager::instance()->appPrefs.DCMSset.DefaultPrinterProfile;
1221
        }
1222
        PrintProfC->clear();
1223
        for (itp3 = PDFXProfiles.constBegin(); itp3 != PDFXProfiles.constEnd(); ++itp3)
1224
        {
1225
                PrintProfC->insertItem(itp3.key());
1226
                if (itp3.key() == tp3)
1227
                        PrintProfC->setCurrentItem(PrintProfC->count()-1);
1228
        }
1229
        InfoString->setText(Opts.Info);
1230
        BleedTop->setValue(Opts.BleedTop*unitRatio);
1231
        BleedBottom->setValue(Opts.BleedBottom*unitRatio);
1232
        BleedRight->setValue(Opts.BleedRight*unitRatio);
1233
        BleedLeft->setValue(Opts.BleedLeft*unitRatio);
6944 fschmid 1234
        docBleeds->setChecked(false);
6921 fschmid 1235
        markOffset->setValue(Opts.markOffset*unitRatio);
1236
        cropMarks->setChecked(Opts.cropMarks);
1237
        bleedMarks->setChecked(Opts.bleedMarks);
1238
        registrationMarks->setChecked(Opts.registrationMarks);
1239
        colorMarks->setChecked(Opts.colorMarks);
1240
        docInfoMarks->setChecked(Opts.docInfoMarks);
5880 jghali 1241
        if (!cmsUse)
6921 fschmid 1242
                X3Group->setEnabled(false);
5880 jghali 1243
        if (cmsUse && (Opts.Version == 12) && (!PDFXProfiles.isEmpty()))
5553 subik 1244
                EnablePDFX(3);
1245
        else
6921 fschmid 1246
                X3Group->setEnabled(false);
5881 jghali 1247
        if (mdoc != 0  && exporting)
5553 subik 1248
        {
1249
                PgSel = 0;
1250
                Pages->setCurrentItem(0);
1251
                SetEffOpts(0);
1252
                Pages->setEnabled(false);
1253
                Effects->setEnabled(false);
1254
                PagePrev->setEnabled(false);
1255
                DoEffects();
1256
                if (CheckBox10->isChecked())
1257
                {
1258
                        PageTime->setValue(EffVal[0].pageViewDuration);
1259
                        EffectTime->setValue(EffVal[0].pageEffectDuration);
1260
                        EffectType->setCurrentItem(EffVal[0].effectType);
1261
                        EDirection->setCurrentItem(EffVal[0].Dm);
1262
                        EDirection_2->setCurrentItem(EffVal[0].M);
1263
                        EDirection_2_2->setCurrentItem(EffVal[0].Di);
1264
                        SetEffOpts(EffectType->currentItem());
1265
                }
6921 fschmid 1266
                if (mdoc->currentPageLayout != 0)
1267
                {
1268
                        BleedTxt3->setText( tr( "Inside:" ) );
1269
                        BleedTxt4->setText( tr( "Outside:" ) );
1270
                }
5553 subik 1271
 
1272
        }
1273
}
1274
 
6944 fschmid 1275
void TabPDFOptions::doDocBleeds()
1276
{
1277
        if (docBleeds->isChecked())
1278
        {
1279
                Opts.BleedTop = BleedTop->value() / unitRatio;
1280
                Opts.BleedBottom = BleedBottom->value() / unitRatio;
1281
                Opts.BleedRight = BleedRight->value() / unitRatio;
1282
                Opts.BleedLeft = BleedLeft->value() / unitRatio;
1283
                BleedTop->setValue(doc->BleedTop*unitRatio);
1284
                BleedBottom->setValue(doc->BleedBottom*unitRatio);
1285
                BleedRight->setValue(doc->BleedRight*unitRatio);
1286
                BleedLeft->setValue(doc->BleedLeft*unitRatio);
1287
                BleedTop->setEnabled(false);
1288
                BleedBottom->setEnabled(false);
1289
                BleedRight->setEnabled(false);
1290
                BleedLeft->setEnabled(false);
1291
        }
1292
        else
1293
        {
1294
                BleedTop->setValue(Opts.BleedTop*unitRatio);
1295
                BleedBottom->setValue(Opts.BleedBottom*unitRatio);
1296
                BleedRight->setValue(Opts.BleedRight*unitRatio);
1297
                BleedLeft->setValue(Opts.BleedLeft*unitRatio);
1298
                BleedTop->setEnabled(true);
1299
                BleedBottom->setEnabled(true);
1300
                BleedRight->setEnabled(true);
1301
                BleedLeft->setEnabled(true);
1302
        }
1303
}
1304
 
3388 fschmid 1305
void TabPDFOptions::checkInfo()
1306
{
1307
        if ((PDFVersionCombo->currentItem() == 3) && (InfoString->text().isEmpty()))
1308
                emit noInfo();
1309
        else
1310
                emit hasInfo();
1311
}
1312
 
1307 fschmid 1313
void TabPDFOptions::ToggleEncr()
1314
{
1315
        bool setter = Encry->isChecked() ? true : false;
1316
        GroupSecSet->setEnabled(setter);
1317
        GroupPass->setEnabled(setter);
1318
}
6922 fschmid 1319
 
1307 fschmid 1320
void TabPDFOptions::enableCMS(bool enable)
1321
{
1973 craig 1322
        disconnect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1323
        int a = PDFVersionCombo->currentItem();
1324
        PDFVersionCombo->clear();
5840 cbradney 1325
        PDFVersionCombo->insertItem("PDF 1.3 (Acrobat 4)");
1326
        PDFVersionCombo->insertItem("PDF 1.4 (Acrobat 5)");
1327
        PDFVersionCombo->insertItem("PDF 1.5 (Acrobat 6)");
1843 cbradney 1328
        cms=enable;
1307 fschmid 1329
        if (enable)
1973 craig 1330
                PDFVersionCombo->insertItem("PDF/X-3");
1307 fschmid 1331
        else
1738 fschmid 1332
                a = QMIN(a, 3);
1973 craig 1333
        PDFVersionCombo->setCurrentItem(a);
1307 fschmid 1334
        EnablePr(1);
1973 craig 1335
        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1307 fschmid 1336
}
1337
 
1338
void TabPDFOptions::EnablePDFX(int a)
1339
{
1843 cbradney 1340
        useLayers->setEnabled(a == 2);
4252 craig 1341
        if (useLayers2)
1342
                useLayers2->setEnabled(a == 2);
1738 fschmid 1343
        if (a != 3)
1307 fschmid 1344
        {
6921 fschmid 1345
                X3Group->setEnabled(false);
1307 fschmid 1346
                setTabEnabled(tabSecurity, true);
1347
                OutCombo->setEnabled(true);
1348
                EmbedProfs2->setEnabled(true);
3564 fschmid 1349
                emit hasInfo();
5880 jghali 1350
                if (doc != 0 && pdfExport)
1307 fschmid 1351
                {
1352
                        CheckBox10->setEnabled(true);
1353
                        EmbedFonts->setEnabled(true);
1781 fschmid 1354
                        if (EmbedList->count() != 0)
1355
                                FromEmbed->setEnabled(true);
1356
                        ToEmbed->setEnabled(true);
1307 fschmid 1357
                }
1358
                return;
1359
        }
1360
        disconnect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
1361
        OutCombo->setCurrentItem(1);
1362
        OutCombo->setEnabled(false);
1363
        EnablePr(1);
1364
        EmbedProfs2->setChecked(true);
1365
        EmbedProfs2->setEnabled(false);
5880 jghali 1366
        if (doc != 0 && pdfExport)
1307 fschmid 1367
        {
1368
                EmbedFonts->setChecked(true);
1369
                EmbedAll();
1370
                CheckBox10->setChecked(false);
1371
                CheckBox10->setEnabled(false);
1372
                EmbedFonts->setEnabled(false);
1781 fschmid 1373
                FromEmbed->setEnabled(false);
1374
                ToEmbed->setEnabled(false);
3388 fschmid 1375
                if (InfoString->text().isEmpty())
1376
                        emit noInfo();
1377
                else
1378
                        emit hasInfo();
1307 fschmid 1379
        }
1380
        EnablePGI();
6921 fschmid 1381
        X3Group->setEnabled(true);
1307 fschmid 1382
        setTabEnabled(tabSecurity, false);
1383
        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
1384
}
1385
 
1386
void TabPDFOptions::EnablePGI()
1387
{
1388
        if (EmbedProfs2->isChecked())
1389
        {
1390
                NoEmbedded->setEnabled(true);
1391
                bool setter = NoEmbedded->isChecked() ? true : false;
1392
                ProfsTxt3->setEnabled(setter);
1393
                ProfsTxt4->setEnabled(setter);
1394
                ImageP->setEnabled(setter);
1395
                IntendI->setEnabled(setter);
1396
        }
1397
        else
1398
        {
1399
                ProfsTxt3->setEnabled(false);
1400
                ProfsTxt4->setEnabled(false);
1401
                ImageP->setEnabled(false);
1402
                IntendI->setEnabled(false);
1403
                NoEmbedded->setEnabled(false);
1404
        }
1405
}
1406
 
1407
void TabPDFOptions::EnablePGI2()
1408
{
1409
        bool setter = NoEmbedded->isChecked() ? true : false;
1410
        ProfsTxt3->setEnabled(setter);
1411
        ProfsTxt4->setEnabled(setter);
1412
        ImageP->setEnabled(setter);
1413
        IntendI->setEnabled(setter);
1414
}
1415
 
1416
void TabPDFOptions::EnablePG()
1417
{
1418
        bool setter = EmbedProfs->isChecked() ? true : false;
1419
        ProfsTxt1->setEnabled(setter);
1420
        ProfsTxt2->setEnabled(setter);
1421
        SolidPr->setEnabled(setter);
1422
        IntendS->setEnabled(setter);
1423
}
1424
 
1425
void TabPDFOptions::EnablePr(int a)
1426
{
1427
        EnableLPI(a);
1428
        bool setter = a == 1 ? true : false;
1429
        GroupBox9->setEnabled(setter);
1430
        ProfsGroup->setEnabled(setter);
1431
}
1432
 
1433
void TabPDFOptions::EnableLPI(int a)
1434
{
1435
        if (a == 1)
1436
        {
4260 craig 1437
                QString tp = Opts.SolidProf;
5243 cbradney 1438
                if (!ScCore->InputProfiles.contains(tp))
1307 fschmid 1439
                {
5880 jghali 1440
                        if (doc != 0)
1441
                                tp = doc->CMSSettings.DefaultSolidColorRGBProfile;
1307 fschmid 1442
                        else
5345 mrdocs 1443
                                tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
1307 fschmid 1444
                }
2891 cbradney 1445
                SolidPr->clear();
1307 fschmid 1446
                ProfilesL::Iterator itp;
5243 cbradney 1447
                ProfilesL::Iterator itpend=ScCore->InputProfiles.end();
1448
                for (itp = ScCore->InputProfiles.begin(); itp != itpend; ++itp)
1307 fschmid 1449
                {
1450
                        SolidPr->insertItem(itp.key());
1451
                        if (itp.key() == tp)
1452
                        {
1453
                                if (cms)
1454
                                        SolidPr->setCurrentItem(SolidPr->count()-1);
1455
                        }
1456
                }
1457
                if (cms)
4260 craig 1458
                        IntendS->setCurrentItem(Opts.Intent);
1459
                QString tp1 = Opts.ImageProf;
5243 cbradney 1460
                if (!ScCore->InputProfiles.contains(tp1))
1307 fschmid 1461
                {
5880 jghali 1462
                        if (doc != 0)
1463
                                tp1 = doc->CMSSettings.DefaultSolidColorRGBProfile;
1307 fschmid 1464
                        else
5345 mrdocs 1465
                                tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
1307 fschmid 1466
                }
1467
                ImageP->clear();
2891 cbradney 1468
                ProfilesL::Iterator itp2;
5243 cbradney 1469
                ProfilesL::Iterator itp2end=ScCore->InputProfiles.end();
1470
                for (itp2 = ScCore->InputProfiles.begin(); itp2 != itp2end; ++itp2)
1307 fschmid 1471
                {
1472
                        ImageP->insertItem(itp2.key());
1473
                        if (itp2.key() == tp1)
1474
                        {
1475
                                if (cms)
1476
                                        ImageP->setCurrentItem(ImageP->count()-1);
1477
                        }
1478
                }
1479
                if (cms)
4260 craig 1480
                        IntendI->setCurrentItem(Opts.Intent2);
1307 fschmid 1481
                if (cms)
1482
                {
1483
                        GroupBox9->show();
1484
                        ProfsGroup->show();
1485
                }
1486
                else
1487
                {
1488
                        GroupBox9->hide();
1489
                        ProfsGroup->hide();
1490
                }
6239 fschmid 1491
                useSpot->show();
1492
                overprintMode->show();
1493
                UseLPI->show();
1494
                if (UseLPI->isChecked())
1495
                        LPIgroup->show();
1496
                else
1497
                        LPIgroup->hide();
1307 fschmid 1498
        }
1499
        else
1500
        {
3079 fschmid 1501
                useSpot->hide();
5320 fschmid 1502
                overprintMode->hide();
1307 fschmid 1503
                UseLPI->hide();
1504
                LPIgroup->hide();
1505
        }
1506
}
1507
 
1508
void TabPDFOptions::EnableLPI2()
1509
{
1510
        if (UseLPI->isChecked())
1511
                LPIgroup->show();
1512
        else
1513
                LPIgroup->hide();
1514
}
1515
 
1516
void TabPDFOptions::SelLPIcol(int c)
1517
{
4260 craig 1518
        // XXX Optionen or Opts changed here
1519
        Opts.LPISettings[SelLPIcolor].Frequency = LPIfreq->value();
1520
        Opts.LPISettings[SelLPIcolor].Angle = LPIangle->value();
1521
        Opts.LPISettings[SelLPIcolor].SpotFunc = LPIfunc->currentItem();
1522
        LPIfreq->setValue(Opts.LPISettings[LPIcolor->text(c)].Frequency);
1523
        LPIangle->setValue(Opts.LPISettings[LPIcolor->text(c)].Angle);
1524
        LPIfunc->setCurrentItem(Opts.LPISettings[LPIcolor->text(c)].SpotFunc);
1307 fschmid 1525
        SelLPIcolor = LPIcolor->text(c);
1526
}
1527
 
1528
void TabPDFOptions::SelRange(bool e)
1529
{
1530
        bool setter = e ? false : true;
1531
        PageNr->setEnabled( setter );
6657 cbradney 1532
        pageNrButton->setEnabled( setter );
1307 fschmid 1533
        if (setter == false)
1534
                CheckBM->setChecked(false);
1535
}
1536
 
1537
void TabPDFOptions::EffectOnAll()
1538
{
5880 jghali 1539
        for (uint pg = 0; pg < doc->Pages->count(); ++pg)
1307 fschmid 1540
        {
1541
                EffVal[pg].pageViewDuration = PageTime->value();
1542
                EffVal[pg].pageEffectDuration = EffectTime->value();
1543
                EffVal[pg].effectType = EffectType->currentItem();
1544
                EffVal[pg].Dm = EDirection->currentItem();
1545
                EffVal[pg].M = EDirection_2->currentItem();
1546
                EffVal[pg].Di = EDirection_2_2->currentItem();
1547
        }
1548
}
1549
 
1550
void TabPDFOptions::PDFMirror()
1551
{
4260 craig 1552
        // XXX Optionen or Opts changed here
1553
        Opts.MirrorH = MirrorH->isOn();
1554
        Opts.MirrorV = MirrorV->isOn();
1307 fschmid 1555
}
1556
 
1557
void TabPDFOptions::Rotation( int value )
1558
{
4260 craig 1559
        Opts.RotateDeg = value * 90;
1307 fschmid 1560
}
1561
 
1562
void TabPDFOptions::DoEffects()
1563
{
1564
        bool setter = CheckBox10->isChecked() ? true : false;
1565
        Pages->setEnabled(setter);
1566
        Effects->setEnabled(setter);
1567
        PagePrev->setEnabled(setter);
1568
}
1569
 
1570
void TabPDFOptions::ValidDI(int nr)
1571
{
1572
        if (!EDirection_2_2->listBox()->item(nr)->isSelectable())
1573
                EDirection_2_2->setCurrentItem(0);
1574
}
1575
 
1576
void TabPDFOptions::SetPgEff(int nr)
1577
{
1578
        if (nr < 0)
1579
                return;
1580
        EffVal[PgSel].pageViewDuration = PageTime->value();
1581
        EffVal[PgSel].pageEffectDuration = EffectTime->value();
1582
        EffVal[PgSel].effectType = EffectType->currentItem();
1583
        EffVal[PgSel].Dm = EDirection->currentItem();
1584
        EffVal[PgSel].M = EDirection_2->currentItem();
1585
        EffVal[PgSel].Di = EDirection_2_2->currentItem();
1586
        SetEffOpts(EffVal[nr].effectType);
1587
        PageTime->setValue(EffVal[nr].pageViewDuration);
1588
        EffectTime->setValue(EffVal[nr].pageEffectDuration);
1589
        EffectType->setCurrentItem(EffVal[nr].effectType);
1590
        EDirection->setCurrentItem(EffVal[nr].Dm);
1591
        EDirection_2->setCurrentItem(EffVal[nr].M);
1592
        EDirection_2_2->setCurrentItem(EffVal[nr].Di);
1593
        PgSel = nr;
1594
}
1595
 
1596
void TabPDFOptions::SetEffOpts(int nr)
1597
{
1598
        EDirection_2_2->listBox()->item(2)->setSelectable(false);
1599
        EDirection_2_2->listBox()->item(3)->setSelectable(false);
1600
        EDirection_2_2->listBox()->item(4)->setSelectable(false);
1601
        switch (nr)
1602
        {
1603
        case 0:
1604
        case 3:
1605
                EDirection->setEnabled(false);
1606
                EDirection_2->setEnabled(false);
1607
                EDirection_2_2->setEnabled(false);
1608
                break;
1609
        case 1:
1610
                EDirection->setEnabled(true);
1611
                EDirection_2->setEnabled(false);
1612
                EDirection_2_2->setEnabled(false);
1613
                break;
1614
        case 2:
1615
                EDirection->setEnabled(false);
1616
                EDirection_2->setEnabled(true);
1617
                EDirection_2_2->setEnabled(false);
1618
                break;
1619
        case 4:
1620
        case 6:
1621
                EDirection->setEnabled(false);
1622
                EDirection_2->setEnabled(false);
1623
                EDirection_2_2->setEnabled(true);
1624
                if (nr == 6)
1625
                {
1626
                        EDirection_2_2->listBox()->item(2)->setSelectable(true);
1627
                        EDirection_2_2->listBox()->item(3)->setSelectable(true);
1628
                }
1629
                else
1630
                        EDirection_2_2->listBox()->item(4)->setSelectable(true);
1631
                break;
1632
        case 5:
1633
                EDirection->setEnabled(true);
1634
                EDirection_2->setEnabled(true);
1635
                EDirection_2_2->setEnabled(false);
1636
                break;
1637
        }
1638
}
1639
 
1640
void TabPDFOptions::PagePr()
1641
{
1642
        disconnect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
1643
        QString tmp;
1815 fschmid 1644
        QPixmap pm;
1307 fschmid 1645
        int ci = Pages->currentItem();
1646
        if (PagePrev->isChecked())
1647
        {
5880 jghali 1648
                for (uint pg = 0; pg < doc->Pages->count(); ++pg)
1815 fschmid 1649
                {
5880 jghali 1650
                        pm.convertFromImage(doc->view()->PageToPixmap(pg, 70));
1815 fschmid 1651
                        Pages->changeItem(pm, tr("Page")+" "+tmp.setNum(pg+1), pg);
1652
                }
1307 fschmid 1653
        }
1654
        else
1655
        {
5880 jghali 1656
                for (uint pg = 0; pg < doc->Pages->count(); ++pg)
1307 fschmid 1657
                        Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
1658
        }
1659
        if (ci != -1)
1660
        {
1661
                PgSel = ci;
1662
                Pages->setCurrentItem(ci);
1663
        }
1664
        else
1665
        {
1666
                PgSel = 0;
1667
                Pages->clearSelection();
1668
        }
1669
        connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
1670
}
1671
 
1672
void TabPDFOptions::DoDownsample()
1673
{
1674
        if (DSColor->isChecked())
1675
        {
1676
                ValC->setEnabled(true);
1677
                if (ValC->value() > Resolution->value())
1678
                        ValC->setValue(Resolution->value());
1679
                ValC->setMaxValue(Resolution->value());
1680
                ValC->setMinValue(35);
1681
        }
1682
        else
1683
                ValC->setEnabled(false);
1684
}
1685
 
1686
void TabPDFOptions::RemoveEmbed()
1687
{
1688
        FontsToEmbed.remove(EmbedList->currentText());
1689
        EmbedList->removeItem(EmbedList->currentItem());
1690
        EmbedList->clearSelection();
1691
        if (EmbedList->count() == 0)
1692
        {
1693
                FromEmbed->setEnabled(false);
1694
                ToSubset->setEnabled(false);
1695
        }
1696
}
1697
 
1698
void TabPDFOptions::PutToEmbed()
1699
{
1700
        if (EmbedList->count() != 0)
1701
        {
5980 avox 1702
                if (!AllFonts[AvailFlist->currentText()].subset())
1307 fschmid 1703
                {
3633 fschmid 1704
                        if (EmbedList->findItem(AvailFlist->currentText()) == NULL)
1705
                        {
1706
                                FontsToEmbed.append(AvailFlist->currentText());
1707
                                EmbedList->insertItem(AvailFlist->currentText());
1708
                        }
1307 fschmid 1709
                }
3633 fschmid 1710
                else
1711
                {
1712
                        if (SubsetList->count() != 0)
1713
                        {
1714
                                if (SubsetList->findItem(AvailFlist->currentText()) == NULL)
1715
                                {
1716
                                        FontsToSubset.append(AvailFlist->currentText());
1717
                                        SubsetList->insertItem(AvailFlist->currentText());
1718
                                }
1719
                        }
1720
                        else
1721
                        {
1722
                                FontsToSubset.append(AvailFlist->currentText());
1723
                                SubsetList->insertItem(AvailFlist->currentText());
1724
                        }
1725
                }
1307 fschmid 1726
        }
1727
        else
1728
        {
5980 avox 1729
                if (!AllFonts[AvailFlist->currentText()].subset())
3633 fschmid 1730
                {
1731
                        FontsToEmbed.append(AvailFlist->currentText());
1732
                        EmbedList->insertItem(AvailFlist->currentText());
1733
                }
1734
                else
1735
                {
1736
                        if (SubsetList->count() != 0)
1737
                        {
1738
                                if (SubsetList->findItem(AvailFlist->currentText()) == NULL)
1739
                                {
1740
                                        FontsToSubset.append(AvailFlist->currentText());
1741
                                        SubsetList->insertItem(AvailFlist->currentText());
1742
                                }
1743
                        }
1744
                        else
1745
                        {
1746
                                FontsToSubset.append(AvailFlist->currentText());
1747
                                SubsetList->insertItem(AvailFlist->currentText());
1748
                        }
1749
                }
1307 fschmid 1750
        }
1751
}
1752
 
1753
void TabPDFOptions::RemoveSubset()
1754
{
5980 avox 1755
        if (!AllFonts[SubsetList->currentText()].subset())
3633 fschmid 1756
        {
1757
                FontsToSubset.remove(SubsetList->currentText());
1758
                FontsToEmbed.append(SubsetList->currentText());
1759
                EmbedList->insertItem(SubsetList->currentText());
1760
                SubsetList->removeItem(SubsetList->currentItem());
1761
                SubsetList->clearSelection();
1762
                if (SubsetList->count() == 0)
1763
                        FromSubset->setEnabled(false);
1764
        }
1307 fschmid 1765
}
1766
 
1767
void TabPDFOptions::PutToSubset()
1768
{
1769
        if (SubsetList->count() != 0)
1770
        {
1771
                if (SubsetList->findItem(EmbedList->currentText()) == NULL)
1772
                {
1773
                        FontsToSubset.append(EmbedList->currentText());
1774
                        SubsetList->insertItem(EmbedList->currentText());
1775
                }
1776
        }
1777
        else
1778
        {
1779
                FontsToSubset.append(EmbedList->currentText());
1780
                SubsetList->insertItem(EmbedList->currentText());
1781
        }
1782
        FontsToEmbed.remove(EmbedList->currentText());
1783
        EmbedList->removeItem(EmbedList->currentItem());
1784
        EmbedList->clearSelection();
1785
        if (EmbedList->count() == 0)
1786
        {
1787
                FromEmbed->setEnabled(false);
1788
                ToSubset->setEnabled(false);
1789
        }
1790
}
1791
 
1792
void TabPDFOptions::SelAFont(QListBoxItem *c)
1793
{
1794
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1795
        {
1796
                FromEmbed->setEnabled(false);
1797
                if (c->isSelectable())
1798
                        ToEmbed->setEnabled(true);
1799
                ToSubset->setEnabled(false);
1800
                FromSubset->setEnabled(false);
1801
                EmbedList->clearSelection();
1802
                SubsetList->clearSelection();
1803
        }
1804
}
1805
 
1806
void TabPDFOptions::SelEFont(QListBoxItem *c)
1807
{
1808
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1809
        {
1781 fschmid 1810
                if (!isTabEnabled(tabPDFX))
1811
                        FromEmbed->setEnabled(true);
1307 fschmid 1812
                ToEmbed->setEnabled(false);
1813
                ToSubset->setEnabled(true);
1814
                FromSubset->setEnabled(false);
1815
                AvailFlist->clearSelection();
1816
                SubsetList->clearSelection();
1817
        }
1818
}
1819
 
1820
void TabPDFOptions::SelSFont(QListBoxItem *c)
1821
{
1822
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1823
        {
1824
                FromSubset->setEnabled(true);
1825
                ToSubset->setEnabled(false);
1826
                ToEmbed->setEnabled(false);
1827
                FromEmbed->setEnabled(false);
1828
                EmbedList->clearSelection();
1829
                AvailFlist->clearSelection();
1830
        }
1831
}
1832
 
1833
void TabPDFOptions::EmbedAll()
1834
{
1835
        if (EmbedFonts->isChecked())
1836
        {
1837
                SubsetFonts->setChecked(false);
1838
                EmbedList->clear();
1839
                FontsToEmbed.clear();
1840
                SubsetList->clear();
1841
                FontsToSubset.clear();
1842
                FromEmbed->setEnabled(false);
1843
                ToEmbed->setEnabled(false);
1844
                ToSubset->setEnabled(false);
1845
                FromSubset->setEnabled(false);
1846
                for (uint a=0; a < AvailFlist->count(); ++a)
1847
                {
1848
                        if (AvailFlist->item(a)->isSelectable())
1849
                        {
5980 avox 1850
                                if (!AllFonts[AvailFlist->item(a)->text()].subset())
3633 fschmid 1851
                                {
1852
                                        FontsToEmbed.append(AvailFlist->item(a)->text());
1853
                                        EmbedList->insertItem(AvailFlist->item(a)->text());
1854
                                }
1855
                                else
1856
                                {
1857
                                        FontsToSubset.append(AvailFlist->item(a)->text());
1858
                                        SubsetList->insertItem(AvailFlist->item(a)->text());
1859
                                }
1307 fschmid 1860
                        }
1861
                }
1862
        }
1863
}
1864
 
1865
void TabPDFOptions::SubsetAll()
1866
{
1867
        if (SubsetFonts->isChecked())
1868
        {
1869
                EmbedFonts->setChecked(false);
1870
                EmbedList->clear();
1871
                FontsToEmbed.clear();
1872
                SubsetList->clear();
1873
                FontsToSubset.clear();
1874
                FromEmbed->setEnabled(false);
1875
                ToEmbed->setEnabled(false);
1876
                ToSubset->setEnabled(false);
1877
                FromSubset->setEnabled(false);
1878
                for (uint a=0; a < AvailFlist->count(); ++a)
1879
                {
1880
                        if (AvailFlist->item(a)->isSelectable())
1881
                        {
1882
                                FontsToSubset.append(AvailFlist->item(a)->text());
1883
                                SubsetList->insertItem(AvailFlist->item(a)->text());
1884
                        }
1885
                }
1886
        }
1887
}
4256 craig 1888
 
5851 subik 1889
void TabPDFOptions::unitChange(QString unit, int docUnitIndex, int decimals, double invUnitConversion)
4256 craig 1890
{
1891
        double oldMin = -1, oldMax = -1, val = -1;
1892
        int decimalsOld = -1;
5851 subik 1893
 
1894
        BleedBottom->setSuffix(unit);
1895
        BleedTop->setSuffix(unit);
1896
        BleedRight->setSuffix(unit);
1897
        BleedLeft->setSuffix(unit);
6921 fschmid 1898
        markOffset->setSuffix(unit);
5851 subik 1899
 
4256 craig 1900
        BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1901
        BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1902
        BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1903
        BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1904
        BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1905
        BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
1906
        BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1907
        BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
6921 fschmid 1908
        markOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
1909
        markOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
4256 craig 1910
}
6657 cbradney 1911
 
1912
void TabPDFOptions::createPageNumberRange( )
1913
{
1914
        if (doc!=0)
1915
        {
6775 cbradney 1916
                CreateRange cr(PageNr->text(), doc->DocPages.count(), this);
6657 cbradney 1917
                if (cr.exec())
1918
                {
1919
                        CreateRangeData crData;
1920
                        cr.getCreateRangeData(crData);
1921
                        PageNr->setText(crData.pageRange);
1922
                        return;
1923
                }
1924
        }
1925
        PageNr->setText(QString::null);
1926
}