60 |
60 |
61 self.networkCombo.addItems(self.__manager.getNetworkNames()) |
61 self.networkCombo.addItems(self.__manager.getNetworkNames()) |
62 |
62 |
63 self.__manager.networksChanged.connect(self.__refreshNetworks) |
63 self.__manager.networksChanged.connect(self.__refreshNetworks) |
64 |
64 |
|
65 def autoConnect(self): |
|
66 """ |
|
67 Public method to perform the IRC auto connection. |
|
68 """ |
|
69 for networkName in self.__manager.getNetworkNames(): |
|
70 if self.__manager.getNetwork(networkName).autoConnect(): |
|
71 row = self.networkCombo.findText(networkName) |
|
72 self.networkCombo.setCurrentIndex(row) |
|
73 self.on_connectButton_clicked() |
|
74 break |
|
75 |
65 @pyqtSlot() |
76 @pyqtSlot() |
66 def __refreshNetworks(self): |
77 def __refreshNetworks(self): |
67 """ |
78 """ |
68 Private slot to refresh all network related widgets. |
79 Private slot to refresh all network related widgets. |
69 """ |
80 """ |
70 currentNetwork = self.networkCombo.currentText() |
81 currentNetwork = self.networkCombo.currentText() |
71 ## currentNick = self.nickCombo.currentText() |
82 currentNick = self.nickCombo.currentText() |
72 ## currentChannel = self.channelCombo.currentText() |
83 currentChannel = self.channelCombo.currentText() |
73 self.networkCombo.clear() |
84 self.networkCombo.clear() |
74 self.networkCombo.addItems(self.__manager.getNetworkNames()) |
85 self.networkCombo.addItems(self.__manager.getNetworkNames()) |
75 row = self.networkCombo.findText(currentNetwork) |
86 row = self.networkCombo.findText(currentNetwork) |
76 if row == -1: |
87 if row == -1: |
77 row = 0 |
88 row = 0 |
78 self.networkCombo.setCurrentIndex(row) |
89 self.networkCombo.setCurrentIndex(row) |
79 ## self.nickCombo.setEditText(currentNick) |
90 self.nickCombo.setEditText(currentNick) |
80 ## self.channelCombo.setEditText(currentChannel) |
91 self.channelCombo.setEditText(currentChannel) |
81 |
92 |
82 @pyqtSlot() |
93 @pyqtSlot() |
83 def on_connectButton_clicked(self): |
94 def on_connectButton_clicked(self): |
84 """ |
95 """ |
85 Private slot to connect to a network. |
96 Private slot to connect to a network. |