Subversion Repositories Scribus

Rev

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