Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
1307 fschmid 1
/***************************************************************************
2
 *                                                                         *
3
 *   This program is free software; you can redistribute it and/or modify  *
4
 *   it under the terms of the GNU General Public License as published by  *
5
 *   the Free Software Foundation; either version 2 of the License, or     *
6
 *   (at your option) any later version.                                   *
7
 *                                                                         *
8
 ***************************************************************************/
9
#include "tabpdfoptions.h"
10
#include "tabpdfoptions.moc"
11
 
12
#include <qpainter.h>
13
#include "units.h"
1972 craig 14
#include "pdfoptions.h"
2834 cbradney 15
#include "prefsmanager.h"
2688 craig 16
#include "scconfig.h"
1307 fschmid 17
 
18
extern QPixmap loadIcon(QString nam);
19
#ifdef HAVE_CMS
20
extern bool CMSuse;
21
#endif
22
extern bool CMSavail;
23
#include "scribus.h"
24
 
25
 
2834 cbradney 26
 
3205 craig 27
 
1792 cbradney 28
TabPDFOptions::TabPDFOptions(   QWidget* parent, PDFOptions *Optionen, SCFonts &AllFonts,
29
                                                                ProfilesL *PDFXProfiles, QMap<QString,QFont> DocFonts,
30
                                                                QValueList<PDFPresentationData> Eff, int unitIndex,
31
                                                                double PageH, double PageB, ScribusView *vie ) : QTabWidget( parent, "pdf" )
