Moving on from adding a selector to the style dialog, my next step is to delete a selector from the selector as well as from the XML representation of the document. Following the approach to get the selection from the treeview, get_selection() is used to obtain the selected row which is then iterated using get_selected().
If the iterator exists, the corresponding row is deleted from the treeview using erase(). Deletion from XML representation is challenging. I tokenized the selector value altogether and compared the first token which is the name of the selector to the selector selected in treeview. If these two are equal, then the corresponding style node is deleted from XML representation.
However, I ended up in a crash of Inkscape while deleting the style node, so currently all it deletes is the row from treeview.
Today we implemented undo/redo for delete operation. Likewise, we proceeded with undo/redo for move operation. Successfully implemented it for point entity. Saving the file also showed the updated coordinates of point. Moving the other entities resulted in inconsistent pushing of positions to the undo stack. Since the other entities need more information to be pushed to the stack, not figured this out yet.
Another issue came by. An item if deleted from the scene got saved because the list being iterated in the writeStream() method keeps a record of all the entities that were once added to the scene. Getting surprises daily. 😉
Also the entities’ properties have been set while one or more of them is selected. The points’ color is changed when selected. A dotted pattern has been implemented showing the selection of other entities accompanied by a change in the color of the points associated with the same entity, say center point for circle, likewise for line and ellipse too.