Subversion Repositories Scribus

Rev

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

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