diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-07 20:56:16 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-07 20:56:16 +0000 |
commit | de9ba10aabdbc3224194f6859f2e4f60ac98ceb5 (patch) | |
tree | a7df606e3dc46857dea54b4f3aaca20e1c311ca0 | |
parent | 80fa0efd1fb775b396652a1a9c3308d6cbfcc8f3 (diff) | |
download | rockbox-de9ba10aabdbc3224194f6859f2e4f60ac98ceb5.tar.gz rockbox-de9ba10aabdbc3224194f6859f2e4f60ac98ceb5.zip |
Theme Editor: Made auto-expand/highlight of parse tree optional (through preferences dialog), added Simulation Time variable to device config panel, subline alternation is now dependent on that rather than time in song
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27342 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | utils/themeeditor/gui/editorwindow.cpp | 29 | ||||
-rw-r--r-- | utils/themeeditor/gui/editorwindow.h | 3 | ||||
-rw-r--r-- | utils/themeeditor/gui/preferencesdialog.cpp | 24 | ||||
-rw-r--r-- | utils/themeeditor/gui/preferencesdialog.h | 4 | ||||
-rw-r--r-- | utils/themeeditor/gui/preferencesdialog.ui | 19 | ||||
-rw-r--r-- | utils/themeeditor/models/parsetreenode.cpp | 2 | ||||
-rw-r--r-- | utils/themeeditor/resources/deviceoptions | 1 |
7 files changed, 66 insertions, 16 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp index 171e7b7019..169dc3f6a1 100644 --- a/utils/themeeditor/gui/editorwindow.cpp +++ b/utils/themeeditor/gui/editorwindow.cpp | |||
@@ -506,13 +506,22 @@ void EditorWindow::updateCurrent() | |||
506 | 506 | ||
507 | void EditorWindow::lineChanged(int line) | 507 | void EditorWindow::lineChanged(int line) |
508 | { | 508 | { |
509 | QSettings settings; | ||
510 | settings.beginGroup("EditorWindow"); | ||
511 | |||
512 | if(settings.value("autoExpandTree", false).toBool()) | ||
513 | { | ||
509 | ui->parseTree->collapseAll(); | 514 | ui->parseTree->collapseAll(); |
510 | ParseTreeModel* model = dynamic_cast<ParseTreeModel*> | 515 | ParseTreeModel* model = dynamic_cast<ParseTreeModel*> |
511 | (ui->parseTree->model()); | 516 | (ui->parseTree->model()); |
512 | parseTreeSelection = new QItemSelectionModel(model); | 517 | parseTreeSelection = new QItemSelectionModel(model); |
513 | expandLine(model, QModelIndex(), line); | 518 | expandLine(model, QModelIndex(), line, |
519 | settings.value("autoHighlightTree", false).toBool()); | ||
514 | sizeColumns(); | 520 | sizeColumns(); |
515 | ui->parseTree->setSelectionModel(parseTreeSelection); | 521 | ui->parseTree->setSelectionModel(parseTreeSelection); |
522 | } | ||
523 | |||
524 | settings.endGroup(); | ||
516 | } | 525 | } |
517 | 526 | ||
518 | void EditorWindow::undo() | 527 | void EditorWindow::undo() |
@@ -566,7 +575,7 @@ void EditorWindow::findReplace() | |||
566 | 575 | ||
567 | 576 | ||
568 | void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent, | 577 | void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent, |
569 | int line) | 578 | int line, bool highlight) |
570 | { | 579 | { |
571 | for(int i = 0; i < model->rowCount(parent); i++) | 580 | for(int i = 0; i < model->rowCount(parent); i++) |
572 | { | 581 | { |
@@ -577,7 +586,7 @@ void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent, | |||
577 | QModelIndex data = model->index(i, ParseTreeModel::lineColumn, parent); | 586 | QModelIndex data = model->index(i, ParseTreeModel::lineColumn, parent); |
578 | QModelIndex recurse = model->index(i, 0, parent); | 587 | QModelIndex recurse = model->index(i, 0, parent); |
579 | 588 | ||
580 | expandLine(model, recurse, line); | 589 | expandLine(model, recurse, line, highlight); |
581 | 590 | ||
582 | if(model->data(data, Qt::DisplayRole) == line) | 591 | if(model->data(data, Qt::DisplayRole) == line) |
583 | { | 592 | { |
@@ -585,12 +594,18 @@ void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent, | |||
585 | ui->parseTree->expand(data); | 594 | ui->parseTree->expand(data); |
586 | ui->parseTree->scrollTo(parent, QAbstractItemView::PositionAtTop); | 595 | ui->parseTree->scrollTo(parent, QAbstractItemView::PositionAtTop); |
587 | 596 | ||
588 | parseTreeSelection->select(data, QItemSelectionModel::Select); | 597 | if(highlight) |
589 | parseTreeSelection->select(dataType, QItemSelectionModel::Select); | 598 | { |
590 | parseTreeSelection->select(dataVal, QItemSelectionModel::Select); | 599 | parseTreeSelection->select(data, |
600 | QItemSelectionModel::Select); | ||
601 | parseTreeSelection->select(dataType, | ||
602 | QItemSelectionModel::Select); | ||
603 | parseTreeSelection->select(dataVal, | ||
604 | QItemSelectionModel::Select); | ||
605 | } | ||
591 | } | 606 | } |
592 | |||
593 | } | 607 | } |
608 | |||
594 | } | 609 | } |
595 | 610 | ||
596 | void EditorWindow::sizeColumns() | 611 | void EditorWindow::sizeColumns() |
diff --git a/utils/themeeditor/gui/editorwindow.h b/utils/themeeditor/gui/editorwindow.h index 6f30249e31..c2ae1770f2 100644 --- a/utils/themeeditor/gui/editorwindow.h +++ b/utils/themeeditor/gui/editorwindow.h | |||
@@ -87,7 +87,8 @@ private: | |||
87 | void setupUI(); | 87 | void setupUI(); |
88 | void setupMenus(); | 88 | void setupMenus(); |
89 | void addTab(TabContent* doc); | 89 | void addTab(TabContent* doc); |
90 | void expandLine(ParseTreeModel* model, QModelIndex parent, int line); | 90 | void expandLine(ParseTreeModel* model, QModelIndex parent, int line, |
91 | bool highlight); | ||
91 | void sizeColumns(); | 92 | void sizeColumns(); |
92 | 93 | ||
93 | Ui::EditorWindow *ui; | 94 | Ui::EditorWindow *ui; |
diff --git a/utils/themeeditor/gui/preferencesdialog.cpp b/utils/themeeditor/gui/preferencesdialog.cpp index f8c71f4450..dbb3249e9f 100644 --- a/utils/themeeditor/gui/preferencesdialog.cpp +++ b/utils/themeeditor/gui/preferencesdialog.cpp | |||
@@ -44,7 +44,7 @@ void PreferencesDialog::loadSettings() | |||
44 | { | 44 | { |
45 | loadColors(); | 45 | loadColors(); |
46 | loadFont(); | 46 | loadFont(); |
47 | loadFontDir(); | 47 | loadRender(); |
48 | } | 48 | } |
49 | 49 | ||
50 | void PreferencesDialog::loadColors() | 50 | void PreferencesDialog::loadColors() |
@@ -107,7 +107,7 @@ void PreferencesDialog::loadFont() | |||
107 | 107 | ||
108 | } | 108 | } |
109 | 109 | ||
110 | void PreferencesDialog::loadFontDir() | 110 | void PreferencesDialog::loadRender() |
111 | { | 111 | { |
112 | QSettings settings; | 112 | QSettings settings; |
113 | settings.beginGroup("RBFont"); | 113 | settings.beginGroup("RBFont"); |
@@ -115,13 +115,22 @@ void PreferencesDialog::loadFontDir() | |||
115 | ui->fontBox->setText(settings.value("fontDir", "/").toString()); | 115 | ui->fontBox->setText(settings.value("fontDir", "/").toString()); |
116 | 116 | ||
117 | settings.endGroup(); | 117 | settings.endGroup(); |
118 | |||
119 | settings.beginGroup("EditorWindow"); | ||
120 | |||
121 | ui->autoExpandBox->setChecked(settings.value("autoExpandTree", | ||
122 | false).toBool()); | ||
123 | ui->autoHighlightBox->setChecked(settings.value("autoHighlightTree", | ||
124 | false).toBool()); | ||
125 | |||
126 | settings.endGroup(); | ||
118 | } | 127 | } |
119 | 128 | ||
120 | void PreferencesDialog::saveSettings() | 129 | void PreferencesDialog::saveSettings() |
121 | { | 130 | { |
122 | saveColors(); | 131 | saveColors(); |
123 | saveFont(); | 132 | saveFont(); |
124 | saveFontDir(); | 133 | saveRender(); |
125 | } | 134 | } |
126 | 135 | ||
127 | void PreferencesDialog::saveColors() | 136 | void PreferencesDialog::saveColors() |
@@ -159,7 +168,7 @@ void PreferencesDialog::saveFont() | |||
159 | settings.endGroup(); | 168 | settings.endGroup(); |
160 | } | 169 | } |
161 | 170 | ||
162 | void PreferencesDialog::saveFontDir() | 171 | void PreferencesDialog::saveRender() |
163 | { | 172 | { |
164 | QSettings settings; | 173 | QSettings settings; |
165 | settings.beginGroup("RBFont"); | 174 | settings.beginGroup("RBFont"); |
@@ -167,6 +176,13 @@ void PreferencesDialog::saveFontDir() | |||
167 | settings.setValue("fontDir", ui->fontBox->text()); | 176 | settings.setValue("fontDir", ui->fontBox->text()); |
168 | 177 | ||
169 | settings.endGroup(); | 178 | settings.endGroup(); |
179 | |||
180 | settings.beginGroup("EditorWindow"); | ||
181 | |||
182 | settings.setValue("autoExpandTree", ui->autoExpandBox->isChecked()); | ||
183 | settings.setValue("autoHighlightTree", ui->autoHighlightBox->isChecked()); | ||
184 | |||
185 | settings.endGroup(); | ||
170 | } | 186 | } |
171 | 187 | ||
172 | void PreferencesDialog::setupUI() | 188 | void PreferencesDialog::setupUI() |
diff --git a/utils/themeeditor/gui/preferencesdialog.h b/utils/themeeditor/gui/preferencesdialog.h index 3df2409fd9..cc1d7c75e3 100644 --- a/utils/themeeditor/gui/preferencesdialog.h +++ b/utils/themeeditor/gui/preferencesdialog.h | |||
@@ -55,11 +55,11 @@ private: | |||
55 | void loadSettings(); | 55 | void loadSettings(); |
56 | void loadColors(); | 56 | void loadColors(); |
57 | void loadFont(); | 57 | void loadFont(); |
58 | void loadFontDir(); | 58 | void loadRender(); |
59 | void saveSettings(); | 59 | void saveSettings(); |
60 | void saveColors(); | 60 | void saveColors(); |
61 | void saveFont(); | 61 | void saveFont(); |
62 | void saveFontDir(); | 62 | void saveRender(); |
63 | 63 | ||
64 | void setupUI(); | 64 | void setupUI(); |
65 | 65 | ||
diff --git a/utils/themeeditor/gui/preferencesdialog.ui b/utils/themeeditor/gui/preferencesdialog.ui index 15e1743138..c455ed0786 100644 --- a/utils/themeeditor/gui/preferencesdialog.ui +++ b/utils/themeeditor/gui/preferencesdialog.ui | |||
@@ -23,6 +23,9 @@ | |||
23 | <property name="tabPosition"> | 23 | <property name="tabPosition"> |
24 | <enum>QTabWidget::North</enum> | 24 | <enum>QTabWidget::North</enum> |
25 | </property> | 25 | </property> |
26 | <property name="currentIndex"> | ||
27 | <number>0</number> | ||
28 | </property> | ||
26 | <widget class="QWidget" name="tab_2"> | 29 | <widget class="QWidget" name="tab_2"> |
27 | <attribute name="title"> | 30 | <attribute name="title"> |
28 | <string>Editor</string> | 31 | <string>Editor</string> |
@@ -257,10 +260,24 @@ | |||
257 | </widget> | 260 | </widget> |
258 | <widget class="QWidget" name="tab"> | 261 | <widget class="QWidget" name="tab"> |
259 | <attribute name="title"> | 262 | <attribute name="title"> |
260 | <string>Fonts</string> | 263 | <string>Rendering</string> |
261 | </attribute> | 264 | </attribute> |
262 | <layout class="QVBoxLayout" name="verticalLayout_4"> | 265 | <layout class="QVBoxLayout" name="verticalLayout_4"> |
263 | <item> | 266 | <item> |
267 | <widget class="QCheckBox" name="autoExpandBox"> | ||
268 | <property name="text"> | ||
269 | <string>Auto-Expand Parse Tree</string> | ||
270 | </property> | ||
271 | </widget> | ||
272 | </item> | ||
273 | <item> | ||
274 | <widget class="QCheckBox" name="autoHighlightBox"> | ||
275 | <property name="text"> | ||
276 | <string>Auto-Highlight Parse Tree</string> | ||
277 | </property> | ||
278 | </widget> | ||
279 | </item> | ||
280 | <item> | ||
264 | <layout class="QHBoxLayout" name="horizontalLayout_10"> | 281 | <layout class="QHBoxLayout" name="horizontalLayout_10"> |
265 | <item> | 282 | <item> |
266 | <widget class="QLabel" name="label_10"> | 283 | <widget class="QLabel" name="label_10"> |
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp index c284b16d6c..b2b5fbbdb4 100644 --- a/utils/themeeditor/models/parsetreenode.cpp +++ b/utils/themeeditor/models/parsetreenode.cpp | |||
@@ -553,7 +553,7 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport, | |||
553 | times.append(findBranchTime(children[i], info)); | 553 | times.append(findBranchTime(children[i], info)); |
554 | 554 | ||
555 | /* Now we figure out which branch to select */ | 555 | /* Now we figure out which branch to select */ |
556 | double timeLeft = info.device()->data(QString("?pc")).toDouble(); | 556 | double timeLeft = info.device()->data(QString("simtime")).toDouble(); |
557 | int branch = 0; | 557 | int branch = 0; |
558 | while(timeLeft > 0) | 558 | while(timeLeft > 0) |
559 | { | 559 | { |
diff --git a/utils/themeeditor/resources/deviceoptions b/utils/themeeditor/resources/deviceoptions index 8cc6381557..d76baf1861 100644 --- a/utils/themeeditor/resources/deviceoptions +++ b/utils/themeeditor/resources/deviceoptions | |||
@@ -35,6 +35,7 @@ screenwidth ; Screen Width ; spin(0,800) ; 300 | |||
35 | screenheight ; Screen Height ; spin(0,800) ; 200 | 35 | screenheight ; Screen Height ; spin(0,800) ; 200 |
36 | remotewidth ; Remote Width ; spin(0,800) ; 100 | 36 | remotewidth ; Remote Width ; spin(0,800) ; 100 |
37 | remoteheight ; Remote Height ; spin(0,800); 50 | 37 | remoteheight ; Remote Height ; spin(0,800); 50 |
38 | simtime ; Simulation Time ; fspin(0, 100000) ; 60.0 | ||
38 | showviewports ; Show Viewports ; check ; false | 39 | showviewports ; Show Viewports ; check ; false |
39 | rendersbs ; Render SBS If Available ; check ; true | 40 | rendersbs ; Render SBS If Available ; check ; true |
40 | rtl ; Right-To-Left Language ; check ; false | 41 | rtl ; Right-To-Left Language ; check ; false |