fix some gtk filechooser issues
[ardour.git] / gtk2_ardour / option_editor.h
index f42d1da9b738aa96a2084c98382f617b7560d66c..13b0285c32a0c08c3aff73c67a36bb0341714615 100644 (file)
@@ -46,7 +46,7 @@
  *  options dialog.
  */
 
-namespace ARDOUR {
+namespace PBD {
        class Configuration;
 }
 
@@ -169,11 +169,11 @@ public:
                _button->set_sensitive (yn);
        }
 
-        Gtk::Widget& tip_widget() { return *_button; }
+       Gtk::Widget& tip_widget() { return *_button; }
 
-private:
+protected:
 
-       void toggled ();
+       virtual void toggled ();
 
        sigc::slot<bool>       _get; ///< slot to get the configuration variable's value
        sigc::slot<bool, bool> _set;  ///< slot to set the configuration variable's value
@@ -181,6 +181,14 @@ private:
        Gtk::Label*            _label; ///< label for button, so we can use markup
 };
 
+class RouteDisplayBoolOption : public BoolOption
+{
+public:
+       RouteDisplayBoolOption (std::string const &, std::string const &, sigc::slot<bool>, sigc::slot<bool, bool>);
+protected:
+       virtual void toggled ();
+};
+
 /** Component which allows to add any GTK Widget - intended for single buttons and custom stateless objects */
 class FooOption : public OptionEditorComponent
 {
@@ -498,6 +506,7 @@ public:
         *  @param page Page step for the spin button.
         *  @param unit Unit name.
         *  @param scale Scaling factor (such that for a value x in the spinbutton, x * scale is written to the config)
+        *  @param digits Number of decimal digits to show.
         */
        SpinOption (
                std::string const & i,
@@ -509,7 +518,8 @@ public:
                T step,
                T page,
                std::string const & unit = "",
-               float scale = 1
+               float scale = 1,
+               unsigned digits = 0
                )
                : Option (i, n),
                  _get (g),
@@ -522,6 +532,7 @@ public:
                _spin = Gtk::manage (new Gtk::SpinButton);
                _spin->set_range (min, max);
                _spin->set_increments (step, page);
+               _spin->set_digits(digits);
 
                _box = Gtk::manage (new Gtk::HBox);
                _box->pack_start (*_spin, true, true);
@@ -613,8 +624,7 @@ public:
         Gtk::Widget& tip_widget() { return _file_chooser; }
 
 private:
-       void file_set ();
-       void current_folder_set ();
+       void selection_changed ();
        
        sigc::slot<std::string> _get; ///< slot to get the configuration variable's value
        sigc::slot<bool, std::string> _set;  ///< slot to set the configuration variable's value
@@ -639,18 +649,19 @@ public:
 class OptionEditor : public ArdourWindow
 {
 public:
-       OptionEditor (ARDOUR::Configuration *, std::string const &);
+       OptionEditor (PBD::Configuration *, std::string const &);
        ~OptionEditor ();
 
        void add_option (std::string const &, OptionEditorComponent *);
-
+       void add_page (std::string const &, Gtk::Widget& page_widget);
+       
        void set_current_page (std::string const &);
 
 protected:
 
        virtual void parameter_changed (std::string const &);
-
-       ARDOUR::Configuration* _config;
+       
+       PBD::Configuration* _config;
 
 private: