SqlBrowser/SqlBrowser.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3030
4a0a82ddd9d2
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
79 """ 79 """
80 Private slot to do some actions after the UI has started and the main 80 Private slot to do some actions after the UI has started and the main
81 loop is up. 81 loop is up.
82 """ 82 """
83 for warning in self.__warnings: 83 for warning in self.__warnings:
84 E5MessageBox.warning(self, 84 E5MessageBox.warning(
85 self,
85 self.trUtf8("SQL Browser startup problem"), 86 self.trUtf8("SQL Browser startup problem"),
86 warning) 87 warning)
87 88
88 if len(QSqlDatabase.connectionNames()) == 0: 89 if len(QSqlDatabase.connectionNames()) == 0:
89 self.__browser.addConnectionByDialog() 90 self.__browser.addConnectionByDialog()
93 Private method to define the user interface actions. 94 Private method to define the user interface actions.
94 """ 95 """
95 # list of all actions 96 # list of all actions
96 self.__actions = [] 97 self.__actions = []
97 98
98 self.addConnectionAct = E5Action(self.trUtf8('Add Connection'), 99 self.addConnectionAct = E5Action(
100 self.trUtf8('Add Connection'),
99 UI.PixmapCache.getIcon("databaseConnection.png"), 101 UI.PixmapCache.getIcon("databaseConnection.png"),
100 self.trUtf8('Add &Connection...'), 102 self.trUtf8('Add &Connection...'),
101 0, 0, self, 'sql_file_add_connection') 103 0, 0, self, 'sql_file_add_connection')
102 self.addConnectionAct.setStatusTip(self.trUtf8( 104 self.addConnectionAct.setStatusTip(self.trUtf8(
103 'Open a dialog to add a new database connection')) 105 'Open a dialog to add a new database connection'))
108 )) 110 ))
109 self.addConnectionAct.triggered[()].connect( 111 self.addConnectionAct.triggered[()].connect(
110 self.__browser.addConnectionByDialog) 112 self.__browser.addConnectionByDialog)
111 self.__actions.append(self.addConnectionAct) 113 self.__actions.append(self.addConnectionAct)
112 114
113 self.exitAct = E5Action(self.trUtf8('Quit'), 115 self.exitAct = E5Action(
116 self.trUtf8('Quit'),
114 UI.PixmapCache.getIcon("exit.png"), 117 UI.PixmapCache.getIcon("exit.png"),
115 self.trUtf8('&Quit'), 118 self.trUtf8('&Quit'),
116 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), 119 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")),
117 0, self, 'sql_file_quit') 120 0, self, 'sql_file_quit')
118 self.exitAct.setStatusTip(self.trUtf8('Quit the SQL browser')) 121 self.exitAct.setStatusTip(self.trUtf8('Quit the SQL browser'))
120 """<b>Quit</b>""" 123 """<b>Quit</b>"""
121 """<p>Quit the SQL browser.</p>""" 124 """<p>Quit the SQL browser.</p>"""
122 )) 125 ))
123 self.exitAct.triggered[()].connect(qApp.closeAllWindows) 126 self.exitAct.triggered[()].connect(qApp.closeAllWindows)
124 127
125 self.aboutAct = E5Action(self.trUtf8('About'), 128 self.aboutAct = E5Action(
129 self.trUtf8('About'),
126 self.trUtf8('&About'), 130 self.trUtf8('&About'),
127 0, 0, self, 'sql_help_about') 131 0, 0, self, 'sql_help_about')
128 self.aboutAct.setStatusTip(self.trUtf8( 132 self.aboutAct.setStatusTip(self.trUtf8(
129 'Display information about this software')) 133 'Display information about this software'))
130 self.aboutAct.setWhatsThis(self.trUtf8( 134 self.aboutAct.setWhatsThis(self.trUtf8(
132 """<p>Display some information about this software.</p>""" 136 """<p>Display some information about this software.</p>"""
133 )) 137 ))
134 self.aboutAct.triggered[()].connect(self.__about) 138 self.aboutAct.triggered[()].connect(self.__about)
135 self.__actions.append(self.aboutAct) 139 self.__actions.append(self.aboutAct)
136 140
137 self.aboutQtAct = E5Action(self.trUtf8('About Qt'), 141 self.aboutQtAct = E5Action(
142 self.trUtf8('About Qt'),
138 self.trUtf8('About &Qt'), 143 self.trUtf8('About &Qt'),
139 0, 0, self, 'sql_help_about_qt') 144 0, 0, self, 'sql_help_about_qt')
140 self.aboutQtAct.setStatusTip( 145 self.aboutQtAct.setStatusTip(
141 self.trUtf8('Display information about the Qt toolkit')) 146 self.trUtf8('Display information about the Qt toolkit'))
142 self.aboutQtAct.setWhatsThis(self.trUtf8( 147 self.aboutQtAct.setWhatsThis(self.trUtf8(
178 183
179 def __about(self): 184 def __about(self):
180 """ 185 """
181 Private slot to show the about information. 186 Private slot to show the about information.
182 """ 187 """
183 E5MessageBox.about(self, self.trUtf8("SQL Browser"), self.trUtf8( 188 E5MessageBox.about(
184 """<h3>About SQL Browser</h3>""" 189 self,
185 """<p>The SQL browser window is a little tool to examine """ 190 self.trUtf8("SQL Browser"),
186 """the data and the schema of a database and to execute """ 191 self.trUtf8(
187 """queries on a database.</p>""" 192 """<h3>About SQL Browser</h3>"""
188 )) 193 """<p>The SQL browser window is a little tool to examine """
194 """the data and the schema of a database and to execute """
195 """queries on a database.</p>"""
196 )
197 )
189 198
190 def __aboutQt(self): 199 def __aboutQt(self):
191 """ 200 """
192 Private slot to show info about Qt. 201 Private slot to show info about Qt.
193 """ 202 """

eric ide

mercurial