From ec7fd8af9916fb7abe020216d80a6eed676a9564 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sun, 24 Jul 2005 20:29:32 +0000 Subject: [PATCH] we now have "print_ichat_every_foo_minutes" in expert. --- src/chat.py | 5 ++++- src/common/config.py | 1 + src/config.py | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/chat.py b/src/chat.py index c9ae9268e..44c77201c 100644 --- a/src/chat.py +++ b/src/chat.py @@ -916,7 +916,10 @@ class Chat: buffer.insert_with_tags_by_name(end_iter, tim_format + ' ', *other_tags_for_time) elif gajim.config.get('print_time') == 'sometimes': - if (time.time() - self.last_time_printout[jid]) > (5*60): + every_foo_seconds = 60 * gajim.config.get( + 'print_ichat_every_foo_minutes') + seconds_passed = time.time() - self.last_time_printout[jid] + if seconds_passed > every_foo_seconds: self.last_time_printout[jid] = time.time() end_iter = buffer.get_end_iter() tim = time.localtime() diff --git a/src/common/config.py b/src/common/config.py index 9911a98f9..d2e752c14 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -118,6 +118,7 @@ class Config: 'always_english_wikipedia': [opt_bool, False], 'use_dbus': [opt_bool, True], # allow control via dbus service 'send_receive_chat_state_notifications': [opt_bool, True], + 'print_ichat_every_foo_minutes': [opt_int, 5], # default is every 5 minutes } __options_per_key = { diff --git a/src/config.py b/src/config.py index 8e46aae35..b2437fff7 100644 --- a/src/config.py +++ b/src/config.py @@ -192,6 +192,10 @@ class PreferencesWindow: self.xml.get_widget('speller_checkbutton').set_sensitive(False) #Print time + st = gajim.config.get('print_ichat_every_foo_minutes') + text = _('Every %s _minutes') % st + self.xml.get_widget('time_sometimes_radiobutton').set_label(text) + if gajim.config.get('print_time') == 'never': self.xml.get_widget('time_never_radiobutton').set_active(True) elif gajim.config.get('print_time') == 'sometimes': @@ -394,6 +398,10 @@ class PreferencesWindow: def on_preferences_window_show(self, widget): self.notebook.set_current_page(0) + st = gajim.config.get('print_ichat_every_foo_minutes') + text = _('Every %s _minutes') % st + self.xml.get_widget('time_sometimes_radiobutton').set_label(text) + def on_preferences_window_key_press_event(self, widget, event): if event.keyval == gtk.keysyms.Escape: