index e515a3f37440f3eb3d5cef0beaaff6e0873b57bd..dd5371460f7c21a552f5a3f58a1f147f709bb002 100644 (file)
--- a/src/dialogs/xml-tree.cpp
+++ b/src/dialogs/xml-tree.cpp
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
+ * Johan Engelen <goejendaagh@zonnet.nl>
*
- * Copyright (C) 1999-2005 Authors
+ * Copyright (C) 1999-2006 Authors
* Copyright (C) 2004 David Turner
*
* Released under GNU GPL, read the file 'COPYING' for more information
#include "message-stack.h"
#include "message-context.h"
+#define MIN_ONSCREEN_DISTANCE 50
+
struct EditableDest {
GtkEditable *editable;
gchar *text;
dlg = sp_window_new("", TRUE);
if (x == -1000 || y == -1000) {
- x = prefs_get_int_attribute(prefs_path, "x", 0);
- y = prefs_get_int_attribute(prefs_path, "y", 0);
+ x = prefs_get_int_attribute(prefs_path, "x", -1000);
+ y = prefs_get_int_attribute(prefs_path, "y", -1000);
}
if (w ==0 || h == 0) {
w = prefs_get_int_attribute(prefs_path, "w", 0);
h = prefs_get_int_attribute(prefs_path, "h", 0);
}
- if (x<0) x=0;
- if (y<0) y=0;
+// if (x<0) x=0;
+// if (y<0) y=0;
- if (x != 0 || y != 0) {
+ if (w && h) {
+ gtk_window_resize((GtkWindow *) dlg, w, h);
+ }
+ if (x >= 0 && y >= 0 && (x < (gdk_screen_width()-MIN_ONSCREEN_DISTANCE)) && (y < (gdk_screen_height()-MIN_ONSCREEN_DISTANCE))) {
gtk_window_move((GtkWindow *) dlg, x, y);
} else {
gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER);
}
- if (w && h) {
- gtk_window_resize((GtkWindow *) dlg, w, h);
- }
sp_transientize(dlg);
wd.win = dlg;
wd.stop = 0;
GTK_CTREE_ROW(node)->sibling == new_sibling)
{
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:888");
+ _("Drag XML subtree"));
} else {
sp_document_cancel(current_document);
}
g_assert(selected_repr != NULL);
if (name.text) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(current_document);
Inkscape::XML::Node *new_repr;
- new_repr = sp_repr_new(name.text);
+ new_repr = xml_doc->createElement(name.text);
g_free(name.text);
selected_repr->appendChild(new_repr);
set_tree_select(new_repr);
set_dt_select(new_repr);
+
+ sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+ _("Create new element node"));
}
} // end of cmd_new_element_node()
{
g_assert(selected_repr != NULL);
- Inkscape::XML::Node *text = sp_repr_new_text("");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(current_document);
+ Inkscape::XML::Node *text = xml_doc->createTextNode("");
selected_repr->appendChild(text);
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1388");
+ _("Create new text node"));
set_tree_select(text);
set_dt_select(text);
g_assert(selected_repr != NULL);
Inkscape::XML::Node *parent = sp_repr_parent(selected_repr);
- Inkscape::XML::Node *dup = selected_repr->duplicate();
+ Inkscape::XML::Node *dup = selected_repr->duplicate(parent->document());
parent->addChild(dup, selected_repr);
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1406");
+ _("Duplicate node"));
GtkCTreeNode *node = sp_xmlview_tree_get_repr_node(SP_XMLVIEW_TREE(tree), dup);
sp_repr_unparent(selected_repr);
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1423");
+ _("Delete node"));
}
}
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1441");
+ _("Delete attribute"));
}
}
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1474");
+ _("Change attribute"));
/* TODO: actually, the row won't have been created yet. why? */
gint row = sp_xmlview_attr_list_find_row_from_key(GTK_CLIST(attributes),
parent->changeOrder(selected_repr, ref);
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1504");
+ _("Raise node"));
set_tree_select(selected_repr);
set_dt_select(selected_repr);
parent->changeOrder(selected_repr, selected_repr->next());
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1521");
+ _("Lower node"));
set_tree_select(selected_repr);
set_dt_select(selected_repr);
prev->addChild(repr, ref);
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1551");
+ _("Indent node"));
set_tree_select(repr);
set_dt_select(repr);
grandparent->addChild(repr, parent);
sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
- /* TODO: annotate */ "xml-tree.cpp:1572");
+ _("Unindent node"));
set_tree_select(repr);
set_dt_select(repr);