summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/skindocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/gui/skindocument.cpp')
-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 bd52685c6b..1ee6b6e7ee 100644
--- a/utils/themeeditor/gui/skindocument.cpp
+++ b/utils/themeeditor/gui/skindocument.cpp
@@ -36,7 +36,8 @@ const int SkinDocument::updateInterval = 500;
36SkinDocument::SkinDocument(QLabel* statusLabel, ProjectModel* project, 36SkinDocument::SkinDocument(QLabel* statusLabel, ProjectModel* project,
37 DeviceState* device, QWidget *parent) 37 DeviceState* device, QWidget *parent)
38 :TabContent(parent), statusLabel(statusLabel), 38 :TabContent(parent), statusLabel(statusLabel),
39 project(project), device(device) 39 project(project), device(device),
40 treeInSync(true)
40{ 41{
41 setupUI(); 42 setupUI();
42 43
@@ -53,7 +54,7 @@ SkinDocument::SkinDocument(QLabel* statusLabel, QString file,
53 QWidget *parent) 54 QWidget *parent)
54 :TabContent(parent), fileName(file), 55 :TabContent(parent), fileName(file),
55 statusLabel(statusLabel), project(project), 56 statusLabel(statusLabel), project(project),
56 device(device) 57 device(device), treeInSync(true)
57{ 58{
58 setupUI(); 59 setupUI();
59 blockUpdate = false; 60 blockUpdate = false;
@@ -163,6 +164,9 @@ void SkinDocument::setupUI()
163 /* Setting up the model */ 164 /* Setting up the model */
164 model = new ParseTreeModel(""); 165 model = new ParseTreeModel("");
165 166
167 QObject::connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
168 this, SLOT(modelChanged()));
169
166 /* Connecting the editor's signal */ 170 /* Connecting the editor's signal */
167 QObject::connect(editor, SIGNAL(textChanged()), 171 QObject::connect(editor, SIGNAL(textChanged()),
168 this, SLOT(codeChanged())); 172 this, SLOT(codeChanged()));
@@ -260,6 +264,10 @@ void SkinDocument::codeChanged()
260 editor->clearErrors(); 264 editor->clearErrors();
261 parseStatus = model->changeTree(editor->document()-> 265 parseStatus = model->changeTree(editor->document()->
262 toPlainText().toAscii()); 266 toPlainText().toAscii());
267
268 treeInSync = true;
269 emit antiSync(false);
270
263 if(skin_error_line() > 0) 271 if(skin_error_line() > 0)
264 parseStatus = tr("Errors in document"); 272 parseStatus = tr("Errors in document");
265 statusLabel->setText(parseStatus); 273 statusLabel->setText(parseStatus);
@@ -313,6 +321,12 @@ void SkinDocument::codeChanged()
313 321
314} 322}
315 323
324void SkinDocument::modelChanged()
325{
326 treeInSync = false;
327 emit antiSync(true);
328}
329
316void SkinDocument::save() 330void SkinDocument::save()
317{ 331{
318 QFile fout(fileName); 332 QFile fout(fileName);