Subversion Repositories Scribus

Rev

Rev 2899 | Rev 3079 | 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"
2891 cbradney 24
extern ScribusApp* ScApp;
1307 fschmid 25
 
26
 
2834 cbradney 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
 
514
        UseLPI = new QCheckBox( tr( "&Use Custom Rendering Settings" ), tabColor, "UseLPI" );
515
        UseLPI->setChecked(Optionen->UseLPI);
516
        tabColorLayout->addWidget( UseLPI );
517
        LPIgroup = new QGroupBox( tr( "Rendering Settings" ), tabColor, "LPIgroup" );
518
        LPIgroup->setColumnLayout(0, Qt::Vertical );
519
        LPIgroup->layout()->setSpacing( 5 );
520
        LPIgroup->layout()->setMargin( 10 );
521
        LPIgroupLayout = new QGridLayout( LPIgroup->layout() );
522
        LPIgroupLayout->setAlignment( Qt::AlignTop );
523
        LPIcolor = new QComboBox( true, LPIgroup, "LPIcolor" );
524
        LPIcolor->setEditable(false);
525
        QMap<QString,LPIData>::Iterator itlp;
526
        for (itlp = Optionen->LPISettings.begin(); itlp != Optionen->LPISettings.end(); ++itlp)
527
        {
528
                LPIcolor->insertItem( itlp.key() );
529
        }
530
        LPIcolor->setCurrentItem(0);
531
        LPIgroupLayout->addWidget( LPIcolor, 0, 0 );
532
        textLPI1 = new QLabel( tr( "Fre&quency:" ), LPIgroup, "textLPI1" );
533
        LPIgroupLayout->addWidget( textLPI1, 0, 1 );
534
        LPIfreq = new QSpinBox( LPIgroup, "LPIfreq" );
535
        LPIfreq->setMinValue(10);
536
        LPIfreq->setMaxValue(1000);
537
        LPIfreq->setValue(Optionen->LPISettings[LPIcolor->currentText()].Frequency);
538
        textLPI1->setBuddy(LPIfreq);
539
        LPIgroupLayout->addWidget( LPIfreq, 0, 2 );
540
        textLPI2 = new QLabel( tr( "&Angle:" ), LPIgroup, "textLPI2" );
541
        LPIgroupLayout->addWidget( textLPI2, 1, 1 );
542
        LPIangle = new QSpinBox( LPIgroup, "LPIangle" );
543
        LPIangle->setSuffix( QString::fromUtf8(" °"));
544
        LPIangle->setMinValue(-180);
545
        LPIangle->setMaxValue(180);
546
        LPIangle->setValue(Optionen->LPISettings[LPIcolor->currentText()].Angle);
547
        textLPI2->setBuddy(LPIangle);
548
        LPIgroupLayout->addWidget( LPIangle, 1, 2 );
549
        textLPI3 = new QLabel( tr( "S&pot Function:" ), LPIgroup, "textLPI3" );
550
        LPIgroupLayout->addWidget( textLPI3, 2, 1 );
551
        LPIfunc = new QComboBox( true, LPIgroup, "LPIfunc" );
552
        LPIfunc->setEditable(false);
553
        LPIfunc->insertItem( tr( "Simple Dot" ) );
554
        LPIfunc->insertItem( tr( "Line" ) );
555
        LPIfunc->insertItem( tr( "Round" ) );
556
        LPIfunc->insertItem( tr( "Ellipse" ) );
557
        LPIfunc->setCurrentItem(Optionen->LPISettings[LPIcolor->currentText()].SpotFunc);
558
        textLPI3->setBuddy(LPIfunc);
559
        LPIgroupLayout->addWidget( LPIfunc, 2, 2 );
560
        tabColorLayout->addWidget( LPIgroup );
561
        SelLPIcolor = LPIcolor->currentText();
562
 
563
        GroupBox9 = new QGroupBox( tr( "Solid Colors:" ), tabColor, "GroupBox9" );
564
        GroupBox9->setColumnLayout(0, Qt::Vertical );
565
        GroupBox9->layout()->setSpacing( 5 );
566
        GroupBox9->layout()->setMargin( 10 );
567
        GroupBox9Layout = new QGridLayout( GroupBox9->layout() );
568
        GroupBox9Layout->setAlignment( Qt::AlignTop );
569
        EmbedProfs = new QCheckBox( GroupBox9, "EmbedProfs" );
570
        EmbedProfs->setText( tr( "Use ICC Profile" ) );
571
        EmbedProfs->setChecked(Optionen->UseProfiles);
572
        GroupBox9Layout->addMultiCellWidget( EmbedProfs, 0, 0, 0, 1 );
573
        ProfsTxt1 = new QLabel(GroupBox9, "ProfsTxt1");
574
        ProfsTxt1->setText( tr( "Profile:" ) );
575
        GroupBox9Layout->addWidget( ProfsTxt1, 1, 0 );
576
        ProfsTxt2 = new QLabel( GroupBox9, "ProfsTxt2_2" );
577
        ProfsTxt2->setText( tr( "Rendering-Intent:" ) );
578
        GroupBox9Layout->addWidget( ProfsTxt2, 1, 1 );
579
        SolidPr = new QComboBox(true, GroupBox9, "SolidPr" );
580
        SolidPr->setEditable(false);
581
        GroupBox9Layout->addWidget( SolidPr, 2, 0 );
582
        IntendS = new QComboBox( true, GroupBox9, "IntendS" );
583
        QString tmp_ip[] = { tr("Perceptual"), tr("Relative Colorimetric"), tr("Saturation"), tr("Absolute Colorimetric")};
584
        size_t ar_ip = sizeof(tmp_ip) / sizeof(*tmp_ip);
585
        for (uint a = 0; a < ar_ip; ++a)
586
                IntendS->insertItem(tmp_ip[a]);
587
        IntendS->setEditable(false);
588
        GroupBox9Layout->addWidget( IntendS, 2, 1 );
