41 |
41 |
42 def __init__(self, parent=None): |
42 def __init__(self, parent=None): |
43 """ |
43 """ |
44 Constructor |
44 Constructor |
45 |
45 |
46 @param parent The parent widget of this dialog. (QWidget) |
46 @param parent The parent widget of this dialog. |
|
47 @type QWidget |
47 """ |
48 """ |
48 super().__init__(parent) |
49 super().__init__(parent) |
49 self.setupUi(self) |
50 self.setupUi(self) |
50 self.setObjectName("ProgramsDialog") |
51 self.setObjectName("ProgramsDialog") |
51 self.setWindowFlags(Qt.WindowType.Window) |
52 self.setWindowFlags(Qt.WindowType.Window) |
77 |
78 |
78 def on_buttonBox_clicked(self, button): |
79 def on_buttonBox_clicked(self, button): |
79 """ |
80 """ |
80 Private slot called by a button of the button box clicked. |
81 Private slot called by a button of the button box clicked. |
81 |
82 |
82 @param button button that was clicked (QAbstractButton) |
83 @param button button that was clicked |
|
84 @type QAbstractButton |
83 """ |
85 """ |
84 if button == self.searchButton: |
86 if button == self.searchButton: |
85 self.on_programsSearchButton_clicked() |
87 self.on_programsSearchButton_clicked() |
86 |
88 |
87 @pyqtSlot() |
89 @pyqtSlot() |
415 exeModule=None, |
417 exeModule=None, |
416 ): |
418 ): |
417 """ |
419 """ |
418 Private method to generate a program entry. |
420 Private method to generate a program entry. |
419 |
421 |
420 @param description descriptive text (string) |
422 @param description descriptive text |
421 @param exe name of the executable program (string) |
423 @type str |
422 @param versionCommand command line switch to get the version info |
424 @param exe name of the executable program |
423 (str). If this is empty, the given version will be shown. |
425 @type str |
|
426 @param versionCommand command line switch to get the version info. |
|
427 If this is empty, the given version will be shown. |
|
428 @type str |
424 @param versionStartsWith start of line identifying version info |
429 @param versionStartsWith start of line identifying version info |
425 (string) |
430 @type str |
426 @param versionPosition index of part containing the version info |
431 @param versionPosition index of part containing the version info |
427 (integer) |
432 @type int |
428 @param version version string to show (string) |
433 @param version version string to show |
|
434 @type str |
429 @param versionCleanup tuple of two integers giving string positions |
435 @param versionCleanup tuple of two integers giving string positions |
430 start and stop for the version string (tuple of integers) |
436 start and stop for the version string |
|
437 @type tuple of (int, int) |
431 @param versionRe regexp to determine the line identifying version |
438 @param versionRe regexp to determine the line identifying version |
432 info (string). Takes precedence over versionStartsWith. |
439 info. Takes precedence over versionStartsWith. |
|
440 @type str |
433 @param exeModule list of command line parameters to execute a module |
441 @param exeModule list of command line parameters to execute a module |
434 with the program given in exe (e.g. to execute a Python module) |
442 with the program given in exe (e.g. to execute a Python module) |
435 (list of str) |
443 @type list of str |
436 @return version string of detected or given version (string) |
444 @return version string of detected or given version |
|
445 @rtype str |
437 """ |
446 """ |
438 itmList = self.programsList.findItems( |
447 itmList = self.programsList.findItems( |
439 description, Qt.MatchFlag.MatchCaseSensitive |
448 description, Qt.MatchFlag.MatchCaseSensitive |
440 ) |
449 ) |
441 itm = ( |
450 itm = ( |
540 |
549 |
541 def __createEntry(self, description, entryText, entryVersion): |
550 def __createEntry(self, description, entryText, entryVersion): |
542 """ |
551 """ |
543 Private method to generate a program entry. |
552 Private method to generate a program entry. |
544 |
553 |
545 @param description descriptive text (string) |
554 @param description descriptive text |
546 @param entryText text to show (string) |
555 @type str |
547 @param entryVersion version string to show (string). |
556 @param entryText text to show |
|
557 @type str |
|
558 @param entryVersion version string to show |
|
559 @type str |
548 """ |
560 """ |
549 itm = QTreeWidgetItem(self.programsList, [description]) |
561 itm = QTreeWidgetItem(self.programsList, [description]) |
550 font = itm.font(0) |
562 font = itm.font(0) |
551 font.setBold(True) |
563 font.setBold(True) |
552 itm.setFont(0, font) |
564 itm.setFont(0, font) |