Synchronise quality spin button and quality action radio buttons.
authorCarlos Lopez <carlos@pcnuevo.(none)>
Sun, 28 Jun 2009 22:11:51 +0000 (00:11 +0200)
committerCarlos Lopez <carlos@pcnuevo.(none)>
Mon, 13 Jul 2009 18:07:45 +0000 (20:07 +0200)
Do not set insensitive the spin button when working depth is true.

synfig-studio/trunk/src/gtkmm/canvasview.cpp
synfig-studio/trunk/src/gtkmm/canvasview.h

index 0d1112b..87b4222 100644 (file)
@@ -1423,7 +1423,7 @@ CanvasView::init_menus()
                        }
                        action_group->add( action,
                                sigc::bind(
-                                       sigc::mem_fun(*work_area, &studio::WorkArea::set_quality),
+                                       sigc::mem_fun(*this, &studio::CanvasView::set_quality),
                                        i
                                )
                        );
@@ -3188,20 +3188,32 @@ void
 CanvasView::update_quality()
 {
        if(working_depth)
-               {
-                       quality_spin->set_sensitive(false);
                        return;
-               }
-       else
-               quality_spin->set_sensitive(true);
        if(updating_quality_)
                return;
        updating_quality_=true;
        work_area->set_quality((int) quality_spin->get_value());
+       // Update Quality Radio actions
+       Glib::RefPtr<Gtk::RadioAction> action=Glib::RefPtr<Gtk::RadioAction>::cast_dynamic(
+               action_group->get_action(strprintf("quality-%02d",(int) quality_spin->get_value()))
+               );
+       action->set_active();
+
        updating_quality_=false;
 }
 
 void
+CanvasView::set_quality(int x)
+{
+       if(updating_quality_)
+               return;
+       work_area->set_quality(x);
+       // Update the quality spin button
+       quality_spin->set_value(x);
+}
+
+
+void
 CanvasView::on_dirty_preview()
 {
        if(!is_playing_)
index aa43bb8..2f26d7b 100644 (file)
@@ -437,6 +437,7 @@ private:
        void decrease_low_res_pixel_size();
        void increase_low_res_pixel_size();
        void toggle_low_res_pixel_flag();
+       void set_quality(int x);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------