diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-06-03 18:42:36 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-06-03 18:42:36 +0000 |
| commit | 88160b6e271f3d948e80e414f06a9506c98bb9a9 (patch) | |
| tree | bd678ab3d623a53c30e3080dc6298527dcd78097 /utils/themeeditor/editorwindow.cpp | |
| parent | 3f44f1c151fd47689719676f40fdda58a2ac837f (diff) | |
| download | rockbox-88160b6e271f3d948e80e414f06a9506c98bb9a9.zip rockbox-88160b6e271f3d948e80e414f06a9506c98bb9a9.tar.gz rockbox-88160b6e271f3d948e80e414f06a9506c98bb9a9.tar.bz2 rockbox-88160b6e271f3d948e80e414f06a9506c98bb9a9.tar.xz | |
Theme Editor: Refactored main window init code, moved parse tree into dock widget
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26519 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/editorwindow.cpp')
| -rw-r--r-- | utils/themeeditor/editorwindow.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp index ada9ecd..e06f0d8 100644 --- a/utils/themeeditor/editorwindow.cpp +++ b/utils/themeeditor/editorwindow.cpp @@ -29,33 +29,51 @@ EditorWindow::EditorWindow(QWidget *parent) : ui(new Ui::EditorWindow) { ui->setupUi(this); + loadSettings(); + setupUI(); + setupMenus(); +} +void EditorWindow::loadSettings() +{ + /* When there are settings to load, they'll be loaded here */ +} + +void EditorWindow::setupUI() +{ /* Establishing the parse tree */ - tree = new ParseTreeModel(ui->code->document()->toPlainText().toAscii()); + tree = new ParseTreeModel(ui->codeEdit->document()->toPlainText(). + toAscii()); ui->parseTree->setModel(tree); /* Setting up the syntax highlighter */ highlighter = new SkinHighlighter(QColor(0,255,0), QColor(255,0,0), QColor(0,0,255), QColor(150,150,150), - ui->code->document()); + ui->codeEdit->document()); /* Connecting the buttons */ - QObject::connect(ui->code, SIGNAL(cursorPositionChanged()), - this, SLOT(updateTree())); + QObject::connect(ui->codeEdit, SIGNAL(cursorPositionChanged()), + this, SLOT(codeChanged())); QObject::connect(ui->fromTree, SIGNAL(pressed()), this, SLOT(updateCode())); + +} + +void EditorWindow::setupMenus() +{ + /* When there are menus to setup, they'll be set up here */ } -void EditorWindow::updateTree() +void EditorWindow::codeChanged() { - tree->changeTree(ui->code->document()->toPlainText().toAscii()); + tree->changeTree(ui->codeEdit->document()->toPlainText().toAscii()); ui->parseTree->expandAll(); } void EditorWindow::updateCode() { tree->genCode(); - ui->code->document()->setPlainText(tree->genCode()); + ui->codeEdit->document()->setPlainText(tree->genCode()); } EditorWindow::~EditorWindow() |