From d21644b7c5b65593cb668b4e960d3dff0b47def0 Mon Sep 17 00:00:00 2001 From: abdelwahabram <63767622+abdelwahabram@users.noreply.github.com> Date: Fri, 21 Mar 2025 02:39:21 +0200 Subject: [PATCH] Fix the application terminates if you cancel the confirmation dialog box for exit by replacing "Yes\No" with "Ok\Cancel" answer in ExitDialog() --- invesalius/gui/frame.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/invesalius/gui/frame.py b/invesalius/gui/frame.py index 842f6fc8b..6ee124f20 100644 --- a/invesalius/gui/frame.py +++ b/invesalius/gui/frame.py @@ -514,12 +514,12 @@ def ExitDialog(self): msg = _("Are you sure you want to exit?") if sys.platform == "darwin": dialog = wx.RichMessageDialog( - None, "", msg, wx.ICON_QUESTION | wx.YES_NO | wx.NO_DEFAULT + None, "", msg, wx.ICON_QUESTION | wx.OK | wx.CANCEL | wx.CANCEL_DEFAULT ) dialog.ShowCheckBox("Store session", True) else: dialog = wx.RichMessageDialog( - None, msg, "Invesalius 3", wx.ICON_QUESTION | wx.YES_NO | wx.NO_DEFAULT + None, msg, "Invesalius 3", wx.ICON_QUESTION | wx.OK | wx.CANCEL | wx.CANCEL_DEFAULT ) dialog.ShowCheckBox("Store session", True) @@ -529,10 +529,10 @@ def ExitDialog(self): # logger = log.MyLogger() - if not save and answer == wx.ID_YES: + if not save and answer == wx.ID_OK: log.invLogger.closeLogging() return 1 # Exit and delete session - elif save and answer == wx.ID_YES: + elif save and answer == wx.ID_OK: log.invLogger.closeLogging() return 2 # Exit without deleting session else: