Skip to content

Commit

Permalink
Restore a GUI1 get_video method
Browse files Browse the repository at this point in the history
Replacement for get_display() removed in db29fa8
  • Loading branch information
Vultraz committed Jan 12, 2016
1 parent 8c0e562 commit 5f732c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/construct_dialog.hpp
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/filechooser.cpp
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/statistics_dialog.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 5f732c3

Please sign in to comment.