+ maybe_add_note (p, n + 2);
+}
+
+/*--------------------------*/
+
+void
+OptionEditorBlank::add_to_page (OptionEditorPage* p)
+{
+ int const n = p->table.property_n_rows();
+ p->table.resize (n + 1, 3);
+ p->table.attach (_dummy, 2, 3, n, n + 1, FILL | EXPAND, SHRINK, 0, 0);
+ _dummy.set_size_request (-1, 1);
+ _dummy.show ();
+}
+
+/*--------------------------*/
+
+RcConfigDisplay::RcConfigDisplay (string const & i, string const & n, sigc::slot<string> g, char s)
+ : _get (g)
+ , _id (i)
+ , _sep (s)
+{
+ _label = manage (right_aligned_label (n));
+ _info = manage (new Label);
+ _info-> set_line_wrap (true);
+ set_state_from_config ();
+}
+
+void
+RcConfigDisplay::set_state_from_config ()
+{
+ string p = _get();
+ if (_sep) {
+ std::replace (p.begin(), p.end(), _sep, '\n');
+ }
+ _info->set_text (p);
+}
+
+void
+RcConfigDisplay::parameter_changed (std::string const & p)
+{
+ if (p == _id) {
+ set_state_from_config ();
+ }
+}
+
+void
+RcConfigDisplay::add_to_page (OptionEditorPage *p)
+{
+ int const n = p->table.property_n_rows();
+ int m = n + 1;
+ p->table.resize (m, 3);
+ p->table.attach (*_label, 1, 2, n, n + 1, FILL | EXPAND);
+ p->table.attach (*_info, 2, 3, n, n + 1, FILL | EXPAND);
+}
+
+/*--------------------------*/
+
+RcActionButton::RcActionButton (std::string const & t, const Glib::SignalProxy0< void >::SlotType & slot, std::string const & l)
+ : _label (NULL)
+{
+ _button = manage (new Button (t));
+ _button->signal_clicked().connect (slot);
+ if (!l.empty ()) {
+ _label = manage (right_aligned_label (l));
+ }
+}
+
+void
+RcActionButton::add_to_page (OptionEditorPage *p)
+{
+ int const n = p->table.property_n_rows();
+ int m = n + 1;
+ p->table.resize (m, 3);
+ if (_label) {
+ p->table.attach (*_label, 1, 2, n, n + 1, FILL | EXPAND);
+ p->table.attach (*_button, 2, 3, n, n + 1, FILL | EXPAND);
+ } else {
+ p->table.attach (*_button, 1, 3, n, n + 1, FILL | EXPAND);
+ }
+}
+
+/*--------------------------*/
+
+CheckOption::CheckOption (string const & i, string const & n, Glib::RefPtr<Gtk::Action> act)
+{
+ _button = manage (new CheckButton);
+ _label = manage (new Label);
+ _label->set_markup (n);
+ _button->add (*_label);
+ _button->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::toggled));
+
+ Gtkmm2ext::Activatable::set_related_action (act);
+ assert (_action);
+
+ action_sensitivity_changed ();
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+ if (tact) {
+ 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));
+}
+
+void
+CheckOption::action_toggled ()
+{
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+ if (tact) {
+ _button->set_active (tact->get_active());
+ }