Convert some calls to gui2::show_error_message.

Found some function that use "Error" as title instead of using the
specialized function, so converted them.
This commit is contained in:
Mark de Wever 2009-05-22 14:59:30 +00:00
parent 99350d4e3e
commit c9cfa82861
3 changed files with 11 additions and 12 deletions

View file

@ -1092,8 +1092,7 @@ namespace {
prepare_addons_list_for_display(addons, addon_dirs, parentdir);
if (addons.empty()) {
/** @todo should use a dialog which always shows the close button. */
gui2::show_message(disp.video(), _("Error"),
gui2::show_error_message(disp.video(),
_("You have no add-ons installed."));
return;
}
@ -1148,13 +1147,10 @@ namespace {
}
else
{
const std::string err_msg_title = _("Error");
std::string err_msg = _("Add-on could not be deleted properly:");
err_msg += '\n';
err_msg += removal_log;
/* GCC-3.3 needs a temp var otherwise compilation fails */
gui::dialog dlg2(disp, err_msg_title, err_msg, gui::OK_ONLY);
dlg2.show();
gui2::show_error_message(disp.video(), err_msg);
}
}

View file

@ -23,6 +23,7 @@
#include "gui/dialogs/editor_generate_map.hpp"
#include "gui/dialogs/editor_resize_map.hpp"
#include "gui/dialogs/editor_settings.hpp"
#include "gui/dialogs/message.hpp"
#include "gui/widgets/window.hpp"
#include "../clipboard.hpp"
@ -366,7 +367,8 @@ void editor_controller::replace_map_context(const map_context& new_mc)
void editor_controller::editor_settings_dialog()
{
if (tods_.empty()) {
gui::message_dialog(gui(), _("Error"), _("No editor time-of-day found.")).show();
gui2::show_error_message(gui().video(),
_("No editor time-of-day found."));
return;
}
@ -476,7 +478,8 @@ 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();
gui2::show_error_message(gui().video(),
_("No random map generators found."));
return;
}
gui2::teditor_generate_map dialog;
@ -512,7 +515,7 @@ void editor_controller::apply_mask_dialog()
gui::message_dialog(gui(), _("Error loading mask"), e.what()).show();
return;
} catch (editor_action_exception& e) {
gui::message_dialog(gui(), _("Error"), e.what()).show();
gui2::show_error_message(gui().video(), e.what());
return;
}
}
@ -534,7 +537,7 @@ void editor_controller::create_mask_to_dialog()
gui::message_dialog(gui(), _("Error loading map"), e.what()).show();
return;
} catch (editor_action_exception& e) {
gui::message_dialog(gui(), _("Error"), e.what()).show();
gui2::show_error_message(gui().video(), e.what());
return;
}
}

View file

@ -573,7 +573,7 @@ bool savegame::check_overwrite(CVideo& video)
void savegame::check_filename(const std::string& filename, CVideo& video)
{
if (is_gzip_file(filename)) {
gui2::show_message(video, _("Error"), _("Save names should not end on '.gz'. "
gui2::show_error_message(video, _("Save names should not end on '.gz'. "
"Please choose a different name."));
throw illegal_filename_exception();
}
@ -639,7 +639,7 @@ bool savegame::save_game(CVideo* video, const std::string& filename)
return true;
} catch(game::save_game_failed&) {
if (video != NULL){
gui2::show_message(*video,_("Error"), error_message_);
gui2::show_error_message(*video,error_message_);
//do not bother retrying, since the user can just try to save the game again
//maybe show a yes-no dialog for "disable autosaves now"?
}