Preferences/ToolConfigurationDialog.py

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

eric ide

mercurial