From 5a2252dafe6760cad89ca40ce1ca9432d192e5d4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 14 Feb 2010 22:41:17 +0000 Subject: Toggle sensitivity of voices spinbutton according to radio buttons. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2455 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/LoadPatchWindow.cpp | 25 ++++++------------------- src/gui/LoadPatchWindow.hpp | 2 -- 2 files changed, 6 insertions(+), 21 deletions(-) (limited to 'src/gui') diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index 4f724e6b..40f1be6d 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -55,8 +55,6 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("load_patch_ok_button", _ok_button); xml->get_widget("load_patch_cancel_button", _cancel_button); - _poly_voices_radio->signal_toggled().connect( - 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( @@ -65,6 +63,12 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_toggled().connect( sigc::mem_fun(this, &LoadPatchWindow::insert_ports_selected)); + _poly_from_file_radio->signal_toggled().connect(sigc::bind( + sigc::mem_fun(_poly_spinbutton, &Gtk::SpinButton::set_sensitive), + false)); + _poly_voices_radio->signal_toggled().connect(sigc::bind( + sigc::mem_fun(_poly_spinbutton, &Gtk::SpinButton::set_sensitive), + true)); signal_selection_changed().connect( sigc::mem_fun(this, &LoadPatchWindow::selection_changed)); @@ -130,23 +134,6 @@ LoadPatchWindow::on_show() } -///// Event Handlers ////// - - -void -LoadPatchWindow::disable_poly_spinner() -{ - _poly_spinbutton->property_sensitive() = false; -} - - -void -LoadPatchWindow::enable_poly_spinner() -{ - _poly_spinbutton->property_sensitive() = true; -} - - void LoadPatchWindow::merge_ports_selected() { diff --git a/src/gui/LoadPatchWindow.hpp b/src/gui/LoadPatchWindow.hpp index c8eafa1e..c23c4978 100644 --- a/src/gui/LoadPatchWindow.hpp +++ b/src/gui/LoadPatchWindow.hpp @@ -51,8 +51,6 @@ protected: void on_show(); private: - void disable_poly_spinner(); - void enable_poly_spinner(); void merge_ports_selected(); void insert_ports_selected(); -- cgit v1.2.1