Implemented checkbox into the multiple terminals confirmation dialog, in oder to suppress it if users don't want this annoying message all the time.
This commit is contained in:
parent
46a3357b1f
commit
df68c6c94d
|
@ -102,6 +102,7 @@ DEFAULTS = {
|
|||
'enabled_plugins' : ['LaunchpadBugURLHandler',
|
||||
'LaunchpadCodeURLHandler',
|
||||
'APTURLHandler'],
|
||||
'suppress_multiple_term_dialog': False,
|
||||
},
|
||||
'keybindings': {
|
||||
'zoom_in' : '<Control>plus',
|
||||
|
|
|
@ -151,6 +151,11 @@ class Container(object):
|
|||
|
||||
def construct_confirm_close(self, window, reqtype):
|
||||
"""Create a confirmation dialog for closing things"""
|
||||
|
||||
# skip this dialog if applicable
|
||||
if self.config['suppress_multiple_term_dialog']:
|
||||
return gtk.RESPONSE_ACCEPT
|
||||
|
||||
dialog = gtk.Dialog(_('Close?'), window, gtk.DIALOG_MODAL)
|
||||
dialog.set_has_separator(False)
|
||||
dialog.set_resizable(False)
|
||||
|
@ -180,8 +185,20 @@ the %s will also close all terminals within it.') % (reqtype, reqtype))
|
|||
box.pack_start(labels, False, False, 6)
|
||||
dialog.vbox.pack_start(box, False, False, 12)
|
||||
|
||||
checkbox = gtk.CheckButton(_("Do not show this message next time"))
|
||||
dialog.vbox.pack_end(checkbox)
|
||||
|
||||
dialog.show_all()
|
||||
return(dialog)
|
||||
|
||||
result = dialog.run()
|
||||
|
||||
# set configuration
|
||||
self.config['suppress_multiple_term_dialog'] = checkbox.get_active()
|
||||
self.config.save()
|
||||
|
||||
dialog.destroy()
|
||||
|
||||
return(result)
|
||||
|
||||
def propagate_title_change(self, widget, title):
|
||||
"""Pass a title change up the widget stack"""
|
||||
|
|
|
@ -246,10 +246,8 @@ class Window(Container, gtk.Window):
|
|||
def confirm_close(self, window, type):
|
||||
"""Display a confirmation dialog when the user is closing multiple
|
||||
terminals in one window"""
|
||||
dialog = self.construct_confirm_close(window, type)
|
||||
result = dialog.run()
|
||||
dialog.destroy()
|
||||
return(not (result == gtk.RESPONSE_ACCEPT))
|
||||
|
||||
return(not (self.construct_confirm_close(window, type) == gtk.RESPONSE_ACCEPT))
|
||||
|
||||
def on_destroy_event(self, widget, data=None):
|
||||
"""Handle window destruction"""
|
||||
|
|
Loading…
Reference in New Issue