1307 fschmid 32
{
1792 cbradney 33
 
34
        unit = unitGetSuffixFromIndex(unitIndex);
35
        precision = unitGetPrecisionFromIndex(unitIndex);
36
        unitRatio = unitGetRatioFromIndex(unitIndex);
37
 
1307 fschmid 38
        FontsToEmbed.clear();
39
        view = vie;
40
        EffVal = Eff;
41
        Opts = Optionen;
42
        pageH = PageH;
43
        pageB = PageB;
44
        tabGeneral = new QWidget( this, "tabGeneral" );
45
        tabLayout = new QVBoxLayout( tabGeneral );
46
        tabLayout->setSpacing( 5 );
1878 cbradney 47
        tabLayout->setMargin( 0 );
1307 fschmid 48
        Layout13 = new QHBoxLayout( 0, 0, 5, "Layout13");
49
        RangeGroup = new QButtonGroup( tabGeneral, "RangeGroup" );
50
        RangeGroup->setTitle( tr( "Export Range" ) );
51
        RangeGroup->setColumnLayout(0, Qt::Vertical );
52
        RangeGroup->layout()->setSpacing( 5 );
53
        RangeGroup->layout()->setMargin( 10 );
54
        RangeGroupLayout = new QVBoxLayout( RangeGroup->layout() );
55
        RangeGroupLayout->setAlignment( Qt::AlignTop );
56
        AllPages = new QRadioButton( tr( "&All Pages" ), RangeGroup, "AllPages" );
57
        AllPages->setChecked( true );
58
        RangeGroupLayout->addWidget( AllPages );
59
        Layout11 = new QGridLayout( 0, 1, 1, 0, 5, "Layout11");
60
        OnlySome = new QRadioButton( tr( "C&hoose Pages" ), RangeGroup, "OnlySome" );
61
        Layout11->addWidget( OnlySome, 0, 0 );
62
        PageNr = new QLineEdit( RangeGroup, "PageNr" );
63
        PageNr->setEnabled(false);
64
        Layout11->addWidget( PageNr, 1, 0 );
65
        RangeGroupLayout->addLayout( Layout11 );
66
        TextLabel3 = new QLabel( tr( "&Rotation:" ), RangeGroup, "TextLabel3" );
67
        RangeGroupLayout->addWidget( TextLabel3 );
68
        RotateDeg = new QComboBox( true, RangeGroup, "RotateDeg" );
69
        RotateDeg->insertItem(QString::fromUtf8("0 °"));
70
        RotateDeg->insertItem(QString::fromUtf8("90 °"));
71
        RotateDeg->insertItem(QString::fromUtf8("180 °"));
72
        RotateDeg->insertItem(QString::fromUtf8("270 °"));
73
        RotateDeg->setEditable(false);
74
        TextLabel3->setBuddy(RotateDeg);
75
        RotateDeg->setCurrentItem(Optionen->RotateDeg / 90);
76
        RangeGroupLayout->addWidget( RotateDeg );
77
        Layout11a = new QGridLayout( 0, 1, 1, 0, 5, "Layout11a");
78
        MirrorH = new QToolButton( RangeGroup, "MirrorH" );
79
        MirrorH->setPixmap(loadIcon("FlipH.xpm"));
80
        MirrorH->setToggleButton( true );
81
        MirrorH->setOn(Optionen->MirrorH);
82
        Layout11a->addWidget( MirrorH, 0, 0 );
83
        MirrorV = new QToolButton( RangeGroup, "MirrorH" );
84
        MirrorV->setPixmap(loadIcon("FlipV.xpm"));
85
        MirrorV->setToggleButton( true );
86
        MirrorV->setOn(Optionen->MirrorV);
87
        Layout11a->addWidget( MirrorV, 0, 1 );
88
        RangeGroupLayout->addLayout( Layout11a );
89
        Layout13->addWidget( RangeGroup );
90
 
91
        GroupBox1 = new QGroupBox( tr( "File Options" ), tabGeneral, "GroupBox1" );
92
        GroupBox1->setColumnLayout(0, Qt::Vertical );
93
        GroupBox1->layout()->setSpacing( 0 );
94
        GroupBox1->layout()->setMargin( 0 );
95
        GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
96
        GroupBox1Layout->setAlignment( Qt::AlignTop );
97
        GroupBox1Layout->setSpacing( 5 );
98
        GroupBox1Layout->setMargin( 10 );
99
        TextLabel1 = new QLabel( tr( "Compatibilit&y:" ), GroupBox1, "TextLabel1" );
100
        TextLabel1->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
101
        GroupBox1Layout->addWidget( TextLabel1, 0, 0 );
1973 craig 102
        PDFVersionCombo = new QComboBox( true, GroupBox1, "PDFVersionCombo" );
103
        PDFVersionCombo->setEditable(false);
104
        TextLabel1->setBuddy(PDFVersionCombo);
2578 craig 105
        PDFVersionCombo->insertItem("PDF 1.3");
106
        PDFVersionCombo->insertItem("PDF 1.4");
107
        PDFVersionCombo->insertItem("PDF 1.5");
1307 fschmid 108
#ifdef HAVE_CMS
109
        if ((CMSuse) && (CMSavail) && (!PDFXProfiles->isEmpty()))
1973 craig 110
                PDFVersionCombo->insertItem("PDF/X-3");
1307 fschmid 111
        if ((CMSuse) && (CMSavail))
112
        {
1973 craig 113
                if (Optionen->Version == PDFOptions::PDFVersion_X3)
114
                        PDFVersionCombo->setCurrentItem(3);
1307 fschmid 115
        }
116
        else
1973 craig 117
                PDFVersionCombo->setCurrentItem(0);
1365 cbradney 118
        cms = CMSuse && CMSavail;
119
#else
120
        cms = false;
1307 fschmid 121
#endif
1973 craig 122
        if (Optionen->Version == PDFOptions::PDFVersion_13)
123
                PDFVersionCombo->setCurrentItem(0);
124
        if (Optionen->Version == PDFOptions::PDFVersion_14)
125
                PDFVersionCombo->setCurrentItem(1);
126
        if (Optionen->Version == PDFOptions::PDFVersion_15)
127
                PDFVersionCombo->setCurrentItem(2);
2439 cbradney 128
        GroupBox1Layout->addMultiCellWidget( PDFVersionCombo, 0, 0, 1, 2 );
1307 fschmid 129
        TextLabel1x = new QLabel( tr( "&Binding:" ), GroupBox1, "TextLabel1" );
130
        TextLabel1x->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
131
        GroupBox1Layout->addWidget( TextLabel1x, 1, 0 );
132
        ComboBind = new QComboBox( true, GroupBox1, "ComboBind" );
133
        ComboBind->insertItem( tr("Left Margin"));
134
        ComboBind->insertItem( tr("Right Margin"));
135
        ComboBind->setEditable(false);
136
        ComboBind->setCurrentItem(Optionen->Binding);
137
        TextLabel1x->setBuddy(ComboBind);
2439 cbradney 138
        GroupBox1Layout->addMultiCellWidget( ComboBind, 1, 1, 1, 2 );
1307 fschmid 139
        CheckBox1 = new QCheckBox( tr( "Generate &Thumbnails" ), GroupBox1, "CheckBox1" );
140
        CheckBox1->setChecked(Optionen->Thumbnails);
141
        GroupBox1Layout->addMultiCellWidget( CheckBox1, 2, 2, 0, 2 );
142
        Article = new QCheckBox( tr( "Save &Linked Text Frames as PDF Articles" ), GroupBox1, "CheckBox1" );
143
        Article->setChecked(Optionen->Articles);
144
        GroupBox1Layout->addMultiCellWidget( Article, 3, 3, 0, 2 );
145
        CheckBM = new QCheckBox( tr( "&Include Bookmarks" ), GroupBox1, "E" );
146
        CheckBM->setChecked(Optionen->Bookmarks);
147
        GroupBox1Layout->addMultiCellWidget( CheckBM, 4, 4, 0, 2 );
1738 fschmid 148
        useLayers = new QCheckBox( tr( "Include Layers" ), GroupBox1, "LI" );
149
        useLayers->setChecked(Optionen->useLayers);
150
        GroupBox1Layout->addMultiCellWidget( useLayers, 5, 5, 0, 2 );
151
        if (Optionen->Version == 15)
152
                useLayers->setEnabled(true);
153
        else
154
                useLayers->setEnabled(false);
1307 fschmid 155
        Resolution = new QSpinBox( GroupBox1, "Resolution" );
156
        Resolution->setMaxValue( 4000 );
157
        Resolution->setMinValue( 35 );
158
        Resolution->setValue(Optionen->Resolution);
159
        Resolution->setSuffix( tr( " dpi" ) );
1799 cbradney 160
        TextLabel2 = new QLabel( Resolution, tr( "&Resolution for EPS Graphics:" ), GroupBox1, "TextLabel2" );
1307 fschmid 161
        TextLabel2->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
1738 fschmid 162
        GroupBox1Layout->addWidget( TextLabel2, 6, 0 );
163
        GroupBox1Layout->addWidget( Resolution, 6, 1, AlignLeft );
1307 fschmid 164
        Layout13->addWidget( GroupBox1 );
165
        tabLayout->addLayout( Layout13 );
166
        Compression = new QCheckBox( tr( "Com&press Text and Vector Graphics" ), tabGeneral, "Compression" );
167
        Compression->setChecked( Optionen->Compress );
168
        tabLayout->addWidget( Compression );
169
        CBox = new QGroupBox( tr( "Image Settings" ), tabGeneral, "CBox" );
170
        CBox->setColumnLayout(0, Qt::Vertical );
171
        CBox->layout()->setSpacing( 5 );
172
        CBox->layout()->setMargin( 11 );
173
        CBoxLayout = new QGridLayout( CBox->layout() );
174
        CBoxLayout->setAlignment( Qt::AlignTop );
175
        CMethod = new QComboBox( true, CBox, "CMethod" );
176
        CMethod->clear();
177
        CMethod->insertItem( tr( "Automatic" ) );
178
        CMethod->insertItem( tr( "JPEG" ) );
179
        CMethod->insertItem( tr( "Zip" ) );
180
        CMethod->insertItem( tr( "None" ) );
181
        CMethod->setEditable(false);
182
        CMethod->setCurrentItem(Optionen->CompressMethod);
183
        TextCom1 = new QLabel( CMethod, tr( "&Method:" ), CBox, "TextCom1" );
184
        CBoxLayout->addWidget( TextCom1, 0, 0 );        CBoxLayout->addWidget( CMethod, 0, 1 );
185
        TextCom2 = new QLabel( tr( "&Quality:" ), CBox, "TextCom2" );
186
        CBoxLayout->addWidget( TextCom2, 1, 0 );
187
        CQuality = new QComboBox( true, CBox, "CQuality" );
188
        CQuality->clear();
189
        CQuality->insertItem( tr( "Maximum" ) );
190
        CQuality->insertItem( tr( "High" ) );
191
        CQuality->insertItem( tr( "Medium" ) );
192
        CQuality->insertItem( tr( "Low" ) );
193
        CQuality->insertItem( tr( "Minimum" ) );
194
        CQuality->setEditable(false);
195
        CQuality->setCurrentItem(Optionen->Quality);
196
        TextCom2->setBuddy(CQuality);
197
        CBoxLayout->addWidget( CQuality, 1, 1 );
1798 fschmid 198
        DSColor = new QCheckBox( tr( "Resample Images to:" ), CBox, "DSColor" );
1307 fschmid 199
        DSColor->setChecked(Optionen->RecalcPic);
200
        CBoxLayout->addWidget( DSColor, 2, 0 );
201
        ValC = new QSpinBox( CBox, "ValC" );
202
        ValC->setSuffix( tr( " dpi" ) );
203
        ValC->setMaxValue( 4000 );
204
        ValC->setMinValue( 35 );
205
        ValC->setValue(Optionen->PicRes);
206
        ValC->setEnabled(DSColor->isChecked() ? true : false);
207
        CBoxLayout->addWidget( ValC, 2, 1, AlignLeft );
208
        tabLayout->addWidget( CBox );
209
        insertTab( tabGeneral, tr( "&General" ) );
210
        if (vie != 0)
211
        {
212
                tabFonts = new QWidget( this, "tabFonts" );
213
                tabLayout_3 = new QVBoxLayout( tabFonts );
214
                tabLayout_3->setSpacing( 5 );
215
                tabLayout_3->setMargin( 11 );
216
                EmbedFonts = new QCheckBox( tr( "&Embed all Fonts" ), tabFonts, "EmbedFonts" );
217
                tabLayout_3->addWidget( EmbedFonts );
218
                SubsetFonts = new QCheckBox( tr( "&Subset all Fonts" ), tabFonts, "SubsetFonts" );
219
                tabLayout_3->addWidget( SubsetFonts );
220
                GroupFont = new QGroupBox( tr( "Embedding" ), tabFonts, "GroupFont" );
221
                GroupFont->setColumnLayout(0, Qt::Vertical );
222
                GroupFont->layout()->setSpacing( 0 );
223
                GroupFont->layout()->setMargin( 0 );
224
                GroupFontLayout = new QHBoxLayout( GroupFont->layout() );
225
                GroupFontLayout->setAlignment( Qt::AlignTop );
226
                GroupFontLayout->setSpacing( 5 );
227
                GroupFontLayout->setMargin( 10 );
228
                Layout4_2 = new QVBoxLayout;
229
                Layout4_2->setSpacing( 5 );
230
                Layout4_2->setMargin( 0 );
231
                TextFont1 = new QLabel( tr( "Available Fonts:" ), GroupFont, "TextFont1" );
232
                Layout4_2->addWidget( TextFont1 );
233
                AvailFlist = new QListBox( GroupFont, "AvailFlist" );
234
                QMap<QString,QFont>::Iterator it;
235
                for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
236
                {
2295 cbradney 237
                        if (AllFonts[it.key()]->typeCode == Foi::TYPE1)
1338 fschmid 238
                                AvailFlist->insertItem(loadIcon("font_type1_16.png"), it.key());
2295 cbradney 239
                        else if (AllFonts[it.key()]->typeCode == Foi::TTF)
1338 fschmid 240
                                AvailFlist->insertItem(loadIcon("font_truetype16.png"), it.key());
2295 cbradney 241
                        else if (AllFonts[it.key()]->typeCode == Foi::OTF)
1338 fschmid 242
                                AvailFlist->insertItem(loadIcon("font_otf16.png"), it.key());
1307 fschmid 243
                }
244
                AvailFlist->setMinimumSize(QSize(150, 140));
245
                Layout4_2->addWidget( AvailFlist );
246
                GroupFontLayout->addLayout( Layout4_2 );
247
                Layout5_2 = new QVBoxLayout;
248
                Layout5_2->setSpacing( 5 );
249
                Layout5_2->setMargin( 0 );
1321 fschmid 250
                QSpacerItem* spacerS3a = new QSpacerItem( 20, 30, QSizePolicy::Minimum, QSizePolicy::Minimum );
251
                Layout5_2->addItem( spacerS3a );
1307 fschmid 252
                ToEmbed = new QPushButton( tr( "&>>" ), GroupFont, "ToEmbed" );
253
                ToEmbed->setEnabled(false);
254
                Layout5_2->addWidget( ToEmbed );
255
                FromEmbed = new QPushButton( tr( "&<<" ), GroupFont, "FromEmbed" );
256
                FromEmbed->setEnabled(false);
257
                Layout5_2->addWidget( FromEmbed );
1321 fschmid 258
                QSpacerItem* spacerS3 = new QSpacerItem( 20, 30, QSizePolicy::Minimum, QSizePolicy::Expanding );
259
                Layout5_2->addItem( spacerS3 );
1307 fschmid 260
                GroupFontLayout->addLayout( Layout5_2 );
261
                Layout6 = new QVBoxLayout;
262
                Layout6->setSpacing( 5 );
263
                Layout6->setMargin( 0 );
264
                TextFont1_2 = new QLabel( tr( "Fonts to embed:" ), GroupFont, "TextFont1_2" );
265
                Layout6->addWidget( TextFont1_2 );
266
                EmbedList = new QListBox( GroupFont, "EmbedList" );
267
                EmbedList->setMinimumSize(QSize(150, 40));
268
                Layout6->addWidget( EmbedList );
269
 
270
                Layout5_2a = new QHBoxLayout;
271
                Layout5_2a->setSpacing( 5 );
272
                Layout5_2a->setMargin( 0 );
273
                QSpacerItem* spacerS1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
274
                Layout5_2a->addItem( spacerS1 );
275
                ToSubset = new QPushButton( "", GroupFont, "ToSubset" );
276
                ToSubset->setPixmap(loadIcon("down.png"));
277
                ToSubset->setEnabled(false);
278
                Layout5_2a->addWidget( ToSubset );
279
                FromSubset = new QPushButton( "", GroupFont, "FromSubset" );
280
                FromSubset->setPixmap(loadIcon("up.png"));
281
                FromSubset->setEnabled(false);
282
                Layout5_2a->addWidget( FromSubset );
283
                QSpacerItem* spacerS2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
284
                Layout5_2a->addItem( spacerS2 );
285
                Layout6->addLayout( Layout5_2a );
286
                TextFont1_2a = new QLabel( tr( "Fonts to subset:" ), GroupFont, "TextFont1_2a" );
287
                Layout6->addWidget( TextFont1_2a );
288
                SubsetList = new QListBox( GroupFont, "SubsetList" );
289
                SubsetList->setMinimumSize(QSize(150, 40));
290
                Layout6->addWidget( SubsetList );
291
                if ((Optionen->EmbedList.count() == 0) && (Optionen->SubsetList.count() == 0))
292
                {
293
                        EmbedFonts->setChecked(true);
294
                        EmbedAll();
295
                }
296
                else
297
                {
298
                        for (uint fe = 0; fe < Optionen->EmbedList.count(); ++fe)
299
                        {
300
                                EmbedList->insertItem(Optionen->EmbedList[fe]);
301
                                FontsToEmbed.append(Optionen->EmbedList[fe]);
302
                        }
303
                }
304
                if (Optionen->SubsetList.count() != 0)
305
                {
306
                        for (uint fe = 0; fe < Optionen->SubsetList.count(); ++fe)
307
                        {
308
                                SubsetList->insertItem(Optionen->SubsetList[fe]);
309
                                FontsToSubset.append(Optionen->SubsetList[fe]);
310
                        }
311
                }
312
                GroupFontLayout->addLayout( Layout6 );
313
                tabLayout_3->addWidget( GroupFont );
314
                insertTab( tabFonts, tr( "&Fonts" ) );
315
                tabPresentation = new QWidget( this, "tabPresentation" );
316
                tabLayout_5 = new QGridLayout( tabPresentation );
317
                tabLayout_5->setSpacing( 5 );
318
                tabLayout_5->setMargin( 11 );
319
                CheckBox10 = new QCheckBox( tr( "Enable &Presentation Effects" ), tabPresentation, "CheckBox10" );
320
                CheckBox10->setChecked(Optionen->PresentMode);
321
                tabLayout_5->addMultiCellWidget( CheckBox10, 0, 0, 0, 1 );
322
                Pages = new QListBox( tabPresentation, "Pages" );
323
                Pages->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, Pages->sizePolicy().hasHeightForWidth() ) );
