summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models/parsetreemodel.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-05 00:43:33 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-05 00:43:33 +0000
commit054a85fdca651844f969f44755b8531ab2e962d7 (patch)
treed424970a137d4bbdd57102961a46653e67589820 /utils/themeeditor/models/parsetreemodel.cpp
parent467451878726a3755eb3b2b472a3b33299cb9245 (diff)
downloadrockbox-054a85fdca651844f969f44755b8531ab2e962d7.zip
rockbox-054a85fdca651844f969f44755b8531ab2e962d7.tar.gz
rockbox-054a85fdca651844f969f44755b8531ab2e962d7.tar.bz2
rockbox-054a85fdca651844f969f44755b8531ab2e962d7.tar.xz
Theme Editor: Added code generate/undo functionality to SkinViewer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27704 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreemodel.cpp')
-rw-r--r--utils/themeeditor/models/parsetreemodel.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp
index a7f04ff..01d60c8 100644
--- a/utils/themeeditor/models/parsetreemodel.cpp
+++ b/utils/themeeditor/models/parsetreemodel.cpp
@@ -40,7 +40,7 @@ ParseTreeModel::ParseTreeModel(const char* document, QObject* parent):
this->tree = skin_parse(document);
if(tree)
- this->root = new ParseTreeNode(tree);
+ this->root = new ParseTreeNode(tree, this);
else
this->root = 0;
@@ -77,7 +77,7 @@ QString ParseTreeModel::changeTree(const char *document)
return error;
}
- ParseTreeNode* temp = new ParseTreeNode(test);
+ ParseTreeNode* temp = new ParseTreeNode(test, this);
if(root)
{
@@ -364,3 +364,17 @@ QGraphicsScene* ParseTreeModel::render(ProjectModel* project,
return scene;
}
+
+void ParseTreeModel::paramChanged(ParseTreeNode *param)
+{
+ QModelIndex index = indexFromPointer(param);
+ emit dataChanged(index, index);
+}
+
+QModelIndex ParseTreeModel::indexFromPointer(ParseTreeNode *p)
+{
+ /* Recursively finding an index for an arbitrary pointer within the tree */
+ if(!p->getParent())
+ return QModelIndex();
+ return index(p->getRow(), 0, indexFromPointer(p->getParent()));
+}