9 |
9 |
10 from PyQt4.QtCore import * |
10 from PyQt4.QtCore import * |
11 from PyQt4.QtGui import * |
11 from PyQt4.QtGui import * |
12 from PyQt4.QtSql import QSqlError, QSqlDatabase |
12 from PyQt4.QtSql import QSqlError, QSqlDatabase |
13 |
13 |
14 from E4Gui.E4Action import E4Action |
14 from E5Gui.E5Action import E5Action |
15 |
15 |
16 from .SqlBrowserWidget import SqlBrowserWidget |
16 from .SqlBrowserWidget import SqlBrowserWidget |
17 |
17 |
18 import UI.PixmapCache |
18 import UI.PixmapCache |
19 import UI.Config |
19 import UI.Config |
81 Private method to define the user interface actions. |
81 Private method to define the user interface actions. |
82 """ |
82 """ |
83 # list of all actions |
83 # list of all actions |
84 self.__actions = [] |
84 self.__actions = [] |
85 |
85 |
86 self.addConnectionAct = E4Action(self.trUtf8('Add Connection'), |
86 self.addConnectionAct = E5Action(self.trUtf8('Add Connection'), |
87 UI.PixmapCache.getIcon("databaseConnection.png"), |
87 UI.PixmapCache.getIcon("databaseConnection.png"), |
88 self.trUtf8('Add &Connection...'), |
88 self.trUtf8('Add &Connection...'), |
89 0, 0, self, 'sql_file_add_connection') |
89 0, 0, self, 'sql_file_add_connection') |
90 self.addConnectionAct.setStatusTip(self.trUtf8( |
90 self.addConnectionAct.setStatusTip(self.trUtf8( |
91 'Open a dialog to add a new database connection')) |
91 'Open a dialog to add a new database connection')) |
95 )) |
95 )) |
96 self.connect(self.addConnectionAct, SIGNAL('triggered()'), |
96 self.connect(self.addConnectionAct, SIGNAL('triggered()'), |
97 self.__browser.addConnectionByDialog) |
97 self.__browser.addConnectionByDialog) |
98 self.__actions.append(self.addConnectionAct) |
98 self.__actions.append(self.addConnectionAct) |
99 |
99 |
100 self.exitAct = E4Action(self.trUtf8('Quit'), |
100 self.exitAct = E5Action(self.trUtf8('Quit'), |
101 UI.PixmapCache.getIcon("exit.png"), |
101 UI.PixmapCache.getIcon("exit.png"), |
102 self.trUtf8('&Quit'), |
102 self.trUtf8('&Quit'), |
103 QKeySequence(self.trUtf8("Ctrl+Q","File|Quit")), |
103 QKeySequence(self.trUtf8("Ctrl+Q","File|Quit")), |
104 0, self, 'sql_file_quit') |
104 0, self, 'sql_file_quit') |
105 self.exitAct.setStatusTip(self.trUtf8('Quit the SQL browser')) |
105 self.exitAct.setStatusTip(self.trUtf8('Quit the SQL browser')) |
108 """<p>Quit the SQL browser.</p>""" |
108 """<p>Quit the SQL browser.</p>""" |
109 )) |
109 )) |
110 self.connect(self.exitAct, SIGNAL('triggered()'), |
110 self.connect(self.exitAct, SIGNAL('triggered()'), |
111 qApp, SLOT('closeAllWindows()')) |
111 qApp, SLOT('closeAllWindows()')) |
112 |
112 |
113 self.aboutAct = E4Action(self.trUtf8('About'), |
113 self.aboutAct = E5Action(self.trUtf8('About'), |
114 self.trUtf8('&About'), |
114 self.trUtf8('&About'), |
115 0, 0, self, 'sql_help_about') |
115 0, 0, self, 'sql_help_about') |
116 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) |
116 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) |
117 self.aboutAct.setWhatsThis(self.trUtf8( |
117 self.aboutAct.setWhatsThis(self.trUtf8( |
118 """<b>About</b>""" |
118 """<b>About</b>""" |
119 """<p>Display some information about this software.</p>""" |
119 """<p>Display some information about this software.</p>""" |
120 )) |
120 )) |
121 self.connect(self.aboutAct, SIGNAL('triggered()'), self.__about) |
121 self.connect(self.aboutAct, SIGNAL('triggered()'), self.__about) |
122 self.__actions.append(self.aboutAct) |
122 self.__actions.append(self.aboutAct) |
123 |
123 |
124 self.aboutQtAct = E4Action(self.trUtf8('About Qt'), |
124 self.aboutQtAct = E5Action(self.trUtf8('About Qt'), |
125 self.trUtf8('About &Qt'), |
125 self.trUtf8('About &Qt'), |
126 0, 0, self, 'sql_help_about_qt') |
126 0, 0, self, 'sql_help_about_qt') |
127 self.aboutQtAct.setStatusTip(\ |
127 self.aboutQtAct.setStatusTip(\ |
128 self.trUtf8('Display information about the Qt toolkit')) |
128 self.trUtf8('Display information about the Qt toolkit')) |
129 self.aboutQtAct.setWhatsThis(self.trUtf8( |
129 self.aboutQtAct.setWhatsThis(self.trUtf8( |