324
                QString tmp;
325
                struct PDFPresentationData ef;
326
                if (EffVal.count() != 0)
327
                {
328
                        for (uint pg2 = 0; pg2 < view->Doc->Pages.count(); ++pg2)
329
                        {
330
                                Pages->insertItem( tr("Page")+" "+tmp.setNum(pg2+1));
331
                                if (EffVal.count()-1 < pg2)
332
                                {
333
                                        ef.pageEffectDuration = 1;
334
                                        ef.pageViewDuration = 1;
335
                                        ef.effectType = 0;
336
                                        ef.Dm = 0;
337
                                        ef.M = 0;
338
                                        ef.Di = 0;
339
                                        EffVal.append(ef);
340
                                }
341
                        }
342
                }
343
                else
344
                {
345
                        for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
346
                        {
347
                                Pages->insertItem( tr("Page")+" "+tmp.setNum(pg+1));
348
                                ef.pageEffectDuration = 1;
349
                                ef.pageViewDuration = 1;
350
                                ef.effectType = 0;
351
                                ef.Dm = 0;
352
                                ef.M = 0;
353
                                ef.Di = 0;
354
                                EffVal.append(ef);
355
                        }
356
                }
357
                tabLayout_5->addWidget( Pages, 1, 0 );
358
                PagePrev = new QCheckBox( tr( "Show Page Pre&views" ), tabPresentation, "CheckBox10" );
359
                PagePrev->setChecked(false);
360
                tabLayout_5->addWidget( PagePrev, 2, 0 );
361
                Effects = new QGroupBox( tr( "Effects" ), tabPresentation, "Effects" );
362
                Effects->setColumnLayout(0, Qt::Vertical );
363
                Effects->layout()->setSpacing( 0 );
364
                Effects->layout()->setMargin( 0 );
365
                EffectsLayout = new QGridLayout( Effects->layout() );
366
                EffectsLayout->setAlignment( Qt::AlignTop );
367
                EffectsLayout->setSpacing( 5 );
368
                EffectsLayout->setMargin( 11 );
369
                TextLabel1e = new QLabel( tr( "&Display Duration:" ), Effects, "TextLabel1_2" );
370
                EffectsLayout->addWidget( TextLabel1e, 0, 0 );
371
                TextLabel2e = new QLabel( tr( "Effec&t Duration:" ), Effects, "TextLabel2_2" );
372
                EffectsLayout->addWidget( TextLabel2e, 1, 0 );
373
                TextLabel3e = new QLabel( tr( "Effect T&ype:" ), Effects, "TextLabel3_2" );
374
                EffectsLayout->addWidget( TextLabel3e, 2, 0 );
375
                TextLabel4e = new QLabel( tr( "&Moving Lines:" ), Effects, "TextLabel4_2" );
376
                EffectsLayout->addWidget( TextLabel4e, 3, 0 );
377
                TextLabel5e = new QLabel( tr( "F&rom the:" ), Effects, "TextLabel6" );
378
                EffectsLayout->addWidget( TextLabel5e, 4, 0 );
379
                TextLabel6e = new QLabel( tr( "D&irection:" ), Effects, "TextLabel5" );
380
                EffectsLayout->addWidget( TextLabel6e, 5, 0 );
381
                PageTime = new QSpinBox( Effects, "PageTime" );
382
                PageTime->setSuffix( tr( " sec" ) );
383
                PageTime->setMaxValue( 3600 );
384
                PageTime->setMinValue( 1 );
385
                PageTime->setValue(EffVal[0].pageViewDuration);
386
                TextLabel1e->setBuddy(PageTime);
387
                EffectsLayout->addWidget( PageTime, 0, 1 );
388
                EffectTime = new QSpinBox( Effects, "EffectTime" );
389
                EffectTime->setSuffix( tr( " sec" ) );
390
                EffectTime->setMaxValue( 3600 );
391
                EffectTime->setMinValue( 1 );
392
                EffectTime->setValue(EffVal[0].pageEffectDuration);
393
                TextLabel2e->setBuddy(EffectTime);
394
                EffectsLayout->addWidget( EffectTime, 1, 1 );
395
                EffectType = new QComboBox( true, Effects, "EffectType" );
396
                QString tmpc[] = { tr("No Effect"), tr("Blinds"), tr("Box"), tr("Dissolve"), tr("Glitter"), tr("Split"), tr("Wipe")};
397
                size_t ar = sizeof(tmpc) / sizeof(*tmpc);
398
                for (uint a = 0; a < ar; ++a)
399
                        EffectType->insertItem(tmpc[a]);
400
                EffectType->setEditable(false);
401
                TextLabel3e->setBuddy(EffectType);
402
                EffectsLayout->addWidget( EffectType, 2, 1 );
403
                EDirection = new QComboBox( true, Effects, "EDirection" );
404
                EDirection->insertItem( tr( "Horizontal" ) );
405
                EDirection->insertItem( tr( "Vertical" ) );
406
                EDirection->setEditable(false);
407
                TextLabel4e->setBuddy(EDirection);
408
                EffectsLayout->addWidget( EDirection, 3, 1 );
409
                EDirection_2 = new QComboBox( true, Effects, "EDirection_2" );
410
                EDirection_2->insertItem( tr( "Inside" ) );
411
                EDirection_2->insertItem( tr( "Outside" ) );
412
                EDirection_2->setEditable(false);
413
                TextLabel5e->setBuddy(EDirection_2);
414
                EffectsLayout->addWidget( EDirection_2, 4, 1 );
415
                EDirection_2_2 = new QComboBox( true, Effects, "EDirection_2_2" );
416
                QString tmp_ed[] = { tr("Left to Right"), tr("Top to Bottom"), tr("Bottom to Top"), tr("Right to Left"),
417
                                                        tr("Top-left to Bottom-Right")};
418
                size_t ar_ed = sizeof(tmp_ed) / sizeof(*tmp_ed);
419
                for (uint a = 0; a < ar_ed; ++a)
420
                        EDirection_2_2->insertItem(tmp_ed[a]);
421
                EDirection_2_2->setEditable(false);
422
                TextLabel6e->setBuddy(EDirection_2_2);
423
                EffectsLayout->addWidget( EDirection_2_2, 5, 1 );
424
                EonAllPg = new QPushButton( tr( "&Apply Effect on all Pages" ), Effects, "Eon" );
425
                EffectsLayout->addMultiCellWidget( EonAllPg, 6, 6, 0, 1 );
426
                tabLayout_5->addMultiCellWidget( Effects, 1, 2, 1, 1 );
427
                insertTab( tabPresentation, tr( "E&xtras" ) );
428
        }
429
        tabSecurity = new QWidget( this, "tabSecurity" );
430
        tabSecurityLayout = new QVBoxLayout( tabSecurity, 11, 5, "tabSecurityLayout");
431
        Encry = new QCheckBox( tr( "&Use Encryption" ), tabSecurity, "Enc" );
432
        Encry->setChecked( Optionen->Encrypt );
433
        tabSecurityLayout->addWidget( Encry );
434
        GroupPass = new QGroupBox( tr( "Passwords" ), tabSecurity, "GroupPass" );
435
        GroupPass->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0,
436
                                               GroupPass->sizePolicy().hasHeightForWidth() ) );
437
        GroupPass->setColumnLayout(0, Qt::Vertical );
438
        GroupPass->layout()->setSpacing( 5 );
439
        GroupPass->layout()->setMargin( 10 );
440
        GroupPassLayout = new QGridLayout( GroupPass->layout() );
441
        GroupPassLayout->setAlignment( Qt::AlignTop );
442
        TextSec2 = new QLabel( tr( "&User:" ), GroupPass, "TextSec2" );
443
        GroupPassLayout->addWidget( TextSec2, 1, 0 );
444
        TextSec1 = new QLabel( tr( "&Owner:" ), GroupPass, "TextSec1" );
445
        GroupPassLayout->addWidget( TextSec1, 0, 0 );
446
        PassOwner = new QLineEdit( GroupPass, "PassOwner" );
447
        PassOwner->setEchoMode( QLineEdit::Password );
448
        PassOwner->setText(Optionen->PassOwner);
449
        TextSec1->setBuddy(PassOwner);
450
        GroupPassLayout->addWidget( PassOwner, 0, 1 );
451
        PassUser = new QLineEdit( GroupPass, "PassUser" );
452
        PassUser->setEchoMode( QLineEdit::Password );
453
        PassUser->setText(Optionen->PassUser);
454
        TextSec2->setBuddy(PassUser);
455
        GroupPassLayout->addWidget( PassUser, 1, 1 );
456
        tabSecurityLayout->addWidget( GroupPass );
457
 
458
        GroupSecSet = new QGroupBox( tr( "Settings" ), tabSecurity, "GroupSecSet" );
459
        GroupSecSet->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0,
460
                                    GroupSecSet->sizePolicy().hasHeightForWidth() ) );
461
        GroupSecSet->setColumnLayout(0, Qt::Vertical );
462
        GroupSecSet->layout()->setSpacing( 5 );
463
        GroupSecSet->layout()->setMargin( 10 );
464
        GroupSecSetLayout = new QVBoxLayout( GroupSecSet->layout() );
465
        GroupSecSetLayout->setAlignment( Qt::AlignTop );
466
        PrintSec = new QCheckBox( tr( "Allow &Printing the Document" ), GroupSecSet, "PrintSec" );
467
        PrintSec->setChecked( Optionen->Permissions & 4 );
468
        GroupSecSetLayout->addWidget( PrintSec );
469
        ModifySec = new QCheckBox( tr( "Allow &Changing the Document" ), GroupSecSet, "ModifySec" );
470
        ModifySec->setChecked( Optionen->Permissions & 8 );
471
        GroupSecSetLayout->addWidget( ModifySec );
472
        CopySec = new QCheckBox( tr( "Allow Cop&ying Text and Graphics" ), GroupSecSet, "CopySec" );
473
        CopySec->setChecked( Optionen->Permissions & 16 );
474
        GroupSecSetLayout->addWidget( CopySec );
475
        AddSec = new QCheckBox( tr( "Allow Adding &Annotations and Fields" ), GroupSecSet, "AddSec" );
