Backed out changeset: 5bbc88f23675

This commit is contained in:
Denis Fomin 2013-01-08 14:36:10 +04:00
parent 5dac0723f7
commit 77d4843d62
3 changed files with 51 additions and 89 deletions

View File

@ -1,45 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-network</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-jump-to</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-connect</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-home</property>
<property name="icon-size">1</property>
</object>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkMenu" id="systray_context_menu">
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="status_menu">
<property name="label" translatable="yes">Sta_tus</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
@ -49,9 +16,7 @@
<child>
<object class="GtkImageMenuItem" id="chat_with_menuitem">
<property name="label" translatable="yes">_Start Chat</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="image">image2</property>
<property name="use_stock">False</property>
@ -61,9 +26,7 @@
<child>
<object class="GtkImageMenuItem" id="join_gc_menuitem">
<property name="label" translatable="yes">_Group Chat</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="image">image3</property>
<property name="use_stock">False</property>
@ -73,9 +36,7 @@
<child>
<object class="GtkImageMenuItem" id="single_message_menuitem">
<property name="label" translatable="yes">Send Single _Message</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="image">image4</property>
<property name="use_stock">False</property>
@ -85,34 +46,27 @@
<child>
<object class="GtkSeparatorMenuItem" id="separator12">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="show_all_events_menuitem">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Show All Pending _Events</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_show_all_events_menuitem_activate" swapped="no"/>
<signal name="activate" handler="on_show_all_events_menuitem_activate"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="sounds_mute_menuitem">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Mute Sounds</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_sounds_mute_menuitem_activate" swapped="no"/>
<signal name="activate" handler="on_sounds_mute_menuitem_activate"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="show_roster_menuitem">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="image">image5</property>
<property name="use_stock">False</property>
@ -122,32 +76,53 @@
<child>
<object class="GtkImageMenuItem" id="preferences_menuitem">
<property name="label">gtk-preferences</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_preferences_menuitem_activate" swapped="no"/>
<signal name="activate" handler="on_preferences_menuitem_activate"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="quit_menuitem">
<property name="label">gtk-quit</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_quit_menuitem_activate" swapped="no"/>
<signal name="activate" handler="on_quit_menuitem_activate"/>
</object>
</child>
</object>
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-network</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-connect</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-home</property>
<property name="icon-size">1</property>
</object>
</interface>

View File

