From dc133351e7c578237189080a087e89f71b0c5f87 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 23 Jan 2011 04:49:49 +0000 Subject: [PATCH] - added save prompt when closing map editor (code based on MuwuM's contribution, thanks) --- source/glest_map_editor/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index a91c12d1..17a2b4aa 100755 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -362,6 +362,11 @@ void MainWindow::init(string fname) { } void MainWindow::onClose(wxCloseEvent &event) { + if( wxMessageDialog(NULL, ToUnicode("Do you want to save the current map?"), + ToUnicode("Question"), wxYES_NO | wxYES_DEFAULT).ShowModal() == wxID_YES) { + wxCommandEvent ev; + MainWindow::onMenuFileSave(ev); + } delete this; }