476
        AddSec->setChecked( Optionen->Permissions & 32 );
477
        GroupSecSetLayout->addWidget( AddSec );
478
        tabSecurityLayout->addWidget( GroupSecSet );
479
        if (!Encry->isChecked())
480
        {
481
                GroupSecSet->setEnabled(false);
482
                GroupPass->setEnabled(false);
483
        }
484
        insertTab( tabSecurity, tr( "S&ecurity" ) );
485
 
486
        tabColor = new QWidget( this, "tabColor" );
487
        tabColorLayout = new QVBoxLayout( tabColor, 11, 5, "tabColorLayout");
488
        ColorGroup = new QGroupBox( tr( "General" ), tabColor, "ColorGroup" );
489
        ColorGroup->setColumnLayout(0, Qt::Vertical );
490
        ColorGroup->layout()->setSpacing( 5 );
491
        ColorGroup->layout()->setMargin( 10 );
492
        ColorGroupLayout = new QHBoxLayout( ColorGroup->layout() );
493
        ColorGroupLayout->setAlignment( Qt::AlignTop );
494
        ColorText1 = new QLabel( tr( "Output &Intended For:" ), ColorGroup, "ColorText1" );
495
        ColorGroupLayout->addWidget( ColorText1 );
496
        OutCombo = new QComboBox( true, ColorGroup, "OutCombo" );
497
        OutCombo->insertItem( tr( "Screen / Web" ) );
498
        OutCombo->insertItem( tr( "Printer" ) );
1476 fschmid 499
        OutCombo->insertItem( tr( "Grayscale" ) );
1307 fschmid 500
        OutCombo->setEditable(false);
1476 fschmid 501
        if (Optionen->UseRGB)
502
                OutCombo->setCurrentItem(0);
503
        else
504
        {
505
                if (Optionen->isGrayscale)
506
                        OutCombo->setCurrentItem(2);
507
                else
508
                        OutCombo->setCurrentItem(1);
509
        }
1307 fschmid 510
        ColorText1->setBuddy(OutCombo);
511
        ColorGroupLayout->addWidget( OutCombo );
512
        tabColorLayout->addWidget( ColorGroup );
513
 
3079 fschmid 514
        useSpot = new QCheckBox( tr( "Convert Spot Colors to Process Colors" ), tabColor, "useSpot" );
515
        useSpot->setChecked(!Optionen->UseSpotColors);
516
        tabColorLayout->addWidget( useSpot );
517
 
1307 fschmid 518
        UseLPI = new QCheckBox( tr( "&Use Custom Rendering Settings" ), tabColor, "UseLPI" );
519
        UseLPI->setChecked(Optionen->UseLPI);
520
        tabColorLayout->addWidget( UseLPI );
521
        LPIgroup = new QGroupBox( tr( "Rendering Settings" ), tabColor, "LPIgroup" );
522
        LPIgroup->setColumnLayout(0, Qt::Vertical );
523
        LPIgroup->layout()->setSpacing( 5 );
524
        LPIgroup->layout()->setMargin( 10 );
525
        LPIgroupLayout = new QGridLayout( LPIgroup->layout() );
526
        LPIgroupLayout->setAlignment( Qt::AlignTop );
527
        LPIcolor = new QComboBox( true, LPIgroup, "LPIcolor" );
528
        LPIcolor->setEditable(false);
529
        QMap<QString,LPIData>::Iterator itlp;
530
        for (itlp = Optionen->LPISettings.begin(); itlp != Optionen->LPISettings.end(); ++itlp)
531
        {
532
                LPIcolor->insertItem( itlp.key() );
533
        }
534
        LPIcolor->setCurrentItem(0);
535
        LPIgroupLayout->addWidget( LPIcolor, 0, 0 );
536
        textLPI1 = new QLabel( tr( "Fre&quency:" ), LPIgroup, "textLPI1" );
537
        LPIgroupLayout->addWidget( textLPI1, 0, 1 );
538
        LPIfreq = new QSpinBox( LPIgroup, "LPIfreq" );
539
        LPIfreq->setMinValue(10);
540
        LPIfreq->setMaxValue(1000);
541
        LPIfreq->setValue(Optionen->LPISettings[LPIcolor->currentText()].Frequency);
542
        textLPI1->setBuddy(LPIfreq);
543
        LPIgroupLayout->addWidget( LPIfreq, 0, 2 );
544
        textLPI2 = new QLabel( tr( "&Angle:" ), LPIgroup, "textLPI2" );
545
        LPIgroupLayout->addWidget( textLPI2, 1, 1 );
546
        LPIangle = new QSpinBox( LPIgroup, "LPIangle" );
547
        LPIangle->setSuffix( QString::fromUtf8(" °"));
548
        LPIangle->setMinValue(-180);
549
        LPIangle->setMaxValue(180);
550
        LPIangle->setValue(Optionen->LPISettings[LPIcolor->currentText()].Angle);
551
        textLPI2->setBuddy(LPIangle);
552
        LPIgroupLayout->addWidget( LPIangle, 1, 2 );
553
        textLPI3 = new QLabel( tr( "S&pot Function:" ), LPIgroup, "textLPI3" );
554
        LPIgroupLayout->addWidget( textLPI3, 2, 1 );
555
        LPIfunc = new QComboBox( true, LPIgroup, "LPIfunc" );
556
        LPIfunc->setEditable(false);
557
        LPIfunc->insertItem( tr( "Simple Dot" ) );
558
        LPIfunc->insertItem( tr( "Line" ) );
559
        LPIfunc->insertItem( tr( "Round" ) );
560
        LPIfunc->insertItem( tr( "Ellipse" ) );
561
        LPIfunc->setCurrentItem(Optionen->LPISettings[LPIcolor->currentText()].SpotFunc);
562
        textLPI3->setBuddy(LPIfunc);
563
        LPIgroupLayout->addWidget( LPIfunc, 2, 2 );
564
        tabColorLayout->addWidget( LPIgroup );
565
        SelLPIcolor = LPIcolor->currentText();
566
 
567
        GroupBox9 = new QGroupBox( tr( "Solid Colors:" ), tabColor, "GroupBox9" );
568
        GroupBox9->setColumnLayout(0, Qt::Vertical );
569
        GroupBox9->layout()->setSpacing( 5 );
570
        GroupBox9->layout()->setMargin( 10 );
571
        GroupBox9Layout = new QGridLayout( GroupBox9->layout() );
572
        GroupBox9Layout->setAlignment( Qt::AlignTop );
573
        EmbedProfs = new QCheckBox( GroupBox9, "EmbedProfs" );
574
        EmbedProfs->setText( tr( "Use ICC Profile" ) );
575
        EmbedProfs->setChecked(Optionen->UseProfiles);
576
        GroupBox9Layout->addMultiCellWidget( EmbedProfs, 0, 0, 0, 1 );
577
        ProfsTxt1 = new QLabel(GroupBox9, "ProfsTxt1");
578
        ProfsTxt1->setText( tr( "Profile:" ) );
579
        GroupBox9Layout->addWidget( ProfsTxt1, 1, 0 );
580
        ProfsTxt2 = new QLabel( GroupBox9, "ProfsTxt2_2" );
581
        ProfsTxt2->setText( tr( "Rendering-Intent:" ) );
582
        GroupBox9Layout->addWidget( ProfsTxt2, 1, 1 );
583
        SolidPr = new QComboBox(true, GroupBox9, "SolidPr" );
584
        SolidPr->setEditable(false);
585
        GroupBox9Layout->addWidget( SolidPr, 2, 0 );
586
        IntendS = new QComboBox( true, GroupBox9, "IntendS" );
587
        QString tmp_ip[] = { tr("Perceptual"), tr("Relative Colorimetric"), tr("Saturation"), tr("Absolute Colorimetric")};
588
        size_t ar_ip = sizeof(tmp_ip) / sizeof(*tmp_ip);
589
        for (uint a = 0; a < ar_ip; ++a)
590
                IntendS->insertItem(tmp_ip[a]);
591
        IntendS->setEditable(false);
592
        GroupBox9Layout->addWidget( IntendS, 2, 1 );
593
        tabColorLayout->addWidget( GroupBox9 );
594
        ProfsGroup = new QGroupBox( tr( "Images:" ), tabColor, "ProfsGroup" );
595
        ProfsGroup->setColumnLayout(0, Qt::Vertical );
596
        ProfsGroup->layout()->setSpacing( 5 );
597
        ProfsGroup->layout()->setMargin( 10 );
598
        ProfsGroupLayout = new QGridLayout( ProfsGroup->layout() );
599
        ProfsGroupLayout->setAlignment( Qt::AlignTop );
600
        EmbedProfs2 = new QCheckBox( tr( "Use ICC Profile" ), ProfsGroup, "EmbedProfs" );
601
        EmbedProfs2->setChecked(Optionen->UseProfiles2);
602
        ProfsGroupLayout->addMultiCellWidget( EmbedProfs2, 0, 0, 0, 1 );
603
        NoEmbedded = new QCheckBox( ProfsGroup, "NoEmbedded" );
604
        NoEmbedded->setText( tr( "Don't use embedded ICC profiles" ) );
605
        NoEmbedded->setChecked(Optionen->EmbeddedI);
606
        ProfsGroupLayout->addMultiCellWidget( NoEmbedded, 1, 1, 0, 1 );
607
        ProfsTxt3 = new QLabel( ProfsGroup, "ProfsTxt3" );
608
        ProfsTxt3->setText( tr( "Profile:" ) );
609
        ProfsGroupLayout->addWidget( ProfsTxt3, 2, 0 );
610
        ProfsTxt4 = new QLabel( ProfsGroup, "ProfsTxt2_2" );
611
        ProfsTxt4->setText( tr( "Rendering-Intent:" ) );
612
        ProfsGroupLayout->addWidget( ProfsTxt4, 2, 1 );
613
        ImageP = new QComboBox( true, ProfsGroup, "ImageP" );
614
        ImageP->setEditable(false);
615
        ProfsGroupLayout->addWidget( ImageP, 3, 0 );
616
        IntendI = new QComboBox( true, ProfsGroup, "IntendS" );
617
        for (uint a = 0; a < ar_ip; ++a)
618
                IntendI->insertItem(tmp_ip[a]);
619
        IntendI->setEditable(false);
620
        ProfsGroupLayout->addWidget( IntendI, 3, 1 );