589
        tabColorLayout->addWidget( GroupBox9 );
590
        ProfsGroup = new QGroupBox( tr( "Images:" ), tabColor, "ProfsGroup" );
591
        ProfsGroup->setColumnLayout(0, Qt::Vertical );
592
        ProfsGroup->layout()->setSpacing( 5 );
593
        ProfsGroup->layout()->setMargin( 10 );
594
        ProfsGroupLayout = new QGridLayout( ProfsGroup->layout() );
595
        ProfsGroupLayout->setAlignment( Qt::AlignTop );
596
        EmbedProfs2 = new QCheckBox( tr( "Use ICC Profile" ), ProfsGroup, "EmbedProfs" );
597
        EmbedProfs2->setChecked(Optionen->UseProfiles2);
598
        ProfsGroupLayout->addMultiCellWidget( EmbedProfs2, 0, 0, 0, 1 );
599
        NoEmbedded = new QCheckBox( ProfsGroup, "NoEmbedded" );
600
        NoEmbedded->setText( tr( "Don't use embedded ICC profiles" ) );
601
        NoEmbedded->setChecked(Optionen->EmbeddedI);
602
        ProfsGroupLayout->addMultiCellWidget( NoEmbedded, 1, 1, 0, 1 );
603
        ProfsTxt3 = new QLabel( ProfsGroup, "ProfsTxt3" );
604
        ProfsTxt3->setText( tr( "Profile:" ) );
605
        ProfsGroupLayout->addWidget( ProfsTxt3, 2, 0 );
606
        ProfsTxt4 = new QLabel( ProfsGroup, "ProfsTxt2_2" );
607
        ProfsTxt4->setText( tr( "Rendering-Intent:" ) );
608
        ProfsGroupLayout->addWidget( ProfsTxt4, 2, 1 );
609
        ImageP = new QComboBox( true, ProfsGroup, "ImageP" );
610
        ImageP->setEditable(false);
611
        ProfsGroupLayout->addWidget( ImageP, 3, 0 );
612
        IntendI = new QComboBox( true, ProfsGroup, "IntendS" );
613
        for (uint a = 0; a < ar_ip; ++a)
614
                IntendI->insertItem(tmp_ip[a]);
615
        IntendI->setEditable(false);
616
        ProfsGroupLayout->addWidget( IntendI, 3, 1 );
617
        tabColorLayout->addWidget( ProfsGroup );
1476 fschmid 618
        if ((Optionen->UseRGB) || (Optionen->isGrayscale))
1307 fschmid 619
        {
620
                ProfsGroup->setEnabled(false);
621
                GroupBox9->setEnabled(false);
1476 fschmid 622
                EnablePr(0);
1307 fschmid 623
        }
1476 fschmid 624
        else
625
                EnablePr(1);
1307 fschmid 626
        EnablePG();
627
        EnablePGI();
628
#ifdef HAVE_CMS
629
 
630
        QString tp = Optionen->SolidProf;
2891 cbradney 631
        if (!ScApp->InputProfiles.contains(tp))
1307 fschmid 632
        {
633
                if (vie != 0)
2984 fschmid 634
                        tp = vie->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 635
                else
2984 fschmid 636
                        tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 637
        }
638
        ProfilesL::Iterator itp;
2891 cbradney 639
        ProfilesL::Iterator itpend=ScApp->InputProfiles.end();
640
        for (itp = ScApp->InputProfiles.begin(); itp != itpend; ++itp)
1307 fschmid 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
        QString tp1 = Optionen->ImageProf;
2891 cbradney 652
        if (!ScApp->InputProfiles.contains(tp1))
1307 fschmid 653
        {
654
                if (vie != 0)
2984 fschmid 655
                        tp1 = vie->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 656
                else
2984 fschmid 657
                        tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 658
        }
2891 cbradney 659
        ProfilesL::Iterator itp2;
660
        ProfilesL::Iterator itp2end=ScApp->InputProfiles.end();
661
        for (itp2 = ScApp->InputProfiles.begin(); itp2 != itp2end; ++itp2)
1307 fschmid 662
        {
663
                ImageP->insertItem(itp2.key());
664
                if (itp2.key() == tp1)
665
                {
666
                        if ((CMSuse) && (CMSavail))
667
                                ImageP->setCurrentItem(ImageP->count()-1);
668
                }
669
        }
670
        if ((CMSuse) && (CMSavail))
671
                IntendI->setCurrentItem(Optionen->Intent2);
672
        if ((!CMSuse) || (!CMSavail))
673
        {
674
                GroupBox9->hide();
675
                ProfsGroup->hide();
676
        }
677
#else
678
        GroupBox9->hide();
679
        ProfsGroup->hide();
680
#endif
681
 
682
        QSpacerItem* spacerCG = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
683
        tabColorLayout->addItem( spacerCG );
684
        insertTab( tabColor, tr( "C&olor" ) );
685
 
686
        tabPDFX = new QWidget( this, "tabPDFX" );
687
        tabPDFXLayout = new QVBoxLayout( tabPDFX, 11, 5, "tabPDFXLayout");
688
        X3Group = new QGroupBox( tabPDFX, "X3Group" );
689
        X3Group->setTitle( tr( "PDF/X-3 Output Intent" ) );
690
        X3Group->setColumnLayout(0, Qt::Vertical );
691
        X3Group->layout()->setSpacing( 5 );
692
        X3Group->layout()->setMargin( 10 );
693
        X3GroupLayout = new QGridLayout( X3Group->layout() );
694
        X3GroupLayout->setAlignment( Qt::AlignTop );
695
        PrintProfC = new QComboBox( true, X3Group, "PrintProfC" );
696
        PrintProfC->setEditable(false);
697
#ifdef HAVE_CMS
698
 
699
        ProfilesL::Iterator itp3;
700
        QString tp3 = Optionen->PrintProf;
701
        if (!PDFXProfiles->contains(tp3))
