diff --git a/src/construct_dialog.hpp b/src/construct_dialog.hpp index c3e8fe94b661..bd2249e000f5 100644 --- a/src/construct_dialog.hpp +++ b/src/construct_dialog.hpp @@ -277,6 +277,7 @@ class dialog { 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. diff --git a/src/filechooser.cpp b/src/filechooser.cpp index b3f3c9ab4359..312b7ed6ec43 100644 --- a/src/filechooser.cpp +++ b/src/filechooser.cpp @@ -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; diff --git a/src/statistics_dialog.cpp b/src/statistics_dialog.cpp index e3f3cd565f0e..898bad500824 100644 --- a/src/statistics_dialog.cpp +++ b/src/statistics_dialog.cpp @@ -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);