From ca1ddcc761b6546f9b81d357466071634d573d36 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 14 Feb 2010 22:34:36 +0000 Subject: Merge LoadPatchWindow and LoadSubpatchWindow. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2454 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/LoadPatchWindow.cpp | 161 +++++++++++++++++++------- src/gui/LoadPatchWindow.hpp | 43 +++---- src/gui/LoadSubpatchWindow.cpp | 207 ---------------------------------- src/gui/LoadSubpatchWindow.hpp | 80 ------------- src/gui/PatchCanvas.cpp | 1 - src/gui/PatchView.cpp | 1 - src/gui/PatchView.hpp | 1 - src/gui/PatchWindow.cpp | 1 - src/gui/PatchWindow.hpp | 1 - src/gui/WindowFactory.cpp | 29 +++-- src/gui/WindowFactory.hpp | 4 +- src/gui/ingen_gui.glade | 249 +++++++---------------------------------- src/gui/wscript | 1 - 13 files changed, 203 insertions(+), 576 deletions(-) delete mode 100644 src/gui/LoadSubpatchWindow.cpp delete mode 100644 src/gui/LoadSubpatchWindow.hpp (limited to 'src') diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index bba7c75d..4f724e6b 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -17,20 +17,23 @@ #include #include -#include +#include +#include +#include #include "interface/EngineInterface.hpp" #include "shared/LV2URIMap.hpp" -#include "shared/runtime_paths.hpp" +#include "client/NodeModel.hpp" #include "client/PatchModel.hpp" +#include "client/ClientStore.hpp" +#include "shared/runtime_paths.hpp" #include "App.hpp" -#include "Configuration.hpp" #include "LoadPatchWindow.hpp" +#include "PatchView.hpp" +#include "Configuration.hpp" #include "ThreadedLoader.hpp" -using namespace Ingen::Serialisation; using boost::optional; using namespace std; -using namespace std; using namespace Raul; namespace Ingen { @@ -39,40 +42,45 @@ namespace GUI { LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml) : Gtk::FileChooserDialog(cobject) - , _merge_ports(true) + , _merge_ports(false) { + xml->get_widget("load_patch_symbol_label", _symbol_label); + xml->get_widget("load_patch_symbol_entry", _symbol_entry); + xml->get_widget("load_patch_ports_label", _ports_label); + xml->get_widget("load_patch_merge_ports_radio", _merge_ports_radio); + xml->get_widget("load_patch_insert_ports_radio", _insert_ports_radio); xml->get_widget("load_patch_poly_voices_radio", _poly_voices_radio); xml->get_widget("load_patch_poly_from_file_radio", _poly_from_file_radio); xml->get_widget("load_patch_poly_spinbutton", _poly_spinbutton); - xml->get_widget("load_patch_merge_ports_radio", _merge_ports_radio); - xml->get_widget("load_patch_insert_ports_radio", _insert_ports_radio); xml->get_widget("load_patch_ok_button", _ok_button); xml->get_widget("load_patch_cancel_button", _cancel_button); - _poly_from_file_radio->signal_toggled().connect( - sigc::mem_fun(this, &LoadPatchWindow::poly_from_file_selected)); _poly_voices_radio->signal_toggled().connect( - sigc::mem_fun(this, &LoadPatchWindow::poly_voices_selected)); + sigc::mem_fun(this, &LoadPatchWindow::enable_poly_spinner)); + _cancel_button->signal_clicked().connect( + sigc::mem_fun(this, &LoadPatchWindow::cancel_clicked)); + _ok_button->signal_clicked().connect( + sigc::mem_fun(this, &LoadPatchWindow::ok_clicked)); _merge_ports_radio->signal_toggled().connect( sigc::mem_fun(this, &LoadPatchWindow::merge_ports_selected)); _insert_ports_radio->signal_toggled().connect( sigc::mem_fun(this, &LoadPatchWindow::insert_ports_selected)); - _ok_button->signal_clicked().connect( - sigc::mem_fun(this, &LoadPatchWindow::ok_clicked)); - _cancel_button->signal_clicked().connect( - sigc::mem_fun(this, &LoadPatchWindow::cancel_clicked)); - _poly_voices_radio->set_active(true); + signal_selection_changed().connect( + sigc::mem_fun(this, &LoadPatchWindow::selection_changed)); Gtk::FileFilter filt; - filt.add_pattern("*.om"); - filt.set_name("Om patch files (XML, DEPRECATED) (*.om)"); - filt.add_pattern("*.ingen.lv2"); - filt.set_name("Ingen bundles (*.ingen.lv2)"); filt.add_pattern("*.ingen.ttl"); filt.set_name("Ingen patch files (*.ingen.ttl)"); + filt.add_pattern("*.ingen.lv2"); + filt.set_name("Ingen bundles (*.ingen.lv2)"); + filt.add_pattern("*.om"); + filt.set_name("Om patch files (*.om)"); + set_filter(filt); + property_select_multiple() = true; + // Add global examples directory to "shortcut folders" (bookmarks) const string examples_dir = Shared::data_file_path("patches"); DIR* d = opendir(examples_dir.c_str()); @@ -84,9 +92,15 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr patch, GraphObject::Properties data) +LoadPatchWindow::present(SharedPtr patch, bool import, GraphObject::Properties data) { + _import = import; set_patch(patch); + _symbol_label->set_visible(!import); + _symbol_entry->set_visible(!import); + _ports_label->set_visible(_import); + _merge_ports_radio->set_visible(_import); + _insert_ports_radio->set_visible(_import); _initial_data = data; Gtk::Window::present(); } @@ -99,7 +113,10 @@ LoadPatchWindow::present(SharedPtr patch, GraphObject::Properties da void LoadPatchWindow::set_patch(SharedPtr patch) { + std::cout << "SET PATCH: " << patch->path() << endl; _patch = patch; + _symbol_entry->set_text(""); + _symbol_entry->set_sensitive(!_import); _poly_spinbutton->set_value(patch->poly()); } @@ -117,18 +134,19 @@ LoadPatchWindow::on_show() void -LoadPatchWindow::poly_from_file_selected() +LoadPatchWindow::disable_poly_spinner() { _poly_spinbutton->property_sensitive() = false; } void -LoadPatchWindow::poly_voices_selected() +LoadPatchWindow::enable_poly_spinner() { _poly_spinbutton->property_sensitive() = true; } + void LoadPatchWindow::merge_ports_selected() { @@ -146,39 +164,106 @@ LoadPatchWindow::insert_ports_selected() void LoadPatchWindow::ok_clicked() { - if (!_patch) + if (!_patch) { + hide(); return; + } - // If unset load_patch will load value - optional parent; - optional symbol; + const LV2URIMap& uris = App::instance().uris(); if (_poly_voices_radio->get_active()) _initial_data.insert(make_pair( - App::instance().uris().ingen_polyphony, - _poly_spinbutton->get_value_as_int())); - - if (!_patch->path().is_root()) { - parent = _patch->path().parent(); - symbol = _patch->symbol(); + uris.ingen_polyphony, + _poly_spinbutton->get_value_as_int())); + + if (_import) { + // If unset load_patch will load value + optional parent; + optional symbol; + if (!_patch->path().is_root()) { + parent = _patch->path().parent(); + symbol = _patch->symbol(); + } + + cout << "MERGE PORTS: " << _merge_ports << endl; + + App::instance().loader()->load_patch(true, get_uri(), Path("/"), + parent, symbol, _initial_data); + + } else { + std::list uri_list = get_uris(); + for (std::list::iterator i = uri_list.begin(); i != uri_list.end(); ++i) { + // Cascade + Atom& x = _initial_data.find(uris.ingenui_canvas_x)->second; + x = Atom(x.get_float() + 20.0f); + Atom& y = _initial_data.find(uris.ingenui_canvas_y)->second; + y = Atom(y.get_float() + 20.0f); + + Raul::Symbol symbol(symbol_from_filename(*i)); + if (uri_list.size() == 1 && _symbol_entry->get_text() != "") + symbol = Symbol::symbolify(_symbol_entry->get_text()); + + symbol = avoid_symbol_clash(symbol); + + App::instance().loader()->load_patch(false, *i, Path("/"), + _patch->path(), symbol, _initial_data); + } } - cout << "MERGE PORTS: " << _merge_ports << endl; - _patch.reset(); hide(); - - App::instance().loader()->load_patch(true, get_uri(), Path("/"), - parent, symbol, _initial_data); } void LoadPatchWindow::cancel_clicked() { + _patch.reset(); hide(); } +Raul::Symbol +LoadPatchWindow::symbol_from_filename(const Glib::ustring& filename) +{ + std::string symbol_str = Glib::path_get_basename(get_filename()); + symbol_str = symbol_str.substr(0, symbol_str.find('.')); + return Raul::Symbol::symbolify(symbol_str); +} + + +Raul::Symbol +LoadPatchWindow::avoid_symbol_clash(const Raul::Symbol& symbol) +{ + unsigned offset = App::instance().store()->child_name_offset( + _patch->path(), symbol); + + if (offset != 0) { + std::stringstream ss; + ss << symbol << "_" << offset; + return ss.str(); + } else { + return symbol; + } +} + + +void +LoadPatchWindow::selection_changed() +{ + if (_import) + return; + + if (get_filenames().size() != 1) { + _symbol_entry->set_text(""); + _symbol_entry->set_sensitive(false); + } else { + _symbol_entry->set_text(avoid_symbol_clash( + symbol_from_filename(get_filename()).c_str()).c_str()); + _symbol_entry->set_sensitive(true); + } +} + + } // namespace GUI } // namespace Ingen diff --git a/src/gui/LoadPatchWindow.hpp b/src/gui/LoadPatchWindow.hpp index faae39dd..c8eafa1e 100644 --- a/src/gui/LoadPatchWindow.hpp +++ b/src/gui/LoadPatchWindow.hpp @@ -15,33 +15,26 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef INGEN_GUI_LOADPATCHWINDOW_HPP -#define INGEN_GUI_LOADPATCHWINDOW_HPP +#ifndef INGEN_GUI_LOADSUBPATCHWINDOW_HPP +#define INGEN_GUI_LOADSUBPATCHWINDOW_HPP #include #include #include "raul/SharedPtr.hpp" #include "interface/GraphObject.hpp" -#include "Window.hpp" - using namespace Ingen::Shared; namespace Ingen { -namespace Client { class PatchModel; class PluginModel; } -using Ingen::Client::PluginModel; +namespace Client { class PatchModel; } using Ingen::Client::PatchModel; namespace GUI { -/** 'Load Patch' window. - * - * Loaded by glade as a derived object. Used for both "Import" and "Load" - * (e.g. Replace, clear-then-import) operations (the radio button state - * should be changed with the provided methods before presenting). +/** 'Add Subpatch' window. * - * This is not for loading subpatches. See @a LoadSubpatchWindow for that. + * Loaded by glade as a derived object. * * \ingroup GUI */ @@ -52,35 +45,45 @@ public: void set_patch(SharedPtr patch); - void present(SharedPtr patch, GraphObject::Properties data); + void present(SharedPtr patch, bool import, GraphObject::Properties data); protected: void on_show(); private: - void poly_voices_selected(); - void poly_from_file_selected(); + void disable_poly_spinner(); + void enable_poly_spinner(); void merge_ports_selected(); void insert_ports_selected(); - void ok_clicked(); + + void selection_changed(); void cancel_clicked(); + void ok_clicked(); + + Raul::Symbol symbol_from_filename(const Glib::ustring& filename); + Raul::Symbol avoid_symbol_clash(const Raul::Symbol& symbol); GraphObject::Properties _initial_data; SharedPtr _patch; - bool _merge_ports; + Gtk::Label* _symbol_label; + Gtk::Entry* _symbol_entry; + Gtk::Label* _ports_label; + Gtk::RadioButton* _merge_ports_radio; + Gtk::RadioButton* _insert_ports_radio; Gtk::RadioButton* _poly_voices_radio; Gtk::RadioButton* _poly_from_file_radio; Gtk::SpinButton* _poly_spinbutton; - Gtk::RadioButton* _merge_ports_radio; - Gtk::RadioButton* _insert_ports_radio; Gtk::Button* _ok_button; Gtk::Button* _cancel_button; + + bool _import; + bool _merge_ports; }; } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_LOADPATCHWINDOW_HPP +#endif // INGEN_GUI_LOADSUBPATCHWINDOW_HPP diff --git a/src/gui/LoadSubpatchWindow.cpp b/src/gui/LoadSubpatchWindow.cpp deleted file mode 100644 index 240b4b64..00000000 --- a/src/gui/LoadSubpatchWindow.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include "interface/EngineInterface.hpp" -#include "shared/LV2URIMap.hpp" -#include "client/NodeModel.hpp" -#include "client/PatchModel.hpp" -#include "client/ClientStore.hpp" -#include "shared/runtime_paths.hpp" -#include "App.hpp" -#include "LoadSubpatchWindow.hpp" -#include "PatchView.hpp" -#include "Configuration.hpp" -#include "ThreadedLoader.hpp" - -using boost::optional; -using namespace std; -using namespace Raul; - -namespace Ingen { -namespace GUI { - - -LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml) -: Gtk::FileChooserDialog(cobject) -{ - xml->get_widget("load_subpatch_symbol_entry", _symbol_entry); - xml->get_widget("load_subpatch_poly_voices_radio", _poly_voices_radio); - xml->get_widget("load_subpatch_poly_from_file_radio", _poly_from_file_radio); - xml->get_widget("load_subpatch_poly_spinbutton", _poly_spinbutton); - xml->get_widget("load_subpatch_ok_button", _ok_button); - xml->get_widget("load_subpatch_cancel_button", _cancel_button); - - _poly_voices_radio->signal_toggled().connect(sigc::mem_fun(this, &LoadSubpatchWindow::enable_poly_spinner)); - _ok_button->signal_clicked().connect(sigc::mem_fun(this, &LoadSubpatchWindow::ok_clicked)); - _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &LoadSubpatchWindow::cancel_clicked)); - - Gtk::FileFilter filt; - filt.add_pattern("*.om"); - filt.set_name("Om patch files (XML, DEPRECATED) (*.om)"); - filt.add_pattern("*.ingen.ttl"); - filt.set_name("Ingen patch files (RDF, *.ingen.ttl)"); - set_filter(filt); - - property_select_multiple() = true; - - // Add global examples directory to "shortcut folders" (bookmarks) - const string examples_dir = Shared::data_file_path("patches"); - DIR* d = opendir(examples_dir.c_str()); - if (d != NULL) { - add_shortcut_folder(examples_dir); - closedir(d); - } - - signal_selection_changed().connect( - sigc::mem_fun(this, &LoadSubpatchWindow::selection_changed)); -} - - -void -LoadSubpatchWindow::present(SharedPtr patch, GraphObject::Properties data) -{ - set_patch(patch); - _initial_data = data; - Gtk::Window::present(); -} - - -/** Sets the patch model for this window and initializes everything. - * - * This function MUST be called before using the window in any way! - */ -void -LoadSubpatchWindow::set_patch(SharedPtr patch) -{ - _patch = patch; - _symbol_entry->set_text(patch->path().symbol()); - _poly_spinbutton->set_value(patch->poly()); -} - - -void -LoadSubpatchWindow::on_show() -{ - if (App::instance().configuration()->patch_folder().length() > 0) - set_current_folder(App::instance().configuration()->patch_folder()); - Gtk::FileChooserDialog::on_show(); -} - - -///// Event Handlers ////// - - -void -LoadSubpatchWindow::disable_poly_spinner() -{ - _poly_spinbutton->property_sensitive() = false; -} - - -void -LoadSubpatchWindow::enable_poly_spinner() -{ - _poly_spinbutton->property_sensitive() = true; -} - - -void -LoadSubpatchWindow::ok_clicked() -{ - assert(_patch); - - const LV2URIMap& uris = App::instance().uris(); - - if (_poly_voices_radio->get_active()) { - _initial_data.insert(make_pair(uris.ingen_polyphony, (int)_poly_spinbutton->get_value_as_int())); - } - - std::list uri_list = get_uris(); - for (std::list::iterator i = uri_list.begin(); i != uri_list.end(); ++i) { - // Cascade - Atom& x = _initial_data.find(uris.ingenui_canvas_x)->second; - x = Atom(x.get_float() + 20.0f); - Atom& y = _initial_data.find(uris.ingenui_canvas_y)->second; - y = Atom(y.get_float() + 20.0f); - - Raul::Symbol symbol(symbol_from_filename(*i)); - if (uri_list.size() == 1 && _symbol_entry->get_text() != "") - symbol = Symbol::symbolify(_symbol_entry->get_text()); - - symbol = avoid_symbol_clash(symbol); - - App::instance().loader()->load_patch(false, *i, Path("/"), - _patch->path(), symbol, _initial_data); - } - - hide(); -} - - -void -LoadSubpatchWindow::cancel_clicked() -{ - hide(); -} - - -Raul::Symbol -LoadSubpatchWindow::symbol_from_filename(const Glib::ustring& filename) -{ - std::string symbol_str = Glib::path_get_basename(get_filename()); - symbol_str = symbol_str.substr(0, symbol_str.find('.')); - return Raul::Symbol::symbolify(symbol_str); -} - - -Raul::Symbol -LoadSubpatchWindow::avoid_symbol_clash(const Raul::Symbol& symbol) -{ - unsigned offset = App::instance().store()->child_name_offset( - _patch->path(), symbol); - - if (offset != 0) { - std::stringstream ss; - ss << symbol << "_" << offset; - return ss.str(); - } else { - return symbol; - } -} - - -void -LoadSubpatchWindow::selection_changed() -{ - if (get_filenames().size() != 1) { - _symbol_entry->set_text(""); - _symbol_entry->set_sensitive(false); - } else { - _symbol_entry->set_text(avoid_symbol_clash( - symbol_from_filename(get_filename()).c_str()).c_str()); - _symbol_entry->set_sensitive(true); - } -} - - -} // namespace GUI -} // namespace Ingen diff --git a/src/gui/LoadSubpatchWindow.hpp b/src/gui/LoadSubpatchWindow.hpp deleted file mode 100644 index c216f26a..00000000 --- a/src/gui/LoadSubpatchWindow.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_GUI_LOADSUBPATCHWINDOW_HPP -#define INGEN_GUI_LOADSUBPATCHWINDOW_HPP - -#include -#include -#include "raul/SharedPtr.hpp" -#include "interface/GraphObject.hpp" -using namespace Ingen::Shared; - -namespace Ingen { - -namespace Client { class PatchModel; } -using Ingen::Client::PatchModel; - -namespace GUI { - - -/** 'Add Subpatch' window. - * - * Loaded by glade as a derived object. - * - * \ingroup GUI - */ -class LoadSubpatchWindow : public Gtk::FileChooserDialog -{ -public: - LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - - void present(SharedPtr patch, GraphObject::Properties data); - -protected: - void on_show(); - -private: - void disable_poly_spinner(); - void enable_poly_spinner(); - - void ok_clicked(); - void cancel_clicked(); - void selection_changed(); - - Raul::Symbol symbol_from_filename(const Glib::ustring& filename); - Raul::Symbol avoid_symbol_clash(const Raul::Symbol& symbol); - - GraphObject::Properties _initial_data; - - SharedPtr _patch; - - Gtk::Entry* _symbol_entry; - Gtk::RadioButton* _poly_voices_radio; - Gtk::RadioButton* _poly_from_file_radio; - Gtk::SpinButton* _poly_spinbutton; - Gtk::Button* _ok_button; - Gtk::Button* _cancel_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // INGEN_GUI_LOADSUBPATCHWINDOW_HPP diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index bd215037..3c30910a 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -36,7 +36,6 @@ #include "PatchWindow.hpp" #include "PatchPortModule.hpp" #include "LoadPluginWindow.hpp" -#include "LoadSubpatchWindow.hpp" #include "NewSubpatchWindow.hpp" #include "Port.hpp" #include "Connection.hpp" diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index b8cc83a1..e420793a 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -26,7 +26,6 @@ #include "PatchCanvas.hpp" #include "LoadPluginWindow.hpp" #include "NewSubpatchWindow.hpp" -#include "LoadSubpatchWindow.hpp" #include "NodeControlWindow.hpp" #include "PatchTreeWindow.hpp" #include "GladeFactory.hpp" diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp index 776cea48..0be9eb1e 100644 --- a/src/gui/PatchView.hpp +++ b/src/gui/PatchView.hpp @@ -43,7 +43,6 @@ namespace GUI { class PatchCanvas; class LoadPluginWindow; class NewSubpatchWindow; -class LoadSubpatchWindow; class NewSubpatchWindow; class NodeControlWindow; class PatchDescriptionWindow; diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 9efd4887..d4fb24cc 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -30,7 +30,6 @@ #include "LoadPluginWindow.hpp" #include "NewSubpatchWindow.hpp" #include "LoadPatchWindow.hpp" -#include "LoadSubpatchWindow.hpp" #include "NodeControlWindow.hpp" #include "Configuration.hpp" #include "MessagesWindow.hpp" diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index 8fecd28f..d4cc87a9 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -41,7 +41,6 @@ namespace GUI { class LoadPluginWindow; class LoadPatchWindow; class NewSubpatchWindow; -class LoadSubpatchWindow; class NewSubpatchWindow; class NodeControlWindow; class PatchDescriptionWindow; diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index d5493339..7b5b6000 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -23,7 +23,6 @@ #include "LoadPatchWindow.hpp" #include "LoadPluginWindow.hpp" #include "LoadRemotePatchWindow.hpp" -#include "LoadSubpatchWindow.hpp" #include "NewSubpatchWindow.hpp" #include "NodeControlWindow.hpp" #include "PropertiesWindow.hpp" @@ -47,7 +46,6 @@ WindowFactory::WindowFactory() , _load_remote_patch_win(NULL) , _upload_patch_win(NULL) , _new_subpatch_win(NULL) - , _load_subpatch_win(NULL) , _properties_win(NULL) { Glib::RefPtr xml = GladeFactory::new_glade_reference(); @@ -56,7 +54,6 @@ WindowFactory::WindowFactory() xml->get_widget_derived("load_patch_win", _load_patch_win); xml->get_widget_derived("load_remote_patch_win", _load_remote_patch_win); xml->get_widget_derived("new_subpatch_win", _new_subpatch_win); - xml->get_widget_derived("load_subpatch_win", _load_subpatch_win); xml->get_widget_derived("properties_win", _properties_win); xml->get_widget_derived("rename_win", _rename_win); @@ -269,7 +266,19 @@ WindowFactory::present_load_patch(SharedPtr patch, GraphObject::Prop if (w != _patch_windows.end()) _load_patch_win->set_transient_for(*w->second); - _load_patch_win->present(patch, data); + _load_patch_win->present(patch, true, data); +} + + +void +WindowFactory::present_load_subpatch(SharedPtr patch, GraphObject::Properties data) +{ + PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + + if (w != _patch_windows.end()) + _load_patch_win->set_transient_for(*w->second); + + _load_patch_win->present(patch, false, data); } @@ -310,18 +319,6 @@ WindowFactory::present_new_subpatch(SharedPtr patch, GraphObject::Pr } -void -WindowFactory::present_load_subpatch(SharedPtr patch, GraphObject::Properties data) -{ - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); - - if (w != _patch_windows.end()) - _load_subpatch_win->set_transient_for(*w->second); - - _load_subpatch_win->present(patch, data); -} - - void WindowFactory::present_rename(SharedPtr object) { diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 8f205620..c55eb13b 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -39,7 +39,6 @@ namespace GUI { class LoadPatchWindow; class LoadPluginWindow; class LoadRemotePatchWindow; -class LoadSubpatchWindow; class NewSubpatchWindow; class NodeControlWindow; class PropertiesWindow; @@ -75,10 +74,10 @@ public: void present_load_plugin(SharedPtr patch, Properties data=Properties()); void present_load_patch(SharedPtr patch, Properties data=Properties()); + void present_load_subpatch(SharedPtr patch, Properties data=Properties()); void present_load_remote_patch(SharedPtr patch, Properties data=Properties()); void present_upload_patch(SharedPtr patch); void present_new_subpatch(SharedPtr patch, Properties data=Properties()); - void present_load_subpatch(SharedPtr patch, Properties data=Properties()); void present_rename(SharedPtr object); void present_properties(SharedPtr object); @@ -104,7 +103,6 @@ private: LoadRemotePatchWindow* _load_remote_patch_win; UploadPatchWindow* _upload_patch_win; NewSubpatchWindow* _new_subpatch_win; - LoadSubpatchWindow* _load_subpatch_win; PropertiesWindow* _properties_win; RenameWindow* _rename_win; }; diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade index d11335b6..acd3ad00 100644 --- a/src/gui/ingen_gui.glade +++ b/src/gui/ingen_gui.glade @@ -795,203 +795,6 @@ - - Load Subpatch - Ingen - center-on-parent - dialog - - - True - 24 - - - True - 0 - 0 - 0 - - - True - 2 - 3 - 12 - 12 - - - True - 0 - _Symbol: - True - True - load_subpatch_symbol_entry - - - GTK_FILL - - - - - - True - 0 - Polyphony: - True - - - 1 - 2 - GTK_FILL - - - - - - Load from _file - True - True - False - True - Use the polyphony value stored in the patch file - True - True - load_subpatch_poly_voices_radio - - - 2 - 3 - 1 - 2 - GTK_FILL - - - - - - True - - - _Voices: - True - True - False - True - Specify a custom polyphony value for new patch - True - True - True - load_subpatch_poly_from_file_radio - - - False - False - 0 - - - - - True - False - True - Specify a custom polyphony value for new patch - - 1 0 1000 1 10 0 - 1 - - - False - 1 - - - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - 0 - - - 2 - 3 - GTK_FILL - - - - - - True - True - Specify the name for the new patch - - True - - - 1 - 3 - - - - - - - False - 2 - - - - - True - end - - - gtk-cancel - -6 - True - True - True - False - True - - - False - False - 0 - - - - - gtk-open - -5 - True - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - Load Patch - Ingen center-on-parent @@ -1007,18 +810,20 @@ True - 2 + 3 3 12 12 - + True 0 Polyphony: True + 1 + 2 GTK_FILL @@ -1038,20 +843,22 @@ 2 3 + 1 + 2 GTK_FILL - + True 0 Ports: True - 1 - 2 + 2 + 3 GTK_FILL @@ -1070,8 +877,8 @@ 2 3 - 1 - 2 + 2 + 3 GTK_FILL @@ -1090,8 +897,8 @@ 1 2 - 1 - 2 + 2 + 3 GTK_FILL @@ -1135,7 +942,37 @@ 1 2 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + 0 + _Symbol: + True + True + load_patch_symbol_entry + + GTK_FILL + + + + + + True + True + Specify the name for the new patch + + True + + + 1 + 3 GTK_FILL diff --git a/src/gui/wscript b/src/gui/wscript index 5550f836..ed9437d5 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -18,7 +18,6 @@ def build(bld): LoadPatchWindow.cpp LoadPluginWindow.cpp LoadRemotePatchWindow.cpp - LoadSubpatchWindow.cpp MessagesWindow.cpp NewSubpatchWindow.cpp NodeControlWindow.cpp -- cgit v1.2.1