we cannot click save preset if status msg is empty
This commit is contained in:
parent
5ef0058780
commit
76757c556c
|
@ -225,6 +225,8 @@ class ChangeStatusMessageDialog:
|
|||
|
||||
message_textview = self.xml.get_widget('message_textview')
|
||||
self.message_buffer = message_textview.get_buffer()
|
||||
self.message_buffer.connect('changed',
|
||||
self.toggle_sensitiviy_of_save_as_preset)
|
||||
msg = None
|
||||
if show:
|
||||
msg = gajim.config.get('last_status_msg_' + show)
|
||||
|
@ -277,6 +279,14 @@ class ChangeStatusMessageDialog:
|
|||
if (event.state & gtk.gdk.CONTROL_MASK):
|
||||
self.window.response(gtk.RESPONSE_OK)
|
||||
|
||||
def toggle_sensitiviy_of_save_as_preset(self, widget):
|
||||
btn = self.xml.get_widget('save_as_preset_button')
|
||||
if self.message_buffer.get_char_count() == 0:
|
||||
btn.set_sensitive(False)
|
||||
else:
|
||||
btn.set_sensitive(True)
|
||||
|
||||
|
||||
class AddNewContactWindow:
|
||||
'''Class for AddNewContactWindow'''
|
||||
def __init__(self, account, jid = None):
|
||||
|
|
|
@ -10190,15 +10190,78 @@ Custom</property>
|
|||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="save_message_as_button">
|
||||
<widget class="GtkButton" id="save_as_preset_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Save Message as Preset...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_save_message_as_button_clicked" last_modification_time="Wed, 25 Jan 2006 10:23:18 GMT"/>
|
||||
<signal name="clicked" handler="on_save_as_preset_button_clicked" last_modification_time="Thu, 26 Jan 2006 17:31:47 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment106">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3021">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1369">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-save-as</property>
|
||||
<property name="icon_size">4</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label380">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Save as Preset...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
Loading…
Reference in New Issue