Show
Ignore:
Timestamp:
01/23/07 21:32:43 (23 months ago)
Author:
asterix
Message:

merge fixes from trunk

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11/src/disco.py

    r7635 r7888  
    4848import gtkgui_helpers 
    4949import groups 
     50import adhoc_commands 
    5051 
    5152from common import gajim 
     
    987988                self.register_button = None 
    988989                self.join_button = None 
     990                self.execute_button = None 
    989991                # Keep track of our treeview signals 
    990992                self._view_signals = [] 
     
    11411143        def _add_actions(self): 
    11421144                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 
    11431157                self.register_button = gtk.Button(label=_("Re_gister"), 
    11441158                        use_underline=True) 
     
    11601174 
    11611175        def _clean_actions(self): 
     1176                if self.execute_button: 
     1177                        self.execute_button.destroy() 
     1178                        self.execute_button = None 
    11621179                if self.register_button: 
    11631180                        self.register_button.destroy() 
     
    11791196                self.window.services_treeview.queue_draw() 
    11801197 
     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 
    11811207        def on_register_button_clicked(self, widget = None): 
    11821208                '''When we want to register an agent: 
     
    12081234 
    12091235        def update_actions(self): 
     1236                if self.execute_button: 
     1237                        self.execute_button.set_sensitive(False) 
    12101238                if self.register_button: 
    12111239                        self.register_button.set_sensitive(False) 
     
    12441272        def _update_actions(self, jid, node, identities, features, data): 
    12451273                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) 
    12461276                if self.register_button and xmpp.NS_REGISTER in features: 
    12471277                        # We can register this agent