Patches item #1318449, was opened at 2005-10-08 19:24
Message generated for change (Settings changed) made by rwst
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=604308&aid=1318449&group_id=93438
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Node Editing
Group: None
>Status: Deleted
>Resolution: Rejected
Priority: 6
Submitted By: Ralf Stephan (rwst)
Assigned to: Peter J. R. Moulder (pjrm)
Summary: fix for #1314369
Initial Comment:
since #1314369 is not a regression, nor a must fix,
I'm submitting a fix via the tracker.
in effect, I introduce a new signal _document_changed
on SPDesktop, to which the xml-tree editor is then connected
please decide. thanks for application
ralf
Index: desktop.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/desktop.cpp,v
retrieving revision 1.191
diff -u -r1.191 desktop.cpp
--- desktop.cpp 3 Oct 2005 14:06:13 -0000 1.191
+++ desktop.cpp 8 Oct 2005 17:14:36 -0000
@@ -1090,6 +1090,8 @@
/* Ugly hack */
_namedview_modified (namedview, SP_OBJECT_MODIFIED_FLAG, this);
}
+
+ _document_changed_signal.emit (this, doc);
}
void
Index: desktop.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/desktop.h,v
retrieving revision 1.94
diff -u -r1.94 desktop.h
--- desktop.h 30 Sep 2005 09:56:00 -0000 1.94
+++ desktop.h 8 Oct 2005 17:14:37 -0000
@@ -110,6 +110,10 @@
sigc::signal<int, SPStyle *, int>::accumulated<StopOnTrue> _query_style_signal;
sigc::signal<void, sp_verb_t> _tool_changed;
+ sigc::connection connectDocumentChanged (sigc::slot<void,SPDesktop*,SPDocument*> const & slot)
+ {
+ return _document_changed_signal.connect (slot);
+ }
sigc::connection connectEventContextChanged (const sigc::slot<void,SPDesktop*,SPEventContext*> & slot)
{
return _event_context_changed_signal.connect (slot);
@@ -212,6 +216,7 @@
sigc::signal<void> _activate_signal;
sigc::signal<void> _deactivate_signal;
+ sigc::signal<void,SPDesktop*,SPDocument*> _document_changed_signal;
sigc::signal<void,SPDesktop*,SPEventContext*> _event_context_changed_signal;
sigc::signal<void, gpointer> _tool_subselection_changed;
Index: dialogs/xml-tree.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/dialogs/xml-tree.cpp,v
retrieving revision 1.59
diff -u -r1.59 xml-tree.cpp
--- dialogs/xml-tree.cpp 4 Sep 2005 14:30:09 -0000 1.59
+++ dialogs/xml-tree.cpp 8 Oct 2005 17:14:42 -0000
@@ -38,6 +38,7 @@
#include <glibmm/i18n.h>
#include "helper/window.h"
#include "macros.h"
+#include "desktop.h"
#include "../inkscape.h"
#include "../document.h"
#include "../desktop-handles.h"
@@ -76,6 +77,7 @@
static GtkWidget * dlg = NULL;
static sigc::connection sel_changed_connection;
+static sigc::connection doc_changed_connection;
static sigc::connection document_uri_set_connection;
static win_data wd;
// impossible original values to make sure they are read from prefs
@@ -143,6 +145,7 @@
static void on_editable_changed_enable_if_valid_xml_name (GtkEditable * editable, gpointer data);
+static void on_document_changed (SPDesktop *dt, SPDocument *doc);
static void on_desktop_selection_changed (Inkscape::Selection * selection);
static void on_document_uri_set (gchar const *uri, SPDocument * document);
@@ -667,11 +670,12 @@
if (current_desktop) {
sel_changed_connection.disconnect();
-// sp_signal_disconnect_by_data (current_desktop, dlg);
+ doc_changed_connection.disconnect();
}
current_desktop = desktop;
if (desktop) {
sel_changed_connection = SP_DT_SELECTION(desktop)->connectChanged(&on_desktop_selection_changed);
+ doc_changed_connection = desktop->connectDocumentChanged (&on_document_changed);
set_tree_document (SP_DT_DOCUMENT (desktop));
} else {
set_tree_document (NULL);
@@ -702,7 +706,14 @@
}
}
-
+void
+on_document_changed (SPDesktop *dt, SPDocument *doc)
+{
+ if (current_desktop)
+ sel_changed_connection.disconnect();
+ sel_changed_connection = SP_DT_SELECTION(dt)->connectChanged(&on_desktop_selection_changed);
+ set_tree_document (doc);
+}
void
set_tree_repr (Inkscape::XML::Node * repr)
----------------------------------------------------------------------
Comment By: bulia byak (buliabyak)
Date: 2005-10-09 19:50
Message:
Logged In: YES
user_id=741217
rwst: by "document changed" do you mean "a new document is
loaded in the same window"? If so please rename the signal
to document_replaced, otherwise it's ambiguous.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=604308&aid=1318449&group_id=93438
|