mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
Better version of 9ccc56e162, implicit signal disconnect
This commit is contained in:
parent
9004a0df7a
commit
2dc3c8b365
2 changed files with 2 additions and 11 deletions
|
|
@ -220,17 +220,12 @@ CheckOption::CheckOption (string const & i, string const & n, Glib::RefPtr<Gtk::
|
||||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
|
||||||
if (tact) {
|
if (tact) {
|
||||||
action_toggled ();
|
action_toggled ();
|
||||||
_callback_connection = tact->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::action_toggled));
|
tact->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::action_toggled));
|
||||||
}
|
}
|
||||||
|
|
||||||
_action->connect_property_changed ("sensitive", sigc::mem_fun (*this, &CheckOption::action_sensitivity_changed));
|
_action->connect_property_changed ("sensitive", sigc::mem_fun (*this, &CheckOption::action_sensitivity_changed));
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckOption::~CheckOption ()
|
|
||||||
{
|
|
||||||
_callback_connection.disconnect ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CheckOption::action_toggled ()
|
CheckOption::action_toggled ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -189,11 +189,10 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Just a Gtk Checkbutton, masquerading as an option component */
|
/** Just a Gtk Checkbutton, masquerading as an option component */
|
||||||
class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable
|
class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable, public sigc::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CheckOption (std::string const &, std::string const &, Glib::RefPtr<Gtk::Action> act );
|
CheckOption (std::string const &, std::string const &, Glib::RefPtr<Gtk::Action> act );
|
||||||
virtual ~CheckOption ();
|
|
||||||
void set_state_from_config () {}
|
void set_state_from_config () {}
|
||||||
void parameter_changed (std::string const &) {}
|
void parameter_changed (std::string const &) {}
|
||||||
void add_to_page (OptionEditorPage*);
|
void add_to_page (OptionEditorPage*);
|
||||||
|
|
@ -213,9 +212,6 @@ protected:
|
||||||
|
|
||||||
Gtk::CheckButton* _button; ///< UI button
|
Gtk::CheckButton* _button; ///< UI button
|
||||||
Gtk::Label* _label; ///< label for button, so we can use markup
|
Gtk::Label* _label; ///< label for button, so we can use markup
|
||||||
|
|
||||||
private:
|
|
||||||
sigc::connection _callback_connection;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Component which provides the UI to handle a boolean option using a GTK CheckButton */
|
/** Component which provides the UI to handle a boolean option using a GTK CheckButton */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue