X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fgroupactionmanager.cpp;h=31941a3e60b334230740687feb99da0690669eaf;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=081677f965a8171680f4242b5c798c49d90d9adf;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/groupactionmanager.cpp b/synfig-studio/trunk/src/gtkmm/groupactionmanager.cpp index 081677f..31941a3 100644 --- a/synfig-studio/trunk/src/gtkmm/groupactionmanager.cpp +++ b/synfig-studio/trunk/src/gtkmm/groupactionmanager.cpp @@ -1,20 +1,22 @@ /* === S Y N F I G ========================================================= */ -/*! \file template.cpp +/*! \file groupactionmanager.cpp ** \brief Template File ** -** $Id: groupactionmanager.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -34,6 +36,8 @@ #include "instance.h" #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -126,7 +130,7 @@ GroupActionManager::queue_refresh() { if(queued) return; - + //queue_refresh_connection.disconnect(); queue_refresh_connection=Glib::signal_idle().connect( sigc::bind_return( @@ -134,14 +138,13 @@ GroupActionManager::queue_refresh() false ) ); - + queued=true; } void GroupActionManager::refresh() { - DEBUGPOINT(); if(queued) { queued=false; @@ -150,19 +153,19 @@ GroupActionManager::refresh() clear(); - + // Make sure we are ready if(!ui_manager_ || !group_tree_ || !canvas_interface_) { synfig::error("GroupActionManager::refresh(): Not ready!"); return; } - + if(group_tree_->get_selection()->count_selected_rows()==0) return; - + String ui_info; - + { { action_group_->add( @@ -183,19 +186,19 @@ GroupActionManager::refresh() // bool multiple_selected(group_tree_->get_selection()->count_selected_rows()>1); LayerGroupTree::LayerList selected_layers(group_tree_->get_selected_layers()); std::list selected_groups(group_tree_->get_selected_groups()); - + synfig::info("selected_layers.size()=%d",selected_layers.size()); synfig::info("selected_groups.size()=%d",selected_groups.size()); - + { bool canvas_set(false); synfigapp::Action::ParamList param_list; param_list.add("time",get_canvas_interface()->get_time()); param_list.add("canvas_interface",get_canvas_interface()); - + { LayerGroupTree::LayerList::iterator iter; - + for(iter=selected_layers.begin();iter!=selected_layers.end();++iter) { if(!canvas_set) @@ -209,7 +212,7 @@ GroupActionManager::refresh() { std::list::iterator iter; - + for(iter=selected_groups.begin();iter!=selected_groups.end();++iter) { param_list.add("group",(synfig::String)*iter); @@ -221,15 +224,15 @@ GroupActionManager::refresh() param_list.add("canvas",Canvas::Handle(get_canvas_interface()->get_canvas())); canvas_set=true; } - + handle::cast_static(get_canvas_interface()->get_instance())-> add_actions_to_group(action_group_, ui_info, param_list, synfigapp::Action::CATEGORY_GROUP); } } - + if(true) { - ui_info=""+ui_info+""; + ui_info=""+ui_info+""; popup_id_=get_ui_manager()->add_ui_from_string(ui_info); } else @@ -249,9 +252,9 @@ GroupActionManager::on_action_add() LayerGroupTreeStore::Model model; String group_name; - + Gtk::TreeIter selected_iter; - + if(group_tree_->get_selection()->count_selected_rows()) { selected_iter=( @@ -262,11 +265,11 @@ GroupActionManager::on_action_add() if(selected_iter && selected_iter->parent()) group_name=(Glib::ustring)(*selected_iter->parent())[model.group_name]+'.'; } - + group_name+=_("UnnamedGroup"); - + Gtk::TreePath path(group_tree_->get_model()->on_group_added(group_name)); - + group_tree_->expand_to_path(path); group_tree_->set_cursor(path,true); }