22 |
22 |
23 def __init__(self, manager, parent=None): |
23 def __init__(self, manager, parent=None): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param manager reference to the IRC network manager (IrcNetworkManager) |
27 @param manager reference to the IRC network manager |
28 @param parent reference to the parent widget (QWidget) |
28 @type IrcNetworkManager |
|
29 @param parent reference to the parent widget |
|
30 @type QWidget |
29 """ |
31 """ |
30 super().__init__(parent) |
32 super().__init__(parent) |
31 self.setupUi(self) |
33 self.setupUi(self) |
32 |
34 |
33 self.__manager = manager |
35 self.__manager = manager |
64 |
66 |
65 def __refreshNetworkEntry(self, itm): |
67 def __refreshNetworkEntry(self, itm): |
66 """ |
68 """ |
67 Private method to (re-)set the data of a network entry. |
69 Private method to (re-)set the data of a network entry. |
68 |
70 |
69 @param itm reference to the network entry (QTreeWidgetItem) |
71 @param itm reference to the network entry |
|
72 @type QTreeWidgetItem |
70 """ |
73 """ |
71 from .IrcNetworkManager import IrcIdentity |
74 from .IrcNetworkManager import IrcIdentity |
72 |
75 |
73 # step 1: delete all child entries |
76 # step 1: delete all child entries |
74 children = itm.takeChildren() |
77 children = itm.takeChildren() |
174 @pyqtSlot(QTreeWidgetItem) |
177 @pyqtSlot(QTreeWidgetItem) |
175 def on_networksList_itemExpanded(self, item): |
178 def on_networksList_itemExpanded(self, item): |
176 """ |
179 """ |
177 Private slot handling the expansion of a top level item. |
180 Private slot handling the expansion of a top level item. |
178 |
181 |
179 @param item reference to the expanded item (QTreeWidgetItem) |
182 @param item reference to the expanded item |
|
183 @type QTreeWidgetItem |
180 """ |
184 """ |
181 self.__resizeColumns() |
185 self.__resizeColumns() |
182 |
186 |
183 @pyqtSlot(QTreeWidgetItem) |
187 @pyqtSlot(QTreeWidgetItem) |
184 def on_networksList_itemCollapsed(self, item): |
188 def on_networksList_itemCollapsed(self, item): |
185 """ |
189 """ |
186 Private slot handling the collapse of a top level item. |
190 Private slot handling the collapse of a top level item. |
187 |
191 |
188 @param item reference to the collapsed item (QTreeWidgetItem) |
192 @param item reference to the collapsed item |
|
193 @type QTreeWidgetItem |
189 """ |
194 """ |
190 self.__resizeColumns() |
195 self.__resizeColumns() |
191 |
196 |
192 @pyqtSlot(bool) |
197 @pyqtSlot(bool) |
193 def on_autoConnectButton_clicked(self, checked): |
198 def on_autoConnectButton_clicked(self, checked): |
194 """ |
199 """ |
195 Private slot handling the auto-connect selection. |
200 Private slot handling the auto-connect selection. |
196 |
201 |
197 @param checked flag indicating the state of the button (boolean) |
202 @param checked flag indicating the state of the button |
|
203 @type bool |
198 """ |
204 """ |
199 itm = self.networksList.selectedItems()[0] |
205 itm = self.networksList.selectedItems()[0] |
200 if itm.parent() is None: |
206 if itm.parent() is None: |
201 networkName = itm.text(0) |
207 networkName = itm.text(0) |
202 if checked: |
208 if checked: |
228 |
234 |
229 def __setAutoConnectEntry(self, itm, on): |
235 def __setAutoConnectEntry(self, itm, on): |
230 """ |
236 """ |
231 Private method to set the auto-connect entry of a network item. |
237 Private method to set the auto-connect entry of a network item. |
232 |
238 |
233 @param itm reference to the network item (QTreeWidgetItem) |
239 @param itm reference to the network item |
234 @param on flag indicating the auto-connect state (boolean) |
240 @type QTreeWidgetItem |
|
241 @param on flag indicating the auto-connect state |
|
242 @type bool |
235 """ |
243 """ |
236 autoConnect = self.tr("Yes") if on else self.tr("No") |
244 autoConnect = self.tr("Yes") if on else self.tr("No") |
237 for index in range(itm.childCount()): |
245 for index in range(itm.childCount()): |
238 citm = itm.child(index) |
246 citm = itm.child(index) |
239 if citm.text(0) == self.tr("Auto-Connect"): |
247 if citm.text(0) == self.tr("Auto-Connect"): |