From c317c1f79519f0ee961842ffb9feac4494af5377 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 28 Apr 2013 17:51:29 -0700 Subject: Fixed logic error confusing bitwise and with logical and. Whitespace cleanup to make the issue easier to spot. (bzr r12311) --- src/selection-describer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 391db8950..968a8bd22 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -197,7 +197,7 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, _("Convert symbol to group to edit"), _when_selected); - } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET (item)->sourceHref)) { + } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, _("Use Shift+D to look up original"), _when_selected); -- cgit v1.2.3 From cd6b7f49054415a6ad7ad71f36e7987bd8af1657 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 17:29:07 -0400 Subject: Fix bug where symbols weren't identified as such Fixed bugs: - https://launchpad.net/bugs/1179224 (bzr r12366) --- src/selection-describer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 968a8bd22..dd64e6232 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -38,8 +38,9 @@ #include "sp-spiral.h" static const gchar * -type2term(GType type) +type2term(SPItem *item) { + GType type = G_OBJECT_TYPE( item ); if (type == SP_TYPE_ANCHOR) //TRANSLATORS: "Link" means internet link (anchor) { return C_("Web", "Link"); } @@ -68,6 +69,8 @@ type2term(GType type) if (type == SP_TYPE_TEXT) { return C_("Object", "Text"); } if (type == SP_TYPE_USE) + if (SP_IS_SYMBOL(item->firstChild())) + { return C_("Object", "Symbol"); } // TRANSLATORS: "Clone" is a noun, type of object { return C_("Object", "Clone"); } if (type == SP_TYPE_ARC) @@ -85,7 +88,7 @@ static GSList *collect_terms (GSList *items) { GSList *r = NULL; for (GSList *i = items; i != NULL; i = i->next) { - const gchar *term = type2term (G_OBJECT_TYPE(i->data)); + const gchar *term = type2term ( SP_ITEM(i->data) ); if (term != NULL && g_slist_find (r, term) == NULL) r = g_slist_prepend (r, (void *) term); } -- cgit v1.2.3 From 5cd0fcd53cf3734cd5e0a52454ce0443fa6754ad Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sun, 16 Jun 2013 09:48:12 -0400 Subject: Fix layer selection so defs don't change layers, updated symbol text. (bzr r12379) --- src/selection-describer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index dd64e6232..e65a88f2e 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -151,6 +151,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select gchar *layer_name; if (layer == root) { layer_name = g_strdup(_("root")); + } else if(!layer) { + layer_name = g_strdup(_("none")); } else { char const *layer_label; bool is_label = false; @@ -183,6 +185,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select if (num_parents == 1) { if (layer == parent) in_phrase = g_strdup_printf(_(" in %s"), layer_name); + else if (!layer) + in_phrase = g_strdup_printf(_(" hidden in definitions")); else in_phrase = g_strdup_printf(_(" in group %s (%s)"), parent_name, layer_name); } else { @@ -200,6 +204,10 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, _("Convert symbol to group to edit"), _when_selected); + } else if (SP_IS_SYMBOL(item)) { + _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s.", + item_desc, in_phrase, + _("Select clone to edit symbol")); } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, -- cgit v1.2.3 From 7b18559bf25c2b1f6255babf8ec07e4753843dd8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 17 Jun 2013 18:53:50 -0400 Subject: Fix my own mis-credit and some symbols labels (bzr r12380) --- src/selection-describer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index e65a88f2e..72467c187 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -207,7 +207,7 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select } else if (SP_IS_SYMBOL(item)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s.", item_desc, in_phrase, - _("Select clone to edit symbol")); + _("Remove from symbols tray to edit symbol")); } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, -- cgit v1.2.3 From c3a160589a9cb41c70a56e5e7b66a65857a0d10e Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Mon, 1 Jul 2013 21:04:32 +0100 Subject: Factored layer model out into new Inkscape::LayerModel class. This allows Inkscape::Selection to use a LayerModel that is not associated with a UI. Changed the interface of verbs (SPAction) to use a new ActionContext rather than UI::View::View, again so that verbs may be used in a console mode. Modified boolean operation verbs to work in console-only mode. Fixed up DESKTOP_IS_ACTIVE macro to work in the case of no desktops. Modified main.cpp to process selections and verbs in no-GUI mode. Other changes are all consequences of the SPDesktop, Selection and LayerModel interface changes. (bzr r12387.1.1) --- src/selection-describer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 72467c187..ce2d1c90b 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -17,6 +17,7 @@ #include #include "xml/quote.h" +#include "layer-model.h" #include "selection.h" #include "selection-describer.h" #include "desktop.h" @@ -144,8 +145,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.set(Inkscape::NORMAL_MESSAGE, _when_nothing); } else { SPItem *item = SP_ITEM(items->data); - SPObject *layer = selection->desktop()->layerForObject(item); - SPObject *root = selection->desktop()->currentRoot(); + SPObject *layer = selection->layerModel()->layerForObject(item); + SPObject *root = selection->layerModel()->currentRoot(); // Layer name gchar *layer_name; -- cgit v1.2.3 From 104efe4e3ecadc975ab76748c66f041abf8ee7b1 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Thu, 4 Jul 2013 15:01:44 +0100 Subject: Code readability improvements and licence changes for action-context.* based on merge request code review and feedback (bzr r12387.1.7) --- src/selection-describer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index ce2d1c90b..6ed8ca584 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -145,8 +145,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.set(Inkscape::NORMAL_MESSAGE, _when_nothing); } else { SPItem *item = SP_ITEM(items->data); - SPObject *layer = selection->layerModel()->layerForObject(item); - SPObject *root = selection->layerModel()->currentRoot(); + SPObject *layer = selection->layers()->layerForObject(item); + SPObject *root = selection->layers()->currentRoot(); // Layer name gchar *layer_name; -- cgit v1.2.3