*Double confirmation of exit function 4.x-dev

Sat, 19 Dec 2020 01:47:19 +0100

author
Luca Tonini <luca.r.tonini@gmail.com>
date
Sat, 19 Dec 2020 01:47:19 +0100
branch
4.x-dev
changeset 1522
723fc72c27b4
parent 1521
d95627760e8a
child 1523
da86720e9360

*Double confirmation of exit function

Tools/ResourceManagementUI/Source/UI/App.cpp file | annotate | diff | comparison | revisions
Tools/ResourceManagementUI/Source/UI/App.h file | annotate | diff | comparison | revisions
--- a/Tools/ResourceManagementUI/Source/UI/App.cpp	Fri Dec 18 21:01:45 2020 +0100
+++ b/Tools/ResourceManagementUI/Source/UI/App.cpp	Sat Dec 19 01:47:19 2020 +0100
@@ -1,6 +1,4 @@
 #include "App.h"
-#include <Gorgon/UI/Organizers/Flow.h>
-
 
 
 namespace UI{
@@ -55,11 +53,11 @@
             exit(0);
         });
         
-        //Program terminates if Exit button is clicked.
+        //Program terminates if Exit button is clicked and confirmedv.
         btnExit.PressEvent.Register([&]{
-            exit(0);
+            pnlSettings.Disable();
+            Gorgon::UI::AskYesNo("Exit","Any currently running imports will be lost!\n\n\nAre you sure you want to leave?", [&]{exit(0);}, [&]{pnlSettings.Enable();});
         });
-            
     }
     
     void App::Import(){
@@ -67,6 +65,8 @@
         std::string toPath = pathTo.GetText();
         std::cout << "Importing Resources From \"" << fromPath << "\" to \"" << toPath << "\"" << std::endl;
     }
+    
+    
 
     
     App::initStyle::initStyle(std::string fontname, int fh) {
--- a/Tools/ResourceManagementUI/Source/UI/App.h	Fri Dec 18 21:01:45 2020 +0100
+++ b/Tools/ResourceManagementUI/Source/UI/App.h	Sat Dec 19 01:47:19 2020 +0100
@@ -33,6 +33,10 @@
 #include <Gorgon/Graphics/Color.h>
 #include <Gorgon/Filesystem.h>
 
+#include <Gorgon/UI/Organizers/Flow.h>
+#include <Gorgon/Widgets/DialogWindow.h>
+#include <Gorgon/UI/Dialog.h>
+
 #include "Cli.h"
 
 
@@ -84,7 +88,7 @@
         Gorgon::Graphics::BlankImage applicationBG;
         
         //Gorgon Button Objects
-        Gorgon::Widgets::Button btnImport, btnFileFrom, btnFileTo, btnExit;
+        Gorgon::Widgets::Button btnImport, btnFileFrom, btnFileTo, btnExit, btnCheckExit;
         
         //Gorgon Checkbox opjects
         //Gorgon::Widgets::Checkbox metadata;
@@ -94,6 +98,5 @@
         //Gorgon panel objects
         Gorgon::Widgets::Panel pnlSettings;
         
-        
     };
 }

mercurial