Subversion Repositories Scribus

Rev

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