Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4200 → Rev 4201

/branches/Version13x/Scribus/scribus/fileloader.cpp
1314,14 → 1314,17
doc->PDF_Options.Encrypt = static_cast<bool>(pg.attribute("Encrypt", "0").toInt());
doc->PDF_Options.useLayers = static_cast<bool>(pg.attribute("UseLayers", "0").toInt());
doc->PDF_Options.UseLPI = static_cast<bool>(pg.attribute("UseLpi", "0").toInt());
doc->PDF_Options.UseSpotColors = static_cast<bool>(dc.attribute("UseSpotColors", "1").toInt());
doc->PDF_Options.doMultiFile = static_cast<bool>(dc.attribute("doMultiFile", "0").toInt());
doc->PDF_Options.displayBookmarks = static_cast<bool>(dc.attribute("displayBookmarks", "0").toInt());
doc->PDF_Options.displayFullscreen = static_cast<bool>(dc.attribute("displayFullscreen", "0").toInt());
doc->PDF_Options.displayLayers = static_cast<bool>(dc.attribute("displayLayers", "0").toInt());
doc->PDF_Options.displayThumbs = static_cast<bool>(dc.attribute("displayThumbs", "0").toInt());
doc->PDF_Options.PageLayout = dc.attribute("PageLayout", "0").toInt();
doc->PDF_Options.openAction = dc.attribute("openAction", "");
doc->PDF_Options.UseSpotColors = static_cast<bool>(pg.attribute("UseSpotColors", "1").toInt());
doc->PDF_Options.doMultiFile = static_cast<bool>(pg.attribute("doMultiFile", "0").toInt());
doc->PDF_Options.displayBookmarks = static_cast<bool>(pg.attribute("displayBookmarks", "0").toInt());
doc->PDF_Options.displayFullscreen = static_cast<bool>(pg.attribute("displayFullscreen", "0").toInt());
doc->PDF_Options.displayLayers = static_cast<bool>(pg.attribute("displayLayers", "0").toInt());
doc->PDF_Options.displayThumbs = static_cast<bool>(pg.attribute("displayThumbs", "0").toInt());
doc->PDF_Options.hideMenuBar = static_cast<bool>(pg.attribute("hideMenuBar", "0").toInt());
doc->PDF_Options.hideToolBar = static_cast<bool>(pg.attribute("hideToolBar", "0").toInt());
doc->PDF_Options.fitWindow = static_cast<bool>(pg.attribute("fitWindow", "0").toInt());
doc->PDF_Options.PageLayout = pg.attribute("PageLayout", "0").toInt();
doc->PDF_Options.openAction = pg.attribute("openAction", "");
QDomNode PFO = PAGE.firstChild();
while(!PFO.isNull())
{
/branches/Version13x/Scribus/scribus/pdfopts.cpp
181,6 → 181,9
Opts->displayFullscreen = Options->useFullScreen->isChecked();
Opts->displayLayers = Options->useLayers2->isChecked();
Opts->displayThumbs = Options->useThumbnails->isChecked();
Opts->hideMenuBar = Options->hideMenuBar->isChecked();
Opts->hideToolBar = Options->hideToolBar->isChecked();
Opts->fitWindow = Options->fitWindow->isChecked();
int pgl = PDFOptions::SinglePage;
if (Options->singlePage->isChecked())
pgl = PDFOptions::SinglePage;
/branches/Version13x/Scribus/scribus/tabpdfoptions.h
168,6 → 168,9
QRadioButton* useBookmarks;
QRadioButton* useThumbnails;
QRadioButton* useLayers2;
QCheckBox* hideToolBar;
QCheckBox* hideMenuBar;
QCheckBox* fitWindow;
QGroupBox* groupJava;
QLabel* actionLabel;
QComboBox* actionCombo;
/branches/Version13x/Scribus/scribus/tabpdfoptions.cpp
503,6 → 503,15
useLayers2->setText( tr( "Display Layers Tab" ) );
useLayers2->setChecked(Optionen->displayLayers);
groupNavigationLayout->addWidget( useLayers2 );
hideToolBar = new QCheckBox( tr( "Hide Viewers Toolbar" ), groupNavigation, "hideToolBar" );
hideToolBar->setChecked(Optionen->hideToolBar);
groupNavigationLayout->addWidget( hideToolBar );
hideMenuBar = new QCheckBox( tr( "Hide Viewers Menubar" ), groupNavigation, "hideMenuBar" );
hideMenuBar->setChecked(Optionen->hideMenuBar);
groupNavigationLayout->addWidget( hideMenuBar );
fitWindow = new QCheckBox( tr( "Zoom Pages to fit Viewer Window" ), groupNavigation, "fitWindow" );
fitWindow->setChecked(Optionen->fitWindow);
groupNavigationLayout->addWidget( fitWindow );
LayoutSpecial->addWidget( groupNavigation );
groupDisplayLayout->addLayout( LayoutSpecial );
tabSpecialLayout->addWidget( groupDisplay );
522,6 → 531,8
QMap<QString,QString>::Iterator itja;
for (itja = view->Doc->JavaScripts.begin(); itja != view->Doc->JavaScripts.end(); ++itja)
actionCombo->insertItem(itja.key());
if (view->Doc->JavaScripts.contains(Optionen->openAction))
actionCombo->setCurrentText(Optionen->openAction);
groupJavaLayout->addWidget( actionCombo );
tabSpecialLayout->addWidget( groupJava );
if (Optionen->PageLayout == PDFOptions::SinglePage)
/branches/Version13x/Scribus/scribus/pdflib.cpp
519,23 → 519,18
PutDoc("/PageMode /UseThumbs\n");
else if ((Options->Version == 15) && (Options->displayLayers))
PutDoc("/PageMode /UseOC\n");
/* if (doc->currentPageLayout == doublePage)
if (!Options->openAction.isEmpty())
{
PutDoc("/PageLayout ");
if (doc->pageSets[doc->currentPageLayout].FirstPage == 0)
PutDoc("/TwoColumnLeft\n");
else
PutDoc("/TwoColumnRight\n");
PutDoc("/OpenAction << /S /JavaScript /JS (this."+Options->openAction+"\\(\\)) >>\n");
}
if (Options->PresentMode)
PutDoc("/PageMode /FullScreen\n");
else
{
if ((Options->Version == 15) && (Options->useLayers))
PutDoc("/PageMode /UseOC\n");
} */
PutDoc("/ViewerPreferences\n<<\n/PageDirection ");
PutDoc( Options->Binding == 0 ? "/L2R\n" : "/R2L\n");
if (Options->hideToolBar)
PutDoc("/HideToolbar true\n");
if (Options->hideMenuBar)
PutDoc("/HideMenubar true\n");
if (Options->fitWindow)
PutDoc("/FitWindow true\n");
PutDoc(" >>\n>>\nendobj\n");
QString IDg(Datum);
IDg += Options->Datei;
/branches/Version13x/Scribus/scribus/prefsmanager.cpp
387,6 → 387,9
appPrefs.PDF_Options.displayFullscreen = false;
appPrefs.PDF_Options.displayLayers = false;
appPrefs.PDF_Options.displayThumbs = false;
appPrefs.PDF_Options.hideMenuBar = false;
appPrefs.PDF_Options.hideToolBar = false;
appPrefs.PDF_Options.fitWindow = false;
appPrefs.PDF_Options.PageLayout = PDFOptions::SinglePage;
appPrefs.PDF_Options.openAction = "";
 
/branches/Version13x/Scribus/scribus/scribusXml.cpp
3325,6 → 3325,9
pdf.setAttribute("displayFullscreen", static_cast<int>(doc->PDF_Options.displayFullscreen));
pdf.setAttribute("displayLayers", static_cast<int>(doc->PDF_Options.displayLayers));
pdf.setAttribute("displayThumbs", static_cast<int>(doc->PDF_Options.displayThumbs));
pdf.setAttribute("hideMenuBar", static_cast<int>(doc->PDF_Options.hideMenuBar));
pdf.setAttribute("hideToolBar", static_cast<int>(doc->PDF_Options.hideToolBar));
pdf.setAttribute("fitWindow", static_cast<int>(doc->PDF_Options.fitWindow));
pdf.setAttribute("PageLayout", doc->PDF_Options.PageLayout);
pdf.setAttribute("openAction", doc->PDF_Options.openAction);
for (uint pdoF = 0; pdoF < doc->PDF_Options.EmbedList.count(); ++pdoF)
/branches/Version13x/Scribus/scribus/pdfoptions.h
124,6 → 124,9
bool displayThumbs;
bool displayLayers;
bool displayFullscreen;
bool hideToolBar;
bool hideMenuBar;
bool fitWindow;
QString openAction;
};
 