621
        tabColorLayout->addWidget( ProfsGroup );
1476 fschmid 622
        if ((Optionen->UseRGB) || (Optionen->isGrayscale))
1307 fschmid 623
        {
624
                ProfsGroup->setEnabled(false);
625
                GroupBox9->setEnabled(false);
1476 fschmid 626
                EnablePr(0);
1307 fschmid 627
        }
1476 fschmid 628
        else
629
                EnablePr(1);
1307 fschmid 630
        EnablePG();
631
        EnablePGI();
632
#ifdef HAVE_CMS
633
 
634
        QString tp = Optionen->SolidProf;
2891 cbradney 635
        if (!ScApp->InputProfiles.contains(tp))
1307 fschmid 636
        {
637
                if (vie != 0)
2984 fschmid 638
                        tp = vie->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 639
                else
2984 fschmid 640
                        tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 641
        }
642
        ProfilesL::Iterator itp;
2891 cbradney 643
        ProfilesL::Iterator itpend=ScApp->InputProfiles.end();
644
        for (itp = ScApp->InputProfiles.begin(); itp != itpend; ++itp)
1307 fschmid 645
        {
646
                SolidPr->insertItem(itp.key());
647
                if (itp.key() == tp)
648
                {
649
                        if ((CMSuse) && (CMSavail))
650
                                SolidPr->setCurrentItem(SolidPr->count()-1);
651
                }
652
        }
653
        if ((CMSuse) && (CMSavail))
654
                IntendS->setCurrentItem(Optionen->Intent);
655
        QString tp1 = Optionen->ImageProf;
2891 cbradney 656
        if (!ScApp->InputProfiles.contains(tp1))
1307 fschmid 657
        {
658
                if (vie != 0)
2984 fschmid 659
                        tp1 = vie->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 660
                else
2984 fschmid 661
                        tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 662
        }
2891 cbradney 663
        ProfilesL::Iterator itp2;
664
        ProfilesL::Iterator itp2end=ScApp->InputProfiles.end();
665
        for (itp2 = ScApp->InputProfiles.begin(); itp2 != itp2end; ++itp2)
1307 fschmid 666
        {
667
                ImageP->insertItem(itp2.key());
668
                if (itp2.key() == tp1)
669
                {
670
                        if ((CMSuse) && (CMSavail))
671
                                ImageP->setCurrentItem(ImageP->count()-1);
672
                }
673
        }
674
        if ((CMSuse) && (CMSavail))
675
                IntendI->setCurrentItem(Optionen->Intent2);
676
        if ((!CMSuse) || (!CMSavail))
677
        {
678
                GroupBox9->hide();
679
                ProfsGroup->hide();
680
        }
681
#else
682
        GroupBox9->hide();
683
        ProfsGroup->hide();
684
#endif
685
 
686
        QSpacerItem* spacerCG = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
687
        tabColorLayout->addItem( spacerCG );
688
        insertTab( tabColor, tr( "C&olor" ) );
689
 
690
        tabPDFX = new QWidget( this, "tabPDFX" );
691
        tabPDFXLayout = new QVBoxLayout( tabPDFX, 11, 5, "tabPDFXLayout");
692
        X3Group = new QGroupBox( tabPDFX, "X3Group" );
693
        X3Group->setTitle( tr( "PDF/X-3 Output Intent" ) );
694
        X3Group->setColumnLayout(0, Qt::Vertical );
695
        X3Group->layout()->setSpacing( 5 );
696
        X3Group->layout()->setMargin( 10 );
697
        X3GroupLayout = new QGridLayout( X3Group->layout() );
698
        X3GroupLayout->setAlignment( Qt::AlignTop );
699
        PrintProfC = new QComboBox( true, X3Group, "PrintProfC" );
700
        PrintProfC->setEditable(false);
701
#ifdef HAVE_CMS
702
 
703
        ProfilesL::Iterator itp3;
704
        QString tp3 = Optionen->PrintProf;
705
        if (!PDFXProfiles->contains(tp3))
706
        {
707
                if (vie != 0)
708
                        tp3 = vie->Doc->CMSSettings.DefaultPrinterProfile;
709
                else
2834 cbradney 710
                        tp3 = PrefsManager::instance()->appPrefs.DCMSset.DefaultPrinterProfile;
1307 fschmid 711
        }
712
        for (itp3 = PDFXProfiles->begin(); itp3 != PDFXProfiles->end(); ++itp3)
713
        {
714
                PrintProfC->insertItem(itp3.key());
715
                if (itp3.key() == tp3)
716
                        PrintProfC->setCurrentItem(PrintProfC->count()-1);
717
        }
718
#endif
719
        X3GroupLayout->addWidget( PrintProfC, 0, 1 );
720
        InfoString = new QLineEdit( X3Group, "InfoString" );
721
        InfoString->setText(Optionen->Info);
722
        X3GroupLayout->addWidget( InfoString, 1, 1 );
723
        PDFX2 = new QLabel( InfoString, tr( "&Info String:" ), X3Group, "PDFX2" );
724
        X3GroupLayout->addWidget( PDFX2, 1, 0 );
725
        PDFX1 = new QLabel( PrintProfC, tr( "Output &Profile:" ), X3Group, "PDFX1" );
726
        X3GroupLayout->addWidget( PDFX1, 0, 0 );
727
        tabPDFXLayout->addWidget( X3Group );
728
        BleedGroup = new QGroupBox( tabPDFX, "BleedGroup" );
729
        BleedGroup->setTitle( tr( "Trim Box" ) );
730
        BleedGroup->setColumnLayout(0, Qt::Vertical );
731
        BleedGroup->layout()->setSpacing( 5 );
732
        BleedGroup->layout()->setMargin( 11 );
733
        BleedGroupLayout = new QGridLayout( BleedGroup->layout() );
734
        BleedGroupLayout->setAlignment( Qt::AlignTop );
735
        BleedIcon = new QLabel( BleedGroup, "BleedIcon" );
736
        BleedIcon->setMinimumSize( QSize( 74, 84 ) );
737
        BleedIcon->setMaximumSize( QSize( 74, 84 ) );
738
        BleedIcon->setFrameShape( QLabel::Panel );
739
        BleedIcon->setFrameShadow( QLabel::Sunken );
740
        BleedIcon->setScaledContents( false );
741
        BleedIcon->setAlignment( static_cast<int>( QLabel::AlignCenter ) );
742
        BleedGroupLayout->addWidget( BleedIcon, 1, 2 );
1792 cbradney 743
        BleedTop = new MSpinBox( BleedGroup, precision );
1307 fschmid 744
        BleedGroupLayout->addWidget( BleedTop, 0, 2 );
1792 cbradney 745
        BleedBottom = new MSpinBox( BleedGroup, precision );
1307 fschmid 746
        BleedGroupLayout->addWidget( BleedBottom, 2, 2 );
1792 cbradney 747
        BleedRight = new MSpinBox( BleedGroup, precision );
1307 fschmid 748
        BleedGroupLayout->addWidget( BleedRight, 1, 3 );
1792 cbradney 749
        BleedLeft = new MSpinBox( BleedGroup, precision );
1307 fschmid 750
        BleedGroupLayout->addWidget( BleedLeft, 1, 1 );
751
        QSpacerItem* spacerPX = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
752
        BleedGroupLayout->addItem( spacerPX, 1, 0 );
753
        QSpacerItem* spacerPX2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
754
        BleedGroupLayout->addItem( spacerPX2, 1, 4 );
755
        tabPDFXLayout->addWidget( BleedGroup );
756
        insertTab( tabPDFX, tr( "PDF/X-&3" ) );
757
        BleedTop->setSuffix( unit );
758
        BleedTop->setMinValue(0);
1792 cbradney 759
        BleedTop->setMaxValue(PageH*unitRatio);
760
        BleedTop->setValue(Optionen->BleedTop*unitRatio);
1307 fschmid 761
        BleedBottom->setSuffix( unit );
762
        BleedBottom->setMinValue(0);
1792 cbradney 763
        BleedBottom->setMaxValue(PageH*unitRatio);
764
        BleedBottom->setValue(Optionen->BleedBottom*unitRatio);
1307 fschmid 765
        BleedRight->setSuffix( unit );
766
        BleedRight->setMinValue(0);
1792 cbradney 767
        BleedRight->setMaxValue(PageB*unitRatio);
768
        BleedRight->setValue(Optionen->BleedRight*unitRatio);
1307 fschmid 769
        BleedLeft->setSuffix( unit );
770
        BleedLeft->setMinValue(0);
1792 cbradney 771
        BleedLeft->setMaxValue(PageB*unitRatio);
772
        BleedLeft->setValue(Optionen->BleedLeft*unitRatio);
1307 fschmid 773
#ifdef HAVE_CMS
774
        if ((!CMSuse) || (!CMSavail))
775
                setTabEnabled(tabPDFX, false);
776
        if ((CMSuse) && (CMSavail) && (Optionen->Version == 12) && (!PDFXProfiles->isEmpty()))
1738 fschmid 777
                EnablePDFX(3);
1307 fschmid 778
        else
779
                setTabEnabled(tabPDFX, false);
780
#else
781
        setTabEnabled(tabPDFX, false);
782
#endif
783
        BleedChanged();
784
        if (vie != 0)
785
        {
786
                PgSel = 0;
787
                Pages->setCurrentItem(0);
788
                SetEffOpts(0);
789
                Pages->setEnabled(false);
790
                Effects->setEnabled(false);
791
                PagePrev->setEnabled(false);
792
                DoEffects();
793
                if (CheckBox10->isChecked())
794
                {
795
                        PageTime->setValue(EffVal[0].pageViewDuration);
796
                        EffectTime->setValue(EffVal[0].pageEffectDuration);
797
                        EffectType->setCurrentItem(EffVal[0].effectType);
798
                        EDirection->setCurrentItem(EffVal[0].Dm);
799
                        EDirection_2->setCurrentItem(EffVal[0].M);
800
                        EDirection_2_2->setCurrentItem(EffVal[0].Di);
801
                        SetEffOpts(EffectType->currentItem());
802
                }
803
                connect(EmbedFonts, SIGNAL(clicked()), this, SLOT(EmbedAll()));
804
                connect(AvailFlist, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelAFont(QListBoxItem*)));
805
                connect(EmbedList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelEFont(QListBoxItem*)));
