mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Tweak VST path edit window
This correctly sets transient parent. Previously this could cause a crash when the rc_option_editor window was detached and not realized.
This commit is contained in:
parent
aaf7d3227c
commit
b5338ce220
4 changed files with 73 additions and 51 deletions
|
|
@ -28,6 +28,7 @@
|
||||||
#include "ardour/types_convert.h"
|
#include "ardour/types_convert.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
|
#include "widgets/paths_dialog.h"
|
||||||
|
|
||||||
#include "ardour_message.h"
|
#include "ardour_message.h"
|
||||||
#include "plugin_manager_ui.h"
|
#include "plugin_manager_ui.h"
|
||||||
|
|
@ -150,17 +151,17 @@ PluginManagerUI::PluginManagerUI ()
|
||||||
|
|
||||||
#if defined LXVST_SUPPORT
|
#if defined LXVST_SUPPORT
|
||||||
ArdourWidgets::ArdourButton* btn_lxvst = Gtk::manage (new ArdourWidgets::ArdourButton (_("Linux VST2 Path")));
|
ArdourWidgets::ArdourButton* btn_lxvst = Gtk::manage (new ArdourWidgets::ArdourButton (_("Linux VST2 Path")));
|
||||||
btn_lxvst->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::edit_vst_path), LXVST));
|
btn_lxvst->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::vst_path_cb), LXVST));
|
||||||
b_paths->pack_start (*btn_lxvst);
|
b_paths->pack_start (*btn_lxvst);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WINDOWS_VST_SUPPORT
|
#ifdef WINDOWS_VST_SUPPORT
|
||||||
ArdourWidgets::ArdourButton* btn_winvst = Gtk::manage (new ArdourWidgets::ArdourButton (_("Windows VST2 Path")));
|
ArdourWidgets::ArdourButton* btn_winvst = Gtk::manage (new ArdourWidgets::ArdourButton (_("Windows VST2 Path")));
|
||||||
btn_winvst->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::edit_vst_path), Windows_VST));
|
btn_winvst->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::vst_path_cb), Windows_VST));
|
||||||
b_paths->pack_start (*btn_winvst);
|
b_paths->pack_start (*btn_winvst);
|
||||||
#endif
|
#endif
|
||||||
#ifdef VST3_SUPPORT
|
#ifdef VST3_SUPPORT
|
||||||
ArdourWidgets::ArdourButton* btn_vst3 = Gtk::manage (new ArdourWidgets::ArdourButton (_("VST3 Path")));
|
ArdourWidgets::ArdourButton* btn_vst3 = Gtk::manage (new ArdourWidgets::ArdourButton (_("VST3 Path")));
|
||||||
btn_vst3->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::edit_vst_path), VST3));
|
btn_vst3->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::vst_path_cb), VST3));
|
||||||
b_paths->pack_start (*btn_vst3);
|
b_paths->pack_start (*btn_vst3);
|
||||||
#endif
|
#endif
|
||||||
b_paths->pack_start (_btn_prefs);
|
b_paths->pack_start (_btn_prefs);
|
||||||
|
|
@ -431,44 +432,62 @@ PluginManagerUI::show_plugin_prefs ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginManagerUI::edit_vst_path (ARDOUR::PluginType t)
|
PluginManagerUI::edit_vst_path (std::string const& title, std::string const& dflt, sigc::slot<std::string> get, sigc::slot<bool, std::string> set)
|
||||||
{
|
{
|
||||||
RCOptionEditor* rc_option_editor = ARDOUR_UI::instance()->get_rc_option_editor();
|
/* see also RCOptionEditor::edit_vst_path */
|
||||||
if (rc_option_editor) {
|
ArdourWidgets::PathsDialog pd (*this, title, get (), dflt);
|
||||||
switch (t) {
|
if (pd.run () != Gtk::RESPONSE_ACCEPT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pd.hide();
|
||||||
|
set (pd.get_serialized_paths ());
|
||||||
|
|
||||||
|
ArdourMessageDialog msg (_("Re-scan Plugins now?"), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO, true);
|
||||||
|
msg.set_default_response (Gtk::RESPONSE_YES);
|
||||||
|
if (msg.run() != Gtk::RESPONSE_YES) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
msg.hide ();
|
||||||
|
PluginScanDialog psd (false, true, this);
|
||||||
|
psd.start ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginManagerUI::vst_path_cb (ARDOUR::PluginType t)
|
||||||
|
{
|
||||||
|
switch (t) {
|
||||||
#ifdef WINDOWS_VST_SUPPORT
|
#ifdef WINDOWS_VST_SUPPORT
|
||||||
case Windows_VST:
|
case Windows_VST:
|
||||||
rc_option_editor->edit_vst_path (
|
edit_vst_path (
|
||||||
_("Set Windows VST2 Search Path"),
|
_("Set Windows VST2 Search Path"),
|
||||||
PluginManager::instance().get_default_windows_vst_path (),
|
PluginManager::instance().get_default_windows_vst_path (),
|
||||||
sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_vst),
|
sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_vst),
|
||||||
sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_vst)
|
sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_vst)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef LXVST_SUPPORT
|
#ifdef LXVST_SUPPORT
|
||||||
case LXVST:
|
case LXVST:
|
||||||
rc_option_editor->edit_vst_path (
|
edit_vst_path (
|
||||||
_("Set Linux VST2 Search Path"),
|
_("Set Linux VST2 Search Path"),
|
||||||
PluginManager::instance().get_default_lxvst_path (),
|
PluginManager::instance().get_default_lxvst_path (),
|
||||||
sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_lxvst),
|
sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_lxvst),
|
||||||
sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_lxvst)
|
sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_lxvst)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef VST3_SUPPORT
|
#ifdef VST3_SUPPORT
|
||||||
case VST3:
|
case VST3:
|
||||||
rc_option_editor->edit_vst_path (
|
edit_vst_path (
|
||||||
_("Set Additional VST3 Search Path"),
|
_("Set Additional VST3 Search Path"),
|
||||||
"", /* default is blank */
|
"", /* default is blank */
|
||||||
sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_vst3),
|
sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_vst3),
|
||||||
sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_vst3)
|
sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_vst3)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ private:
|
||||||
void rescan_selected ();
|
void rescan_selected ();
|
||||||
void clear_log ();
|
void clear_log ();
|
||||||
void show_plugin_prefs ();
|
void show_plugin_prefs ();
|
||||||
void edit_vst_path (ARDOUR::PluginType);
|
void vst_path_cb (ARDOUR::PluginType);
|
||||||
|
void edit_vst_path (std::string const&, std::string const&, sigc::slot<std::string>, sigc::slot<bool, std::string>);
|
||||||
|
|
||||||
void plugin_status_changed (ARDOUR::PluginType, std::string, ARDOUR::PluginManager::PluginStatusType);
|
void plugin_status_changed (ARDOUR::PluginType, std::string, ARDOUR::PluginManager::PluginStatusType);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4651,7 +4651,7 @@ void RCOptionEditor::show_transport_masters () {
|
||||||
|
|
||||||
void RCOptionEditor::plugin_scan_refresh () {
|
void RCOptionEditor::plugin_scan_refresh () {
|
||||||
/* first argument says discover new plugins, second means be verbose */
|
/* first argument says discover new plugins, second means be verbose */
|
||||||
PluginScanDialog psd (false, true);
|
PluginScanDialog psd (false, true, current_toplevel ());
|
||||||
psd.start ();
|
psd.start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4683,21 +4683,23 @@ void RCOptionEditor::clear_au_blacklist () {
|
||||||
PluginManager::instance().clear_au_blacklist();
|
PluginManager::instance().clear_au_blacklist();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RCOptionEditor::edit_vst_path (std::string const& title, std::string const& dflt, sigc::slot<string> get, sigc::slot<bool, string> set) {
|
void
|
||||||
PathsDialog *pd = new PathsDialog (*current_toplevel(), title, get (), dflt);
|
RCOptionEditor::edit_vst_path (std::string const& title, std::string const& dflt, sigc::slot<string> get, sigc::slot<bool, string> set)
|
||||||
ResponseType r = (ResponseType) pd->run ();
|
{
|
||||||
pd->hide();
|
/* see also PluginManagerUI::edit_vst_path */
|
||||||
if (r == RESPONSE_ACCEPT) {
|
PathsDialog pd (*current_toplevel(), title, get (), dflt);
|
||||||
set (pd->get_serialized_paths());
|
if (pd.run () != Gtk::RESPONSE_ACCEPT) {
|
||||||
MessageDialog msg (_("Re-scan Plugins now?"),
|
return;
|
||||||
false /*no markup*/, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO, true /*modal*/);
|
|
||||||
msg.set_default_response (Gtk::RESPONSE_YES);
|
|
||||||
if (msg.run() == Gtk::RESPONSE_YES) {
|
|
||||||
msg.hide ();
|
|
||||||
plugin_scan_refresh ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
delete pd;
|
pd.hide();
|
||||||
|
set (pd.get_serialized_paths());
|
||||||
|
MessageDialog msg (_("Re-scan Plugins now?"), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO, true);
|
||||||
|
msg.set_default_response (Gtk::RESPONSE_YES);
|
||||||
|
if (msg.run() != Gtk::RESPONSE_YES) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
msg.hide ();
|
||||||
|
plugin_scan_refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ public:
|
||||||
XMLNode& get_state ();
|
XMLNode& get_state ();
|
||||||
|
|
||||||
bool on_key_release_event (GdkEventKey*);
|
bool on_key_release_event (GdkEventKey*);
|
||||||
void edit_vst_path (std::string const& title, std::string const& dflt, sigc::slot<std::string>, sigc::slot<bool, std::string>);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parameter_changed (std::string const &);
|
void parameter_changed (std::string const &);
|
||||||
|
|
@ -78,6 +77,7 @@ private:
|
||||||
void clear_vst3_blacklist ();
|
void clear_vst3_blacklist ();
|
||||||
void clear_au_cache ();
|
void clear_au_cache ();
|
||||||
void clear_au_blacklist ();
|
void clear_au_blacklist ();
|
||||||
|
void edit_vst_path (std::string const&, std::string const&, sigc::slot<std::string>, sigc::slot<bool, std::string>);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __gtk_ardour_rc_option_editor_h__ */
|
#endif /* __gtk_ardour_rc_option_editor_h__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue