r20490 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 24 12:33:21 UTC 2015


Author: jghali
Date: Sat Oct 24 12:33:21 2015
New Revision: 20490

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20490
Log:
#13458: Note Styles editor non-switching translations

Modified:
    trunk/Scribus/scribus/ui/notesstyleseditor.cpp
    trunk/Scribus/scribus/ui/notesstyleseditor.h

Modified: trunk/Scribus/scribus/ui/notesstyleseditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20490&path=/trunk/Scribus/scribus/ui/notesstyleseditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/notesstyleseditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/notesstyleseditor.cpp	Sat Oct 24 12:33:21 2015
@@ -53,10 +53,22 @@
 	storeSize();
 }
 
+void NotesStylesEditor::changeEvent(QEvent *e)
+{
+	if (e->type() == QEvent::LanguageChange)
+	{
+		languageChange();
+		return;
+	}
+	ScrPaletteBase::changeEvent(e);
+}
+
 void NotesStylesEditor::languageChange()
 {
 	bool wasSignalsBlocked = signalsBlocked();
 	setBlockSignals(true);
+
+	retranslateUi(this);
 
 	if (addNewNsMode)
 	{
@@ -70,26 +82,34 @@
 		OKButton->setToolTip("");
 		ApplyButton->setText(tr("Apply"));
 	}
-	NewButton->setText(tr("Add New Style"));
-    NewButton->setToolTip(tr("New notes style will be add to document only after pressing Apply button.\nYou cannot switch to different notes style before you apply that new one or press Cancel button and exit from adding mode."));
-	NewNameLabel->setText(tr("New Style Name"));
-	FootRadio->setText(tr("Footnotes"));
-	EndRadio->setText(tr("Endnotes"));
-	NumberingLabel->setText(tr("Numbering"));
-	RangeLabel->setText(tr("Range"));
-	StartLabel->setText(tr("Start Number"));
-	PrefixLabel->setText(tr("Prefix"));
-	SuffixLabel->setText(tr("Suffix"));
-	SuperMasterLabel->setText(tr("Superscript in text"));
-	SuperNoteLabel->setText(tr("Superscript in notes"));
-	charStyleComboLabel->setText(tr("Mark Character Style"));
-	paraStyleComboLabel->setText(tr("Note Paragraph Style"));
-	AutoHLabel->setText(tr("Auto Height"));
-	AutoWLabel->setText(tr("Auto Width"));
-	AutoWeldLabel->setText(tr("Auto Welding"));
-	AutoRemoveLabel->setText(tr("Remove if empty"));
-	DeleteButton->setText(tr("Delete"));
-	setBlockSignals(wasSignalsBlocked);
+
+	bool paraStyleBlocked = paraStyleCombo->blockSignals(true);
+	int  paraStyleIndex = paraStyleCombo->currentIndex();
+	paraStyleCombo->setDoc(m_Doc);
+	if (paraStyleIndex >= 0)
+		paraStyleCombo->setCurrentIndex(paraStyleIndex);
+	paraStyleCombo->blockSignals(paraStyleBlocked);
+
+	bool charStyleBlocked = charStyleCombo->blockSignals(true);
+	int  charStyleIndex = charStyleCombo->currentIndex();
+	charStyleCombo->setDoc(m_Doc);
+	if (charStyleIndex >= 0)
+		charStyleCombo->setCurrentIndex(charStyleIndex);
+	charStyleCombo->blockSignals(charStyleBlocked);
+
+	bool rangeBlocked = RangeBox->blockSignals(true);
+	int  rangeIndex = RangeBox->currentIndex();
+	RangeBox->clear();
+	RangeBox->addItem(tr("Document"));
+	RangeBox->addItem(tr("Section"));
+	RangeBox->addItem(tr("Story"));
+	RangeBox->addItem(tr("Page"));
+	RangeBox->addItem(tr("Frame"));
+	if (rangeIndex >= 0)
+		RangeBox->setCurrentIndex(rangeIndex);
+	RangeBox->blockSignals(rangeBlocked);
+
+    setBlockSignals(wasSignalsBlocked);
 }
 
 void NotesStylesEditor::setDoc(ScribusDoc *doc)

Modified: trunk/Scribus/scribus/ui/notesstyleseditor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20490&path=/trunk/Scribus/scribus/ui/notesstyleseditor.h
==============================================================================
--- trunk/Scribus/scribus/ui/notesstyleseditor.h	(original)
+++ trunk/Scribus/scribus/ui/notesstyleseditor.h	Sat Oct 24 12:33:21 2015
@@ -15,6 +15,8 @@
 public:
 	explicit NotesStylesEditor(QWidget *parent = 0, const char *name = "notesStylesEditor");
 	~NotesStylesEditor();
+
+	virtual void changeEvent(QEvent *e);
 	void updateNSList();
 
 private:




More information about the scribus-commit mailing list