46 self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) |
46 self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) |
47 |
47 |
48 if networkName: |
48 if networkName: |
49 self.__network = copy.deepcopy(self.__manager.getNetwork(networkName)) |
49 self.__network = copy.deepcopy(self.__manager.getNetwork(networkName)) |
50 else: |
50 else: |
51 from .IrcNetworkManager import IrcNetwork |
51 from .IrcNetworkManager import IrcNetwork # __IGNORE_WARNING_I101__ |
52 |
52 |
53 self.__network = IrcNetwork("") |
53 self.__network = IrcNetwork("") |
54 |
54 |
55 # network name |
55 # network name |
56 self.networkEdit.setText(networkName) |
56 self.networkEdit.setText(networkName) |
93 """ |
93 """ |
94 Private method to refresh the identity combo. |
94 Private method to refresh the identity combo. |
95 |
95 |
96 @param currentIdentity name of the identity to select (string) |
96 @param currentIdentity name of the identity to select (string) |
97 """ |
97 """ |
|
98 from .IrcNetworkManager import IrcIdentity |
|
99 |
98 self.identityCombo.clear() |
100 self.identityCombo.clear() |
99 |
|
100 from .IrcNetworkManager import IrcIdentity |
|
101 |
101 |
102 identities = sorted(self.__manager.getIdentityNames()) |
102 identities = sorted(self.__manager.getIdentityNames()) |
103 identities[ |
103 identities[ |
104 identities.index(IrcIdentity.DefaultIdentityName) |
104 identities.index(IrcIdentity.DefaultIdentityName) |
105 ] = IrcIdentity.DefaultIdentityDisplay |
105 ] = IrcIdentity.DefaultIdentityDisplay |
219 """ |
219 """ |
220 Private method to edit a channel. |
220 Private method to edit a channel. |
221 |
221 |
222 @param itm reference to the item to be edited (QTreeWidgetItem) |
222 @param itm reference to the item to be edited (QTreeWidgetItem) |
223 """ |
223 """ |
|
224 from .IrcChannelEditDialog import IrcChannelEditDialog |
|
225 from .IrcNetworkManager import IrcChannel |
|
226 |
224 if itm: |
227 if itm: |
225 channel = self.__network.getChannel(itm.text(0)) |
228 channel = self.__network.getChannel(itm.text(0)) |
226 name = channel.getName() |
229 name = channel.getName() |
227 key = channel.getKey() |
230 key = channel.getKey() |
228 autoJoin = channel.autoJoin() |
231 autoJoin = channel.autoJoin() |
230 # add a new channel |
233 # add a new channel |
231 name = "" |
234 name = "" |
232 key = "" |
235 key = "" |
233 autoJoin = False |
236 autoJoin = False |
234 |
237 |
235 from .IrcChannelEditDialog import IrcChannelEditDialog |
|
236 |
|
237 dlg = IrcChannelEditDialog(name, key, autoJoin, itm is not None, self) |
238 dlg = IrcChannelEditDialog(name, key, autoJoin, itm is not None, self) |
238 if dlg.exec() == QDialog.DialogCode.Accepted: |
239 if dlg.exec() == QDialog.DialogCode.Accepted: |
239 from .IrcNetworkManager import IrcChannel |
|
240 |
|
241 name, key, autoJoin = dlg.getData() |
240 name, key, autoJoin = dlg.getData() |
242 channel = IrcChannel(name) |
241 channel = IrcChannel(name) |
243 channel.setKey(key) |
242 channel.setKey(key) |
244 channel.setAutoJoin(autoJoin) |
243 channel.setAutoJoin(autoJoin) |
245 if itm: |
244 if itm: |