summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/skindocument.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/gui/skindocument.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 '')
-rw-r--r--utils/themeeditor/gui/skindocument.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/themeeditor/gui/skindocument.cpp b/utils/themeeditor/gui/skindocument.cpp
index bd52685..1ee6b6e 100644
--- a/utils/themeeditor/gui/skindocument.cpp
+++ b/utils/themeeditor/gui/skindocument.cpp
@@ -36,7 +36,8 @@ const int SkinDocument::updateInterval = 500;
SkinDocument::SkinDocument(QLabel* statusLabel, ProjectModel* project,
DeviceState* device, QWidget *parent)
:TabContent(parent), statusLabel(statusLabel),
- project(project), device(device)
+ project(project), device(device),
+ treeInSync(true)
{
setupUI();
@@ -53,7 +54,7 @@ SkinDocument::SkinDocument(QLabel* statusLabel, QString file,
QWidget *parent)
:TabContent(parent), fileName(file),
statusLabel(statusLabel), project(project),
- device(device)
+ device(device), treeInSync(true)
{
setupUI();
blockUpdate = false;
@@ -163,6 +164,9 @@ void SkinDocument::setupUI()
/* Setting up the model */
model = new ParseTreeModel("");
+ QObject::connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(modelChanged()));
+
/* Connecting the editor's signal */
QObject::connect(editor, SIGNAL(textChanged()),
this, SLOT(codeChanged()));
@@ -260,6 +264,10 @@ void SkinDocument::codeChanged()
editor->clearErrors();
parseStatus = model->changeTree(editor->document()->
toPlainText().toAscii());
+
+ treeInSync = true;
+ emit antiSync(false);
+
if(skin_error_line() > 0)
parseStatus = tr("Errors in document");
statusLabel->setText(parseStatus);
@@ -313,6 +321,12 @@ void SkinDocument::codeChanged()
}
+void SkinDocument::modelChanged()
+{
+ treeInSync = false;
+ emit antiSync(true);
+}
+
void SkinDocument::save()
{
QFile fout(fileName);