Subversion Repositories Scribus

Rev

Rev 4822 | Details | Compare with Previous | Last modification | View Log | RSS feed

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