Disallow to close wizard with Esc and remove close button also on windows
We must force the user to follow the flow of the wizard
This commit is contained in:
1 parent
5bfc7eb9cd
commit
9a853aea8d
1 file changed
+6
-1
@@ -25,8 +25,9 @@ class Dialog(object):
|
||||
self.dia = gtk.Dialog(_('Wizard'), parent,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
|
||||
self.dia.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
|
||||
if hasattr(self.dia, 'set_deletable') and os.name != 'nt':
|
||||
if hasattr(self.dia, 'set_deletable'):
|
||||
self.dia.set_deletable(False)
|
||||
self.dia.connect('close', self.close)
|
||||
|
||||
self.accel_group = gtk.AccelGroup()
|
||||
self.dia.add_accel_group(self.accel_group)
|
||||
@@ -145,6 +146,10 @@ class Dialog(object):
|
||||
self.parent.present()
|
||||
return False
|
||||
|
||||
def close(self, widget, event=None):
|
||||
widget.emit_stop_by_name('close')
|
||||
return True
|
||||
|
||||
def destroy(self):
|
||||
self.dia.destroy()
|
||||
|
||||
|
||||
Reference in new issue
Block a user