@ -293,8 +293,8 @@ class RosterWindow:
# Draw all known groups
for group in gajim.groups[account]:
self._really_draw_group(group, account)
self._really_draw_account(account)
self.draw_group(group, account)
self.draw_account(account)
self.starting = False
@ -897,7 +897,7 @@ class RosterWindow:
# update all contacts in the given group
if self.regroup:
accounts = list(gajim.connections.keys())
accounts = gajim.connections.keys()
else:
accounts = [account, ]
@ -1122,7 +1122,7 @@ class RosterWindow:
self.model[child_iter][C_NAME] = text
def _really_draw_groups(self):
for ag in list(self.groups_to_draw.values()):
for ag in self.groups_to_draw.values():
acct = ag['account']
grp = ag['group']
self._really_draw_group(grp, acct)
@ -1135,7 +1135,7 @@ class RosterWindow:
return
self.groups_to_draw[ag] = {'group': group, 'account': account}
if len(self.groups_to_draw) == 1:
GObject.idle_add(self._really_draw_groups)
GObject.timeout_add(200, self._really_draw_groups)
def draw_parent_contact(self, jid, account):
child_iters = self._get_contact_iter(jid, account, model=self.model)
@ -1150,13 +1150,7 @@ class RosterWindow:
self.draw_contact(parent_jid, parent_account)
return False
def draw_contact(self, jid, account, selected=False, focus=False,
contact_instances=None, contact=None):
GObject.idle_add(self._really_draw_contact, jid, account, selected,
focus, contact_instances, contact)
def _really_draw_contact(self, jid, account, selected=False, focus=False,
contact_instances=None, contact=None):
def draw_contact(self, jid, account, selected=False, focus=False, contact_instances=None, contact=None):
"""
Draw the correct state image, name BUT not avatar
"""
@ -1335,10 +1329,6 @@ class RosterWindow:
self.draw_pep(jid, account, pep_type, contact=contact)
def draw_pep(self, jid, account, pep_type, contact=None):
GObject.idle_add(self._really_draw_pep, jid, account, pep_type,
contact)
def _really_draw_pep(self, jid, account, pep_type, contact=None):
if pep_type not in self._pep_type_to_model_column:
return
if not self._is_pep_shown_in_roster(pep_type):
@ -1358,9 +1348,6 @@ class RosterWindow:
self.model[child_iter][model_column] = pixbuf
def draw_avatar(self, jid, account):
GObject.idle_add(self._really_draw_avatar, jid, account)
def _really_draw_avatar(self, jid, account):
iters = self._get_contact_iter(jid, account, model=self.model)
if not iters or not gajim.config.get('show_avatars_in_roster'):
return
@ -5611,7 +5598,7 @@ class RosterWindow:
item = Gtk.SeparatorMenuItem.new()
sub_menu.append(item)
item = Gtk.ImageMenuItem.new_with_mnemonic(_('Change Status Message'))
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Change Status Message'))
gtkgui_helpers.add_image_to_menuitem(item, 'gajim-kbd_input')
sub_menu.append(item)
item.connect('activate', self.on_change_status_message_activate,
@ -5622,7 +5609,7 @@ class RosterWindow:
item = Gtk.SeparatorMenuItem.new()
sub_menu.append(item)
uf_show = helpers.get_uf_show('offline', use_mnemonic=False)
uf_show = helpers.get_uf_show('offline', use_mnemonic=True)
item = Gtk.ImageMenuItem(uf_show)
icon = state_images['offline']
item.set_image(icon)
@ -5709,7 +5696,7 @@ class RosterWindow:
status_menuitem.set_submenu(sub_menu)
for show in ('online', 'away', 'dnd', 'invisible'):
uf_show = helpers.get_uf_show(show, use_mnemonic=False)
uf_show = helpers.get_uf_show(show, use_mnemonic=True)
item = Gtk.ImageMenuItem(uf_show)
icon = state_images[show]
item.set_image(icon)
@ -5719,7 +5706,7 @@ class RosterWindow:
item = Gtk.SeparatorMenuItem.new()
sub_menu.append(item)
item = Gtk.ImageMenuItem.new_with_mnemonic(_('Change Status Message'))
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Change Status Message'))
gtkgui_helpers.add_image_to_menuitem(item, 'gajim-kbd_input')
sub_menu.append(item)
item.connect('activate', self.on_change_status_message_activate,
@ -5727,7 +5714,7 @@ class RosterWindow:
if gajim.connections[account].connected < 2:
item.set_sensitive(False)
uf_show = helpers.get_uf_show('offline', use_mnemonic=False)
uf_show = helpers.get_uf_show('offline', use_mnemonic=True)
item = Gtk.ImageMenuItem(uf_show)
icon = state_images['offline']
item.set_image(icon)
@ -6324,7 +6311,7 @@ class RosterWindow:
"""
Show join new group chat item and bookmarks list for an account
"""
item = Gtk.ImageMenuItem.new_with_mnemonic(_('Join New Group Chat'))
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Join New Group Chat'))
icon = Gtk.Image.new_from_stock(Gtk.STOCK_NEW, Gtk.IconSize.MENU)
item.set_image(icon)
item.connect('activate', self.on_join_gc_activate, account)
@ -6429,7 +6416,7 @@ class RosterWindow:
col.add_attribute(rend[1], rend[3], rend[4])
col.set_cell_data_func(rend[1], rend[5], rend[6])
# set renderers propertys
for renderer in list(self.renderers_propertys.keys()):
for renderer in self.renderers_propertys.keys():
renderer.set_property(self.renderers_propertys[renderer][0],
self.renderers_propertys[renderer][1])

View File

@ -229,7 +229,7 @@ class StatusIcon:
join_gc_menuitem.set_image(state_images['muc_active'])
for show in ('online', 'chat', 'away', 'xa', 'dnd', 'invisible'):
uf_show = helpers.get_uf_show(show, use_mnemonic = False)
uf_show = helpers.get_uf_show(show, use_mnemonic = True)
item = Gtk.ImageMenuItem(uf_show)
item.set_image(state_images[show])
sub_menu.append(item)
@ -238,7 +238,7 @@ class StatusIcon:
item = Gtk.SeparatorMenuItem.new()
sub_menu.append(item)
item = Gtk.ImageMenuItem(_('Change Status Message...'))
item = Gtk.ImageMenuItem(_('_Change Status Message...'))
gtkgui_helpers.add_image_to_menuitem(item, 'gajim-kbd_input')
sub_menu.append(item)
item.connect('activate', self.on_change_status_message_activate)
@ -252,7 +252,7 @@ class StatusIcon:
item = Gtk.SeparatorMenuItem.new()
sub_menu.append(item)
uf_show = helpers.get_uf_show('offline', use_mnemonic = False)
uf_show = helpers.get_uf_show('offline', use_mnemonic = True)
item = Gtk.ImageMenuItem(uf_show)
item.set_image(state_images['offline'])
sub_menu.append(item)
@ -328,7 +328,7 @@ class StatusIcon:
# join gc
gc_item = Gtk.MenuItem(_('using account %s') % account,
use_underline=True)
use_underline=False)
gc_sub_menu.append(gc_item)
gc_menuitem_menu = Gtk.Menu()
gajim.interface.roster.add_bookmarks_list(gc_menuitem_menu,
@ -338,7 +338,7 @@ class StatusIcon:
newitem = Gtk.SeparatorMenuItem.new() # separator
gc_sub_menu.append(newitem)
newitem = Gtk.ImageMenuItem(_('Manage Bookmarks...'))
newitem = Gtk.ImageMenuItem(_('_Manage Bookmarks...'))
img = Gtk.Image.new_from_stock(Gtk.STOCK_PREFERENCES, Gtk.IconSize.MENU)
newitem.set_image(img)
newitem.connect('activate',