-/* === S I N F G =========================================================== */
-/*! \file template.cpp
+/* === S Y N F I G ========================================================= */
+/*! \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 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
*/
/* ========================================================================= */
#include "statemanager.h"
#include <gtkmm/actiongroup.h>
#include <gtkmm/action.h>
-#include <sinfg/string.h>
+#include <synfig/string.h>
#include "app.h"
#include "toolbox.h"
using namespace std;
using namespace etl;
-using namespace sinfg;
+using namespace synfig;
using namespace studio;
/* === M A C R O S ========================================================= */
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<Gtk::Action> action(
Gtk::Action::create(
"state-"+name,
- Gtk::StockID("sinfg-"+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(
"state-"+name
);
*/
-
+
String uid_def("<ui><popup action='menu-main'><menu action='menu-state'><menuitem action='state-"+name+"' /></menu></popup></ui>");
merge_id_list.push_back(App::ui_manager()->add_ui_from_string(uid_def));
-
+
App::ui_manager()->ensure_update();
App::toolbox->add_state(state);