From 72556cdd7a16fd61eb39b7bd5c806ac46655ffcd Mon Sep 17 00:00:00 2001 From: nick_m Date: Fri, 23 Oct 2015 02:14:03 +1100 Subject: [PATCH] Amend last commit. --- gtk2_ardour/ambiguous_file_dialog.cc | 4 +++- gtk2_ardour/ardour_ui.cc | 13 ++----------- gtk2_ardour/missing_file_dialog.cc | 5 ++++- gtk2_ardour/missing_plugin_dialog.cc | 5 ++++- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gtk2_ardour/ambiguous_file_dialog.cc b/gtk2_ardour/ambiguous_file_dialog.cc index be4bdc2dc1..98d0eaec39 100644 --- a/gtk2_ardour/ambiguous_file_dialog.cc +++ b/gtk2_ardour/ambiguous_file_dialog.cc @@ -29,8 +29,10 @@ using namespace Gtk; AmbiguousFileDialog::AmbiguousFileDialog (const string& file, const vector& paths) : ArdourDialog (_("Ambiguous File"), true, false) { - get_vbox()->set_spacing (6); + /* This dialog is always shown programatically. Center the window.*/ + set_position (Gtk::WIN_POS_CENTER); + get_vbox()->set_spacing (6); Label* l = manage (new Label); l->set_markup (string_compose (_("%1 has found the file %2 in the following places:\n\n"), PROGRAM_NAME, file)); get_vbox()->pack_start (*l); diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 361a29d39a..1291023f1b 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3162,7 +3162,6 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name, list const u = new_session->unknown_processors (); if (!u.empty()) { MissingPluginDialog d (_session, u); - d.set_position (Gtk::WIN_POS_CENTER); d.run (); } } @@ -4673,11 +4672,6 @@ int ARDOUR_UI::missing_file (Session*s, std::string str, DataType type) { MissingFileDialog dialog (s, str, type); - /** - * This dialog may appear many times in succession, so - * we can't use ArdourDialog's default WIN_POS_MOUSE. - */ - dialog.set_position (Gtk::WIN_POS_CENTER); dialog.show (); dialog.present (); @@ -4701,15 +4695,12 @@ int ARDOUR_UI::ambiguous_file (std::string file, std::vector hits) { AmbiguousFileDialog dialog (file, hits); - /** - * This dialog may appear many times in succession, so - * we can't use ArdourDialog's default WIN_POS_MOUSE. - */ - dialog.set_position (Gtk::WIN_POS_CENTER); + dialog.show (); dialog.present (); dialog.run (); + return dialog.get_which (); } diff --git a/gtk2_ardour/missing_file_dialog.cc b/gtk2_ardour/missing_file_dialog.cc index 691dd29c61..9fe1258432 100644 --- a/gtk2_ardour/missing_file_dialog.cc +++ b/gtk2_ardour/missing_file_dialog.cc @@ -42,7 +42,10 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT , all_missing_ok (choice_group, _("Skip all missing files"), false) , this_missing_ok (choice_group, _("Skip this file"), false) { - set_session (s); + /* This dialog is always shown programatically. Center the window.*/ + set_position (Gtk::WIN_POS_CENTER); + + set_session (s); add_button (_("Done"), RESPONSE_OK); set_default_response (RESPONSE_OK); diff --git a/gtk2_ardour/missing_plugin_dialog.cc b/gtk2_ardour/missing_plugin_dialog.cc index fe0a597008..d800946a95 100644 --- a/gtk2_ardour/missing_plugin_dialog.cc +++ b/gtk2_ardour/missing_plugin_dialog.cc @@ -28,7 +28,10 @@ using namespace PBD; MissingPluginDialog::MissingPluginDialog (Session * s, list const & plugins) : ArdourDialog (_("Missing Plugins"), true, false) { - set_session (s); + /* This dialog is always shown programatically. Center the window.*/ + set_position (Gtk::WIN_POS_CENTER); + + set_session (s); add_button (_("OK"), RESPONSE_OK); set_default_response (RESPONSE_OK);