[qet] [1518] The application now uses right-to-left layouts when required by translations through a special , non-displayed translated string.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1518
Author:   xavier
Date:     2012-02-20 22:20:34 +0100 (Mon, 20 Feb 2012)
Log Message:
-----------
The application now uses right-to-left layouts when required by translations through a special, non-displayed translated string.

Modified Paths:
--------------
    branches/0.3/sources/qetapp.cpp
    branches/0.3/sources/qetapp.h

Modified: branches/0.3/sources/qetapp.cpp
===================================================================
--- branches/0.3/sources/qetapp.cpp	2012-02-20 21:04:12 UTC (rev 1517)
+++ branches/0.3/sources/qetapp.cpp	2012-02-20 21:20:34 UTC (rev 1518)
@@ -168,9 +168,22 @@
 		}
 	}
 	installTranslator(&qetTranslator);
+	
+	QString ltr_special_string = tr(
+		"LTR",
+		"Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR"
+	);
+	if (ltr_special_string == "RTL") switchLayout(Qt::RightToLeft);
 }
 
 /**
+	Switches the application to the provided layout.
+*/
+void QETApp::switchLayout(Qt::LayoutDirection direction) {
+	setLayoutDirection(direction);
+}
+
+/**
 	Gere les evenements relatifs au QSystemTrayIcon
 	@param reason un entier representant l'evenement survenu sur le systray
 */

Modified: branches/0.3/sources/qetapp.h
===================================================================
--- branches/0.3/sources/qetapp.h	2012-02-20 21:04:12 UTC (rev 1517)
+++ branches/0.3/sources/qetapp.h	2012-02-20 21:20:34 UTC (rev 1518)
@@ -62,6 +62,7 @@
 	public:
 	static QETApp *instance();
 	void setLanguage(const QString &);
+	void switchLayout(Qt::LayoutDirection);
 	static void printHelp();
 	static void printVersion();
 	static void printLicense();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/