Add "select all layers" (S-C-a) and "unselect all ducks" (C-d). Move "unselect all...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 10 Apr 2008 18:43:36 +0000 (18:43 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 10 Apr 2008 18:43:36 +0000 (18:43 +0000)
git-svn-id: http://svn.voria.com/code@2011 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index 3ea17a7..591d7eb 100644 (file)
@@ -670,6 +670,8 @@ init_ui_manager()
        DEFINE_ACTION("copy", Gtk::StockID("gtk-copy"));
        DEFINE_ACTION("paste", Gtk::StockID("gtk-paste"));
        DEFINE_ACTION("select-all-ducks", _("Select All Ducks"));
+       DEFINE_ACTION("unselect-all-ducks", _("Unselect All Ducks"));
+       DEFINE_ACTION("select-all-layers", _("Select All Layers"));
        DEFINE_ACTION("unselect-all-layers", _("Unselect All Layers"));
        DEFINE_ACTION("properties", _("Properties"));
 
@@ -798,8 +800,10 @@ init_ui_manager()
 "              <menuitem action='copy'/>"
 "              <menuitem action='paste'/>"
 "              <separator name='bleh06'/>"
-"              <menuitem action='select-all-ducks'/>"
+"              <menuitem action='select-all-layers'/>"
 "              <menuitem action='unselect-all-layers'/>"
+"              <menuitem action='select-all-ducks'/>"
+"              <menuitem action='unselect-all-ducks'/>"
 "              <separator name='bleh07'/>"
 "              <menuitem action='properties'/>"
 "      </menu>"
@@ -938,7 +942,9 @@ init_ui_manager()
        }
 
        ACCEL("<Actions>//select-all-ducks","<Control>a");
-       ACCEL("<Actions>//unselect-all-layers","<Control>d");
+       ACCEL("<Actions>//unselect-all-ducks","<Control>d");
+       ACCEL("<Actions>//select-all-layers","<Control><Shift>a");
+       ACCEL("<Actions>//unselect-all-layers","<Control><Shift>d");
        ACCEL("<Actions>//render","F9");
        ACCEL("<Actions>//preview","F11");
        ACCEL("<Actions>//properties","F8");
index e0f52a8..b2263f6 100644 (file)
@@ -1240,6 +1240,14 @@ CanvasView::init_menus()
                sigc::mem_fun(*work_area,&studio::WorkArea::select_all_ducks)
        );
 
+       action_group->add( Gtk::Action::create("unselect-all-ducks", _("Unselect All Ducks")),
+               sigc::mem_fun(*work_area,&studio::WorkArea::unselect_all_ducks)
+       );
+
+       action_group->add( Gtk::Action::create("select-all-layers", _("Select All Layers")),
+               sigc::mem_fun(*this,&CanvasView::on_select_layers)
+       );
+
        action_group->add( Gtk::Action::create("unselect-all-layers", _("Unselect All Layers")),
                sigc::mem_fun(*this,&CanvasView::on_unselect_layers)
        );
@@ -1520,6 +1528,8 @@ CanvasView::init_menus()
 //     editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-paste"),NOT_IMPLEMENTED_SLOT));
 //     editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
 //     editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Select All Ducks"),Gtk::AccelKey('E',Gdk::CONTROL_MASK),sigc::mem_fun(*work_area,&studio::WorkArea::select_all_ducks)));
+//     editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Unselect All Ducks"),Gtk::AccelKey('E',Gdk::CONTROL_MASK),sigc::mem_fun(*work_area,&studio::WorkArea::unselect_all_ducks)));
+//     editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Select All Layers"),Gtk::AccelKey('A',Gdk::CONTROL_MASK),sigc::mem_fun(*this,&CanvasView::on_select_layers)));
 //     editmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Unselect All Layers"),Gtk::AccelKey('D',Gdk::CONTROL_MASK),sigc::mem_fun(*this,&CanvasView::on_unselect_layers)));
 //     editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
 //
@@ -1719,6 +1729,14 @@ CanvasView::init_menus()
 }
 
 void
+CanvasView::on_select_layers()
+{
+       Canvas::Handle canvas(get_canvas());
+       for (CanvasBase::iterator iter = canvas->begin(); iter != canvas->end(); iter++)
+               layer_tree->select_all_children_layers(*iter);
+}
+
+void
 CanvasView::on_unselect_layers()
 {
        layer_tree->clear_selected_layers();
index 1fe43c6..3b27e8b 100644 (file)
@@ -595,6 +595,7 @@ public:
 
 private:
 
+       void on_select_layers();
        void on_unselect_layers();
 
        void on_input_device_changed(GdkDevice*);
index ec99b8f..92675c8 100644 (file)
@@ -282,6 +282,14 @@ Duckmatic::select_all_ducks()
 }
 
 void
+Duckmatic::unselect_all_ducks()
+{
+       DuckMap::const_iterator iter;
+       for(iter=duck_map.begin();iter!=duck_map.end();++iter)
+               unselect_duck(iter->second);
+}
+
+void
 Duckmatic::toggle_select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br)
 {
        Vector vmin, vmax;
index f313255..42282e0 100644 (file)
@@ -381,6 +381,7 @@ public:
        Type get_type_mask()const { return type_mask; }
 
        void select_all_ducks();
+       void unselect_all_ducks();
 
        void clear_ducks();