summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/skindocument.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-11 21:24:38 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-11 21:24:38 +0000
commitce0d21437e5197f90b0d8aa7a9055571c9db0263 (patch)
tree0fb73fc45eb8b8cb0241bb1df489454dbb0bf3d5 /utils/themeeditor/skindocument.cpp
parent6c921f5e04a1336f4a27f55afe728bae8f96065c (diff)
downloadrockbox-ce0d21437e5197f90b0d8aa7a9055571c9db0263.tar.gz
rockbox-ce0d21437e5197f90b0d8aa7a9055571c9db0263.zip
Theme Editor: Made errors display in status bar when cursor is on error'd line
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26801 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/skindocument.cpp')
-rw-r--r--utils/themeeditor/skindocument.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp
index 53e480cbe3..9a9bf5c85f 100644
--- a/utils/themeeditor/skindocument.cpp
+++ b/utils/themeeditor/skindocument.cpp
@@ -138,6 +138,8 @@ void SkinDocument::setupUI()
/* Connecting the editor's signal */
QObject::connect(editor, SIGNAL(textChanged()),
this, SLOT(codeChanged()));
+ QObject::connect(editor, SIGNAL(cursorPositionChanged()),
+ this, SLOT(cursorChanged()));
settingsChanged();
}
@@ -171,6 +173,28 @@ void SkinDocument::settingsChanged()
}
+void SkinDocument::cursorChanged()
+{
+ if(editor->isError(editor->textCursor().blockNumber() + 1))
+ {
+ QTextCursor line = editor->textCursor();
+ line.movePosition(QTextCursor::StartOfLine);
+ line.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
+ skin_parse(line.selectedText().toAscii());
+ if(skin_error_line() > 0)
+ parseStatus = tr("Error on line ") +
+ QString::number(line.blockNumber() + 1) + tr(": ") +
+ skin_error_message();
+ statusLabel->setText(parseStatus);
+ }
+ else if(editor->hasErrors())
+ {
+ parseStatus = tr("Errors in document");
+ statusLabel->setText(parseStatus);
+ }
+
+}
+
void SkinDocument::codeChanged()
{
if(blockUpdate)
@@ -190,7 +214,6 @@ void SkinDocument::codeChanged()
parseStatus = tr("Errors in document");
statusLabel->setText(parseStatus);
-
/* Highlighting if an error was found */
if(skin_error_line() > 0)
{
@@ -225,6 +248,9 @@ void SkinDocument::codeChanged()
emit titleChanged(title + QChar('*'));
else
emit titleChanged(title);
+
+ cursorChanged();
+
}
void SkinDocument::save()