From 88aa47be2a3bfb9563bbb87fc4c78e75dd98217f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 7 Aug 2008 11:01:38 +0200 Subject: [PATCH] Remove the readonly test as the button is disable when field is readonly --- .../view_form/view/form_gtk/calendar.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/calendar.py b/tryton/gui/window/view_form/view/form_gtk/calendar.py index 47e0e8c261..944363f609 100644 --- a/tryton/gui/window/view_form/view/form_gtk/calendar.py +++ b/tryton/gui/window/view_form/view/form_gtk/calendar.py @@ -39,16 +39,13 @@ class Calendar(WidgetInterface): self.widget.pack_start(self.but_open, expand=False, fill=False) tooltips = gtk.Tooltips() - tooltips.set_tip(self.but_open, _('Open the calendar widget')) + tooltips.set_tip(self.but_open, _('Open the calendar')) tooltips.enable() - self.readonly = False - def _color_widget(self): return self.entry def _readonly_set(self, value): - super(Calendar, self)._readonly_set(value) self.entry.set_editable(not value) self.entry.set_sensitive(not value) self.but_open.set_sensitive(not value) @@ -96,10 +93,6 @@ class Calendar(WidgetInterface): return True def cal_open(self, widget): - if self.readonly: - message(_('This widget is readonly!'), self._window) - return True - win = gtk.Dialog(_('Date Selection'), self._window, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, @@ -161,18 +154,16 @@ class DateTime(WidgetInterface): self.widget.pack_start(self.but_open, expand=False, fill=False) tooltips = gtk.Tooltips() - tooltips.set_tip(self.but_open, _('Open the calendar widget')) + tooltips.set_tip(self.but_open, _('Open the calendar')) tooltips.enable() - self.readonly = False - def _color_widget(self): return self.entry def _readonly_set(self, value): - self.readonly = value self.entry.set_editable(not value) self.entry.set_sensitive(not value) + self.but_open.set_sensitive(not value) def sig_key_press(self, widget, event): if event.keyval == gtk.keysyms.F2: @@ -241,10 +232,6 @@ class DateTime(WidgetInterface): return True def cal_open(self, widget): - if self.readonly: - message(_('This widget is readonly!'), self._window) - return True - win = gtk.Dialog(_('Date Time Selection'), self._window, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,