}
}
+ if(layer_action_manager)
+ action_group_layer_ops->add(layer_action_manager->get_action_select_all_child_layers());
action_group_layer_ops->add( Gtk::Action::create("toolbar-layer", _("Layer Ops")) );
App::ui_manager()->insert_action_group(action_group_layer_ops);
-
Glib::ustring ui_info =
"<ui>"
" <toolbar action='toolbar-layer'>"
" <toolitem action='action-layer_raise' />"
" <toolitem action='action-layer_lower' />"
+ " <separator />"
" <toolitem action='action-layer_duplicate' />"
" <toolitem action='action-layer_encapsulate' />"
+ " <toolitem action='select-all-child-layers' />"
" <toolitem action='action-layer_remove' />"
+ " <separator />"
" <toolitem action='cut' />"
" <toolitem action='copy' />"
" <toolitem action='paste' />"
_("Amount"),_("Amount")
);
-
+ action_select_all_child_layers_=Gtk::Action::create(
+ "select-all-child-layers",
+ Gtk::StockID("synfig-select_all_child_layers"),
+ _("Select All Child Layers"),_("Select All Child Layers")
+ );
+ action_select_all_child_layers_->set_sensitive(false);
}
LayerActionManager::~LayerActionManager()
return;
}
-
- String ui_info, ui_toolbar_info;
+ String ui_info;
action_paste_->set_sensitive(!clipboard_.empty());
action_group_->add(action_paste_);
if(!multiple_selected && layer->get_name()=="PasteCanvas")
{
- action_group_->add(Gtk::Action::create(
- "select-all-child-layers",
- Gtk::StockID("synfig-select_all_child_layers"),
- _("Select All Child Layers"),
- _("Select All Child Layers")),
+ if (select_all_child_layers_connection)
+ select_all_child_layers_connection.disconnect();
+
+ select_all_child_layers_connection = action_select_all_child_layers_->signal_activate().connect(
sigc::bind(sigc::mem_fun(*layer_tree_,
&studio::LayerTree::select_all_children_layers),
Layer::LooseHandle(layer)));
+
+ action_select_all_child_layers_->set_sensitive(true);
+
ui_info+="<menuitem action='select-all-child-layers'/>";
- ui_toolbar_info+="<toolbar action='toolbar-layer'><toolitem action='select-all-child-layers'/></toolbar>";
}
+ else
+ action_select_all_child_layers_->set_sensitive(false);
+ action_group_->add(action_select_all_child_layers_);
+
handle<studio::Instance>::cast_static(get_canvas_interface()->get_instance())->
add_actions_to_group(action_group_, ui_info, param_list, synfigapp::Action::CATEGORY_LAYER);
}
"<separator/>"
"</menu>"
"</popup>" +
- ui_toolbar_info +
"</ui>");
popup_id_=get_ui_manager()->add_ui_from_string(ui_info);
#ifdef ONE_ACTION_GROUP
Glib::RefPtr<Gtk::Action> action_amount_dec_;
Glib::RefPtr<Gtk::Action> action_amount_;
+ Glib::RefPtr<Gtk::Action> action_select_all_child_layers_;
+ sigc::connection select_all_child_layers_connection;
std::list<synfig::Layer::Handle> clipboard_;
-
sigc::connection selection_changed_connection;
bool queued;
void refresh();
void clear();
+
+ Glib::RefPtr<Gtk::Action> get_action_select_all_child_layers() { return action_select_all_child_layers_; }
}; // END of LayerActionManager
}; // END of namespace studio