702
        {
703
                if (vie != 0)
704
                        tp3 = vie->Doc->CMSSettings.DefaultPrinterProfile;
705
                else
2834 cbradney 706
                        tp3 = PrefsManager::instance()->appPrefs.DCMSset.DefaultPrinterProfile;
1307 fschmid 707
        }
708
        for (itp3 = PDFXProfiles->begin(); itp3 != PDFXProfiles->end(); ++itp3)
709
        {
710
                PrintProfC->insertItem(itp3.key());
711
                if (itp3.key() == tp3)
712
                        PrintProfC->setCurrentItem(PrintProfC->count()-1);
713
        }
714
#endif
715
        X3GroupLayout->addWidget( PrintProfC, 0, 1 );
716
        InfoString = new QLineEdit( X3Group, "InfoString" );
717
        InfoString->setText(Optionen->Info);
718
        X3GroupLayout->addWidget( InfoString, 1, 1 );
719
        PDFX2 = new QLabel( InfoString, tr( "&Info String:" ), X3Group, "PDFX2" );
720
        X3GroupLayout->addWidget( PDFX2, 1, 0 );
721
        PDFX1 = new QLabel( PrintProfC, tr( "Output &Profile:" ), X3Group, "PDFX1" );
722
        X3GroupLayout->addWidget( PDFX1, 0, 0 );
723
        tabPDFXLayout->addWidget( X3Group );
724
        BleedGroup = new QGroupBox( tabPDFX, "BleedGroup" );
725
        BleedGroup->setTitle( tr( "Trim Box" ) );
726
        BleedGroup->setColumnLayout(0, Qt::Vertical );
727
        BleedGroup->layout()->setSpacing( 5 );
728
        BleedGroup->layout()->setMargin( 11 );
729
        BleedGroupLayout = new QGridLayout( BleedGroup->layout() );
730
        BleedGroupLayout->setAlignment( Qt::AlignTop );
731
        BleedIcon = new QLabel( BleedGroup, "BleedIcon" );
732
        BleedIcon->setMinimumSize( QSize( 74, 84 ) );
733
        BleedIcon->setMaximumSize( QSize( 74, 84 ) );
734
        BleedIcon->setFrameShape( QLabel::Panel );
735
        BleedIcon->setFrameShadow( QLabel::Sunken );
736
        BleedIcon->setScaledContents( false );
737
        BleedIcon->setAlignment( static_cast<int>( QLabel::AlignCenter ) );
738
        BleedGroupLayout->addWidget( BleedIcon, 1, 2 );
1792 cbradney 739
        BleedTop = new MSpinBox( BleedGroup, precision );
1307 fschmid 740
        BleedGroupLayout->addWidget( BleedTop, 0, 2 );
1792 cbradney 741
        BleedBottom = new MSpinBox( BleedGroup, precision );
1307 fschmid 742
        BleedGroupLayout->addWidget( BleedBottom, 2, 2 );
1792 cbradney 743
        BleedRight = new MSpinBox( BleedGroup, precision );
1307 fschmid 744
        BleedGroupLayout->addWidget( BleedRight, 1, 3 );
1792 cbradney 745
        BleedLeft = new MSpinBox( BleedGroup, precision );
1307 fschmid 746
        BleedGroupLayout->addWidget( BleedLeft, 1, 1 );
747
        QSpacerItem* spacerPX = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
748
        BleedGroupLayout->addItem( spacerPX, 1, 0 );
749
        QSpacerItem* spacerPX2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
750
        BleedGroupLayout->addItem( spacerPX2, 1, 4 );
751
        tabPDFXLayout->addWidget( BleedGroup );
752
        insertTab( tabPDFX, tr( "PDF/X-&3" ) );
753
        BleedTop->setSuffix( unit );
754
        BleedTop->setMinValue(0);
1792 cbradney 755
        BleedTop->setMaxValue(PageH*unitRatio);
756
        BleedTop->setValue(Optionen->BleedTop*unitRatio);
1307 fschmid 757
        BleedBottom->setSuffix( unit );
758
        BleedBottom->setMinValue(0);
1792 cbradney 759
        BleedBottom->setMaxValue(PageH*unitRatio);
760
        BleedBottom->setValue(Optionen->BleedBottom*unitRatio);
1307 fschmid 761
        BleedRight->setSuffix( unit );
762
        BleedRight->setMinValue(0);
1792 cbradney 763
        BleedRight->setMaxValue(PageB*unitRatio);
764
        BleedRight->setValue(Optionen->BleedRight*unitRatio);
1307 fschmid 765
        BleedLeft->setSuffix( unit );
766
        BleedLeft->setMinValue(0);
1792 cbradney 767
        BleedLeft->setMaxValue(PageB*unitRatio);
768
        BleedLeft->setValue(Optionen->BleedLeft*unitRatio);
1307 fschmid 769
#ifdef HAVE_CMS
770
        if ((!CMSuse) || (!CMSavail))
771
                setTabEnabled(tabPDFX, false);
772
        if ((CMSuse) && (CMSavail) && (Optionen->Version == 12) && (!PDFXProfiles->isEmpty()))
1738 fschmid 773
                EnablePDFX(3);
1307 fschmid 774
        else
775
                setTabEnabled(tabPDFX, false);
776
#else
777
        setTabEnabled(tabPDFX, false);
778
#endif
779
        BleedChanged();
780
        if (vie != 0)
781
        {
782
                PgSel = 0;
783
                Pages->setCurrentItem(0);
784
                SetEffOpts(0);
785
                Pages->setEnabled(false);
786
                Effects->setEnabled(false);
787
                PagePrev->setEnabled(false);
788
                DoEffects();
789
                if (CheckBox10->isChecked())
790
                {
791
                        PageTime->setValue(EffVal[0].pageViewDuration);
792
                        EffectTime->setValue(EffVal[0].pageEffectDuration);
793
                        EffectType->setCurrentItem(EffVal[0].effectType);
794
                        EDirection->setCurrentItem(EffVal[0].Dm);
795
                        EDirection_2->setCurrentItem(EffVal[0].M);
796
                        EDirection_2_2->setCurrentItem(EffVal[0].Di);
797
                        SetEffOpts(EffectType->currentItem());
798
                }
799
                connect(EmbedFonts, SIGNAL(clicked()), this, SLOT(EmbedAll()));
800
                connect(AvailFlist, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelAFont(QListBoxItem*)));
