From 720dc98574c6ec13f3d9c61d67a7144cb8200a2c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Nov 2009 03:43:34 +0000 Subject: Clean up load plugin window and add close button. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2268 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/LoadPluginWindow.cpp | 38 ++++++++----------------- src/gui/LoadPluginWindow.hpp | 8 ++---- src/gui/ingen_gui.glade | 68 +++++++++++++++++++++++++------------------- 3 files changed, 54 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index a4adf44e..312d735b 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -45,10 +45,8 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("load_plugin_plugins_treeview", _plugins_treeview); xml->get_widget("load_plugin_polyphonic_checkbutton", _polyphonic_checkbutton); xml->get_widget("load_plugin_name_entry", _node_name_entry); - xml->get_widget("load_plugin_clear_button", _clear_button); xml->get_widget("load_plugin_add_button", _add_button); - //xml->get_widget("load_plugin_close_button", _close_button); - //xml->get_widget("load_plugin_ok_button", _add_button); + xml->get_widget("load_plugin_close_button", _close_button); xml->get_widget("load_plugin_filter_combo", _filter_combo); xml->get_widget("load_plugin_search_entry", _search_entry); @@ -83,14 +81,10 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_clicked().connect( - sigc::mem_fun(this, &LoadPluginWindow::clear_clicked)); _add_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); - //m_close_button->signal_clicked().connect( - // sigc::mem_fun(this, &LoadPluginWindow::close_clicked)); - //m_add_button->signal_clicked().connect( - // sigc::mem_fun(this, &LoadPluginWindow::ok_clicked)); + _close_button->signal_clicked().connect( + sigc::mem_fun(this, &LoadPluginWindow::close_clicked)); _plugins_treeview->signal_row_activated().connect( sigc::mem_fun(this, &LoadPluginWindow::plugin_activated)); _search_entry->signal_activate().connect( @@ -99,6 +93,8 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::name_changed)); + _search_entry->signal_icon_release().connect( + sigc::mem_fun(this, &LoadPluginWindow::name_cleared)); _selection = _plugins_treeview->get_selection(); _selection->set_mode(Gtk::SELECTION_MULTIPLE); @@ -144,6 +140,13 @@ LoadPluginWindow::name_changed() } +void +LoadPluginWindow::name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton* event) +{ + _search_entry->set_text(""); +} + + /** Sets the patch controller for this window and initializes everything. * * This function MUST be called before using the window in any way! @@ -361,7 +364,6 @@ LoadPluginWindow::add_clicked() } -/* void LoadPluginWindow::close_clicked() { @@ -369,14 +371,6 @@ LoadPluginWindow::close_clicked() } -void -LoadPluginWindow::ok_clicked() -{ - add_clicked(); - close_clicked(); -} -*/ - void LoadPluginWindow::filter_changed() { @@ -437,14 +431,6 @@ LoadPluginWindow::filter_changed() } -void -LoadPluginWindow::clear_clicked() -{ - _search_entry->set_text(""); - set_plugins(App::instance().store()->plugins()); -} - - bool LoadPluginWindow::on_key_press_event(GdkEventKey* event) { diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index f4a0a074..37a1da83 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -93,11 +93,11 @@ private: }; void add_clicked(); - //void close_clicked(); - //void ok_clicked(); + void close_clicked(); void filter_changed(); void clear_clicked(); void name_changed(); + void name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton* event); void new_plugin(SharedPtr plugin); @@ -134,10 +134,8 @@ private: Gtk::TreeView* _plugins_treeview; Gtk::CheckButton* _polyphonic_checkbutton; Gtk::Entry* _node_name_entry; - Gtk::Button* _clear_button; + Gtk::Button* _close_button; Gtk::Button* _add_button; - //Gtk::Button* _close_button; - //Gtk::Button* _ok_button; Gtk::ComboBox* _filter_combo; Gtk::Entry* _search_entry; }; diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade index 371c7bd0..3d345bd1 100644 --- a/src/gui/ingen_gui.glade +++ b/src/gui/ingen_gui.glade @@ -522,6 +522,7 @@ 1 2 GTK_FILL + GTK_FILL @@ -584,41 +585,24 @@ 2 2 3 - GTK_FILL GTK_FILL 6 - - - gtk-add - True - False - True - False - Add selected plugin to patch - True - - - 2 - 3 - 2 - 3 - GTK_FILL - - - True True True Search string to filter plugin list + gtk-clear + True + True 1 - 2 - 6 + 3 + GTK_FILL @@ -632,19 +616,45 @@ - - gtk-clear + True - True - False - Clear filter text (show all plugins) - True + 4 + + + gtk-close + True + True + True + True + + + False + False + 0 + + + + + gtk-add + True + True + True + True + + + False + False + 1 + + 2 3 + 2 + 3 GTK_FILL - + GTK_FILL -- cgit v1.2.1