ability to hide systray icon when there is no pending events. Fixes #4645

This commit is contained in:
Yann Leboulanger 2009-01-25 09:19:24 +00:00
parent 7a8b5aa309
commit e1ae6ea0fe
8 changed files with 528 additions and 464 deletions

View File

@ -1,5 +1,5 @@
AC_INIT([Gajim - A Jabber Instant Messager],
[0.12.0.1-svn],[http://trac.gajim.org/],[gajim])
[0.12.1.1-svn],[http://trac.gajim.org/],[gajim])
AC_PREREQ([2.59])
AC_CONFIG_HEADER(config.h)

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@ class Config:
'last_status_msg_dnd': [ opt_str, '' ],
'last_status_msg_invisible': [ opt_str, '' ],
'last_status_msg_offline': [ opt_str, '' ],
'trayicon': [ opt_bool, True, '', True ],
'trayicon': [opt_str, 'always', _("When to show systray icon. Can be 'never', 'on_event', 'always'."), True],
'iconset': [ opt_str, DEFAULT_ICONSET, '', True ],
'mood_iconset': [ opt_str, DEFAULT_MOOD_ICONSET, '', True ],
'activity_iconset': [ opt_str, DEFAULT_ACTIVITY_ICONSET, '', True ],
@ -269,7 +269,7 @@ class Config:
'attach_notifications_to_systray': [opt_bool, False, _('If True, notification windows from notification-daemon will be attached to systray icon.')],
'check_idle_every_foo_seconds': [opt_int, 2, _('Choose interval between 2 checks of idleness.')],
'latex_png_dpi': [opt_str, '108',_('Change the value to change the size of latex formulas displayed. The higher is larger.') ],
'uri_schemes': [opt_str, 'aaa aaas acap cap cid crid data dav dict dns fax file ftp go gopher h323 http https icap im imap info ipp iris iris.beep iris.xpc iris.xpcs iris.lwz ldap mid modem msrp msrps mtqp mupdate news nfs nntp opaquelocktoken pop pres rtsp service shttp sip sips snmp soap.beep soap.beeps tag tel telnet tftp thismessage tip tv urn vemmi xmlrpc.beep xmlrpc.beeps z39.50r z39.50s about cvs daap ed2k feed fish git iax2 irc ircs ldaps magnet mms rsync ssh svn sftp smb webcal', _('Valid uri schemes. Only schemes in this list will be accepted as "real" uri. (mailto and xmpp are handled seperately)')],
'uri_schemes': [opt_str, 'aaa aaas acap cap cid crid data dav dict dns fax file ftp go gopher h323 http https icap im imap info ipp iris iris.beep iris.xpc iris.xpcs iris.lwz ldap mid modem msrp msrps mtqp mupdate news nfs nntp opaquelocktoken pop pres rtsp service shttp sip sips snmp soap.beep soap.beeps tag tel telnet tftp thismessage tip tv urn vemmi xmlrpc.beep xmlrpc.beeps z39.50r z39.50s about cvs daap ed2k feed fish git iax2 irc ircs ldaps magnet mms rsync ssh svn sftp smb webcal', _('Valid uri schemes. Only schemes in this list will be accepted as "real" uri. (mailto and xmpp are handled seperately)'), True],
}
__options_per_key = {

View File

@ -26,7 +26,7 @@
docdir = '../'
datadir = '../'
version = '0.12.0.1-svn'
version = '0.12.1.1-svn'
import sys, os.path
for base in ('.', 'common'):

View File

@ -187,6 +187,8 @@ class OptionsParser:
self.update_config_to_01144()
if old < [0, 12, 0, 1] and new >= [0, 12, 0, 1]:
self.update_config_to_01201()
if old < [0, 12, 1, 1] and new >= [0, 12, 1, 1]:
self.update_config_to_01211()
gajim.logger.init_vars()
gajim.config.set('version', new_version)
@ -563,8 +565,8 @@ class OptionsParser:
cur.executescript(
'''
CREATE TABLE IF NOT EXISTS rooms_last_message_time(
jid_id INTEGER PRIMARY KEY UNIQUE,
time INTEGER
jid_id INTEGER PRIMARY KEY UNIQUE,
time INTEGER
);
'''
)
@ -607,5 +609,13 @@ class OptionsParser:
replace(' xmpp', '')
gajim.config.set('uri_schemes', new_values)
gajim.config.set('version', '0.12.0.1')
def update_config_to_01211(self):
if 'trayicon' in self.old_values:
if self.old_values['trayicon'] == 'False':
gajim.config.set('trayicon', 'never')
else:
gajim.config.set('trayicon', 'always')
gajim.config.set('version', '0.12.1.1')
# vim: se ts=3:

View File

@ -301,6 +301,15 @@ class PreferencesWindow:
st = gajim.config.get('autopopupaway')
self.auto_popup_away_checkbutton.set_active(st)
# Systray
systray_combobox = self.xml.get_widget('systray_combobox')
if gajim.config.get('trayicon') == 'never':
systray_combobox.set_active(0)
elif gajim.config.get('trayicon') == 'on_event':
systray_combobox.set_active(1)
else:
systray_combobox.set_active(2)
# sounds
if gajim.config.get('sounds_on'):
self.xml.get_widget('play_sounds_checkbutton').set_active(True)
@ -720,6 +729,15 @@ class PreferencesWindow:
def on_auto_popup_away_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'autopopupaway')
def on_systray_combobox_changed(self, widget):
active = widget.get_active()
if active == 0:
gajim.config.set('trayicon', 'never')
elif active == 1:
gajim.config.set('trayicon', 'on_event')
else:
gajim.config.set('trayicon', 'always')
def on_advanced_notifications_button_clicked(self, widget):
dialogs.AdvancedNotificationsWindow()

View File

@ -3265,7 +3265,7 @@ class Interface:
if self.systray_capabilities:
self.systray = systray.Systray()
if self.systray_capabilities and gajim.config.get('trayicon'):
if self.systray_capabilities and gajim.config.get('trayicon') != 'never':
self.show_systray()
path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps', 'gajim.png')

View File

@ -99,6 +99,10 @@ class Systray:
state = 'event'
else:
state = self.status
if state != 'event' and gajim.config.get('trayicon') == 'on_event':
self.t.hide()
else:
self.t.show()
image = gajim.interface.jabber_state_images['16'][state]
if image.get_storage_type() == gtk.IMAGE_ANIMATION:
self.img_tray.set_from_animation(image.get_animation())