diff -r 96232974dcdb -r 645c12de6b0c SqlBrowser/SqlBrowser.py --- a/SqlBrowser/SqlBrowser.py Sun Mar 30 22:00:14 2014 +0200 +++ b/SqlBrowser/SqlBrowser.py Thu Apr 03 23:05:31 2014 +0200 @@ -38,7 +38,7 @@ super(SqlBrowser, self).__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"), @@ -62,7 +62,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(), @@ -70,7 +70,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) @@ -83,7 +83,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: @@ -97,58 +97,58 @@ 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>""" )) - self.addConnectionAct.triggered[()].connect( + self.addConnectionAct.triggered.connect( self.__browser.addConnectionByDialog) 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.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>""" )) - self.aboutAct.triggered[()].connect(self.__about) + self.aboutAct.triggered.connect(self.__about) 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>""" )) - self.aboutQtAct.triggered[()].connect(self.__aboutQt) + self.aboutQtAct.triggered.connect(self.__aboutQt) self.__actions.append(self.aboutQtAct) def __initMenus(self): @@ -157,7 +157,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() @@ -165,7 +165,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) @@ -174,7 +174,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) @@ -187,8 +187,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 """ @@ -200,4 +200,4 @@ """ Private slot to show info about Qt. """ - E5MessageBox.aboutQt(self, self.trUtf8("SQL Browser")) + E5MessageBox.aboutQt(self, self.tr("SQL Browser"))