20 |
20 |
21 def __init__(self, name, key, autoJoin, edit, parent=None): |
21 def __init__(self, name, key, autoJoin, edit, parent=None): |
22 """ |
22 """ |
23 Constructor |
23 Constructor |
24 |
24 |
25 @param name channel name (string) |
25 @param name channel name |
26 @param key channel key (string) |
26 @type str |
|
27 @param key channel key |
|
28 @type str |
27 @param autoJoin flag indicating, that the channel should |
29 @param autoJoin flag indicating, that the channel should |
28 be joined automatically (boolean) |
30 be joined automatically |
|
31 @type bool |
29 @param edit flag indicating an edit of an existing |
32 @param edit flag indicating an edit of an existing |
30 channel (boolean) |
33 channel |
31 @param parent reference to the parent widget (QWidget) |
34 @type bool |
|
35 @param parent reference to the parent widget |
|
36 @type QWidget |
32 """ |
37 """ |
33 super().__init__(parent) |
38 super().__init__(parent) |
34 self.setupUi(self) |
39 self.setupUi(self) |
35 |
40 |
36 self.nameEdit.setText(name) |
41 self.nameEdit.setText(name) |
47 @pyqtSlot(str) |
52 @pyqtSlot(str) |
48 def on_nameEdit_textChanged(self, txt): |
53 def on_nameEdit_textChanged(self, txt): |
49 """ |
54 """ |
50 Private slot to handle changes of the given name. |
55 Private slot to handle changes of the given name. |
51 |
56 |
52 @param txt text of the edit (string) |
57 @param txt text of the edit |
|
58 @type str |
53 """ |
59 """ |
54 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(txt != "") |
60 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(txt != "") |
55 |
61 |
56 def getData(self): |
62 def getData(self): |
57 """ |
63 """ |
58 Public method to get the channel data. |
64 Public method to get the channel data. |
59 |
65 |
60 @return tuple giving the channel name, channel key and a flag |
66 @return tuple giving the channel name, channel key and a flag |
61 indicating, that the channel should be joined automatically |
67 indicating, that the channel should be joined automatically |
62 (string, string, boolean) |
68 @rtype tuple of (str, str, bool) |
63 """ |
69 """ |
64 return ( |
70 return ( |
65 self.nameEdit.text(), |
71 self.nameEdit.text(), |
66 self.keyEdit.text(), |
72 self.keyEdit.text(), |
67 self.autoJoinCheckBox.isChecked(), |
73 self.autoJoinCheckBox.isChecked(), |