print time sometimes or never disables being able to change before after time entries
This commit is contained in:
parent
60c916b53a
commit
b4574c341b
|
@ -210,8 +210,10 @@ class PreferencesWindow:
|
|||
|
||||
if gajim.config.get('print_time') == 'never':
|
||||
self.xml.get_widget('time_never_radiobutton').set_active(True)
|
||||
self._set_sensitivity_for_before_after_time_widgets(False)
|
||||
elif gajim.config.get('print_time') == 'sometimes':
|
||||
self.xml.get_widget('time_sometimes_radiobutton').set_active(True)
|
||||
self._set_sensitivity_for_before_after_time_widgets(False)
|
||||
else:
|
||||
self.xml.get_widget('time_always_radiobutton').set_active(True)
|
||||
|
||||
|
@ -594,21 +596,30 @@ class PreferencesWindow:
|
|||
for msg_win in gajim.interface.msg_win_mgr.windows():
|
||||
msg_win.update_print_time()
|
||||
|
||||
def _set_sensitivity_for_before_after_time_widgets(self, sensitive):
|
||||
self.xml.get_widget('before_time_label').set_sensitive(sensitive)
|
||||
self.xml.get_widget('before_time_entry').set_sensitive(sensitive)
|
||||
self.xml.get_widget('after_time_label').set_sensitive(sensitive)
|
||||
self.xml.get_widget('after_time_entry').set_sensitive(sensitive)
|
||||
|
||||
def on_time_never_radiobutton_toggled(self, widget):
|
||||
if widget.get_active():
|
||||
gajim.config.set('print_time', 'never')
|
||||
self._set_sensitivity_for_before_after_time_widgets(False)
|
||||
self.update_print_time()
|
||||
gajim.interface.save_config()
|
||||
|
||||
def on_time_sometimes_radiobutton_toggled(self, widget):
|
||||
if widget.get_active():
|
||||
gajim.config.set('print_time', 'sometimes')
|
||||
self._set_sensitivity_for_before_after_time_widgets(False)
|
||||
self.update_print_time()
|
||||
gajim.interface.save_config()
|
||||
|
||||
def on_time_always_radiobutton_toggled(self, widget):
|
||||
if widget.get_active():
|
||||
gajim.config.set('print_time', 'always')
|
||||
self._set_sensitivity_for_before_after_time_widgets(True)
|
||||
self.update_print_time()
|
||||
gajim.interface.save_config()
|
||||
|
||||
|
|
|
@ -3948,7 +3948,7 @@ Per type</property>
|
|||
<property name="column_spacing">12</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label229">
|
||||
<widget class="GtkLabel" id="after_time_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">After time:</property>
|
||||
<property name="use_underline">False</property>
|
||||
|
@ -4032,7 +4032,7 @@ Per type</property>
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label228">
|
||||
<widget class="GtkLabel" id="before_time_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Before time:</property>
|
||||
<property name="use_underline">False</property>
|
||||
|
|
Loading…
Reference in New Issue