fix avatar save popup menu

This commit is contained in:
Denis Fomin 2013-01-08 02:22:40 +04:00
parent 9cd0ca803b
commit 4460d51d79
1 changed files with 4 additions and 2 deletions

View File

@ -183,7 +183,7 @@ class VcardWindow:
""" """
if event.button == 3: # right click if event.button == 3: # right click
menu = Gtk.Menu() menu = Gtk.Menu()
menuitem = Gtk.ImageMenuItem(Gtk.STOCK_SAVE_AS) menuitem = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_SAVE_AS, None)
menuitem.connect('activate', menuitem.connect('activate',
gtkgui_helpers.on_avatar_save_as_menuitem_activate, gtkgui_helpers.on_avatar_save_as_menuitem_activate,
self.contact.jid, self.contact.get_shown_name()) self.contact.jid, self.contact.get_shown_name())
@ -191,6 +191,7 @@ class VcardWindow:
menu.connect('selection-done', lambda w:w.destroy()) menu.connect('selection-done', lambda w:w.destroy())
# show the menu # show the menu
menu.show_all() menu.show_all()
menu.attach_to_widget(widget, None)
menu.popup(None, None, None, None, event.button, event.time) menu.popup(None, None, None, None, event.button, event.time)
def set_value(self, entry_name, value): def set_value(self, entry_name, value):
@ -525,7 +526,7 @@ class ZeroconfVcardWindow:
""" """
if event.button == 3: # right click if event.button == 3: # right click
menu = Gtk.Menu() menu = Gtk.Menu()
menuitem = Gtk.ImageMenuItem(Gtk.STOCK_SAVE_AS) menuitem = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_SAVE_AS, None)
menuitem.connect('activate', menuitem.connect('activate',
gtkgui_helpers.on_avatar_save_as_menuitem_activate, gtkgui_helpers.on_avatar_save_as_menuitem_activate,
self.contact.jid, self.contact.get_shown_name()) self.contact.jid, self.contact.get_shown_name())
@ -533,6 +534,7 @@ class ZeroconfVcardWindow:
menu.connect('selection-done', lambda w:w.destroy()) menu.connect('selection-done', lambda w:w.destroy())
# show the menu # show the menu
menu.show_all() menu.show_all()
menu.attach_to_widget(widget, None)
menu.popup(None, None, None, None, event.button, event.time) menu.popup(None, None, None, None, event.button, event.time)
def set_value(self, entry_name, value): def set_value(self, entry_name, value):