summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-16 03:43:34 +0000
committerDavid Robillard <d@drobilla.net>2009-11-16 03:43:34 +0000
commit720dc98574c6ec13f3d9c61d67a7144cb8200a2c (patch)
treee011f02ce6c16f5c1f4747fc73b6c92de6b0d62a
parent3d89115a67a9c947a28539ffdd2399808a53279b (diff)
downloadingen-720dc98574c6ec13f3d9c61d67a7144cb8200a2c.tar.gz
ingen-720dc98574c6ec13f3d9c61d67a7144cb8200a2c.tar.bz2
ingen-720dc98574c6ec13f3d9c61d67a7144cb8200a2c.zip
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
-rw-r--r--src/gui/LoadPluginWindow.cpp38
-rw-r--r--src/gui/LoadPluginWindow.hpp8
-rw-r--r--src/gui/ingen_gui.glade68
3 files changed, 54 insertions, 60 deletions
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::RefPtr<G
xml->get_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::RefPtr<G
row[_criteria_columns._col_label] = "URI contains";
row[_criteria_columns._col_criteria] = CriteriaColumns::URI;
- _clear_button->signal_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::RefPtr<G
sigc::mem_fun(this, &LoadPluginWindow::filter_changed));
_node_name_entry->signal_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()
{
@@ -370,14 +372,6 @@ LoadPluginWindow::close_clicked()
void
-LoadPluginWindow::ok_clicked()
-{
- add_clicked();
- close_clicked();
-}
-*/
-
-void
LoadPluginWindow::filter_changed()
{
_rows.clear();
@@ -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<PluginModel> 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 @@
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
@@ -584,41 +585,24 @@
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">6</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="load_plugin_add_button">
- <property name="label">gtk-add</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Add selected plugin to patch</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
<widget class="GtkEntry" id="load_plugin_search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="tooltip" translatable="yes">Search string to filter plugin list</property>
+ <property name="secondary_icon_stock">gtk-clear</property>
+ <property name="secondary_icon_activatable">True</property>
+ <property name="secondary_icon_sensitive">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_padding">6</property>
+ <property name="right_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
@@ -632,19 +616,45 @@
</packing>
</child>
<child>
- <widget class="GtkButton" id="load_plugin_clear_button">
- <property name="label">gtk-clear</property>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Clear filter text (show all plugins)</property>
- <property name="use_stock">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkButton" id="load_plugin_close_button">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="load_plugin_add_button">
+ <property name="label">gtk-add</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>