$OpenBSD: patch-src_editor2_editor_controller_cpp,v 1.1 2009/11/11 16:01:34 jasper Exp $
--- src/editor2/editor_controller.cpp.orig	Tue Jul  7 22:04:31 2009
+++ src/editor2/editor_controller.cpp	Tue Jul  7 22:00:35 2009
@@ -273,7 +273,7 @@ EXIT_STATUS editor_controller::main_loop()
 			play_slice();
 		}
 	} catch (editor_exception& e) {
-		gui::message_dialog(gui(), _("Fatal error"), e.what()).show();
+		gui::message_dialog(*gui_, _("Fatal error"), e.what()).show();
 		return EXIT_ERROR;
 	} catch (twml_exception& e) {
 		e.show(gui());
@@ -359,7 +359,7 @@ void editor_controller::replace_map_context(const map_
 void editor_controller::editor_settings_dialog()
 {
 	if (tods_.empty()) {
-		gui::message_dialog(gui(), _("Error"), _("No editor time-of-day found.")).show();
+		gui::message_dialog(*gui_, _("Error"), _("No editor time-of-day found.")).show();
 		return;
 	}
 
@@ -469,7 +469,7 @@ void editor_controller::save_map_as_dialog()
 void editor_controller::generate_map_dialog()
 {
 	if (map_generators_.empty()) {
-		gui::message_dialog(gui(), _("Error"), _("No random map generators found.")).show();
+		gui::message_dialog(*gui_, _("Error"), _("No random map generators found.")).show();
 		return;
 	}
 	gui2::teditor_generate_map dialog;
@@ -482,11 +482,11 @@ void editor_controller::generate_map_dialog()
 			map_string = dialog.get_selected_map_generator()
 				->create_map(std::vector<std::string>());
 		} catch (mapgen_exception& e) {
-			gui::message_dialog(gui(), _("Map creation failed."), e.what()).show();
+			gui::message_dialog(*gui_, _("Map creation failed."), e.what()).show();
 			return;
 		}
 		if (map_string.empty()) {
-			gui::message_dialog(gui(), "", _("Map creation failed.")).show();
+			gui::message_dialog(*gui_, "", _("Map creation failed.")).show();
 		} else {
 			editor_map new_map(game_config_, map_string);
 			editor_action_whole_map a(new_map);
@@ -508,10 +508,10 @@ void editor_controller::apply_mask_dialog()
 			editor_action_apply_mask a(mask.get_map());
 			perform_refresh(a);
 		} catch (editor_map_load_exception& e) {
-			gui::message_dialog(gui(), _("Error loading mask"), e.what()).show();
+			gui::message_dialog(*gui_, _("Error loading mask"), e.what()).show();
 			return;
 		} catch (editor_action_exception& e) {
-			gui::message_dialog(gui(), _("Error"), e.what()).show();
+			gui::message_dialog(*gui_, _("Error"), e.what()).show();
 			return;
 		}
 	}
@@ -530,10 +530,10 @@ void editor_controller::create_mask_to_dialog()
 			editor_action_create_mask a(map.get_map());
 			perform_refresh(a);
 		} catch (editor_map_load_exception& e) {
-			gui::message_dialog(gui(), _("Error loading map"), e.what()).show();
+			gui::message_dialog(*gui_, _("Error loading map"), e.what()).show();
 			return;
 		} catch (editor_action_exception& e) {
-			gui::message_dialog(gui(), _("Error"), e.what()).show();
+			gui::message_dialog(*gui_, _("Error"), e.what()).show();
 			return;
 		}
 	}
@@ -608,7 +608,7 @@ bool editor_controller::save_map_as(const std::string&
 	if (is_open < map_contexts_.size()
 			&& is_open != static_cast<unsigned>(current_context_index_)) {
 
-		gui::dialog(gui(), _("This map is already open."), filename).show();
+		gui::dialog(*gui_, _("This map is already open."), filename).show();
 		return false;
 	}
 	std::string old_filename = get_map_context().get_filename();
@@ -629,10 +629,10 @@ bool editor_controller::save_map(bool display_confirma
 	try {
 		get_map_context().save();
 		if (display_confirmation) {
-			gui::message_dialog(gui(), "", _("Map saved.")).show();
+			gui::message_dialog(*gui_, "", _("Map saved.")).show();
 		}
 	} catch (editor_map_save_exception& e) {
-		gui::message_dialog(gui(), "", e.what()).show();
+		gui::message_dialog(*gui_, "", e.what()).show();
 		return false;
 	}
 	return true;
@@ -650,7 +650,7 @@ bool editor_controller::check_switch_open_map(const st
 {
 	size_t i = check_open_map(fn);
 	if (i < map_contexts_.size()) {
-		gui::dialog(gui(), _("This map is already open."), fn).show();
+		gui::dialog(*gui_, _("This map is already open."), fn).show();
 		switch_context(i);
 		return true;
 	}
@@ -674,7 +674,7 @@ void editor_controller::load_map(const std::string& fi
 		}
 		if (get_map_context().is_embedded()) {
 			const char* msg = _("Loaded embedded map data");
-			gui::message_dialog(gui(), _("Map loaded from scenario"), msg).show();
+			gui::message_dialog(*gui_, _("Map loaded from scenario"), msg).show();
 		} else {
 			if (get_map_context().get_filename() != filename) {
 				if (get_map_context().get_map_data_key().empty()) {
@@ -688,13 +688,13 @@ void editor_controller::load_map(const std::string& fi
 						"$new");
 					symbols["new"] = get_map_context().get_filename();
 					symbols["map_data"] = get_map_context().get_map_data_key();
-					gui::message_dialog(gui(), _("Map loaded from scenario"), 
+					gui::message_dialog(*gui_, _("Map loaded from scenario"), 
 						vgettext(msg, symbols)).show();
 				}
 			}
 		}
 	} catch (editor_map_load_exception& e) {
-		gui::message_dialog(gui(), _("Error loading map"), e.what()).show();
+		gui::message_dialog(*gui_, _("Error loading map"), e.what()).show();
 		return;
 	}
 }
