summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a941a08)
raw | patch | inline | side by side (parent: a941a08)
author | Jon A. Cruz <jon@joncruz.org> | |
Mon, 11 Jan 2010 00:12:18 +0000 (16:12 -0800) | ||
committer | Jon A. Cruz <jon@joncruz.org> | |
Mon, 11 Jan 2010 00:12:18 +0000 (16:12 -0800) |
Added name fetch.
src/widgets/toolbox.cpp | patch | blob | history | |
src/widgets/toolbox.h | patch | blob | history |
index b4dc4ee17bb789889940b52c4b44be5916170ff3..25014160db2ebfe06fed9bfc0dc6ece48989c00b 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
namespace { GtkWidget *sp_text_toolbox_new (SPDesktop *desktop); }
+#if ENABLE_TASK_SUPPORT
static void fireTaskChange( EgeSelectOneAction *act, SPDesktop *dt )
{
gint selected = ege_select_one_action_get_active( act );
UXManager::getInstance()->setTask(dt, selected);
}
+#endif // ENABLE_TASK_SUPPORT
using Inkscape::UI::ToolboxFactory;
}
}
+#if ENABLE_TASK_SUPPORT
if ( !mainActions->get_action("TaskSetAction") ) {
GtkListStore* model = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING );
//ege_select_one_action_set_active( act, mode );
g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(fireTaskChange), desktop );
}
+#endif // ENABLE_TASK_SUPPORT
return mainActions;
}
" <separator />"
" <toolitem action='DialogPreferences' />"
" <toolitem action='DialogDocumentProperties' />"
+#if ENABLE_TASK_SUPPORT
" <separator />"
" <toolitem action='TaskSetAction' />"
+#endif // ENABLE_TASK_SUPPORT
" </toolbar>"
"</ui>";
"/toolbox/secondary" );
}
+Glib::ustring ToolboxFactory::getToolboxName(GtkWidget* toolbox)
+{
+ Glib::ustring name;
+ BarId id = static_cast<BarId>( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(toolbox), BAR_ID_KEY)) );
+ switch(id) {
+ case BAR_TOOL:
+ name = "ToolToolbar";
+ break;
+ case BAR_AUX:
+ name = "AuxToolbar";
+ break;
+ case BAR_COMMANDS:
+ name = "CommandsToolbar";
+ break;
+ case BAR_SNAP:
+ name = "SnapToolbar";
+ break;
+ }
+
+ return name;
+}
+
void ToolboxFactory::updateSnapToolbox(SPDesktop *desktop, SPEventContext */*eventcontext*/, GtkWidget *toolbox)
{
g_assert(desktop != NULL);
diff --git a/src/widgets/toolbox.h b/src/widgets/toolbox.h
index b028dd0a971ea3b9ce283316f48746960e1bff82..2e4b2958a0b44379dae116412bef4ffe417b7668 100644 (file)
--- a/src/widgets/toolbox.h
+++ b/src/widgets/toolbox.h
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Frank Felfe <innerspace@iname.com>
+ * Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 1999-2002 Authors
* Copyright (C) 2001-2002 Ximian, Inc.
static GtkWidget *createCommandsToolbox();
static GtkWidget *createSnapToolbox();
+ static Glib::ustring getToolboxName(GtkWidget* toolbox);
+
static void updateSnapToolbox(SPDesktop *desktop, SPEventContext *eventcontext, GtkWidget *toolbox);
static Inkscape::IconSize prefToSize(Glib::ustring const &path, int base = 0 );