801
                connect(EmbedList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelEFont(QListBoxItem*)));
802
                connect(ToEmbed, SIGNAL(clicked()), this, SLOT(PutToEmbed()));
803
                connect(FromEmbed, SIGNAL(clicked()), this, SLOT(RemoveEmbed()));
804
                connect(SubsetFonts, SIGNAL(clicked()), this, SLOT(SubsetAll()));
805
                connect(SubsetList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelSFont(QListBoxItem*)));
806
                connect(ToSubset, SIGNAL(clicked()), this, SLOT(PutToSubset()));
807
                connect(FromSubset, SIGNAL(clicked()), this, SLOT(RemoveSubset()));
808
                connect(PagePrev, SIGNAL(clicked()), this, SLOT(PagePr()));
809
                connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
810
                connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
811
                connect(EDirection_2_2, SIGNAL(activated(int)), this, SLOT(ValidDI(int)));
812
                connect(CheckBox10, SIGNAL(clicked()), this, SLOT(DoEffects()));
813
                connect(EonAllPg, SIGNAL(clicked()), this, SLOT(EffectOnAll()));
814
                QToolTip::add( EmbedFonts, tr( "Embed fonts into the PDF. Embedding the fonts\nwill preserve the layout and appearance of your document." ) );
2217 cbradney 815
                QToolTip::add( CheckBox10, "<qt>" + tr( "Enables presentation effects when using Adobe&#174; Reader&#174; in full screen mode." ) + "</qt>");
1307 fschmid 816
                QToolTip::add( PagePrev, tr( "Show page previews of each page listed above." ) );
817
                QToolTip::add( PageTime, tr( "Length of time the page is shown before the presentation starts on the selected page." ) );
818
                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." ) );
819
                QToolTip::add( EffectType, tr( "Type of the display effect." ) );
820
                QToolTip::add( EDirection, tr( "Direction of the effect of moving lines for the split and blind effects." ) );
821
                QToolTip::add( EDirection_2, tr( "Starting position for the box and split effects." ) );
822
                QToolTip::add( EDirection_2_2, tr( "Direction of the glitter or wipe effects." ) );
823
                QToolTip::add( EonAllPg, tr( "Apply the selected effect to all pages." ) );
824
        }
