diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py
index c7634401d..71263a13f 100644
--- a/plugins/gtkgui/config.py
+++ b/plugins/gtkgui/config.py
@@ -367,10 +367,24 @@ class Preferences_window:
else:
window.show_all()
- def on_auto_popup_checkbutton_toggled(self, widget):
+ def on_notify_on_new_message_radiobutton_toggled(self, widget):
+ self.on_checkbutton_toggled(widget, 'notify_on_new_message', \
+ [self.auto_popup_away_checkbutton])
+
+ def on_popup_new_message_radiobutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'autopopup', \
[self.auto_popup_away_checkbutton])
+ def on_only_in_roster_radiobutton_toggled(self, widget):
+ if widget.get_active():
+ self.auto_popup_away_checkbutton.set_sensitive(False)
+
+ def on_notify_on_online_checkbutton_toggled(self, widget):
+ self.on_checkbutton_toggled(widget, 'notify_on_online')
+
+ def on_notify_on_offline_checkbutton_toggled(self, widget):
+ self.on_checkbutton_toggled(widget, 'notify_on_offline')
+
def on_auto_popup_away_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'autopopupaway')
@@ -626,7 +640,14 @@ class Preferences_window:
self.window = self.xml.get_widget('preferences_window')
self.plugin = plugin
self.iconset_combobox = self.xml.get_widget('iconset_combobox')
- self.auto_popup_checkbutton = self.xml.get_widget('auto_popup_checkbutton')
+ self.notify_on_new_message_radiobutton = self.xml.get_widget \
+ ('notify_on_new_message_radiobutton')
+ self.popup_new_message_radiobutton = self.xml.get_widget \
+ ('popup_new_message_radiobutton')
+ self.notify_on_online_checkbutton = self.xml.get_widget \
+ ('notify_on_online_checkbutton')
+ self.notify_on_offline_checkbutton = self.xml.get_widget \
+ ('notify_on_offline_checkbutton')
self.auto_popup_away_checkbutton = self.xml.get_widget \
('auto_popup_away_checkbutton')
self.auto_away_checkbutton = self.xml.get_widget('auto_away_checkbutton')
@@ -756,14 +777,25 @@ class Preferences_window:
self.xml.get_widget('use_emoticons_checkbutton').set_active(st)
self.xml.get_widget('add_remove_emoticons_button').set_sensitive(st)
+ #notify on new message
+ st = self.plugin.config['notify_on_new_message']
+ self.notify_on_new_message_radiobutton.set_active(st)
+
#autopopup
st = self.plugin.config['autopopup']
- self.auto_popup_checkbutton.set_active(st)
+ self.notify_on_online_checkbutton.set_active(st)
+
+ #notify on online statuses
+ st = self.plugin.config['notify_on_online']
+ self.notify_on_online_checkbutton.set_active(st)
+
+ #notify on offline statuses
+ st = self.plugin.config['notify_on_offline']
+ self.notify_on_offline_checkbutton.set_active(st)
#autopopupaway
st = self.plugin.config['autopopupaway']
self.auto_popup_away_checkbutton.set_active(st)
- self.auto_popup_away_checkbutton.set_sensitive(self.plugin.config['autopopup'])
#Ignore messages from unknown contacts
self.xml.get_widget('ignore_events_from_unknown_contacts_checkbutton').\
diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade
index 680f5cfb4..cc65f7937 100644
--- a/plugins/gtkgui/gtkgui.glade
+++ b/plugins/gtkgui/gtkgui.glade
@@ -4287,14 +4287,14 @@
5
-
+
True
0
0.5
GTK_SHADOW_ETCHED_IN
-
+
True
0.5
0.5
@@ -4306,24 +4306,128 @@
0
-
+
True
False
0
-
+
+
+ True
+ False
+ 5
+
+
+
+ True
+ Notify me about contacts going:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Gajim will notify you via a popup window in the bottom right of the screen about contacts that just went online
+ True
+ _Online
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Gajim will notify you via a popup window in the bottom right of the screen about contacts that just went offline
+ True
+ Of_fline
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+
+ 0
+ False
+ False
+
+
+
+
+ 0
+ False
+ True
+
+
+
-
+
True
- <b>When new chat nessage is received</b>
+ <b>Notifications</b>
False
True
GTK_JUSTIFY_LEFT
@@ -4390,7 +4574,7 @@
True
True
- _Ignore events from contacts not in your roster
+ _Ignore events from contacts not in the roster
True
GTK_RELIEF_NORMAL
True
@@ -4717,7 +4901,7 @@
True
True
- Auto _away after
+ Auto _away after:
True
GTK_RELIEF_NORMAL
True
@@ -4740,7 +4924,7 @@
True
True
- Auto e_Xtended Away after
+ Auto e_Xtended Away after:
True
GTK_RELIEF_NORMAL
True
@@ -5621,7 +5805,7 @@ Custom
True
0
0.5
- GTK_SHADOW_NONE
+ GTK_SHADOW_IN
diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index f66d9d7c3..8e93387e2 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -413,15 +413,7 @@ class plugin:
self.play_sound('sound_contact_connected')
if not self.windows[account]['chats'].has_key(jid) and \
not self.queues[account].has_key(jid) and \
- not self.config['autopopup']:
- #FIXME:
- #DOES NOT ALWAYS WORK WHY?
- #I control nkour@lagaule in jabber
- # have nkour@lagaul in nkour@jabber.org
- #go online from psi in lagaule
- #gajim doesn't give a shit
- # WHY? same with offline
- # new message works
+ self.config['notify_on_online']:
instance = Popup_window(self, 'Contact Online', jid, account)
self.roster.popup_windows.append(instance)
elif old_show > 1 and new_show < 2 and \
@@ -429,7 +421,7 @@ class plugin:
self.play_sound('sound_contact_disconnected')
if not self.windows[account]['chats'].has_key(jid) and \
not self.queues[account].has_key(jid) and \
- not self.config['autopopup']:
+ self.config['notify_on_offline']:
instance = Popup_window(self, 'Contact Offline', jid, account)
self.roster.popup_windows.append(instance)
@@ -452,7 +444,7 @@ class plugin:
if not self.windows[account]['chats'].has_key(jid) and \
not self.queues[account].has_key(jid):
first = True
- if not self.config['autopopup']:
+ if self.config['notify_on_new_message']:
instance = Popup_window(self, 'New Message', jid, account)
self.roster.popup_windows.append(instance)
self.roster.on_message(jid, array[1], array[2], account)
@@ -862,7 +854,11 @@ class plugin:
'MYVCARD', 'OS_INFO', 'VCARD', 'LOG_NB_LINE', 'LOG_LINE', 'VISUAL', \
'GC_MSG', 'GC_SUBJECT', 'BAD_PASSPHRASE', 'GPG_SECRETE_KEYS', \
'ROSTER_INFO', 'MSGSENT'])
- self.default_config = {'autopopup':0,\
+ self.default_config = {\
+ 'notify_on_new_message': 1,\
+ 'autopopup':0,\
+ 'notify_on_online': 1,\
+ 'notify_on_offline': 0,\
'autopopupaway':0,\
'ignore_unknown_contacts':0,\
'showoffline':0,\