806
                connect(ToEmbed, SIGNAL(clicked()), this, SLOT(PutToEmbed()));
807
                connect(FromEmbed, SIGNAL(clicked()), this, SLOT(RemoveEmbed()));
808
                connect(SubsetFonts, SIGNAL(clicked()), this, SLOT(SubsetAll()));
809
                connect(SubsetList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelSFont(QListBoxItem*)));
810
                connect(ToSubset, SIGNAL(clicked()), this, SLOT(PutToSubset()));
811
                connect(FromSubset, SIGNAL(clicked()), this, SLOT(RemoveSubset()));
812
                connect(PagePrev, SIGNAL(clicked()), this, SLOT(PagePr()));
813
                connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
814
                connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
815
                connect(EDirection_2_2, SIGNAL(activated(int)), this, SLOT(ValidDI(int)));
816
                connect(CheckBox10, SIGNAL(clicked()), this, SLOT(DoEffects()));
817
                connect(EonAllPg, SIGNAL(clicked()), this, SLOT(EffectOnAll()));
818
                QToolTip::add( EmbedFonts, tr( "Embed fonts into the PDF. Embedding the fonts\nwill preserve the layout and appearance of your document." ) );
2217 cbradney 819
                QToolTip::add( CheckBox10, "<qt>" + tr( "Enables presentation effects when using Adobe&#174; Reader&#174; in full screen mode." ) + "</qt>");
1307 fschmid 820
                QToolTip::add( PagePrev, tr( "Show page previews of each page listed above." ) );
821
                QToolTip::add( PageTime, tr( "Length of time the page is shown before the presentation starts on the selected page." ) );
822
                QToolTip::add( EffectTime, tr( "Length of time the effect runs.\nA shorter time will speed up the effect, a longer one will slow it down." ) );
823
                QToolTip::add( EffectType, tr( "Type of the display effect." ) );
824
                QToolTip::add( EDirection, tr( "Direction of the effect of moving lines for the split and blind effects." ) );
825
                QToolTip::add( EDirection_2, tr( "Starting position for the box and split effects." ) );
826
                QToolTip::add( EDirection_2_2, tr( "Direction of the glitter or wipe effects." ) );
827
                QToolTip::add( EonAllPg, tr( "Apply the selected effect to all pages." ) );
828
        }
