src/eric7/Preferences/ToolConfigurationDialog.py

branch
eric7
changeset 10428
a071d4065202
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10427:3733e2b23cf7 10428:a071d4065202
28 def __init__(self, toollist, parent=None): 28 def __init__(self, toollist, parent=None):
29 """ 29 """
30 Constructor 30 Constructor
31 31
32 @param toollist list of configured tools 32 @param toollist list of configured tools
33 @param parent parent widget (QWidget) 33 @type list
34 @param parent parent widget
35 @type QWidget
34 """ 36 """
35 super().__init__(parent) 37 super().__init__(parent)
36 self.setupUi(self) 38 self.setupUi(self)
37 39
38 self.iconPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) 40 self.iconPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
64 66
65 def __findModeIndex(self, shortName): 67 def __findModeIndex(self, shortName):
66 """ 68 """
67 Private method to find the mode index by its short name. 69 Private method to find the mode index by its short name.
68 70
69 @param shortName short name of the mode (string) 71 @param shortName short name of the mode
70 @return index of the mode (integer) 72 @type str
73 @return index of the mode
74 @rtype int
71 """ 75 """
72 for ind, mode in enumerate(self.redirectionModes): 76 for ind, mode in enumerate(self.redirectionModes):
73 if mode[0] == shortName: 77 if mode[0] == shortName:
74 return ind 78 return ind
75 return 1 # default is "show output" 79 return 1 # default is "show output"
289 293
290 def on_toolsList_currentRowChanged(self, row): 294 def on_toolsList_currentRowChanged(self, row):
291 """ 295 """
292 Private slot to set the lineedits depending on the selected entry. 296 Private slot to set the lineedits depending on the selected entry.
293 297
294 @param row the row of the selected entry (integer) 298 @param row the row of the selected entry
299 @type int
295 """ 300 """
296 if row >= 0 and row < len(self.toollist): 301 if row >= 0 and row < len(self.toollist):
297 if self.toollist[row]["menutext"] == "--": 302 if self.toollist[row]["menutext"] == "--":
298 self.executablePicker.clear() 303 self.executablePicker.clear()
299 self.menuEdit.clear() 304 self.menuEdit.clear()
347 @pyqtSlot(str) 352 @pyqtSlot(str)
348 def on_menuEdit_textChanged(self, text): 353 def on_menuEdit_textChanged(self, text):
349 """ 354 """
350 Private slot called, when the menu text was changed. 355 Private slot called, when the menu text was changed.
351 356
352 @param text the new text (string) (ignored) 357 @param text the new text (ignored)
358 @type str
353 """ 359 """
354 self.__toolEntryChanged() 360 self.__toolEntryChanged()
355 361
356 @pyqtSlot(str) 362 @pyqtSlot(str)
357 def on_iconPicker_textChanged(self, text): 363 def on_iconPicker_textChanged(self, text):
358 """ 364 """
359 Private slot called, when the icon path was changed. 365 Private slot called, when the icon path was changed.
360 366
361 @param text the new text (string) (ignored) 367 @param text the new text (ignored)
368 @type str
362 """ 369 """
363 self.__toolEntryChanged() 370 self.__toolEntryChanged()
364 371
365 @pyqtSlot(str) 372 @pyqtSlot(str)
366 def on_executablePicker_textChanged(self, text): 373 def on_executablePicker_textChanged(self, text):
367 """ 374 """
368 Private slot called, when the executable was changed. 375 Private slot called, when the executable was changed.
369 376
370 @param text the new text (string) (ignored) 377 @param text the new text (ignored)
378 @type str
371 """ 379 """
372 self.__toolEntryChanged() 380 self.__toolEntryChanged()
373 381
374 @pyqtSlot(str) 382 @pyqtSlot(str)
375 def on_argumentsEdit_textChanged(self, text): 383 def on_argumentsEdit_textChanged(self, text):
376 """ 384 """
377 Private slot called, when the arguments string was changed. 385 Private slot called, when the arguments string was changed.
378 386
379 @param text the new text (string) (ignored) 387 @param text the new text (ignored)
388 @type str
380 """ 389 """
381 self.__toolEntryChanged() 390 self.__toolEntryChanged()
382 391
383 @pyqtSlot(int) 392 @pyqtSlot(int)
384 def on_redirectCombo_currentIndexChanged(self, index): 393 def on_redirectCombo_currentIndexChanged(self, index):
385 """ 394 """
386 Private slot called, when the redirection mode was changed. 395 Private slot called, when the redirection mode was changed.
387 396
388 @param index the selected mode index (integer) (ignored) 397 @param index the selected mode index (ignored)
398 @type int
389 """ 399 """
390 self.__toolEntryChanged() 400 self.__toolEntryChanged()
391 401
392 def getToollist(self): 402 def getToollist(self):
393 """ 403 """
394 Public method to retrieve the tools list. 404 Public method to retrieve the tools list.
395 405
396 @return a list of tuples containing the menu text, the executable, 406 @return a list of tuples containing the menu text, the executable,
397 the executables arguments and a redirection flag 407 the executables arguments and a redirection flag
408 @rtype list of [tuple of (str, str, list of str, bool)]
398 """ 409 """
399 return self.toollist[:] 410 return self.toollist[:]
400 411
401 def __swap(self, itm1, itm2): 412 def __swap(self, itm1, itm2):
402 """ 413 """
403 Private method used two swap two list entries given by their index. 414 Private method used two swap two list entries given by their index.
404 415
405 @param itm1 index of first entry (int) 416 @param itm1 index of first entry
406 @param itm2 index of second entry (int) 417 @type int
418 @param itm2 index of second entry
419 @type int
407 """ 420 """
408 tmp = self.toollist[itm1] 421 tmp = self.toollist[itm1]
409 self.toollist[itm1] = self.toollist[itm2] 422 self.toollist[itm1] = self.toollist[itm2]
410 self.toollist[itm2] = tmp 423 self.toollist[itm2] = tmp

eric ide

mercurial