X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstatemanager.cpp;h=4a6828cdf066247dd06c3322d66fee7783b5dbc6;hb=1b138b535876987c79453888f370d71910d975ed;hp=81cd39d243838d0d2aaf0f8d879599e11b541e7f;hpb=ce408de81ca266b1f334ee9bc6c8fb7ba1492ed4;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/statemanager.cpp b/synfig-studio/trunk/src/gtkmm/statemanager.cpp index 81cd39d..4a6828c 100644 --- a/synfig-studio/trunk/src/gtkmm/statemanager.cpp +++ b/synfig-studio/trunk/src/gtkmm/statemanager.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ -/*! \file template.cpp +/*! \file statemanager.cpp ** \brief Template File ** -** $Id: statemanager.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -36,6 +37,8 @@ #include "app.h" #include "toolbox.h" +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -78,25 +81,28 @@ void StateManager::add_state(const Smach::state_base *state) { String name(state->get_name()); - + + Gtk::StockItem stock_item; + Gtk::Stock::lookup(Gtk::StockID("synfig-"+name),stock_item); + Glib::RefPtr action( Gtk::Action::create( "state-"+name, - Gtk::StockID("synfig-"+name), - name, - name + stock_item.get_stock_id(), + stock_item.get_label(), + stock_item.get_label() ) ); /*action->set_sensitive(false);*/ state_group->add(action); - + action->signal_activate().connect( sigc::bind( sigc::mem_fun(*this,&studio::StateManager::change_state_), state ) ); - + App::ui_manager()->ensure_update(); /*App::ui_manager()->add_ui( @@ -106,10 +112,10 @@ StateManager::add_state(const Smach::state_base *state) "state-"+name ); */ - + String uid_def(""); merge_id_list.push_back(App::ui_manager()->add_ui_from_string(uid_def)); - + App::ui_manager()->ensure_update(); App::toolbox->add_state(state);