829
        connect(AllPages, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
830
        connect(DSColor, SIGNAL(clicked()), this, SLOT(DoDownsample()));
831
        connect(MirrorH, SIGNAL(clicked()), this, SLOT(PDFMirror()));
832
        connect(MirrorV, SIGNAL(clicked()), this, SLOT(PDFMirror()));
833
        connect(RotateDeg, SIGNAL(activated(int)), this, SLOT(Rotation(int)));
834
        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
835
        connect(EmbedProfs, SIGNAL(clicked()), this, SLOT(EnablePG()));
836
        connect(EmbedProfs2, SIGNAL(clicked()), this, SLOT(EnablePGI()));
837
        connect(NoEmbedded, SIGNAL(clicked()), this, SLOT(EnablePGI2()));
1973 craig 838
        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1307 fschmid 839
        connect(BleedTop, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
840
        connect(BleedBottom, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
841
        connect(BleedLeft, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
842
        connect(BleedRight, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
843
        connect(Encry, SIGNAL(clicked()), this, SLOT(ToggleEncr()));
844
        connect(UseLPI, SIGNAL(clicked()), this, SLOT(EnableLPI2()));
845
        connect(LPIcolor, SIGNAL(activated(int)), this, SLOT(SelLPIcol(int)));
846
        //tooltips
847
        QToolTip::add( AllPages, tr( "Export all pages to PDF" ) );
848
        QToolTip::add( OnlySome, tr( "Export a range of pages to PDF" ) );
849
        QToolTip::add( PageNr, tr( "Insert a comma separated list of tokens where\n"
850
                                      "a token can be * for all the pages, 1-5 for\n"
851
                                      "a range of pages or a single page number.") );
852
 
2849 mrdocs 853
        QToolTip::add( PDFVersionCombo, tr( "Determines the PDF compatibility.\nThe default is PDF 1.3 which gives the widest compatibility.\nChoose PDF 1.4 if your file uses features such as transparency or you require 128 bit encryption.\nPDF/X-3 is for exporting the PDF, when you want color managed RGB for commercial printing\n and is selectable when you have activated color management. \nUse only when advised by your printer or in some cases printing to a 4 color digital color laser printer." ) );
1307 fschmid 854
        QToolTip::add( ComboBind, tr( "Determines the binding of pages in the PDF. Unless you know\nyou need to change it leave the default choice - Left." ) );
855
        QToolTip::add( CheckBox1, tr( "Generates thumbnails of each page in the PDF.\nSome viewers can use the thumbnails for navigation." ) );
856
        QToolTip::add( Article, tr( "Generate PDF Articles, which is useful for navigating linked articles in a PDF." ) );
1801 cbradney 857
        QToolTip::add( useLayers, tr( "Layers in your document are exported to the PDF\nOnly available if PDF 1.5 is choosen." ) );
1307 fschmid 858
        QToolTip::add( CheckBM, tr( "Embed the bookmarks you created in your document.\nThese are useful for navigating long PDF documents." ) );
859
        QToolTip::add( Resolution, tr( "Export resolution of text and vector graphics.\nThis does not affect the resolution of bitmap images like photos." ) );
2896 mrdocs 860
        QToolTip::add( Compression, tr( "Enable lossless compression of text and graphics.\nUnless you have a reason, leave this checked. This reduces PDF size." ) );
2899 mrdocs 861
        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>");
1307 fschmid 862
        QToolTip::add( CQuality, tr( "Compression levels: Minimum (25%), Low (50%), Medium (75%), High (85%), Maximum (95%)" ) );
2844 mrdocs 863
        QToolTip::add( DSColor, tr( "Re-sample your bitmap images to the selected DPI.\nLeaving this unchecked will render them at their native resolution.\nThis can increase memory usage and slow down export." ) );
1307 fschmid 864
        QToolTip::add( ValC, tr( "DPI (Dots Per Inch) for image export.") );
1801 cbradney 865
        QToolTip::add( Encry, tr( "Enable the security features in your exported PDF.\nIf you selected PDF 1.3, the PDF will be protected by 40 bit encryption.\nIf you selected PDF 1.4, the PDF will be protected by 128 bit encryption.\nDisclaimer: PDF encryption is not as reliable as GPG or PGP encryption and does have some limitations." ) );
1307 fschmid 866
        QToolTip::add( PassOwner, tr( "Choose a master password which enables or disables all the\nsecurity features in your exported PDF" ) );
867
        QToolTip::add( PassUser, tr( "Choose a password for users to be able to read your PDF." ) );
868
        QToolTip::add( PrintSec, tr( "Allow printing of the PDF. If un-checked, printing is prevented. " ) );
869
        QToolTip::add( ModifySec, tr( "Allow modifying of the PDF. If un-checked, modifying the PDF is prevented." ) );
870
        QToolTip::add( CopySec, tr( "Allow copying of text or graphics from the PDF. \nIf un-checked, text and graphics cannot be copied." ) );
871
        QToolTip::add( AddSec, tr( "Allow adding annotations and fields to the PDF. \nIf un-checked, editing annotations and fileds is prevented." ) );
872
        QToolTip::add( OutCombo, tr( "Color model for the output of your PDF.\nChoose Screen/Web for PDFs which are used for screen display and for printing on typical inkjets.\nChoose Printer when printing to a true 4 color CMYK printer." ) );
873
        QToolTip::add( UseLPI, tr( "This is an advanced setting which is not enabled by default. This should only be enabled\nwhen specifically requested by your printer and they have given you the exact details needed.\nOtherwise, your exported PDF may not print properly and is truly not portable across systems." ) );
874
        QToolTip::add( EmbedProfs, tr( "Embed a color profile for solid colors" ) );
875
        QToolTip::add( SolidPr, tr( "Color profile for solid colors" ) );
876
        QToolTip::add( IntendS, tr( "Rendering intent for solid colors" ) );
877
        QToolTip::add( EmbedProfs2, tr( "Embed a color profile for images" ) );
878
        QToolTip::add( NoEmbedded, tr( "Do not use color profiles that are embedded in source images" ) );
879
        QToolTip::add( ImageP, tr( "Color profile for images" ) );
880
        QToolTip::add( IntendI, tr( "Rendering intent for images" ) );
881
        QToolTip::add( PrintProfC, tr( "Output profile for printing. If possible, get some guidance from your printer on profile selection." ) );
882
        QToolTip::add( InfoString, tr( "Mandatory string for PDF/X-3 or the PDF will fail\nPDF/X-3 conformance. We recommend you use the title of the document." ) );
883
        QToolTip::add( BleedTop, tr( "Distance for bleed from the top of the physical page" ) );
884
        QToolTip::add( BleedBottom, tr( "Distance for bleed from the bottom of the physical page" ) );
885
        QToolTip::add( BleedLeft, tr( "Distance for bleed from the left of the physical page" ) );
886
        QToolTip::add( BleedRight, tr( "Distance for bleed from the right of the physical page" ) );
887
        QToolTip::add( MirrorH, tr( "Mirror Page(s) horizontally" ) );
888
        QToolTip::add( MirrorV, tr( "Mirror Page(s) vertically" ) );
889
}
890
 
1828 fschmid 891
void TabPDFOptions::restoreDefaults()
892
{
893
}
894
 
1307 fschmid 895
void TabPDFOptions::ToggleEncr()
896
{
897
        bool setter = Encry->isChecked() ? true : false;
898
        GroupSecSet->setEnabled(setter);
899
        GroupPass->setEnabled(setter);
900
}
901
 
902
void TabPDFOptions::BleedChanged()
903
{
1792 cbradney 904
        BleedTop->setMaxValue(pageH*unitRatio-BleedBottom->value());
905
        BleedBottom->setMaxValue(pageH*unitRatio-BleedTop->value());
906
        BleedRight->setMaxValue(pageB*unitRatio-BleedLeft->value());
907
        BleedLeft->setMaxValue(pageB*unitRatio-BleedRight->value());
1307 fschmid 908
        QPixmap pm = QPixmap(70,80);
909
        pm.fill(white);
910
        QPainter p;
911
        p.begin(&pm);
912
        p.setBrush(NoBrush);
913
        p.setPen(black);
914
        p.drawRect(0, 0, pm.width(), pm.height());
915
        p.setPen(QPen(black, 1, DotLine, FlatCap, MiterJoin));
1792 cbradney 916
        int x = qRound((BleedLeft->value() / unitRatio) * (70.0 / pageB));
917
        int y = qRound((BleedTop->value() / unitRatio) * (80.0 / pageH));
918
        int w =qRound((pageB-((BleedLeft->value()+BleedRight->value())/unitRatio))*(70.0/pageB));
919
        int h = qRound((pageH-((BleedTop->value()+BleedBottom->value())/unitRatio))*(80.0/pageH));
1307 fschmid 920
        p.drawRect(x, y, w, h);
921
        BleedIcon->setPixmap(pm);
922
        p.end();
923
}
924
 
925
void TabPDFOptions::enableCMS(bool enable)
926
{
1973 craig 927
        disconnect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
928
        int a = PDFVersionCombo->currentItem();
929
        PDFVersionCombo->clear();
2578 craig 930
        PDFVersionCombo->insertItem("PDF 1.3");
931
        PDFVersionCombo->insertItem("PDF 1.4");
932
        PDFVersionCombo->insertItem("PDF 1.5");
1843 cbradney 933
        cms=enable;
1307 fschmid 934
        if (enable)
1973 craig 935
                PDFVersionCombo->insertItem("PDF/X-3");
1307 fschmid 936
        else
1738 fschmid 937
                a = QMIN(a, 3);
1973 craig 938
        PDFVersionCombo->setCurrentItem(a);
1307 fschmid 939
        EnablePr(1);
1973 craig 940
        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1307 fschmid 941
}
942
 
943
void TabPDFOptions::EnablePDFX(int a)
944
{
1843 cbradney 945
        useLayers->setEnabled(a == 2);
1738 fschmid 946
        if (a != 3)
1307 fschmid 947
        {
948
                setTabEnabled(tabPDFX, false);
949
                setTabEnabled(tabSecurity, true);
950
                OutCombo->setEnabled(true);
951
                EmbedProfs2->setEnabled(true);
952
                if (view != 0)
953
                {
954
                        CheckBox10->setEnabled(true);
955
                        EmbedFonts->setEnabled(true);
1781 fschmid 956
                        if (EmbedList->count() != 0)
957
                                FromEmbed->setEnabled(true);
958
                        ToEmbed->setEnabled(true);
1307 fschmid 959
                }
960
                return;
961
        }
962
        disconnect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
963
        OutCombo->setCurrentItem(1);
964
        OutCombo->setEnabled(false);
965
        EnablePr(1);
966
        EmbedProfs2->setChecked(true);
967
        EmbedProfs2->setEnabled(false);
968
        if (view != 0)
969
        {
970
                EmbedFonts->setChecked(true);
971
                EmbedAll();
972
                CheckBox10->setChecked(false);
973
                CheckBox10->setEnabled(false);
974
                EmbedFonts->setEnabled(false);
1781 fschmid 975
                FromEmbed->setEnabled(false);
976
                ToEmbed->setEnabled(false);
1307 fschmid 977
        }
978
        EnablePGI();
979
        setTabEnabled(tabPDFX, true);
980
        setTabEnabled(tabSecurity, false);
981
        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
982
}
983
 
984
void TabPDFOptions::EnablePGI()
985
{
986
        if (EmbedProfs2->isChecked())
987
        {
988
                NoEmbedded->setEnabled(true);
989
                bool setter = NoEmbedded->isChecked() ? true : false;
990
                ProfsTxt3->setEnabled(setter);
991
                ProfsTxt4->setEnabled(setter);
992
                ImageP->setEnabled(setter);
993
                IntendI->setEnabled(setter);
994
        }
995
        else
996
        {
997
                ProfsTxt3->setEnabled(false);
998
                ProfsTxt4->setEnabled(false);
999
                ImageP->setEnabled(false);
1000
                IntendI->setEnabled(false);
1001
                NoEmbedded->setEnabled(false);
1002
        }
1003
}
1004
 
1005
void TabPDFOptions::EnablePGI2()
1006
{
1007
        bool setter = NoEmbedded->isChecked() ? true : false;
1008
        ProfsTxt3->setEnabled(setter);
1009
        ProfsTxt4->setEnabled(setter);
1010
        ImageP->setEnabled(setter);
1011
        IntendI->setEnabled(setter);
1012
}
1013
 
1014
void TabPDFOptions::EnablePG()
1015
{
1016
        bool setter = EmbedProfs->isChecked() ? true : false;
1017
        ProfsTxt1->setEnabled(setter);
1018
        ProfsTxt2->setEnabled(setter);
1019
        SolidPr->setEnabled(setter);
1020
        IntendS->setEnabled(setter);
1021
}
1022
 
1023
void TabPDFOptions::EnablePr(int a)
1024
{
1025
        EnableLPI(a);
1026
        bool setter = a == 1 ? true : false;
1027
        GroupBox9->setEnabled(setter);
1028
        ProfsGroup->setEnabled(setter);
1029
}
1030
 
1031
void TabPDFOptions::EnableLPI(int a)
1032
{
1033
        if (a == 1)
1034
        {
1035
#ifdef HAVE_CMS
1036
                QString tp = Opts->SolidProf;
2891 cbradney 1037
                if (!ScApp->InputProfiles.contains(tp))
1307 fschmid 1038
                {
1039
                        if (view != 0)
2984 fschmid 1040
                                tp = view->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 1041
                        else
2984 fschmid 1042
                                tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 1043
                }
2891 cbradney 1044
                SolidPr->clear();
1307 fschmid 1045
                ProfilesL::Iterator itp;
2891 cbradney 1046
                ProfilesL::Iterator itpend=ScApp->InputProfiles.end();
1047
                for (itp = ScApp->InputProfiles.begin(); itp != itpend; ++itp)
1307 fschmid 1048
                {
1049
                        SolidPr->insertItem(itp.key());
1050
                        if (itp.key() == tp)
1051
                        {
1052
                                if (cms)
1053
                                        SolidPr->setCurrentItem(SolidPr->count()-1);
1054
                        }
1055
                }
1056
                if (cms)
1057
                        IntendS->setCurrentItem(Opts->Intent);
1058
                QString tp1 = Opts->ImageProf;
2891 cbradney 1059
                if (!ScApp->InputProfiles.contains(tp1))
1307 fschmid 1060
                {
1061
                        if (view != 0)
2984 fschmid 1062
                                tp1 = view->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 1063
                        else
2984 fschmid 1064
                                tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 1065
                }
1066
                ImageP->clear();
2891 cbradney 1067
                ProfilesL::Iterator itp2;
1068
                ProfilesL::Iterator itp2end=ScApp->InputProfiles.end();
1069
                for (itp2 = ScApp->InputProfiles.begin(); itp2 != itp2end; ++itp2)
1307 fschmid 1070
                {
1071
                        ImageP->insertItem(itp2.key());
1072
                        if (itp2.key() == tp1)
1073
                        {
1074
                                if (cms)
1075
                                        ImageP->setCurrentItem(ImageP->count()-1);
1076
                        }
1077
                }
1078
                if (cms)
1079
                        IntendI->setCurrentItem(Opts->Intent2);
1080
#endif
1081
                if (cms)
1082
                {
1083
                        GroupBox9->show();
1084
                        ProfsGroup->show();
1476 fschmid 1085
                        UseLPI->hide();
3079 fschmid 1086
                        useSpot->hide();
1307 fschmid 1087
                }
1088
                else
1089
                {
1090
                        GroupBox9->hide();
1091
                        ProfsGroup->hide();
3079 fschmid 1092
                        useSpot->show();
1307 fschmid 1093
                        UseLPI->show();
1094
                        if (UseLPI->isChecked())
1095
                                LPIgroup->show();
1096
                        else
1097
                                LPIgroup->hide();
1098
                }
1099
        }
1100
        else
1101
        {
3079 fschmid 1102
                useSpot->hide();
1307 fschmid 1103
                UseLPI->hide();
1104
                LPIgroup->hide();
1105
        }
1106
}
1107
 
1108
void TabPDFOptions::EnableLPI2()
1109
{
1110
        if (UseLPI->isChecked())
1111
                LPIgroup->show();
1112
        else
1113
                LPIgroup->hide();
1114
}
1115
 
1116
void TabPDFOptions::SelLPIcol(int c)
1117
{
1118
        Opts->LPISettings[SelLPIcolor].Frequency = LPIfreq->value();
1119
        Opts->LPISettings[SelLPIcolor].Angle = LPIangle->value();
1120
        Opts->LPISettings[SelLPIcolor].SpotFunc = LPIfunc->currentItem();
1121
        LPIfreq->setValue(Opts->LPISettings[LPIcolor->text(c)].Frequency);
1122
        LPIangle->setValue(Opts->LPISettings[LPIcolor->text(c)].Angle);
1123
        LPIfunc->setCurrentItem(Opts->LPISettings[LPIcolor->text(c)].SpotFunc);
1124
        SelLPIcolor = LPIcolor->text(c);
1125
}
1126
 
1127
void TabPDFOptions::SelRange(bool e)
1128
{
1129
        bool setter = e ? false : true;
1130
        PageNr->setEnabled( setter );
1131
        if (setter == false)
1132
                CheckBM->setChecked(false);
1133
}
1134
 
1135
void TabPDFOptions::EffectOnAll()
1136
{
1137
        for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
1138
        {
1139
                EffVal[pg].pageViewDuration = PageTime->value();
1140
                EffVal[pg].pageEffectDuration = EffectTime->value();
1141
                EffVal[pg].effectType = EffectType->currentItem();
1142
                EffVal[pg].Dm = EDirection->currentItem();
1143
                EffVal[pg].M = EDirection_2->currentItem();
1144
                EffVal[pg].Di = EDirection_2_2->currentItem();
1145
        }
1146
}
1147
 
1148
void TabPDFOptions::PDFMirror()
1149
{
1150
        Opts->MirrorH = MirrorH->isOn();
1151
        Opts->MirrorV = MirrorV->isOn();
1152
}
1153
 
1154
void TabPDFOptions::Rotation( int value )
1155
{
1156
        Opts->RotateDeg = value * 90;
1157
}
1158
 
1159
void TabPDFOptions::DoEffects()
1160
{
1161
        bool setter = CheckBox10->isChecked() ? true : false;
1162
        Pages->setEnabled(setter);
1163
        Effects->setEnabled(setter);
1164
        PagePrev->setEnabled(setter);
1165
}
1166
 
1167
void TabPDFOptions::ValidDI(int nr)
1168
{
1169
        if (!EDirection_2_2->listBox()->item(nr)->isSelectable())
1170
                EDirection_2_2->setCurrentItem(0);
1171
}
1172
 
1173
void TabPDFOptions::SetPgEff(int nr)
1174
{
1175
        if (nr < 0)
1176
                return;
1177
        EffVal[PgSel].pageViewDuration = PageTime->value();
1178
        EffVal[PgSel].pageEffectDuration = EffectTime->value();
1179
        EffVal[PgSel].effectType = EffectType->currentItem();
1180
        EffVal[PgSel].Dm = EDirection->currentItem();
1181
        EffVal[PgSel].M = EDirection_2->currentItem();
1182
        EffVal[PgSel].Di = EDirection_2_2->currentItem();
1183
        SetEffOpts(EffVal[nr].effectType);
1184
        PageTime->setValue(EffVal[nr].pageViewDuration);
1185
        EffectTime->setValue(EffVal[nr].pageEffectDuration);
1186
        EffectType->setCurrentItem(EffVal[nr].effectType);
1187
        EDirection->setCurrentItem(EffVal[nr].Dm);
1188
        EDirection_2->setCurrentItem(EffVal[nr].M);
1189
        EDirection_2_2->setCurrentItem(EffVal[nr].Di);
1190
        PgSel = nr;
1191
}
1192
 
1193
void TabPDFOptions::SetEffOpts(int nr)
1194
{
1195
        EDirection_2_2->listBox()->item(2)->setSelectable(false);
1196
        EDirection_2_2->listBox()->item(3)->setSelectable(false);
1197
        EDirection_2_2->listBox()->item(4)->setSelectable(false);
1198
        switch (nr)
1199
        {
1200
        case 0:
1201
        case 3:
1202
                EDirection->setEnabled(false);
1203
                EDirection_2->setEnabled(false);
1204
                EDirection_2_2->setEnabled(false);
1205
                break;
1206
        case 1:
1207
                EDirection->setEnabled(true);
1208
                EDirection_2->setEnabled(false);
1209
                EDirection_2_2->setEnabled(false);
1210
                break;
1211
        case 2:
1212
                EDirection->setEnabled(false);
1213
                EDirection_2->setEnabled(true);
1214
                EDirection_2_2->setEnabled(false);
1215
                break;
1216
        case 4:
1217
        case 6:
1218
                EDirection->setEnabled(false);
1219
                EDirection_2->setEnabled(false);
1220
                EDirection_2_2->setEnabled(true);
1221
                if (nr == 6)
1222
                {
1223
                        EDirection_2_2->listBox()->item(2)->setSelectable(true);
1224
                        EDirection_2_2->listBox()->item(3)->setSelectable(true);
1225
                }
1226
                else
1227
                        EDirection_2_2->listBox()->item(4)->setSelectable(true);
1228
                break;
1229
        case 5:
1230
                EDirection->setEnabled(true);
1231
                EDirection_2->setEnabled(true);
1232
                EDirection_2_2->setEnabled(false);
1233
                break;
1234
        }
1235
}
1236
 
1237
void TabPDFOptions::PagePr()
1238
{
1239
        disconnect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
1240
        QString tmp;
1815 fschmid 1241
        QPixmap pm;
1307 fschmid 1242
        int ci = Pages->currentItem();
1243
        if (PagePrev->isChecked())
1244
        {
1245
                for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
1815 fschmid 1246
                {
1247
                        pm.convertFromImage(view->PageToPixmap(pg, 70));
1248
                        Pages->changeItem(pm, tr("Page")+" "+tmp.setNum(pg+1), pg);
1249
                }
1307 fschmid 1250
        }
1251
        else
1252
        {
1253
                for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
1254
                        Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
1255
        }
1256
        if (ci != -1)
1257
        {
1258
                PgSel = ci;
1259
                Pages->setCurrentItem(ci);
1260
        }
1261
        else
1262
        {
1263
                PgSel = 0;
1264
                Pages->clearSelection();
1265
        }
1266
        connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
1267
}
1268
 
1269
void TabPDFOptions::DoDownsample()
1270
{
1271
        if (DSColor->isChecked())
1272
        {
1273
                ValC->setEnabled(true);
1274
                if (ValC->value() > Resolution->value())
1275
                        ValC->setValue(Resolution->value());
1276
                ValC->setMaxValue(Resolution->value());
1277
                ValC->setMinValue(35);
1278
        }
1279
        else
1280
                ValC->setEnabled(false);
1281
}
1282
 
1283
void TabPDFOptions::RemoveEmbed()
1284
{
1285
        FontsToEmbed.remove(EmbedList->currentText());
1286
        EmbedList->removeItem(EmbedList->currentItem());
1287
        EmbedList->clearSelection();
1288
        if (EmbedList->count() == 0)
1289
        {
1290
                FromEmbed->setEnabled(false);
1291
                ToSubset->setEnabled(false);
1292
        }
1293
}
1294
 
1295
void TabPDFOptions::PutToEmbed()
1296
{
1297
        if (EmbedList->count() != 0)
1298
        {
1299
                if (EmbedList->findItem(AvailFlist->currentText()) == NULL)
1300
                {
1301
                        FontsToEmbed.append(AvailFlist->currentText());
1302
                        EmbedList->insertItem(AvailFlist->currentText());
1303
                }
1304
        }
1305
        else
1306
        {
1307
                FontsToEmbed.append(AvailFlist->currentText());
1308
                EmbedList->insertItem(AvailFlist->currentText());
1309
        }
1310
}
1311
 
1312
void TabPDFOptions::RemoveSubset()
1313
{
1314
        FontsToSubset.remove(SubsetList->currentText());
1315
        FontsToEmbed.append(SubsetList->currentText());
1316
        EmbedList->insertItem(SubsetList->currentText());
1317
        SubsetList->removeItem(SubsetList->currentItem());
1318
        SubsetList->clearSelection();
1319
        if (SubsetList->count() == 0)
1320
                FromSubset->setEnabled(false);
1321
}
1322
 
1323
void TabPDFOptions::PutToSubset()
1324
{
1325
        if (SubsetList->count() != 0)
1326
        {
1327
                if (SubsetList->findItem(EmbedList->currentText()) == NULL)
1328
                {
1329
                        FontsToSubset.append(EmbedList->currentText());
1330
                        SubsetList->insertItem(EmbedList->currentText());
1331
                }
1332
        }
1333
        else
1334
        {
1335
                FontsToSubset.append(EmbedList->currentText());
1336
                SubsetList->insertItem(EmbedList->currentText());
1337
        }
1338
        FontsToEmbed.remove(EmbedList->currentText());
1339
        EmbedList->removeItem(EmbedList->currentItem());
1340
        EmbedList->clearSelection();
1341
        if (EmbedList->count() == 0)
1342
        {
1343
                FromEmbed->setEnabled(false);
1344
                ToSubset->setEnabled(false);
1345
        }
1346
}
1347
 
1348
void TabPDFOptions::SelAFont(QListBoxItem *c)
1349
{
1350
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1351
        {
1352
                FromEmbed->setEnabled(false);
1353
                if (c->isSelectable())
1354
                        ToEmbed->setEnabled(true);
1355
                ToSubset->setEnabled(false);
1356
                FromSubset->setEnabled(false);
1357
                EmbedList->clearSelection();
1358
                SubsetList->clearSelection();
1359
        }
1360
}
1361
 
1362
void TabPDFOptions::SelEFont(QListBoxItem *c)
1363
{
1364
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1365
        {
1781 fschmid 1366
                if (!isTabEnabled(tabPDFX))
1367
                        FromEmbed->setEnabled(true);
1307 fschmid 1368
                ToEmbed->setEnabled(false);
1369
                ToSubset->setEnabled(true);
1370
                FromSubset->setEnabled(false);
1371
                AvailFlist->clearSelection();
1372
                SubsetList->clearSelection();
1373
        }
1374
}
1375
 
1376
void TabPDFOptions::SelSFont(QListBoxItem *c)
1377
{
1378
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1379
        {
1380
                FromSubset->setEnabled(true);
1381
                ToSubset->setEnabled(false);
1382
                ToEmbed->setEnabled(false);
1383
                FromEmbed->setEnabled(false);
1384
                EmbedList->clearSelection();
1385
                AvailFlist->clearSelection();
1386
        }
1387
}
1388
 
1389
void TabPDFOptions::EmbedAll()
1390
{
1391
        if (EmbedFonts->isChecked())
1392
        {
1393
                SubsetFonts->setChecked(false);
1394
                EmbedList->clear();
1395
                FontsToEmbed.clear();
1396
                SubsetList->clear();
1397
                FontsToSubset.clear();
1398
                FromEmbed->setEnabled(false);
1399
                ToEmbed->setEnabled(false);
1400
                ToSubset->setEnabled(false);
1401
                FromSubset->setEnabled(false);
1402
                for (uint a=0; a < AvailFlist->count(); ++a)
1403
                {
1404
                        if (AvailFlist->item(a)->isSelectable())
1405
                        {
1406
                                FontsToEmbed.append(AvailFlist->item(a)->text());
1407
                                EmbedList->insertItem(AvailFlist->item(a)->text());
1408
                        }
1409
                }
1410
        }
1411
}
1412
 
1413
void TabPDFOptions::SubsetAll()
1414
{
1415
        if (SubsetFonts->isChecked())
1416
        {
1417
                EmbedFonts->setChecked(false);
1418
                EmbedList->clear();
1419
                FontsToEmbed.clear();
1420
                SubsetList->clear();
1421
                FontsToSubset.clear();
1422
                FromEmbed->setEnabled(false);
1423
                ToEmbed->setEnabled(false);
1424
                ToSubset->setEnabled(false);
1425
                FromSubset->setEnabled(false);
1426
                for (uint a=0; a < AvailFlist->count(); ++a)
1427
                {
1428
                        if (AvailFlist->item(a)->isSelectable())
1429
                        {
1430
                                FontsToSubset.append(AvailFlist->item(a)->text());
1431
                                SubsetList->insertItem(AvailFlist->item(a)->text());
1432
                        }
1433
                }
1434
        }
1435
}