Convert some more OK_ONLY windows to new-style transient popups.

This commit is contained in:
Eric S. Raymond 2007-06-11 08:37:02 +00:00
parent b76a3fe4d6
commit 3c04fcb577
4 changed files with 11 additions and 12 deletions

View file

@ -173,8 +173,8 @@ std::string new_map_dialog(display& disp, const t_translation::t_letter fill_ter
const std::string map =
random_map_generator.get()->create_map(std::vector<std::string>());
if (map == "") {
gui::show_dialog(disp, NULL, "",
_("Map creation failed."), gui::OK_ONLY);
gui::message_dialog(disp, "",
_("Map creation failed.")).show();
}
return map;
}

View file

@ -1245,15 +1245,14 @@ void connect::load_game()
}
if(state_.campaign_type != "multiplayer") {
gui::show_dialog(disp(), NULL, "", _("This is not a multiplayer save"),
gui::OK_ONLY);
gui::message_dialog(disp(), "", _("This is not a multiplayer save")).show();
set_result(QUIT);
return;
}
if(state_.version != game_config::version) {
if(state_.version < game_config::min_savegame_version) {
gui::show_dialog(disp(), NULL, "", _("This save is from a version too old to be loaded."), gui::OK_ONLY);
gui::message_dialog(disp(), "", _("This save is from a version too old to be loaded.")).show();
set_result(QUIT);
return;
}

View file

@ -18,6 +18,7 @@
#include "display.hpp"
#include "gettext.hpp"
#include "image.hpp"
#include "construct_dialog.hpp"
#include "show_dialog.hpp"
#include "map_create.hpp"
#include "minimap.hpp"
@ -187,7 +188,7 @@ create::create(display& disp, const config &cfg, chat& c, config& gamelist) :
eras.push_back((**er)["name"]);
}
if(eras.empty()) {
gui::show_dialog(disp, NULL, "", _("No multiplayer sides."), gui::OK_ONLY);
gui::message_dialog(disp, "", _("No multiplayer sides.")).show();
std::cerr << "ERROR: no eras found\n";
throw config::error(_("No eras found"));
}
@ -290,7 +291,7 @@ void create::process_event()
set_result(CREATE);
return;
} else {
gui::show_dialog(disp_, NULL, "", _("You must enter a name."), gui::OK_ONLY);
gui::message_dialog(disp_, "", _("You must enter a name.")).show();
}
}

View file

@ -217,8 +217,8 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
info["result"] = "defeat";
network::send_data(cfg);
} else {
gui::show_dialog(*gui_, NULL, _("Game Over"),
_("The game is over."), gui::OK_ONLY);
gui::message_dialog(*gui_,_("Game Over"),
_("The game is over.")).show();
return OBSERVER_END;
}
}
@ -350,8 +350,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
}
} //end catch
catch(replay::error&) {
gui::show_dialog(*gui_,NULL,"",_("The file you have tried to load is corrupt"),
gui::OK_ONLY);
gui::message_dialog(*gui_,"",_("The file you have tried to load is corrupt")).show();
return QUIT;
}
catch(network::error& e) {
@ -396,7 +395,7 @@ void playsingle_controller::play_turn(bool save)
replaying_ = ::do_replay(*gui_,map_,gameinfo_,units_,teams_,
player_number_,status_,gamestate_);
} catch(replay::error&) {
gui::show_dialog(*gui_,NULL,"",_("The file you have tried to load is corrupt"),gui::OK_ONLY);
gui::message_dialog(*gui_,"",_("The file you have tried to load is corrupt")).show();
replaying_ = false;
}