Code

Separate shape settings for pen and pencil tool
authorcilix42 <cilix42@users.sourceforge.net>
Tue, 22 Jul 2008 14:53:10 +0000 (14:53 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Tue, 22 Jul 2008 14:53:10 +0000 (14:53 +0000)
src/draw-context.cpp
src/widgets/toolbox.cpp

index 6a9e634360ad5ac878d80d29967dff976450cd2e..a87ca43b69feff32ce21f8200a12f3c8a41de6d9 100644 (file)
@@ -282,7 +282,7 @@ spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item)
             Effect::createAndApply(SPIRO, dc->desktop->doc(), item);
         }
 
-        int shape = prefs_get_int_attribute("tools.freehand", "shape", 0);
+        int shape = prefs_get_int_attribute(tool_name(dc), "shape", 0);
         bool shape_applied = false;
         SPCSSAttr *css_item = sp_css_attr_from_object (SP_OBJECT(item), SP_STYLE_FLAG_ALWAYS);
         const char *cstroke = sp_repr_css_property(css_item, "stroke", "none");
index 16e2f3f68bc5e172a366918eafefe589b3478406..eb45282978854eaee91b43a65ff9fbe3ef499c7f 100644 (file)
@@ -3328,9 +3328,9 @@ static void sp_add_spiro_toggle(GtkActionGroup* mainActions, GObject* holder, bo
     }
 }
 
-static void sp_freehand_change_shape(EgeSelectOneAction* act, GObject */*dataKludge*/) {
+static void sp_freehand_change_shape(EgeSelectOneAction* act, GObject *dataKludge) {
     gint shape = ege_select_one_action_get_active( act );
-    prefs_set_int_attribute("tools.freehand", "shape", shape);
+    prefs_set_int_attribute(freehand_tool_name(dataKludge), "shape", shape);
 }
 
 /**
@@ -3366,10 +3366,10 @@ sp_freehand_add_advanced_shape_options(GtkActionGroup* mainActions, GObject* hol
         items = 0;
         EgeSelectOneAction* act1 = ege_select_one_action_new(
             tool_is_pencil ? "SetPencilShapeAction" : "SetPenShapeAction",
-            _("Shape:"), (""), NULL, GTK_TREE_MODEL(model));
+            _("Shape:"), ("Shape"), NULL, GTK_TREE_MODEL(model));
         g_object_set( act1, "short_label", _("Shape:"), NULL );
         ege_select_one_action_set_appearance( act1, "compact" );
-        ege_select_one_action_set_active( act1, prefs_get_int_attribute("tools.freehand", "shape", 0) );
+        ege_select_one_action_set_active( act1, prefs_get_int_attribute(freehand_tool_name(holder), "shape", 0) );
         g_signal_connect( G_OBJECT(act1), "changed", G_CALLBACK(sp_freehand_change_shape), holder );
         gtk_action_group_add_action( mainActions, GTK_ACTION(act1) );
         g_object_set_data( holder, "shape_action", act1 );