r17577 by craig - #10202: Fix some GUI string translation issues

scribus-commit scribus-commit at lists.scribus.net
Sun Jun 17 18:38:27 UTC 2012


Author: craig
Date: Sun Jun 17 18:38:27 2012
New Revision: 17577

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17577
Log:
#10202: Fix some GUI string translation issues

Modified:
    branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
    branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h
    branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
    branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h
    branches/Version14x/Scribus/scribus/ui/copypagetomasterpagedialog.cpp

Modified: branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17577&path=/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp Sun Jun 17 18:38:27 2012
@@ -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,14 +83,14 @@
 	detailButton->setCheckState(isFullDetail ? Qt::Checked : Qt::Unchecked);
 }
 
-void satdialog::writePrefs()
+void SATDialog::writePrefs()
 {
 	prefs->set("author", authorEdit->text());
 	prefs->set("email", emailEdit->text());
 	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();
 }

Modified: branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17577&path=/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h (original)
+++ branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satdialog.h Sun Jun 17 18:38:27 2012
@@ -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:

Modified: branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17577&path=/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp Sun Jun 17 18:38:27 2012
@@ -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;

Modified: branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17577&path=/branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h (original)
+++ branches/Version14x/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h Sun Jun 17 18:38:27 2012
@@ -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();
 };
 

Modified: branches/Version14x/Scribus/scribus/ui/copypagetomasterpagedialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17577&path=/branches/Version14x/Scribus/scribus/ui/copypagetomasterpagedialog.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/ui/copypagetomasterpagedialog.cpp (original)
+++ branches/Version14x/Scribus/scribus/ui/copypagetomasterpagedialog.cpp Sun Jun 17 18:38:27 2012
@@ -5,22 +5,34 @@
 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)
  : 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)
 		pagePositionComboBox->hide();
 	else
 	{
-		pagePositionComboBox->addItems(pageLocations);
+		foreach (QString untranslatedPageName, pageLocations)
+			pagePositionComboBox->addItem(CommonStrings::translatePageSetLocString(untranslatedPageName));
 		pagePositionComboBox->setCurrentIndex(currentLocation);
 	}
 }




More information about the scribus-commit mailing list