/branches/Version13x/Scribus/scribus/javadocs.cpp
6,41 → 6,42
#include "scribusdoc.h"
#include "page.h"
#include "commonstrings.h"
#include <qregexp.h>
 
extern QPixmap loadIcon(QString nam);
 
JavaDocs::JavaDocs(QWidget* parent, ScribusDoc *doc, ScribusView* vie)
: QDialog( parent, "Javadocs", true, 0 )
: QDialog( parent, "Javadocs", true, 0 )
{
setCaption( tr( "Edit JavaScripts" ) );
setCaption( tr( "Edit JavaScripts" ) );
setIcon(loadIcon("AppIcon.png"));
Doc = doc;
Doc = doc;
View = vie;
JavaDocsLayout = new QHBoxLayout( this, 11, 6, "JavaDocsLayout");
JavaDocsLayout = new QHBoxLayout( this, 11, 6, "JavaDocsLayout");
 
Scripts = new QListBox( this, "Scripts" );
Scripts->setMinimumSize( QSize( 150, 200 ) );
Scripts = new QListBox( this, "Scripts" );
Scripts->setMinimumSize( QSize( 150, 200 ) );
QMap<QString,QString>::Iterator it;
for (it = Doc->JavaScripts.begin(); it != Doc->JavaScripts.end(); ++it)
Scripts->insertItem(it.key());
JavaDocsLayout->addWidget( Scripts );
JavaDocsLayout->addWidget( Scripts );
 
Layout1 = new QVBoxLayout( 0, 0, 6, "Layout1");
Layout1 = new QVBoxLayout( 0, 0, 6, "Layout1");
 
EditScript = new QPushButton( tr( "&Edit..." ), this, "EditScript" );
Layout1->addWidget( EditScript );
EditScript = new QPushButton( tr( "&Edit..." ), this, "EditScript" );
Layout1->addWidget( EditScript );
 
AddScript = new QPushButton( tr( "&Add..." ), this, "AddScript" );
Layout1->addWidget( AddScript );
AddScript = new QPushButton( tr( "&Add..." ), this, "AddScript" );
Layout1->addWidget( AddScript );
 
DeleteScript = new QPushButton( tr( "&Delete" ), this, "DeleteScript" );
Layout1->addWidget( DeleteScript );
QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer );
DeleteScript = new QPushButton( tr( "&Delete" ), this, "DeleteScript" );
Layout1->addWidget( DeleteScript );
QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer );
 
