Changeset 7888 for branches/gajim_0.11/src/disco.py
- Timestamp:
- 01/23/07 21:32:43 (23 months ago)
- Files:
-
- 1 modified
-
branches/gajim_0.11/src/disco.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11/src/disco.py
r7635 r7888 48 48 import gtkgui_helpers 49 49 import groups 50 import adhoc_commands 50 51 51 52 from common import gajim … … 987 988 self.register_button = None 988 989 self.join_button = None 990 self.execute_button = None 989 991 # Keep track of our treeview signals 990 992 self._view_signals = [] … … 1141 1143 def _add_actions(self): 1142 1144 AgentBrowser._add_actions(self) 1145 self.execute_button = gtk.Button() 1146 image = gtk.image_new_from_stock(gtk.STOCK_EXECUTE, gtk.ICON_SIZE_BUTTON) 1147 label = gtk.Label(_('_Execute Command...')) 1148 label.set_use_underline(True) 1149 hbox = gtk.HBox() 1150 hbox.pack_start(image, False, True, 6) 1151 hbox.pack_end(label, True, True) 1152 self.execute_button.add(hbox) 1153 self.execute_button.connect('clicked', self.on_execute_button_clicked) 1154 self.window.action_buttonbox.add(self.execute_button) 1155 self.execute_button.show_all() 1156 1143 1157 self.register_button = gtk.Button(label=_("Re_gister"), 1144 1158 use_underline=True) … … 1160 1174 1161 1175 def _clean_actions(self): 1176 if self.execute_button: 1177 self.execute_button.destroy() 1178 self.execute_button = None 1162 1179 if self.register_button: 1163 1180 self.register_button.destroy() … … 1179 1196 self.window.services_treeview.queue_draw() 1180 1197 1198 def on_execute_button_clicked(self, widget = None): 1199 '''When we want to execute a command: 1200 open adhoc command window''' 1201 model, iter = self.window.services_treeview.get_selection().get_selected() 1202 if not iter: 1203 return 1204 service = model[iter][0].decode('utf-8') 1205 adhoc_commands.CommandWindow(self.account, service) 1206 1181 1207 def on_register_button_clicked(self, widget = None): 1182 1208 '''When we want to register an agent: … … 1208 1234 1209 1235 def update_actions(self): 1236 if self.execute_button: 1237 self.execute_button.set_sensitive(False) 1210 1238 if self.register_button: 1211 1239 self.register_button.set_sensitive(False) … … 1244 1272 def _update_actions(self, jid, node, identities, features, data): 1245 1273 AgentBrowser._update_actions(self, jid, node, identities, features, data) 1274 if self.execute_button and xmpp.NS_COMMANDS in features: 1275 self.execute_button.set_sensitive(True) 1246 1276 if self.register_button and xmpp.NS_REGISTER in features: 1247 1277 # We can register this agent
