summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-06 05:34:01 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-06 05:34:01 +0000
commitd505bc01195ddc4ca6e57efe42b97f1ce49d6afd (patch)
tree28418562cbb74c1e0741676c1d6a3f3b3da5de87
parent6063e9138b2c5a1ca25b3cd1ece0f9ce248f56a1 (diff)
downloadrockbox-d505bc01195ddc4ca6e57efe42b97f1ce49d6afd.tar.gz
rockbox-d505bc01195ddc4ca6e57efe42b97f1ce49d6afd.tar.bz2
rockbox-d505bc01195ddc4ca6e57efe42b97f1ce49d6afd.zip
Theme Editor: Made SBS elements in WPS documents non-interactive, which makes it a little more difficult to crash the editor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27734 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp2
-rw-r--r--utils/themeeditor/models/parsetreemodel.cpp14
-rw-r--r--utils/themeeditor/models/parsetreemodel.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index 015ed729d1..3b97e7143d 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -48,8 +48,6 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info,
leftGraphic(0), centerGraphic(0), rightGraphic(0), scrollTime(0),
node(pNode), doc(info.document())
{
- setFlags(ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges);
-
if(!node->tag)
{
/* Default viewport takes up the entire screen */
diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp
index e30d0be09d..ed5f5740c3 100644
--- a/utils/themeeditor/models/parsetreemodel.cpp
+++ b/utils/themeeditor/models/parsetreemodel.cpp
@@ -342,8 +342,9 @@ QGraphicsScene* ParseTreeModel::render(ProjectModel* project,
sbsInfo = RBRenderInfo(sbsModel, project, doc, &settings,
device, sbsScreen);
sbsModel->root->render(sbsInfo);
- }
+ setChildrenUnselectable(sbsScreen);
+ }
}
}
@@ -384,3 +385,14 @@ QModelIndex ParseTreeModel::indexFromPointer(ParseTreeNode *p)
return QModelIndex();
return index(p->getRow(), 0, indexFromPointer(p->getParent()));
}
+
+void ParseTreeModel::setChildrenUnselectable(QGraphicsItem *root)
+{
+ root->setFlag(QGraphicsItem::ItemIsSelectable, false);
+ root->setFlag(QGraphicsItem::ItemIsMovable, false);
+
+ QList<QGraphicsItem*> children = root->children();
+ for(QList<QGraphicsItem*>::iterator i = children.begin()
+ ; i != children.end(); i++)
+ setChildrenUnselectable(*i);
+}
diff --git a/utils/themeeditor/models/parsetreemodel.h b/utils/themeeditor/models/parsetreemodel.h
index 2c762f3645..f176b760d3 100644
--- a/utils/themeeditor/models/parsetreemodel.h
+++ b/utils/themeeditor/models/parsetreemodel.h
@@ -80,6 +80,8 @@ public:
QModelIndex indexFromPointer(ParseTreeNode* p);
private:
+ void setChildrenUnselectable(QGraphicsItem* root);
+
ParseTreeNode* root;
ParseTreeModel* sbsModel;
struct skin_element* tree;