ExitDia = new QPushButton( tr( "&Close" ), this, "ExitDia" );
ExitDia->setDefault( true );
Layout1->addWidget( ExitDia );
ExitDia = new QPushButton( tr( "&Close" ), this, "ExitDia" );
ExitDia->setDefault( true );
Layout1->addWidget( ExitDia );
if (Doc->JavaScripts.count() == 0)
{
EditScript->setEnabled(false);
48,12 → 49,13
}
else
Scripts->setCurrentItem(0);
JavaDocsLayout->addLayout( Layout1 );
JavaDocsLayout->addLayout( Layout1 );
connect(AddScript, SIGNAL(clicked()), this, SLOT(slotAdd()));
connect(EditScript, SIGNAL(clicked()), this, SLOT(slotEdit()));
connect(DeleteScript, SIGNAL(clicked()), this, SLOT(slotDelete()));
connect(ExitDia, SIGNAL(clicked()), this, SLOT(accept()));
connect( Scripts, SIGNAL( selected(QListBoxItem*) ), this, SLOT( slotEdit() ) );
QToolTip::add( AddScript, "<qt>" + tr( "Adds a new Script, predefines a function with the same name. If you want to use this script as an \"Open Action\" script be sure not to change the name of the function." ) + "</qt>" );
}
 
void JavaDocs::slotAdd()
64,6 → 66,7
if (dia->exec())
{
nam = dia->getEditText();
nam.replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" );
while (Doc->JavaScripts.contains(nam) || (nam.isEmpty()))
{
if (!dia->exec())
74,6 → 77,7
nam = dia->getEditText();
}
Editor* dia2 = new Editor(this, "", View);
dia2->EditTex->setText("function "+nam+"()\n{\n}");
if (dia2->exec())
{
EditScript->setEnabled(true);
102,11 → 106,11
void JavaDocs::slotDelete()
{
int exit=ScMessageBox::warning(this,
CommonStrings::trWarning,
tr("Do you really want to delete this script?"),
tr("&Yes"),
tr("&No"),
0, 0, 0);
CommonStrings::trWarning,
tr("Do you really want to delete this script?"),
tr("&Yes"),
tr("&No"),
0, 0, 0);
if (exit == 0)
{
QString nam = Scripts->currentText();
/branches/Version13x/Scribus/scribus/javadocs.h
12,19 → 12,19
class ScribusView;
 
class SCRIBUS_API JavaDocs : public QDialog
{
Q_OBJECT
{
Q_OBJECT
 
public:
JavaDocs( QWidget* parent, ScribusDoc *doc, ScribusView* vie);
~JavaDocs() {};
JavaDocs( QWidget* parent, ScribusDoc *doc, ScribusView* vie);
~JavaDocs() {};
 
QListBox* Scripts;
QPushButton* EditScript;
QPushButton* AddScript;
QPushButton* DeleteScript;
QPushButton* ExitDia;
ScribusDoc *Doc;
QListBox* Scripts;
QPushButton* EditScript;
QPushButton* AddScript;
QPushButton* DeleteScript;
QPushButton* ExitDia;
ScribusDoc *Doc;
ScribusView *View;
 
private slots:
36,8 → 36,8
void docChanged(bool);
 
protected:
QHBoxLayout* JavaDocsLayout;
QVBoxLayout* Layout1;
QHBoxLayout* JavaDocsLayout;
QVBoxLayout* Layout1;
};
 
#endif // JAVADOCS_H