From fcc7481c7c9d20f8c49b7f7f8ded56f80d50b134 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 10 Jan 2010 16:12:18 -0800 Subject: [PATCH] Disable questioned code section. Added name fetch. --- src/widgets/toolbox.cpp | 28 ++++++++++++++++++++++++++++ src/widgets/toolbox.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index b4dc4ee17..25014160d 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -140,11 +140,13 @@ static void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* ma 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; @@ -837,6 +839,7 @@ Glib::RefPtr create_or_fetch_actions( SPDesktop* desktop ) } } +#if ENABLE_TASK_SUPPORT if ( !mainActions->get_action("TaskSetAction") ) { GtkListStore* model = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ); @@ -866,6 +869,7 @@ Glib::RefPtr create_or_fetch_actions( SPDesktop* desktop ) //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; } @@ -1916,8 +1920,10 @@ setup_commands_toolbox(GtkWidget *toolbox, SPDesktop *desktop) " " " " " " +#if ENABLE_TASK_SUPPORT " " " " +#endif // ENABLE_TASK_SUPPORT " " ""; @@ -2246,6 +2252,28 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop) "/toolbox/secondary" ); } +Glib::ustring ToolboxFactory::getToolboxName(GtkWidget* toolbox) +{ + Glib::ustring name; + BarId id = static_cast( 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 b028dd0a9..2e4b2958a 100644 --- a/src/widgets/toolbox.h +++ b/src/widgets/toolbox.h @@ -7,6 +7,7 @@ * Authors: * Lauris Kaplinski * Frank Felfe + * Jon A. Cruz * * Copyright (C) 1999-2002 Authors * Copyright (C) 2001-2002 Ximian, Inc. @@ -36,6 +37,8 @@ public: 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 ); -- 2.30.2