SqlBrowser/SqlBrowser.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3345
071afe8be2a1
--- a/SqlBrowser/SqlBrowser.py	Fri Jan 10 19:30:21 2014 +0100
+++ b/SqlBrowser/SqlBrowser.py	Sat Jan 11 11:55:33 2014 +0100
@@ -36,7 +36,7 @@
         super().__init__(parent)
         self.setObjectName("SqlBrowser")
         
-        self.setWindowTitle(self.trUtf8("SQL Browser"))
+        self.setWindowTitle(self.tr("SQL Browser"))
         self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
         
         self.setStyle(Preferences.getUI("Style"),
@@ -60,7 +60,7 @@
             url = QUrl(connection, QUrl.TolerantMode)
             if not url.isValid():
                 self.__warnings.append(
-                    self.trUtf8("Invalid URL: {0}").format(connection))
+                    self.tr("Invalid URL: {0}").format(connection))
                 continue
             
             err = self.__browser.addConnection(url.scheme(), url.path(),
@@ -68,7 +68,7 @@
                                                url.host(), url.port(-1))
             if err.type() != QSqlError.NoError:
                 self.__warnings.append(
-                    self.trUtf8("Unable to open connection: {0}".format(
+                    self.tr("Unable to open connection: {0}".format(
                         err.text())))
         
         QTimer.singleShot(0, self.__uiStartUp)
@@ -81,7 +81,7 @@
         for warning in self.__warnings:
             E5MessageBox.warning(
                 self,
-                self.trUtf8("SQL Browser startup problem"),
+                self.tr("SQL Browser startup problem"),
                 warning)
         
         if len(QSqlDatabase.connectionNames()) == 0:
@@ -95,13 +95,13 @@
         self.__actions = []
         
         self.addConnectionAct = E5Action(
-            self.trUtf8('Add Connection'),
+            self.tr('Add Connection'),
             UI.PixmapCache.getIcon("databaseConnection.png"),
-            self.trUtf8('Add &Connection...'),
+            self.tr('Add &Connection...'),
             0, 0, self, 'sql_file_add_connection')
-        self.addConnectionAct.setStatusTip(self.trUtf8(
+        self.addConnectionAct.setStatusTip(self.tr(
             'Open a dialog to add a new database connection'))
-        self.addConnectionAct.setWhatsThis(self.trUtf8(
+        self.addConnectionAct.setWhatsThis(self.tr(
             """<b>Add Connection</b>"""
             """<p>This opens a dialog to add a new database"""
             """ connection.</p>"""
@@ -111,25 +111,25 @@
         self.__actions.append(self.addConnectionAct)
         
         self.exitAct = E5Action(
-            self.trUtf8('Quit'),
+            self.tr('Quit'),
             UI.PixmapCache.getIcon("exit.png"),
-            self.trUtf8('&Quit'),
-            QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")),
+            self.tr('&Quit'),
+            QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
             0, self, 'sql_file_quit')
-        self.exitAct.setStatusTip(self.trUtf8('Quit the SQL browser'))
-        self.exitAct.setWhatsThis(self.trUtf8(
+        self.exitAct.setStatusTip(self.tr('Quit the SQL browser'))
+        self.exitAct.setWhatsThis(self.tr(
             """<b>Quit</b>"""
             """<p>Quit the SQL browser.</p>"""
         ))
         self.exitAct.triggered[()].connect(qApp.closeAllWindows)
         
         self.aboutAct = E5Action(
-            self.trUtf8('About'),
-            self.trUtf8('&About'),
+            self.tr('About'),
+            self.tr('&About'),
             0, 0, self, 'sql_help_about')
-        self.aboutAct.setStatusTip(self.trUtf8(
+        self.aboutAct.setStatusTip(self.tr(
             'Display information about this software'))
-        self.aboutAct.setWhatsThis(self.trUtf8(
+        self.aboutAct.setWhatsThis(self.tr(
             """<b>About</b>"""
             """<p>Display some information about this software.</p>"""
         ))
@@ -137,12 +137,12 @@
         self.__actions.append(self.aboutAct)
         
         self.aboutQtAct = E5Action(
-            self.trUtf8('About Qt'),
-            self.trUtf8('About &Qt'),
+            self.tr('About Qt'),
+            self.tr('About &Qt'),
             0, 0, self, 'sql_help_about_qt')
         self.aboutQtAct.setStatusTip(
-            self.trUtf8('Display information about the Qt toolkit'))
-        self.aboutQtAct.setWhatsThis(self.trUtf8(
+            self.tr('Display information about the Qt toolkit'))
+        self.aboutQtAct.setWhatsThis(self.tr(
             """<b>About Qt</b>"""
             """<p>Display some information about the Qt toolkit.</p>"""
         ))
@@ -155,7 +155,7 @@
         """
         mb = self.menuBar()
         
-        menu = mb.addMenu(self.trUtf8('&File'))
+        menu = mb.addMenu(self.tr('&File'))
         menu.setTearOffEnabled(True)
         menu.addAction(self.addConnectionAct)
         menu.addSeparator()
@@ -163,7 +163,7 @@
         
         mb.addSeparator()
         
-        menu = mb.addMenu(self.trUtf8('&Help'))
+        menu = mb.addMenu(self.tr('&Help'))
         menu.setTearOffEnabled(True)
         menu.addAction(self.aboutAct)
         menu.addAction(self.aboutQtAct)
@@ -172,7 +172,7 @@
         """
         Private method to create the toolbars.
         """
-        filetb = self.addToolBar(self.trUtf8("File"))
+        filetb = self.addToolBar(self.tr("File"))
         filetb.setObjectName("FileToolBar")
         filetb.setIconSize(UI.Config.ToolBarIconSize)
         filetb.addAction(self.addConnectionAct)
@@ -185,8 +185,8 @@
         """
         E5MessageBox.about(
             self,
-            self.trUtf8("SQL Browser"),
-            self.trUtf8(
+            self.tr("SQL Browser"),
+            self.tr(
                 """<h3>About SQL Browser</h3>"""
                 """<p>The SQL browser window is a little tool to examine """
                 """the data and the schema of a database and to execute """
@@ -198,4 +198,4 @@
         """
         Private slot to show info about Qt.
         """
-        E5MessageBox.aboutQt(self, self.trUtf8("SQL Browser"))
+        E5MessageBox.aboutQt(self, self.tr("SQL Browser"))

eric ide

mercurial