Preferences/ToolConfigurationDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3010
befeff46ec0f
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
40 40
41 self.redirectionModes = [ 41 self.redirectionModes = [
42 ("no", self.trUtf8("no redirection")), 42 ("no", self.trUtf8("no redirection")),
43 ("show", self.trUtf8("show output")), 43 ("show", self.trUtf8("show output")),
44 ("insert", self.trUtf8("insert into current editor")), 44 ("insert", self.trUtf8("insert into current editor")),
45 ("replaceSelection", self.trUtf8("replace selection of current editor")), 45 ("replaceSelection",
46 self.trUtf8("replace selection of current editor")),
46 ] 47 ]
47 48
48 self.toollist = copy.deepcopy(toollist) 49 self.toollist = copy.deepcopy(toollist)
49 for tool in toollist: 50 for tool in toollist:
50 self.toolsList.addItem(tool['menutext']) 51 self.toolsList.addItem(tool['menutext'])
117 self.trUtf8("The selected file could not be found or" 118 self.trUtf8("The selected file could not be found or"
118 " is not an executable." 119 " is not an executable."
119 " Please choose an executable filename.")) 120 " Please choose an executable filename."))
120 return 121 return
121 122
122 if len(self.toolsList.findItems(menutext, Qt.MatchFlags(Qt.MatchExactly))): 123 if len(self.toolsList.findItems(
124 menutext, Qt.MatchFlags(Qt.MatchExactly))):
123 E5MessageBox.critical(self, 125 E5MessageBox.critical(self,
124 self.trUtf8("Add tool entry"), 126 self.trUtf8("Add tool entry"),
125 self.trUtf8("An entry for the menu text {0} already exists.")\ 127 self.trUtf8("An entry for the menu text {0} already exists.")\
126 .format(menutext)) 128 .format(menutext))
127 return 129 return
246 self.toollist.append(tool) 248 self.toollist.append(tool)
247 249
248 @pyqtSlot() 250 @pyqtSlot()
249 def on_executableButton_clicked(self): 251 def on_executableButton_clicked(self):
250 """ 252 """
251 Private slot to handle the executable selection via a file selection dialog. 253 Private slot to handle the executable selection via a file selection
254 dialog.
252 """ 255 """
253 execfile = E5FileDialog.getOpenFileName( 256 execfile = E5FileDialog.getOpenFileName(
254 self, 257 self,
255 self.trUtf8("Select executable"), 258 self.trUtf8("Select executable"),
256 self.executableEdit.text(), 259 self.executableEdit.text(),
296 tool = self.toollist[row] 299 tool = self.toollist[row]
297 self.menuEdit.setText(tool['menutext']) 300 self.menuEdit.setText(tool['menutext'])
298 self.iconEdit.setText(tool['icon']) 301 self.iconEdit.setText(tool['icon'])
299 self.executableEdit.setText(tool['executable']) 302 self.executableEdit.setText(tool['executable'])
300 self.argumentsEdit.setText(tool['arguments']) 303 self.argumentsEdit.setText(tool['arguments'])
301 self.redirectCombo.setCurrentIndex(self.__findModeIndex(tool['redirect'])) 304 self.redirectCombo.setCurrentIndex(
305 self.__findModeIndex(tool['redirect']))
302 306
303 self.changeButton.setEnabled(False) 307 self.changeButton.setEnabled(False)
304 self.deleteButton.setEnabled(True) 308 self.deleteButton.setEnabled(True)
305 309
306 if row != 0: 310 if row != 0:

eric ide

mercurial