20 |
20 |
21 def __init__(self, bookmarksList, parent=None): |
21 def __init__(self, bookmarksList, parent=None): |
22 """ |
22 """ |
23 Constructor |
23 Constructor |
24 |
24 |
25 @param bookmarksList list of bookmarks (list of strings) |
25 @param bookmarksList list of bookmarks |
26 @param parent reference to the parent widget (QWidget) |
26 @type list of str |
|
27 @param parent reference to the parent widget |
|
28 @type QWidget |
27 """ |
29 """ |
28 super().__init__(parent) |
30 super().__init__(parent) |
29 self.setupUi(self) |
31 self.setupUi(self) |
30 |
32 |
31 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) |
33 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) |
46 @pyqtSlot(str) |
48 @pyqtSlot(str) |
47 def on_nameEdit_textChanged(self, txt): |
49 def on_nameEdit_textChanged(self, txt): |
48 """ |
50 """ |
49 Private slot to handle changes of the bookmark name. |
51 Private slot to handle changes of the bookmark name. |
50 |
52 |
51 @param txt text of the edit (string) |
53 @param txt text of the edit |
|
54 @type str |
52 """ |
55 """ |
53 self.__updateUI() |
56 self.__updateUI() |
54 |
57 |
55 @pyqtSlot(str) |
58 @pyqtSlot(str) |
56 def on_bookmarkCombo_editTextChanged(self, txt): |
59 def on_bookmarkCombo_editTextChanged(self, txt): |
57 """ |
60 """ |
58 Private slot to handle changes of the selected bookmark. |
61 Private slot to handle changes of the selected bookmark. |
59 |
62 |
60 @param txt name of the selected bookmark (string) |
63 @param txt name of the selected bookmark |
|
64 @type str |
61 """ |
65 """ |
62 self.__updateUI() |
66 self.__updateUI() |
63 |
67 |
64 def getData(self): |
68 def getData(self): |
65 """ |
69 """ |
66 Public method to retrieve the entered data. |
70 Public method to retrieve the entered data. |
67 |
71 |
68 @return tuple naming the old and new bookmark names |
72 @return tuple naming the old and new bookmark names |
69 (string, string) |
73 @rtype tuple of (str, str) |
70 """ |
74 """ |
71 return ( |
75 return ( |
72 self.bookmarkCombo.currentText().replace(" ", "_"), |
76 self.bookmarkCombo.currentText().replace(" ", "_"), |
73 self.nameEdit.text().replace(" ", "_"), |
77 self.nameEdit.text().replace(" ", "_"), |
74 ) |
78 ) |