X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fkeyframeactionmanager.cpp;h=ec238ad1676ac946d0a81c1da8b2977d95511765;hb=429a714273c61bfadf0f8f373403760910f75eef;hp=de3a8dc3b9d5e41c49cf216d6272eac3e35501ea;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/keyframeactionmanager.cpp b/synfig-studio/trunk/src/gtkmm/keyframeactionmanager.cpp index de3a8dc..ec238ad 100644 --- a/synfig-studio/trunk/src/gtkmm/keyframeactionmanager.cpp +++ b/synfig-studio/trunk/src/gtkmm/keyframeactionmanager.cpp @@ -2,19 +2,21 @@ /*! \file keyframeactionmanager.cpp ** \brief Template File ** -** $Id: keyframeactionmanager.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 */ /* ========================================================================= */ @@ -33,6 +35,8 @@ #include #include "instance.h" +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -130,7 +134,7 @@ KeyframeActionManager::queue_refresh() { if(queued) return; - + //queue_refresh_connection.disconnect(); queue_refresh_connection=Glib::signal_idle().connect( sigc::bind_return( @@ -138,7 +142,7 @@ KeyframeActionManager::queue_refresh() false ) ); - + queued=true; } @@ -151,11 +155,11 @@ KeyframeActionManager::on_keyframe_properties() void KeyframeActionManager::on_add_keyframe() { - synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_add")); + synfigapp::Action::Handle action(synfigapp::Action::create("KeyframeAdd")); if(!action) return; - + action->set_param("canvas",canvas_interface_->get_canvas()); action->set_param("canvas_interface",canvas_interface_); action->set_param("keyframe",Keyframe(canvas_interface_->get_time())); @@ -167,7 +171,7 @@ void KeyframeActionManager::refresh() { KeyframeTreeStore::Model model; - + if(queued) { queued=false; @@ -176,16 +180,16 @@ KeyframeActionManager::refresh() clear(); - + // Make sure we are ready if(!ui_manager_ || !keyframe_tree_ || !canvas_interface_) { synfig::error("KeyframeActionManager::refresh(): Not ready!"); return; } - + String ui_info; - + { synfigapp::Action::ParamList param_list; param_list.add("time",get_canvas_interface()->get_time()); @@ -206,39 +210,40 @@ KeyframeActionManager::refresh() synfigapp::Action::CATEGORY_KEYFRAME ); } - if(action_group_->get_action("action-keyframe_add")) + if(action_group_->get_action("action-KeyframeAdd")) { - action_group_->remove(action_group_->get_action("action-keyframe_add")); + action_group_->remove(action_group_->get_action("action-KeyframeAdd")); } - + action_group_->add(Gtk::Action::create( - "action-keyframe_add", + "action-KeyframeAdd", Gtk::StockID("gtk-add"), - _("Add new Keyframe"),_("Add new Keyframe") + _("Add New Keyframe"),_("Add New Keyframe") ), sigc::mem_fun(*this,&KeyframeActionManager::on_add_keyframe) ); - + try { canvas_interface_->get_canvas()->keyframe_list().find(canvas_interface_->get_time()); - action_group_->get_action("action-keyframe_add")->set_sensitive(false); - if(action_group_->get_action("action-keyframe_duplicate")) - action_group_->get_action("action-keyframe_duplicate")->set_sensitive(false); + action_group_->get_action("action-KeyframeAdd")->set_sensitive(false); + if(action_group_->get_action("action-KeyframeDuplicate")) + action_group_->get_action("action-KeyframeDuplicate")->set_sensitive(false); } catch(...) { } - + { - Glib::RefPtr action(Gtk::Action::create("keyframe-properties", Gtk::StockID("gtk-properties"), _("Keyframe Properties"))); + Glib::RefPtr action(Gtk::Action::create("keyframe-properties", Gtk::StockID("gtk-properties"), + _("Keyframe Properties"), _("Keyframe Properties"))); action_group_->add(action,sigc::mem_fun(*this,&KeyframeActionManager::on_keyframe_properties)); if(keyframe_tree_->get_selection()->count_selected_rows()==0) action->set_sensitive(false); } - ui_info=""+ui_info+""; - popup_id_=get_ui_manager()->add_ui_from_string(ui_info); + ui_info=""+ui_info+""; + popup_id_=get_ui_manager()->add_ui_from_string(ui_info); #ifdef ONE_ACTION_GROUP #else get_ui_manager()->insert_action_group(action_group_);