diff options
Diffstat (limited to 'src/ui/dialog/xml-tree.cpp')
| -rw-r--r-- | src/ui/dialog/xml-tree.cpp | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index e62f0232d..2e53ebf32 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -41,8 +41,8 @@ #include "ui/interface.h" #include "ui/tools/tool-base.h" -#include "widgets/sp-xmlview-attr-list.h" #include "widgets/sp-xmlview-tree.h" +#include "ui/dialog/attrdialog.h" #include "ui/dialog/cssdialog.h" namespace Inkscape { @@ -59,7 +59,6 @@ XmlTree::XmlTree() : selected_attr (0), selected_repr (nullptr), tree (nullptr), - attributes (nullptr), status (""), tree_toolbar(), xml_element_new_button ( _("New element node")), @@ -181,28 +180,19 @@ XmlTree::XmlTree() : node_box.pack_start(*tree_scroller); - /* node view */ + /* attributes */ + attributes = new AttrDialog; + attr_box.pack_start(*attributes); notebook_content->insert_page(attr_box, _("_Attributes"), NOTEBOOK_PAGE_ATTRS, true); notebook_content->set_tab_detachable(attr_box, true); - /* attributes */ - attributes = SP_XMLVIEW_ATTR_LIST(sp_xmlview_attr_list_new(nullptr)); - - Gtk::ScrolledWindow *attr_scroller = new Gtk::ScrolledWindow(); - attr_scroller->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ); - attr_scroller->set_shadow_type(Gtk::SHADOW_IN); - attr_scroller->set_size_request(-1, 80); - - attr_box.pack_start( *attr_scroller ); - attr_scroller->add(*Gtk::manage(Glib::wrap(GTK_WIDGET(attributes)))); - /* Signal handlers */ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(tree)); g_signal_connect (G_OBJECT(selection), "changed", G_CALLBACK (on_tree_select_row), this); g_signal_connect_after( G_OBJECT(tree), "tree_move", G_CALLBACK(after_tree_move), this); - g_signal_connect( G_OBJECT(attributes), "row-value-changed", G_CALLBACK(on_attr_row_changed), this); - g_signal_connect( G_OBJECT(attributes), "attr-value-edited", G_CALLBACK(on_attr_edited), this); + //g_signal_connect( G_OBJECT(attributes), "row-value-changed", G_CALLBACK(on_attr_row_changed), this); + //g_signal_connect( G_OBJECT(attributes), "attr-value-edited", G_CALLBACK(on_attr_edited), this); xml_element_new_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_new_element_node)); xml_text_new_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_new_text_node)); @@ -388,9 +378,9 @@ void XmlTree::set_tree_select(Inkscape::XML::Node *repr) void XmlTree::propagate_tree_select(Inkscape::XML::Node *repr) { if (repr && (repr->type() == Inkscape::XML::ELEMENT_NODE)) { - sp_xmlview_attr_list_set_repr(attributes, repr); + attributes->setRepr(repr); } else { - sp_xmlview_attr_list_set_repr(attributes, nullptr); + attributes->setRepr(nullptr); } } @@ -482,7 +472,7 @@ void XmlTree::on_tree_select_row(GtkTreeSelection *selection, gpointer data) } -void XmlTree::after_tree_move(SPXMLViewTree * /*attributes*/, gpointer value, gpointer data) +void XmlTree::after_tree_move(SPXMLViewTree * /*tree*/, gpointer value, gpointer data) { XmlTree *self = static_cast<XmlTree *>(data); guint val = GPOINTER_TO_UINT(value); @@ -631,7 +621,7 @@ void XmlTree::on_tree_unselect_row_disable() lower_node_button.set_sensitive(false); } -void XmlTree::on_attr_edited(SPXMLViewAttrList *attributes, const gchar * name, const gchar * value, gpointer data) +/*void XmlTree::on_attr_edited(SPXMLViewAttrList *attributes, const gchar * name, const gchar * value, gpointer data) { XmlTree *self = static_cast<XmlTree *>(data); g_assert(self->selected_repr != nullptr); @@ -656,10 +646,10 @@ void XmlTree::on_attr_edited(SPXMLViewAttrList *attributes, const gchar * name, } else { DocumentUndo::done(self->current_document, SP_VERB_DIALOG_XML_EDITOR, _("Delete attribute")); } -} +}*/ -void XmlTree::on_attr_row_changed(SPXMLViewAttrList *attributes, const gchar * name, gpointer /*data*/) -{ +//void XmlTree::on_attr_row_changed(SPXMLViewAttrList *attributes, const gchar * name, gpointer /*data*/) +/*{ // Reselect the selected row if the data changes to refresh the attribute and value edit boxes. GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(attributes)); GtkTreeIter iter; @@ -679,7 +669,7 @@ void XmlTree::on_attr_row_changed(SPXMLViewAttrList *attributes, const gchar * n g_free(attr_name); attr_name = nullptr; } -} +}*/ void XmlTree::onCreateNameChanged() { |
