Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 17576 → Rev 17577

/branches/Version14x/Scribus/scribus/ui/copypagetomasterpagedialog.cpp
5,9 → 5,10
for which a new license (GPL+exception) is in place.
*/
 
#include <QAbstractButton>
#include <QCheckBox>
#include <QLineEdit>
 
#include "commonstrings.h"
#include "copypagetomasterpagedialog.h"
 
CopyPageToMasterPageDialog::CopyPageToMasterPageDialog(int existingMasterNamesCount, QStringList& pageLocations, int currentLocation, QWidget *parent)
14,6 → 15,16
: QDialog(parent)
{
setupUi(this);
 
QList<QAbstractButton *> buttonList = buttonBox->buttons();
foreach (QAbstractButton* b, buttonList)
{
if (buttonBox->buttonRole(b)==QDialogButtonBox::AcceptRole)
b->setText(CommonStrings::tr_OK);
else
if (buttonBox->buttonRole(b)==QDialogButtonBox::RejectRole)
b->setText(CommonStrings::tr_Cancel);
}
nameLineEdit->setText( tr("New Master Page %1").arg(existingMasterNamesCount));
if (currentLocation==-1)
20,7 → 31,8
pagePositionComboBox->hide();
else
{
pagePositionComboBox->addItems(pageLocations);
foreach (QString untranslatedPageName, pageLocations)
pagePositionComboBox->addItem(CommonStrings::translatePageSetLocString(untranslatedPageName));
pagePositionComboBox->setCurrentIndex(currentLocation);
}
}
/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
145,7 → 145,7
 
if (currentFile != doc->DocName)
{
satdialog* satdia = new satdialog(doc->scMW(),docName,
SATDialog* satdia = new SATDialog(doc->scMW(),docName,
static_cast<int>(doc->pageWidth + 0.5),
static_cast<int>(doc->pageHeight + 0.5));
if (satdia->exec())
171,7 → 171,7
 
// --------------------- CLASS sat ------------------------------------------------//
 
sat::sat(ScribusDoc* doc, satdialog* satdia, QString fileName, QString tmplDir)
sat::sat(ScribusDoc* doc, SATDialog* satdia, QString fileName, QString tmplDir)
{
lang = ScCore->getGuiLanguage();
m_Doc = doc;
/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h
34,7 → 34,7
extern "C" PLUGIN_API void saveastemplateplugin_freePlugin(ScPlugin* plugin);
 
 
class satdialog;
class SATDialog;
 
 
class MenuSAT : public QObject
55,7 → 55,7
{
private:
ScribusDoc* m_Doc;
satdialog* dia;
SATDialog* dia;
QString file;
QString dir;
QString tmplXmlFile;
67,7 → 67,7
public:
void createTmplXml();
void createImages();
sat(ScribusDoc* doc, satdialog* satdia, QString fileName, QString tmplDir);
sat(ScribusDoc* doc, SATDialog* satdia, QString fileName, QString tmplDir);
~sat();
};
 
/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
35,7 → 35,7
};
};
 
satdialog::satdialog(QWidget* parent, QString tmplName, int pageW, int pageH) : QDialog(parent)
SATDialog::SATDialog(QWidget* parent, QString tmplName, int pageW, int pageH) : QDialog(parent)
{
setupUi(this);
setModal(true);
53,7 → 53,7
connect(detailButton, SIGNAL(stateChanged(int)), this, SLOT(detailClicked(int)));
}
 
void satdialog::detailClicked(int state)
void SATDialog::detailClicked(int state)
{
isFullDetail = state == Qt::Checked;
 
73,7 → 73,7
emailEdit->setVisible(isFullDetail);
}
 
void satdialog::readPrefs()
void SATDialog::readPrefs()
{
prefs = PrefsManager::instance()->prefsFile->getPluginContext("satemplate");
author = prefs->get("author", "");
83,7 → 83,7
detailButton->setCheckState(isFullDetail ? Qt::Checked : Qt::Unchecked);
}
 
void satdialog::writePrefs()
void SATDialog::writePrefs()
{
prefs->set("author", authorEdit->text());
prefs->set("email", emailEdit->text());
90,7 → 90,7
prefs->set("isFullDetail", isFullDetail);
}
 
QString satdialog::findTemplateXml(QString dir)
QString SATDialog::findTemplateXml(QString dir)
{
QString lang = ScCore->getGuiLanguage();
QString tmp = dir + "/template." + lang + ".xml";
106,7 → 106,7
return dir + "/template.xml";
}
 
void satdialog::addCategories(const QString& dir)
void SATDialog::addCategories(const QString& dir)
{
// Read categories from the dir itself
QString tmplFile = findTemplateXml(dir);
128,7 → 128,7
}
}
 
void satdialog::readCategories(const QString& fileName)
void SATDialog::readCategories(const QString& fileName)
{
QFile file(fileName);
CategoriesReader catReader;
145,7 → 145,7
}
}
 
void satdialog::setupCategories()
void SATDialog::setupCategories()
{
// en will be used in template.xml and it will be then replaced with the lang when used for users
// to get the categories in their language.
192,7 → 192,7
catsCombo->setEditable(true);
}
 
void satdialog::setupPageSize(int w, int h)
void SATDialog::setupPageSize(int w, int h)
{
QString sizelist[] =
{"2380x3368", "1684x2380", "1190x1684", "842x1190", "595x842", "421x595", "297x421", "210x297", "148x210",
238,7 → 238,7
psizeEdit->setText(psize + orient);
}
 
satdialog::~satdialog()
SATDialog::~SATDialog()
{
writePrefs();
}
/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h
14,13 → 14,13
#include <QMap>
#include <prefscontext.h>
 
class satdialog : public QDialog, public Ui::satdialog
class SATDialog : public QDialog, public Ui::satdialog
{
Q_OBJECT
 
public:
satdialog(QWidget* parent, QString tmplName = "", int pageW = 0, int pageH = 0);
~satdialog();
SATDialog(QWidget* parent, QString tmplName = "", int pageW = 0, int pageH = 0);
~SATDialog();
 
QMap<QString, QString> cats;
private slots: