Code

Disable questioned code section.
authorJon A. Cruz <jon@joncruz.org>
Mon, 11 Jan 2010 00:12:18 +0000 (16:12 -0800)
committerJon A. Cruz <jon@joncruz.org>
Mon, 11 Jan 2010 00:12:18 +0000 (16:12 -0800)
Added name fetch.

src/widgets/toolbox.cpp
src/widgets/toolbox.h

index b4dc4ee17bb789889940b52c4b44be5916170ff3..25014160db2ebfe06fed9bfc0dc6ece48989c00b 100644 (file)
@@ -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<Gtk::ActionGroup> 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<Gtk::ActionGroup> 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)
         "    <separator />"
         "    <toolitem action='DialogPreferences' />"
         "    <toolitem action='DialogDocumentProperties' />"
+#if ENABLE_TASK_SUPPORT
         "    <separator />"
         "    <toolitem action='TaskSetAction' />"
+#endif // ENABLE_TASK_SUPPORT
         "  </toolbar>"
         "</ui>";
 
@@ -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<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);
index b028dd0a971ea3b9ce283316f48746960e1bff82..2e4b2958a0b44379dae116412bef4ffe417b7668 100644 (file)
@@ -7,6 +7,7 @@
  * 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.
@@ -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 );