16 |
16 |
17 from .Ui_IrcNetworkEditDialog import Ui_IrcNetworkEditDialog |
17 from .Ui_IrcNetworkEditDialog import Ui_IrcNetworkEditDialog |
18 |
18 |
19 from .IrcNetworkManager import IrcIdentity, IrcChannel |
19 from .IrcNetworkManager import IrcIdentity, IrcChannel |
20 from .IrcChannelEditDialog import IrcChannelEditDialog |
20 from .IrcChannelEditDialog import IrcChannelEditDialog |
|
21 from .IrcServerEditDialog import IrcServerEditDialog |
21 |
22 |
22 import UI.PixmapCache |
23 import UI.PixmapCache |
23 |
24 |
24 |
25 |
25 class IrcNetworkEditDialog(QDialog, Ui_IrcNetworkEditDialog): |
26 class IrcNetworkEditDialog(QDialog, Ui_IrcNetworkEditDialog): |
38 self.setupUi(self) |
39 self.setupUi(self) |
39 |
40 |
40 self.__manager = manager |
41 self.__manager = manager |
41 |
42 |
42 self.editIdentitiesButton.setIcon(UI.PixmapCache.getIcon("ircConfigure.png")) |
43 self.editIdentitiesButton.setIcon(UI.PixmapCache.getIcon("ircConfigure.png")) |
43 self.editServersButton.setIcon(UI.PixmapCache.getIcon("ircConfigure.png")) |
44 self.editServerButton.setIcon(UI.PixmapCache.getIcon("ircConfigure.png")) |
44 self.editChannelButton.setIcon(UI.PixmapCache.getIcon("ircConfigure.png")) |
45 self.editChannelButton.setIcon(UI.PixmapCache.getIcon("ircConfigure.png")) |
45 self.addChannelButton.setIcon(UI.PixmapCache.getIcon("plus.png")) |
46 self.addChannelButton.setIcon(UI.PixmapCache.getIcon("plus.png")) |
46 self.deleteChannelButton.setIcon(UI.PixmapCache.getIcon("minus.png")) |
47 self.deleteChannelButton.setIcon(UI.PixmapCache.getIcon("minus.png")) |
47 |
48 |
48 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
49 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
64 index = self.identityCombo.findText(identity) |
65 index = self.identityCombo.findText(identity) |
65 if index == -1: |
66 if index == -1: |
66 index = 0 |
67 index = 0 |
67 self.identityCombo.setCurrentIndex(index) |
68 self.identityCombo.setCurrentIndex(index) |
68 |
69 |
69 # servers |
70 # server |
70 self.serverEdit.setText(self.__network.getServerName()) |
71 self.serverEdit.setText(self.__network.getServerName()) |
71 |
72 |
72 # channels |
73 # channels |
73 for channelName in sorted(self.__network.getChannelNames()): |
74 for channelName in sorted(self.__network.getChannelNames()): |
74 channel = self.__network.getChannel(channelName) |
75 channel = self.__network.getChannel(channelName) |
98 |
99 |
99 @param txt text entered into the network name edit (string) |
100 @param txt text entered into the network name edit (string) |
100 """ |
101 """ |
101 self.__updateOkButton() |
102 self.__updateOkButton() |
102 |
103 |
|
104 @pyqtSlot(str) |
|
105 def on_identityCombo_activated(self, identity): |
|
106 """ |
|
107 Private slot to handle the selection of an identity. |
|
108 |
|
109 @param identity selected entity (string) |
|
110 """ |
|
111 self.__network.setIdentityName(identity) |
|
112 |
103 @pyqtSlot() |
113 @pyqtSlot() |
104 def on_editIdentitiesButton_clicked(self): |
114 def on_editIdentitiesButton_clicked(self): |
105 """ |
115 """ |
106 Slot documentation goes here. |
116 Slot documentation goes here. |
107 """ |
117 """ |
108 # TODO: not implemented yet |
118 # TODO: not implemented yet |
109 raise NotImplementedError |
119 raise NotImplementedError |
110 |
120 |
111 @pyqtSlot() |
121 @pyqtSlot() |
112 def on_editServersButton_clicked(self): |
122 def on_editServerButton_clicked(self): |
113 """ |
123 """ |
114 Slot documentation goes here. |
124 Private slot to edit the server configuration. |
115 """ |
125 """ |
116 # TODO: not implemented yet |
126 dlg = IrcServerEditDialog(self.__network.getServer()) |
117 raise NotImplementedError |
127 if dlg.exec_() == QDialog.Accepted: |
|
128 self.__network.setServer(dlg.getServer()) |
|
129 self.serverEdit.setText(self.__network.getServerName()) |
118 |
130 |
119 @pyqtSlot() |
131 @pyqtSlot() |
120 def on_addChannelButton_clicked(self): |
132 def on_addChannelButton_clicked(self): |
121 """ |
133 """ |
122 Private slot to add a channel. |
134 Private slot to add a channel. |