From: cilix42 Date: Mon, 18 Aug 2008 00:46:44 +0000 (+0000) Subject: Some debugging messages X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4ff05d32b1a695a929736916e43cd4a461e993d4;p=inkscape.git Some debugging messages --- diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index f7b0091ec..0b3fb25bf 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -167,6 +167,7 @@ destroys old and creates new nodepath and reassigns listeners to the new selecte void sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer data) { + g_print ("sp_lpetool_context_selection_changed()\n"); SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(data); // TODO: update ShapeEditorsCollective instead @@ -329,13 +330,16 @@ lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) { int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item) { if (!SP_IS_LPE_ITEM(item)) { + g_print ("item is not LPEItem; returning -1\n"); return -1; } Inkscape::LivePathEffect::Effect* lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)); if (!lpe) { + g_print ("no valid construction; returning -1\n"); return -1; } + g_print ("returning construction %d\n", lpetool_mode_to_index(lpe->effectType())); return lpetool_mode_to_index(lpe->effectType()); } diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index eefc5de87..5676529c3 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -4835,6 +4835,7 @@ void sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl) { using namespace Inkscape::LivePathEffect; + g_print ("sp_lpetool_toolbox_sel_changed()"); { GtkAction* w = GTK_ACTION(g_object_get_data(tbl, "lpetool_line_segment_action")); SPItem *item = selection->singleItem(); @@ -4843,22 +4844,26 @@ sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl) SPLPEItem *lpeitem = SP_LPE_ITEM(item); Effect* lpe = sp_lpe_item_get_current_lpe(lpeitem); if (lpe && lpe->effectType() == LINE_SEGMENT) { + g_print (" - item with line segment LPE found\n"); LPELineSegment *lpels = static_cast(lpe); g_object_set_data(tbl, "currentlpe", lpe); g_object_set_data(tbl, "currentlpeitem", lpeitem); gtk_action_set_sensitive(w, TRUE); ege_select_one_action_set_active(act, lpels->end_type->get_value()); } else { + g_print (" - unsetting item\n"); g_object_set_data(tbl, "currentlpe", NULL); g_object_set_data(tbl, "currentlpeitem", NULL); gtk_action_set_sensitive(w, FALSE); } } else { + g_print (" - unsetting item\n"); g_object_set_data(tbl, "currentlpe", NULL); g_object_set_data(tbl, "currentlpeitem", NULL); gtk_action_set_sensitive(w, FALSE); } } + g_print ("\n"); } static void @@ -4901,6 +4906,7 @@ sp_line_segment_build_list(GObject *tbl) static void sp_lpetool_change_line_segment_type(EgeSelectOneAction* act, GObject* tbl) { + g_print ("sp_lpetool_change_line_segment_type()\n"); using namespace Inkscape::LivePathEffect; // quit if run by the attr_changed listener @@ -4913,7 +4919,15 @@ sp_lpetool_change_line_segment_type(EgeSelectOneAction* act, GObject* tbl) { LPELineSegment *lpe = static_cast(g_object_get_data(tbl, "currentlpe")); SPLPEItem *lpeitem = static_cast(g_object_get_data(tbl, "currentlpeitem")); - if (lpe) { + if (!lpeitem) { + g_print ("no lpeitem!\n"); + } else { + g_print ("lpeitem found\n"); + } + if (!lpe) { + g_print ("no LPE!\n"); + } else { + g_print ("LPE found. Adjusting line segment type\n"); SPLPEItem *lpeitem = static_cast(g_object_get_data(tbl, "currentlpeitem")); lpe->end_type.param_set_value(static_cast(ege_select_one_action_get_active(act))); sp_lpe_item_update_patheffect(lpeitem, true, true);