Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / selection-describer.cpp
index 1debd73e15e95206674d275db6b5b5fbfcf2940b..06c477f4bfbd8a1cc8ae8d7dc29c093bfadd2425 100644 (file)
@@ -39,7 +39,8 @@ const gchar *
 type2term(GType type)
 {
     if (type == SP_TYPE_ANCHOR)
-        { return _("Link"); }
+       // TRANSLATORS: only translate and put "Link" in the translation. It means internet link (anchor)
+        { return Q_("web|Link"); }
     if (type == SP_TYPE_CIRCLE)
         { return _("Circle"); }
     if (type == SP_TYPE_ELLIPSE)
@@ -96,7 +97,25 @@ namespace Inkscape {
 SelectionDescriber::SelectionDescriber(Inkscape::Selection *selection, MessageStack *stack)
 : _context(stack)
 {
-    selection->connectChanged(sigc::mem_fun(*this, &SelectionDescriber::_updateMessageFromSelection));
+    _selection_changed_connection = new sigc::connection (
+             selection->connectChanged(
+                 sigc::mem_fun(*this, &SelectionDescriber::_updateMessageFromSelection)));
+    _selection_modified_connection = new sigc::connection (
+             selection->connectModified(
+                 sigc::mem_fun(*this, &SelectionDescriber::_selectionModified)));
+    _updateMessageFromSelection(selection);
+}
+
+SelectionDescriber::~SelectionDescriber()
+{
+    _selection_changed_connection->disconnect();
+    _selection_modified_connection->disconnect();
+    delete _selection_changed_connection;
+    delete _selection_modified_connection;
+}
+
+void SelectionDescriber::_selectionModified(Inkscape::Selection *selection, guint /*flags*/)
+{
     _updateMessageFromSelection(selection);
 }