summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-07 20:56:16 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-07 20:56:16 +0000
commitde9ba10aabdbc3224194f6859f2e4f60ac98ceb5 (patch)
treea7df606e3dc46857dea54b4f3aaca20e1c311ca0
parent80fa0efd1fb775b396652a1a9c3308d6cbfcc8f3 (diff)
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.cpp29
-rw-r--r--utils/themeeditor/gui/editorwindow.h3
-rw-r--r--utils/themeeditor/gui/preferencesdialog.cpp24
-rw-r--r--utils/themeeditor/gui/preferencesdialog.h4
-rw-r--r--utils/themeeditor/gui/preferencesdialog.ui19
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp2
-rw-r--r--utils/themeeditor/resources/deviceoptions1
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()
void EditorWindow::lineChanged(int line)
{
+ QSettings settings;
+ settings.beginGroup("EditorWindow");
+
+ if(settings.value("autoExpandTree", false).toBool())
+ {
ui->parseTree->collapseAll();
ParseTreeModel* model = dynamic_cast<ParseTreeModel*>
(ui->parseTree->model());
parseTreeSelection = new QItemSelectionModel(model);
- expandLine(model, QModelIndex(), line);
+ expandLine(model, QModelIndex(), line,
+ settings.value("autoHighlightTree", false).toBool());
sizeColumns();
ui->parseTree->setSelectionModel(parseTreeSelection);
+ }
+
+ settings.endGroup();
}
void EditorWindow::undo()
@@ -566,7 +575,7 @@ void EditorWindow::findReplace()
void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent,
- int line)
+ int line, bool highlight)
{
for(int i = 0; i < model->rowCount(parent); i++)
{
@@ -577,7 +586,7 @@ void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent,
QModelIndex data = model->index(i, ParseTreeModel::lineColumn, parent);
QModelIndex recurse = model->index(i, 0, parent);
- expandLine(model, recurse, line);
+ expandLine(model, recurse, line, highlight);
if(model->data(data, Qt::DisplayRole) == line)
{
@@ -585,12 +594,18 @@ void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent,
ui->parseTree->expand(data);
ui->parseTree->scrollTo(parent, QAbstractItemView::PositionAtTop);
- parseTreeSelection->select(data, QItemSelectionModel::Select);
- parseTreeSelection->select(dataType, QItemSelectionModel::Select);
- parseTreeSelection->select(dataVal, QItemSelectionModel::Select);
+ if(highlight)
+ {
+ parseTreeSelection->select(data,
+ QItemSelectionModel::Select);
+ parseTreeSelection->select(dataType,
+ QItemSelectionModel::Select);
+ parseTreeSelection->select(dataVal,
+ QItemSelectionModel::Select);
+ }
}
-
}
+
}
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:
void setupUI();
void setupMenus();
void addTab(TabContent* doc);
- void expandLine(ParseTreeModel* model, QModelIndex parent, int line);
+ void expandLine(ParseTreeModel* model, QModelIndex parent, int line,
+ bool highlight);
void sizeColumns();
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()
{
loadColors();
loadFont();
- loadFontDir();
+ loadRender();
}
void PreferencesDialog::loadColors()
@@ -107,7 +107,7 @@ void PreferencesDialog::loadFont()
}
-void PreferencesDialog::loadFontDir()
+void PreferencesDialog::loadRender()
{
QSettings settings;
settings.beginGroup("RBFont");
@@ -115,13 +115,22 @@ void PreferencesDialog::loadFontDir()
ui->fontBox->setText(settings.value("fontDir", "/").toString());
settings.endGroup();
+
+ settings.beginGroup("EditorWindow");
+
+ ui->autoExpandBox->setChecked(settings.value("autoExpandTree",
+ false).toBool());
+ ui->autoHighlightBox->setChecked(settings.value("autoHighlightTree",
+ false).toBool());
+
+ settings.endGroup();
}
void PreferencesDialog::saveSettings()
{
saveColors();
saveFont();
- saveFontDir();
+ saveRender();
}
void PreferencesDialog::saveColors()
@@ -159,7 +168,7 @@ void PreferencesDialog::saveFont()
settings.endGroup();
}
-void PreferencesDialog::saveFontDir()
+void PreferencesDialog::saveRender()
{
QSettings settings;
settings.beginGroup("RBFont");
@@ -167,6 +176,13 @@ void PreferencesDialog::saveFontDir()
settings.setValue("fontDir", ui->fontBox->text());
settings.endGroup();
+
+ settings.beginGroup("EditorWindow");
+
+ settings.setValue("autoExpandTree", ui->autoExpandBox->isChecked());
+ settings.setValue("autoHighlightTree", ui->autoHighlightBox->isChecked());
+
+ settings.endGroup();
}
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:
void loadSettings();
void loadColors();
void loadFont();
- void loadFontDir();
+ void loadRender();
void saveSettings();
void saveColors();
void saveFont();
- void saveFontDir();
+ void saveRender();
void setupUI();
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 @@
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Editor</string>
@@ -257,10 +260,24 @@
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
- <string>Fonts</string>
+ <string>Rendering</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
+ <widget class="QCheckBox" name="autoExpandBox">
+ <property name="text">
+ <string>Auto-Expand Parse Tree</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="autoHighlightBox">
+ <property name="text">
+ <string>Auto-Highlight Parse Tree</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<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,
times.append(findBranchTime(children[i], info));
/* Now we figure out which branch to select */
- double timeLeft = info.device()->data(QString("?pc")).toDouble();
+ double timeLeft = info.device()->data(QString("simtime")).toDouble();
int branch = 0;
while(timeLeft > 0)
{
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
screenheight ; Screen Height ; spin(0,800) ; 200
remotewidth ; Remote Width ; spin(0,800) ; 100
remoteheight ; Remote Height ; spin(0,800); 50
+simtime ; Simulation Time ; fspin(0, 100000) ; 60.0
showviewports ; Show Viewports ; check ; false
rendersbs ; Render SBS If Available ; check ; true
rtl ; Right-To-Left Language ; check ; false