Restore a GUI1 get_video method

Replacement for get_display() removed in db29fa8a20d2b5547ad0a636b3af66b1629a4b6f
This commit is contained in:
Charles Dang 2016-01-12 13:17:39 +11:00
parent 8c0e56213b
commit 5f732c3dfb
3 changed files with 6 additions and 5 deletions

View file

@ -277,6 +277,7 @@ public:
std::string textbox_text() const { return text_widget_->text();}
dialog_textbox& get_textbox() const { return *text_widget_; }
bool option_checked(unsigned int option_index=0);
CVideo& get_video() { return video_; }
/// Explicit freeing of class static resources.
/// Must not be called if any instances of this class exist.

View file

@ -204,7 +204,7 @@ void file_dialog::action(gui::dialog_process_info &dp_info)
if(!chosen_file_.empty())
{
if(files_list_->delete_chosen_file() == -1) {
gui2::show_transient_error_message(CVideo::get_singleton()
gui2::show_transient_error_message(get_video()
, _("Deletion of the file failed."));
dp_info.clear_buttons();
} else {
@ -217,10 +217,10 @@ void file_dialog::action(gui::dialog_process_info &dp_info)
else if(result() == gui::CREATE_ITEM)
{
std::string new_dir_name = "";
if(gui2::tfolder_create::execute(new_dir_name, CVideo::get_singleton()))
if(gui2::tfolder_create::execute(new_dir_name, get_video()))
{
if( !files_list_->make_directory(new_dir_name) ) {
gui2::show_transient_error_message(CVideo::get_singleton()
gui2::show_transient_error_message(get_video()
, _("Creation of the directory failed."));
} else {
dp_info.first_time = true;

View file

@ -149,7 +149,7 @@ void statistics_dialog::action(gui::dialog_process_info &dp_info)
break;
}
if (items_sub.empty() == false) {
gui::dialog d(CVideo::get_singleton(), title + " (" + player_name_ + ")", "", gui::CLOSE_ONLY);
gui::dialog d(get_video(), title + " (" + player_name_ + ")", "", gui::CLOSE_ONLY);
d.set_menu(items_sub);
d.show();
dp_info.clear_buttons();
@ -317,7 +317,7 @@ void statistics_dialog::do_scene_selection()
// Let the player choose a scenario.
SDL_Rect const &loc = scene_btn_->location();
size_t new_scenario = gui::show_dialog(CVideo::get_singleton(), NULL, "", "",
size_t new_scenario = gui::show_dialog(get_video(), NULL, "", "",
gui::MESSAGE, &names, NULL, "", NULL,
-1, NULL, loc.x, loc.y + loc.h);