Better button for relation dialogs

This commit is contained in:
Cédric Krier committed 2008-01-20 23:58:40 +01:00
1 parent 307e6374f5
commit bf7eedc1e8
2 files changed
+9 -2

No files matched your search

@@ -36,7 +36,10 @@ class Dialog(object):
self.accel_group = gtk.AccelGroup()
self.dia.add_accel_group(self.accel_group)
self.but_cancel = self.dia.add_button(gtk.STOCK_CANCEL,
icon_cancel = gtk.STOCK_CLOSE
if not obj_id:
icon_cancel = gtk.STOCK_CANCEL
self.but_cancel = self.dia.add_button(icon_cancel,
gtk.RESPONSE_CANCEL)
self.but_cancel.add_accelerator('clicked', self.accel_group,
gtk.keysyms.Escape, gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
@@ -32,7 +32,10 @@ class Dialog(object):
self.accel_group = gtk.AccelGroup()
self.dia.add_accel_group(self.accel_group)
self.but_cancel = self.dia.add_button(gtk.STOCK_CANCEL,
icon_cancel = gtk.STOCK_CLOSE
if not model:
icon_cancel = gtk.STOCK_CANCEL
self.but_cancel = self.dia.add_button(icon_cancel,
gtk.RESPONSE_CANCEL)
self.but_cancel.add_accelerator('clicked', self.accel_group,
gtk.keysyms.Escape, gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
@@ -88,6 +91,7 @@ class Dialog(object):
or self.screen.current_model.validate()
if not end:
self.screen.display()
self.but_cancel.set_label(gtk.STOCK_CLOSE)
if res == gtk.RESPONSE_OK:
self.screen.current_view.set_value()