Subversion Repositories Scribus

Rev

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