Subversion Repositories Scribus

Rev

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

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