825
        connect(AllPages, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
826
        connect(DSColor, SIGNAL(clicked()), this, SLOT(DoDownsample()));
827
        connect(MirrorH, SIGNAL(clicked()), this, SLOT(PDFMirror()));
828
        connect(MirrorV, SIGNAL(clicked()), this, SLOT(PDFMirror()));
829
        connect(RotateDeg, SIGNAL(activated(int)), this, SLOT(Rotation(int)));
830
        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
831
        connect(EmbedProfs, SIGNAL(clicked()), this, SLOT(EnablePG()));
832
        connect(EmbedProfs2, SIGNAL(clicked()), this, SLOT(EnablePGI()));
833
        connect(NoEmbedded, SIGNAL(clicked()), this, SLOT(EnablePGI2()));
1973 craig 834
        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1307 fschmid 835
        connect(BleedTop, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
836
        connect(BleedBottom, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
837
        connect(BleedLeft, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
838
        connect(BleedRight, SIGNAL(valueChanged(int)), this, SLOT(BleedChanged()));
839
        connect(Encry, SIGNAL(clicked()), this, SLOT(ToggleEncr()));
840
        connect(UseLPI, SIGNAL(clicked()), this, SLOT(EnableLPI2()));
841
        connect(LPIcolor, SIGNAL(activated(int)), this, SLOT(SelLPIcol(int)));
842
        //tooltips
843
        QToolTip::add( AllPages, tr( "Export all pages to PDF" ) );
844
        QToolTip::add( OnlySome, tr( "Export a range of pages to PDF" ) );
845
        QToolTip::add( PageNr, tr( "Insert a comma separated list of tokens where\n"
846
                                      "a token can be * for all the pages, 1-5 for\n"
847
                                      "a range of pages or a single page number.") );
848
 
2849 mrdocs 849
        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 850
        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." ) );
851
        QToolTip::add( CheckBox1, tr( "Generates thumbnails of each page in the PDF.\nSome viewers can use the thumbnails for navigation." ) );
852
        QToolTip::add( Article, tr( "Generate PDF Articles, which is useful for navigating linked articles in a PDF." ) );
1801 cbradney 853
        QToolTip::add( useLayers, tr( "Layers in your document are exported to the PDF\nOnly available if PDF 1.5 is choosen." ) );
1307 fschmid 854
        QToolTip::add( CheckBM, tr( "Embed the bookmarks you created in your document.\nThese are useful for navigating long PDF documents." ) );
855
        QToolTip::add( Resolution, tr( "Export resolution of text and vector graphics.\nThis does not affect the resolution of bitmap images like photos." ) );
2896 mrdocs 856
        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 857
        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 858
        QToolTip::add( CQuality, tr( "Compression levels: Minimum (25%), Low (50%), Medium (75%), High (85%), Maximum (95%)" ) );
2844 mrdocs 859
        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 860
        QToolTip::add( ValC, tr( "DPI (Dots Per Inch) for image export.") );
1801 cbradney 861
        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 862
        QToolTip::add( PassOwner, tr( "Choose a master password which enables or disables all the\nsecurity features in your exported PDF" ) );
863
        QToolTip::add( PassUser, tr( "Choose a password for users to be able to read your PDF." ) );
864
        QToolTip::add( PrintSec, tr( "Allow printing of the PDF. If un-checked, printing is prevented. " ) );
865
        QToolTip::add( ModifySec, tr( "Allow modifying of the PDF. If un-checked, modifying the PDF is prevented." ) );
866
        QToolTip::add( CopySec, tr( "Allow copying of text or graphics from the PDF. \nIf un-checked, text and graphics cannot be copied." ) );
867
        QToolTip::add( AddSec, tr( "Allow adding annotations and fields to the PDF. \nIf un-checked, editing annotations and fileds is prevented." ) );
868
        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." ) );
869
        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." ) );
870
        QToolTip::add( EmbedProfs, tr( "Embed a color profile for solid colors" ) );
871
        QToolTip::add( SolidPr, tr( "Color profile for solid colors" ) );
872
        QToolTip::add( IntendS, tr( "Rendering intent for solid colors" ) );
873
        QToolTip::add( EmbedProfs2, tr( "Embed a color profile for images" ) );
874
        QToolTip::add( NoEmbedded, tr( "Do not use color profiles that are embedded in source images" ) );
875
        QToolTip::add( ImageP, tr( "Color profile for images" ) );
876
        QToolTip::add( IntendI, tr( "Rendering intent for images" ) );
877
        QToolTip::add( PrintProfC, tr( "Output profile for printing. If possible, get some guidance from your printer on profile selection." ) );
878
        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." ) );
879
        QToolTip::add( BleedTop, tr( "Distance for bleed from the top of the physical page" ) );
880
        QToolTip::add( BleedBottom, tr( "Distance for bleed from the bottom of the physical page" ) );
881
        QToolTip::add( BleedLeft, tr( "Distance for bleed from the left of the physical page" ) );
882
        QToolTip::add( BleedRight, tr( "Distance for bleed from the right of the physical page" ) );
883
        QToolTip::add( MirrorH, tr( "Mirror Page(s) horizontally" ) );
884
        QToolTip::add( MirrorV, tr( "Mirror Page(s) vertically" ) );
885
}
886
 
1828 fschmid 887
void TabPDFOptions::restoreDefaults()
888
{
889
}
890
 
1307 fschmid 891
void TabPDFOptions::ToggleEncr()
892
{
893
        bool setter = Encry->isChecked() ? true : false;
894
        GroupSecSet->setEnabled(setter);
895
        GroupPass->setEnabled(setter);
896
}
897
 
898
void TabPDFOptions::BleedChanged()
899
{
1792 cbradney 900
        BleedTop->setMaxValue(pageH*unitRatio-BleedBottom->value());
901
        BleedBottom->setMaxValue(pageH*unitRatio-BleedTop->value());
902
        BleedRight->setMaxValue(pageB*unitRatio-BleedLeft->value());
903
        BleedLeft->setMaxValue(pageB*unitRatio-BleedRight->value());
1307 fschmid 904
        QPixmap pm = QPixmap(70,80);
905
        pm.fill(white);
906
        QPainter p;
907
        p.begin(&pm);
908
        p.setBrush(NoBrush);
909
        p.setPen(black);
910
        p.drawRect(0, 0, pm.width(), pm.height());
911
        p.setPen(QPen(black, 1, DotLine, FlatCap, MiterJoin));
1792 cbradney 912
        int x = qRound((BleedLeft->value() / unitRatio) * (70.0 / pageB));
913
        int y = qRound((BleedTop->value() / unitRatio) * (80.0 / pageH));
914
        int w =qRound((pageB-((BleedLeft->value()+BleedRight->value())/unitRatio))*(70.0/pageB));
915
        int h = qRound((pageH-((BleedTop->value()+BleedBottom->value())/unitRatio))*(80.0/pageH));
1307 fschmid 916
        p.drawRect(x, y, w, h);
917
        BleedIcon->setPixmap(pm);
918
        p.end();
919
}
920
 
921
void TabPDFOptions::enableCMS(bool enable)
922
{
1973 craig 923
        disconnect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
924
        int a = PDFVersionCombo->currentItem();
925
        PDFVersionCombo->clear();
2578 craig 926
        PDFVersionCombo->insertItem("PDF 1.3");
927
        PDFVersionCombo->insertItem("PDF 1.4");
928
        PDFVersionCombo->insertItem("PDF 1.5");
1843 cbradney 929
        cms=enable;
1307 fschmid 930
        if (enable)
1973 craig 931
                PDFVersionCombo->insertItem("PDF/X-3");
1307 fschmid 932
        else
1738 fschmid 933
                a = QMIN(a, 3);
1973 craig 934
        PDFVersionCombo->setCurrentItem(a);
1307 fschmid 935
        EnablePr(1);
1973 craig 936
        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
1307 fschmid 937
}
938
 
939
void TabPDFOptions::EnablePDFX(int a)
940
{
1843 cbradney 941
        useLayers->setEnabled(a == 2);
1738 fschmid 942
        if (a != 3)
1307 fschmid 943
        {
944
                setTabEnabled(tabPDFX, false);
945
                setTabEnabled(tabSecurity, true);
946
                OutCombo->setEnabled(true);
947
                EmbedProfs2->setEnabled(true);
948
                if (view != 0)
949
                {
950
                        CheckBox10->setEnabled(true);
951
                        EmbedFonts->setEnabled(true);
1781 fschmid 952
                        if (EmbedList->count() != 0)
953
                                FromEmbed->setEnabled(true);
954
                        ToEmbed->setEnabled(true);
1307 fschmid 955
                }
956
                return;
957
        }
958
        disconnect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
959
        OutCombo->setCurrentItem(1);
960
        OutCombo->setEnabled(false);
961
        EnablePr(1);
962
        EmbedProfs2->setChecked(true);
963
        EmbedProfs2->setEnabled(false);
964
        if (view != 0)
965
        {
966
                EmbedFonts->setChecked(true);
967
                EmbedAll();
968
                CheckBox10->setChecked(false);
969
                CheckBox10->setEnabled(false);
970
                EmbedFonts->setEnabled(false);
1781 fschmid 971
                FromEmbed->setEnabled(false);
972
                ToEmbed->setEnabled(false);
1307 fschmid 973
        }
974
        EnablePGI();
975
        setTabEnabled(tabPDFX, true);
976
        setTabEnabled(tabSecurity, false);
977
        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
978
}
979
 
980
void TabPDFOptions::EnablePGI()
981
{
982
        if (EmbedProfs2->isChecked())
983
        {
984
                NoEmbedded->setEnabled(true);
985
                bool setter = NoEmbedded->isChecked() ? true : false;
986
                ProfsTxt3->setEnabled(setter);
987
                ProfsTxt4->setEnabled(setter);
988
                ImageP->setEnabled(setter);
989
                IntendI->setEnabled(setter);
990
        }
991
        else
992
        {
993
                ProfsTxt3->setEnabled(false);
994
                ProfsTxt4->setEnabled(false);
995
                ImageP->setEnabled(false);
996
                IntendI->setEnabled(false);
997
                NoEmbedded->setEnabled(false);
998
        }
999
}
1000
 
1001
void TabPDFOptions::EnablePGI2()
1002
{
1003
        bool setter = NoEmbedded->isChecked() ? true : false;
1004
        ProfsTxt3->setEnabled(setter);
1005
        ProfsTxt4->setEnabled(setter);
1006
        ImageP->setEnabled(setter);
1007
        IntendI->setEnabled(setter);
1008
}
1009
 
1010
void TabPDFOptions::EnablePG()
1011
{
1012
        bool setter = EmbedProfs->isChecked() ? true : false;
1013
        ProfsTxt1->setEnabled(setter);
1014
        ProfsTxt2->setEnabled(setter);
1015
        SolidPr->setEnabled(setter);
1016
        IntendS->setEnabled(setter);
1017
}
1018
 
1019
void TabPDFOptions::EnablePr(int a)
1020
{
1021
        EnableLPI(a);
1022
        bool setter = a == 1 ? true : false;
1023
        GroupBox9->setEnabled(setter);
1024
        ProfsGroup->setEnabled(setter);
1025
}
1026
 
1027
void TabPDFOptions::EnableLPI(int a)
1028
{
1029
        if (a == 1)
1030
        {
1031
#ifdef HAVE_CMS
1032
                QString tp = Opts->SolidProf;
2891 cbradney 1033
                if (!ScApp->InputProfiles.contains(tp))
1307 fschmid 1034
                {
1035
                        if (view != 0)
2984 fschmid 1036
                                tp = view->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 1037
                        else
2984 fschmid 1038
                                tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 1039
                }
2891 cbradney 1040
                SolidPr->clear();
1307 fschmid 1041
                ProfilesL::Iterator itp;
2891 cbradney 1042
                ProfilesL::Iterator itpend=ScApp->InputProfiles.end();
1043
                for (itp = ScApp->InputProfiles.begin(); itp != itpend; ++itp)
1307 fschmid 1044
                {
1045
                        SolidPr->insertItem(itp.key());
1046
                        if (itp.key() == tp)
1047
                        {
1048
                                if (cms)
1049
                                        SolidPr->setCurrentItem(SolidPr->count()-1);
1050
                        }
1051
                }
1052
                if (cms)
1053
                        IntendS->setCurrentItem(Opts->Intent);
1054
                QString tp1 = Opts->ImageProf;
2891 cbradney 1055
                if (!ScApp->InputProfiles.contains(tp1))
1307 fschmid 1056
                {
1057
                        if (view != 0)
2984 fschmid 1058
                                tp1 = view->Doc->CMSSettings.DefaultSolidColorProfile;
1307 fschmid 1059
                        else
2984 fschmid 1060
                                tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorProfile;
1307 fschmid 1061
                }
1062
                ImageP->clear();
2891 cbradney 1063
                ProfilesL::Iterator itp2;
1064
                ProfilesL::Iterator itp2end=ScApp->InputProfiles.end();
1065
                for (itp2 = ScApp->InputProfiles.begin(); itp2 != itp2end; ++itp2)
1307 fschmid 1066
                {
1067
                        ImageP->insertItem(itp2.key());
1068
                        if (itp2.key() == tp1)
1069
                        {
1070
                                if (cms)
1071
                                        ImageP->setCurrentItem(ImageP->count()-1);
1072
                        }
1073
                }
1074
                if (cms)
1075
                        IntendI->setCurrentItem(Opts->Intent2);
1076
#endif
1077
                if (cms)
1078
                {
1079
                        GroupBox9->show();
1080
                        ProfsGroup->show();
1476 fschmid 1081
                        UseLPI->hide();
1307 fschmid 1082
                }
1083
                else
1084
                {
1085
                        GroupBox9->hide();
1086
                        ProfsGroup->hide();
1087
                        UseLPI->show();
1088
                        if (UseLPI->isChecked())
1089
                                LPIgroup->show();
1090
                        else
1091
                                LPIgroup->hide();
1092
                }
1093
        }
1094
        else
1095
        {
1096
                UseLPI->hide();
1097
                LPIgroup->hide();
1098
        }
1099
}
1100
 
1101
void TabPDFOptions::EnableLPI2()
1102
{
1103
        if (UseLPI->isChecked())
1104
                LPIgroup->show();
1105
        else
1106
                LPIgroup->hide();
1107
}
1108
 
1109
void TabPDFOptions::SelLPIcol(int c)
1110
{
1111
        Opts->LPISettings[SelLPIcolor].Frequency = LPIfreq->value();
1112
        Opts->LPISettings[SelLPIcolor].Angle = LPIangle->value();
1113
        Opts->LPISettings[SelLPIcolor].SpotFunc = LPIfunc->currentItem();
1114
        LPIfreq->setValue(Opts->LPISettings[LPIcolor->text(c)].Frequency);
1115
        LPIangle->setValue(Opts->LPISettings[LPIcolor->text(c)].Angle);
1116
        LPIfunc->setCurrentItem(Opts->LPISettings[LPIcolor->text(c)].SpotFunc);
1117
        SelLPIcolor = LPIcolor->text(c);
1118
}
1119
 
1120
void TabPDFOptions::SelRange(bool e)
1121
{
1122
        bool setter = e ? false : true;
1123
        PageNr->setEnabled( setter );
1124
        if (setter == false)
1125
                CheckBM->setChecked(false);
1126
}
1127
 
1128
void TabPDFOptions::EffectOnAll()
1129
{
1130
        for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
1131
        {
1132
                EffVal[pg].pageViewDuration = PageTime->value();
1133
                EffVal[pg].pageEffectDuration = EffectTime->value();
1134
                EffVal[pg].effectType = EffectType->currentItem();
1135
                EffVal[pg].Dm = EDirection->currentItem();
1136
                EffVal[pg].M = EDirection_2->currentItem();
1137
                EffVal[pg].Di = EDirection_2_2->currentItem();
1138
        }
1139
}
1140
 
1141
void TabPDFOptions::PDFMirror()
1142
{
1143
        Opts->MirrorH = MirrorH->isOn();
1144
        Opts->MirrorV = MirrorV->isOn();
1145
}
1146
 
1147
void TabPDFOptions::Rotation( int value )
1148
{
1149
        Opts->RotateDeg = value * 90;
1150
}
1151
 
1152
void TabPDFOptions::DoEffects()
1153
{
1154
        bool setter = CheckBox10->isChecked() ? true : false;
1155
        Pages->setEnabled(setter);
1156
        Effects->setEnabled(setter);
1157
        PagePrev->setEnabled(setter);
1158
}
1159
 
1160
void TabPDFOptions::ValidDI(int nr)
1161
{
1162
        if (!EDirection_2_2->listBox()->item(nr)->isSelectable())
1163
                EDirection_2_2->setCurrentItem(0);
1164
}
1165
 
1166
void TabPDFOptions::SetPgEff(int nr)
1167
{
1168
        if (nr < 0)
1169
                return;
1170
        EffVal[PgSel].pageViewDuration = PageTime->value();
1171
        EffVal[PgSel].pageEffectDuration = EffectTime->value();
1172
        EffVal[PgSel].effectType = EffectType->currentItem();
1173
        EffVal[PgSel].Dm = EDirection->currentItem();
1174
        EffVal[PgSel].M = EDirection_2->currentItem();
1175
        EffVal[PgSel].Di = EDirection_2_2->currentItem();
1176
        SetEffOpts(EffVal[nr].effectType);
1177
        PageTime->setValue(EffVal[nr].pageViewDuration);
1178
        EffectTime->setValue(EffVal[nr].pageEffectDuration);
1179
        EffectType->setCurrentItem(EffVal[nr].effectType);
1180
        EDirection->setCurrentItem(EffVal[nr].Dm);
1181
        EDirection_2->setCurrentItem(EffVal[nr].M);
1182
        EDirection_2_2->setCurrentItem(EffVal[nr].Di);
1183
        PgSel = nr;
1184
}
1185
 
1186
void TabPDFOptions::SetEffOpts(int nr)
1187
{
1188
        EDirection_2_2->listBox()->item(2)->setSelectable(false);
1189
        EDirection_2_2->listBox()->item(3)->setSelectable(false);
1190
        EDirection_2_2->listBox()->item(4)->setSelectable(false);
1191
        switch (nr)
1192
        {
1193
        case 0:
1194
        case 3:
1195
                EDirection->setEnabled(false);
1196
                EDirection_2->setEnabled(false);
1197
                EDirection_2_2->setEnabled(false);
1198
                break;
1199
        case 1:
1200
                EDirection->setEnabled(true);
1201
                EDirection_2->setEnabled(false);
1202
                EDirection_2_2->setEnabled(false);
1203
                break;
1204
        case 2:
1205
                EDirection->setEnabled(false);
1206
                EDirection_2->setEnabled(true);
1207
                EDirection_2_2->setEnabled(false);
1208
                break;
1209
        case 4:
1210
        case 6:
1211
                EDirection->setEnabled(false);
1212
                EDirection_2->setEnabled(false);
1213
                EDirection_2_2->setEnabled(true);
1214
                if (nr == 6)
1215
                {
1216
                        EDirection_2_2->listBox()->item(2)->setSelectable(true);
1217
                        EDirection_2_2->listBox()->item(3)->setSelectable(true);
1218
                }
1219
                else
1220
                        EDirection_2_2->listBox()->item(4)->setSelectable(true);
1221
                break;
1222
        case 5:
1223
                EDirection->setEnabled(true);
1224
                EDirection_2->setEnabled(true);
1225
                EDirection_2_2->setEnabled(false);
1226
                break;
1227
        }
1228
}
1229
 
1230
void TabPDFOptions::PagePr()
1231
{
1232
        disconnect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
1233
        QString tmp;
1815 fschmid 1234
        QPixmap pm;
1307 fschmid 1235
        int ci = Pages->currentItem();
1236
        if (PagePrev->isChecked())
1237
        {
1238
                for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
1815 fschmid 1239
                {
1240
                        pm.convertFromImage(view->PageToPixmap(pg, 70));
1241
                        Pages->changeItem(pm, tr("Page")+" "+tmp.setNum(pg+1), pg);
1242
                }
1307 fschmid 1243
        }
1244
        else
1245
        {
1246
                for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
1247
                        Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
1248
        }
1249
        if (ci != -1)
1250
        {
1251
                PgSel = ci;
1252
                Pages->setCurrentItem(ci);
1253
        }
1254
        else
1255
        {
1256
                PgSel = 0;
1257
                Pages->clearSelection();
1258
        }
1259
        connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
1260
}
1261
 
1262
void TabPDFOptions::DoDownsample()
1263
{
1264
        if (DSColor->isChecked())
1265
        {
1266
                ValC->setEnabled(true);
1267
                if (ValC->value() > Resolution->value())
1268
                        ValC->setValue(Resolution->value());
1269
                ValC->setMaxValue(Resolution->value());
1270
                ValC->setMinValue(35);
1271
        }
1272
        else
1273
                ValC->setEnabled(false);
1274
}
1275
 
1276
void TabPDFOptions::RemoveEmbed()
1277
{
1278
        FontsToEmbed.remove(EmbedList->currentText());
1279
        EmbedList->removeItem(EmbedList->currentItem());
1280
        EmbedList->clearSelection();
1281
        if (EmbedList->count() == 0)
1282
        {
1283
                FromEmbed->setEnabled(false);
1284
                ToSubset->setEnabled(false);
1285
        }
1286
}
1287
 
1288
void TabPDFOptions::PutToEmbed()
1289
{
1290
        if (EmbedList->count() != 0)
1291
        {
1292
                if (EmbedList->findItem(AvailFlist->currentText()) == NULL)
1293
                {
1294
                        FontsToEmbed.append(AvailFlist->currentText());
1295
                        EmbedList->insertItem(AvailFlist->currentText());
1296
                }
1297
        }
1298
        else
1299
        {
1300
                FontsToEmbed.append(AvailFlist->currentText());
1301
                EmbedList->insertItem(AvailFlist->currentText());
1302
        }
1303
}
1304
 
1305
void TabPDFOptions::RemoveSubset()
1306
{
1307
        FontsToSubset.remove(SubsetList->currentText());
1308
        FontsToEmbed.append(SubsetList->currentText());
1309
        EmbedList->insertItem(SubsetList->currentText());
1310
        SubsetList->removeItem(SubsetList->currentItem());
1311
        SubsetList->clearSelection();
1312
        if (SubsetList->count() == 0)
1313
                FromSubset->setEnabled(false);
1314
}
1315
 
1316
void TabPDFOptions::PutToSubset()
1317
{
1318
        if (SubsetList->count() != 0)
1319
        {
1320
                if (SubsetList->findItem(EmbedList->currentText()) == NULL)
1321
                {
1322
                        FontsToSubset.append(EmbedList->currentText());
1323
                        SubsetList->insertItem(EmbedList->currentText());
1324
                }
1325
        }
1326
        else
1327
        {
1328
                FontsToSubset.append(EmbedList->currentText());
1329
                SubsetList->insertItem(EmbedList->currentText());
1330
        }
1331
        FontsToEmbed.remove(EmbedList->currentText());
1332
        EmbedList->removeItem(EmbedList->currentItem());
1333
        EmbedList->clearSelection();
1334
        if (EmbedList->count() == 0)
1335
        {
1336
                FromEmbed->setEnabled(false);
1337
                ToSubset->setEnabled(false);
1338
        }
1339
}
1340
 
1341
void TabPDFOptions::SelAFont(QListBoxItem *c)
1342
{
1343
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1344
        {
1345
                FromEmbed->setEnabled(false);
1346
                if (c->isSelectable())
1347
                        ToEmbed->setEnabled(true);
1348
                ToSubset->setEnabled(false);
1349
                FromSubset->setEnabled(false);
1350
                EmbedList->clearSelection();
1351
                SubsetList->clearSelection();
1352
        }
1353
}
1354
 
1355
void TabPDFOptions::SelEFont(QListBoxItem *c)
1356
{
1357
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1358
        {
1781 fschmid 1359
                if (!isTabEnabled(tabPDFX))
1360
                        FromEmbed->setEnabled(true);
1307 fschmid 1361
                ToEmbed->setEnabled(false);
1362
                ToSubset->setEnabled(true);
1363
                FromSubset->setEnabled(false);
1364
                AvailFlist->clearSelection();
1365
                SubsetList->clearSelection();
1366
        }
1367
}
1368
 
1369
void TabPDFOptions::SelSFont(QListBoxItem *c)
1370
{
1371
        if ((c != NULL) && (!EmbedFonts->isChecked()))
1372
        {
1373
                FromSubset->setEnabled(true);
1374
                ToSubset->setEnabled(false);
1375
                ToEmbed->setEnabled(false);
1376
                FromEmbed->setEnabled(false);
1377
                EmbedList->clearSelection();
1378
                AvailFlist->clearSelection();
1379
        }
1380
}
1381
 
1382
void TabPDFOptions::EmbedAll()
1383
{
1384
        if (EmbedFonts->isChecked())
1385
        {
1386
                SubsetFonts->setChecked(false);
1387
                EmbedList->clear();
1388
                FontsToEmbed.clear();
1389
                SubsetList->clear();
1390
                FontsToSubset.clear();
1391
                FromEmbed->setEnabled(false);
1392
                ToEmbed->setEnabled(false);
1393
                ToSubset->setEnabled(false);
1394
                FromSubset->setEnabled(false);
1395
                for (uint a=0; a < AvailFlist->count(); ++a)
1396
                {
1397
                        if (AvailFlist->item(a)->isSelectable())
1398
                        {
1399
                                FontsToEmbed.append(AvailFlist->item(a)->text());
1400
                                EmbedList->insertItem(AvailFlist->item(a)->text());
1401
                        }
1402
                }
1403
        }
1404
}
1405
 
1406
void TabPDFOptions::SubsetAll()
1407
{
1408
        if (SubsetFonts->isChecked())
1409
        {
1410
                EmbedFonts->setChecked(false);
1411
                EmbedList->clear();
1412
                FontsToEmbed.clear();
1413
                SubsetList->clear();
1414
                FontsToSubset.clear();
1415
                FromEmbed->setEnabled(false);
1416
                ToEmbed->setEnabled(false);
1417
                ToSubset->setEnabled(false);
1418
                FromSubset->setEnabled(false);
1419
                for (uint a=0; a < AvailFlist->count(); ++a)
1420
                {
1421
                        if (AvailFlist->item(a)->isSelectable())
1422
                        {
1423
                                FontsToSubset.append(AvailFlist->item(a)->text());
1424
                                SubsetList->insertItem(AvailFlist->item(a)->text());
1425
                        }
1426
                }
1427
        }
1428
}