add show_all_events and show_roster menuitems to systray menu

This commit is contained in:
Yann Leboulanger 2005-10-30 00:08:39 +00:00
parent 39710fe110
commit 56bc8d4709
2 changed files with 88 additions and 38 deletions

View File

@ -11798,7 +11798,7 @@ Status message</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image1236"> <widget class="GtkImage" id="image1263">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-new</property> <property name="stock">gtk-new</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -11811,6 +11811,42 @@ Status message</property>
</widget> </widget>
</child> </child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator12">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="show_all_events_menuitem">
<property name="visible">True</property>
<property name="label" translatable="yes">Show All _Events</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_show_all_events_menuitem_activate" last_modification_time="Sat, 29 Oct 2005 23:55:24 GMT"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="show_roster_menuitem">
<property name="visible">True</property>
<property name="label" translatable="yes">Show _Roster</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_show_roster_menuitem_activate" last_modification_time="Sat, 29 Oct 2005 23:55:24 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1264">
<property name="visible">True</property>
<property name="stock">gtk-home</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child> <child>
<widget class="GtkImageMenuItem" id="preferences_menuitem"> <widget class="GtkImageMenuItem" id="preferences_menuitem">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -209,6 +209,14 @@ class Systray:
self.systray_context_menu.popup(None, None, None, event.button, event.time) self.systray_context_menu.popup(None, None, None, event.button, event.time)
self.systray_context_menu.show_all() self.systray_context_menu.show_all()
def on_show_all_events_menuitem_activate(self, widget):
while len(self.jids):
self.handle_first_event()
def on_show_roster_menuitem_activate(self, widget):
win = gajim.interface.roster.window
win.present()
def on_preferences_menuitem_activate(self, widget): def on_preferences_menuitem_activate(self, widget):
if gajim.interface.windows['preferences'].window.get_property('visible'): if gajim.interface.windows['preferences'].window.get_property('visible'):
gajim.interface.windows['preferences'].window.present() gajim.interface.windows['preferences'].window.present()
@ -258,9 +266,15 @@ class Systray:
else: else:
win.present() win.present()
else: else:
self.handle_first_event()
def handle_first_event(self):
account = self.jids[0][0] account = self.jids[0][0]
jid = self.jids[0][1] jid = self.jids[0][1]
typ = self.jids[0][2] typ = self.jids[0][2]
self.handle_event(account, jid, typ)
def handle_event(self, account, jid, typ):
wins = gajim.interface.windows[account] wins = gajim.interface.windows[account]
w = None w = None
if typ == 'gc': if typ == 'gc':