Ask for confirmation before exiting
This commit is contained in:
@@ -619,6 +619,7 @@ class Controller(object):
|
||||
### GUI events
|
||||
# These functions are connected to GUI elements such as menus, buttons and so on.
|
||||
def connect_gui_events(self):
|
||||
widgetUtils.connectExitFunction(self.exit_)
|
||||
widgetUtils.connect_event(self.window, widgetUtils.CLOSE_EVENT, self.exit)
|
||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.update_buffer, menuitem=self.window.update_buffer)
|
||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.check_for_updates, menuitem=self.window.check_for_updates)
|
||||
@@ -655,6 +656,11 @@ class Controller(object):
|
||||
self.window.tb.Bind(wx.EVT_CONTEXT_MENU, self.on_context_menu)
|
||||
|
||||
def exit(self, *args, **kwargs):
|
||||
answer = commonMessages.exit()
|
||||
if answer == widgetUtils.YES:
|
||||
self.exit_()
|
||||
|
||||
def exit_(self, *args, **kwargs):
|
||||
""" Try to set offline in the current user's profile at VK, then closes the application. """
|
||||
log.debug("Receibed an exit signal. closing...")
|
||||
self.set_offline()
|
||||
|
@@ -93,4 +93,8 @@ def alpha_reminder():
|
||||
sys.exit()
|
||||
return
|
||||
else:
|
||||
return wx.MessageDialog(None, _("Please remember that from November 27, 2019, you will have to download the alpha version from scratch from the Socializer website. The alpha version you are currently running will no longer receive updates. The new alpha version, which must be downloaded from the project's page, should not be considered suspicious by most antivirus vendors and all automatic updates will be sent to the new generation of socializer alpha. Thank you for your patience."), _("Important notice"), style=wx.OK).ShowModal()
|
||||
return wx.MessageDialog(None, _("Please remember that from November 27, 2019, you will have to download the alpha version from scratch from the Socializer website. The alpha version you are currently running will no longer receive updates. The new alpha version, which must be downloaded from the project's page, should not be considered suspicious by most antivirus vendors and all automatic updates will be sent to the new generation of socializer alpha. Thank you for your patience."), _("Important notice"), style=wx.OK).ShowModal()
|
||||
|
||||
def exit():
|
||||
dlg = wx.MessageDialog(None, _("Do you really want to close Socializer?"), _("Exit"), wx.YES_NO|wx.ICON_QUESTION)
|
||||
return dlg.ShowModal()
|
Reference in New Issue
Block a user