← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1392406 into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1392406 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1392406 in widelands: "Confirmation dialog when leaving the editor although Ctrl has been pressed"
  https://bugs.launchpad.net/widelands/+bug/1392406

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1392406/+merge/241727

When leaving the editor after the map has changed, the confirmation dialog can now be skipped by pressing CTRL.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1392406/+merge/241727
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1392406 into lp:widelands.
=== modified file 'src/editor/editorinteractive.cc'
--- src/editor/editorinteractive.cc	2014-11-13 08:25:45 +0000
+++ src/editor/editorinteractive.cc	2014-11-13 18:52:58 +0000
@@ -251,13 +251,17 @@
 
 void EditorInteractive::exit() {
 	if (m_need_save) {
-		UI::WLMessageBox mmb
-		(this,
-		 _("Unsaved Map"),
-		 _("The map has not been saved, do you really want to quit?"),
-		 UI::WLMessageBox::YESNO);
-		if (mmb.run() == 0)
-			return;
+		if (get_key_state(SDL_SCANCODE_LCTRL) || get_key_state(SDL_SCANCODE_RCTRL)) {
+			end_modal(0);
+		} else {
+			UI::WLMessageBox mmb
+			(this,
+			 _("Unsaved Map"),
+			 _("The map has not been saved, do you really want to quit?"),
+			 UI::WLMessageBox::YESNO);
+			if (mmb.run() == 0)
+				return;
+		}
 	}
 	end_modal(0);
 }


Follow ups