Subversion Repositories Scribus

Rev

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