Logo Search packages:      
Sourcecode: gajim version File versions  Download package

def roster_window::RosterWindow::make_transport_menu (   self,
  event,
  iter 
)

Make transport's popup menu

Definition at line 1421 of file roster_window.py.

01421                                                 :
            '''Make transport's popup menu'''
            model = self.tree.get_model()
            jid = model[iter][C_JID].decode('utf-8')
            path = model.get_path(iter)
            account = model[iter][C_ACCOUNT].decode('utf-8')
            is_connected = gajim.connections[account].connected > 1
            contact = gajim.contacts.get_contact_with_highest_priority(account, jid)
            menu = gtk.Menu()

            item = gtk.ImageMenuItem(_('_Log on'))
            icon = gtk.image_new_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_MENU)
            item.set_image(icon)
            menu.append(item)
            show = contact.show
            if (show != 'offline' and show != 'error') or not is_connected:
                  item.set_sensitive(False)
            item.connect('activate', self.on_agent_logging, jid, None, account)

            item = gtk.ImageMenuItem(_('Log _off'))
            icon = gtk.image_new_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU)
            item.set_image(icon)
            menu.append(item)
            if show in ('offline', 'error') or not is_connected:
                  item.set_sensitive(False)
            item.connect('activate', self.on_agent_logging, jid, 'unavailable',
                  account)

            item = gtk.SeparatorMenuItem() # separator
            menu.append(item)

            item = gtk.ImageMenuItem(_('_Edit'))
            icon = gtk.image_new_from_stock(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_MENU)
            item.set_image(icon)
            menu.append(item)
            item.connect('activate', self.on_edit_agent, contact, account)
            if not is_connected:
                  item.set_sensitive(False)
            
            item = gtk.ImageMenuItem(_('_Rename'))
            # add a special img for rename menuitem
            path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps',
                  'kbd_input.png')
            img = gtk.Image()
            img.set_from_file(path_to_kbd_input_img)
            item.set_image(img)
            menu.append(item)
            item.connect('activate', self.on_rename, iter, path)
            if not is_connected:
                  item.set_sensitive(False)

            item = gtk.ImageMenuItem(_('_Remove from Roster'))
            icon = gtk.image_new_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_MENU)
            item.set_image(icon)
            menu.append(item)
            item.connect('activate', self.on_remove_agent, contact, account)
            if not is_connected:
                  item.set_sensitive(False)

            event_button = gtkgui_helpers.get_possible_button_event(event)

            menu.attach_to_widget(self.tree, None)
            menu.connect('selection-done', gtkgui_helpers.destroy_widget)
            menu.popup(None, None, None, event_button, event.time)
            menu.show_all()

      def on_edit_account(self, widget, account):


Generated by  Doxygen 1.6.0   Back to index