forked from len0rd/rockbox
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
This commit is contained in:
parent
80fa0efd1f
commit
de9ba10aab
7 changed files with 66 additions and 16 deletions
|
@ -505,16 +505,25 @@ void EditorWindow::updateCurrent()
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorWindow::lineChanged(int line)
|
void EditorWindow::lineChanged(int line)
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
settings.beginGroup("EditorWindow");
|
||||||
|
|
||||||
|
if(settings.value("autoExpandTree", false).toBool())
|
||||||
{
|
{
|
||||||
ui->parseTree->collapseAll();
|
ui->parseTree->collapseAll();
|
||||||
ParseTreeModel* model = dynamic_cast<ParseTreeModel*>
|
ParseTreeModel* model = dynamic_cast<ParseTreeModel*>
|
||||||
(ui->parseTree->model());
|
(ui->parseTree->model());
|
||||||
parseTreeSelection = new QItemSelectionModel(model);
|
parseTreeSelection = new QItemSelectionModel(model);
|
||||||
expandLine(model, QModelIndex(), line);
|
expandLine(model, QModelIndex(), line,
|
||||||
|
settings.value("autoHighlightTree", false).toBool());
|
||||||
sizeColumns();
|
sizeColumns();
|
||||||
ui->parseTree->setSelectionModel(parseTreeSelection);
|
ui->parseTree->setSelectionModel(parseTreeSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settings.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
void EditorWindow::undo()
|
void EditorWindow::undo()
|
||||||
{
|
{
|
||||||
TabContent* doc = dynamic_cast<TabContent*>
|
TabContent* doc = dynamic_cast<TabContent*>
|
||||||
|
@ -566,7 +575,7 @@ void EditorWindow::findReplace()
|
||||||
|
|
||||||
|
|
||||||
void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent,
|
void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent,
|
||||||
int line)
|
int line, bool highlight)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < model->rowCount(parent); i++)
|
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 data = model->index(i, ParseTreeModel::lineColumn, parent);
|
||||||
QModelIndex recurse = model->index(i, 0, parent);
|
QModelIndex recurse = model->index(i, 0, parent);
|
||||||
|
|
||||||
expandLine(model, recurse, line);
|
expandLine(model, recurse, line, highlight);
|
||||||
|
|
||||||
if(model->data(data, Qt::DisplayRole) == line)
|
if(model->data(data, Qt::DisplayRole) == line)
|
||||||
{
|
{
|
||||||
|
@ -585,13 +594,19 @@ void EditorWindow::expandLine(ParseTreeModel* model, QModelIndex parent,
|
||||||
ui->parseTree->expand(data);
|
ui->parseTree->expand(data);
|
||||||
ui->parseTree->scrollTo(parent, QAbstractItemView::PositionAtTop);
|
ui->parseTree->scrollTo(parent, QAbstractItemView::PositionAtTop);
|
||||||
|
|
||||||
parseTreeSelection->select(data, QItemSelectionModel::Select);
|
if(highlight)
|
||||||
parseTreeSelection->select(dataType, QItemSelectionModel::Select);
|
{
|
||||||
parseTreeSelection->select(dataVal, QItemSelectionModel::Select);
|
parseTreeSelection->select(data,
|
||||||
|
QItemSelectionModel::Select);
|
||||||
|
parseTreeSelection->select(dataType,
|
||||||
|
QItemSelectionModel::Select);
|
||||||
|
parseTreeSelection->select(dataVal,
|
||||||
|
QItemSelectionModel::Select);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void EditorWindow::sizeColumns()
|
void EditorWindow::sizeColumns()
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,7 +87,8 @@ private:
|
||||||
void setupUI();
|
void setupUI();
|
||||||
void setupMenus();
|
void setupMenus();
|
||||||
void addTab(TabContent* doc);
|
void addTab(TabContent* doc);
|
||||||
void expandLine(ParseTreeModel* model, QModelIndex parent, int line);
|
void expandLine(ParseTreeModel* model, QModelIndex parent, int line,
|
||||||
|
bool highlight);
|
||||||
void sizeColumns();
|
void sizeColumns();
|
||||||
|
|
||||||
Ui::EditorWindow *ui;
|
Ui::EditorWindow *ui;
|
||||||
|
|
|
@ -44,7 +44,7 @@ void PreferencesDialog::loadSettings()
|
||||||
{
|
{
|
||||||
loadColors();
|
loadColors();
|
||||||
loadFont();
|
loadFont();
|
||||||
loadFontDir();
|
loadRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::loadColors()
|
void PreferencesDialog::loadColors()
|
||||||
|
@ -107,7 +107,7 @@ void PreferencesDialog::loadFont()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::loadFontDir()
|
void PreferencesDialog::loadRender()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("RBFont");
|
settings.beginGroup("RBFont");
|
||||||
|
@ -115,13 +115,22 @@ void PreferencesDialog::loadFontDir()
|
||||||
ui->fontBox->setText(settings.value("fontDir", "/").toString());
|
ui->fontBox->setText(settings.value("fontDir", "/").toString());
|
||||||
|
|
||||||
settings.endGroup();
|
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()
|
void PreferencesDialog::saveSettings()
|
||||||
{
|
{
|
||||||
saveColors();
|
saveColors();
|
||||||
saveFont();
|
saveFont();
|
||||||
saveFontDir();
|
saveRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::saveColors()
|
void PreferencesDialog::saveColors()
|
||||||
|
@ -159,7 +168,7 @@ void PreferencesDialog::saveFont()
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::saveFontDir()
|
void PreferencesDialog::saveRender()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("RBFont");
|
settings.beginGroup("RBFont");
|
||||||
|
@ -167,6 +176,13 @@ void PreferencesDialog::saveFontDir()
|
||||||
settings.setValue("fontDir", ui->fontBox->text());
|
settings.setValue("fontDir", ui->fontBox->text());
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
settings.beginGroup("EditorWindow");
|
||||||
|
|
||||||
|
settings.setValue("autoExpandTree", ui->autoExpandBox->isChecked());
|
||||||
|
settings.setValue("autoHighlightTree", ui->autoHighlightBox->isChecked());
|
||||||
|
|
||||||
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::setupUI()
|
void PreferencesDialog::setupUI()
|
||||||
|
|
|
@ -55,11 +55,11 @@ private:
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void loadColors();
|
void loadColors();
|
||||||
void loadFont();
|
void loadFont();
|
||||||
void loadFontDir();
|
void loadRender();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
void saveColors();
|
void saveColors();
|
||||||
void saveFont();
|
void saveFont();
|
||||||
void saveFontDir();
|
void saveRender();
|
||||||
|
|
||||||
void setupUI();
|
void setupUI();
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
<property name="tabPosition">
|
<property name="tabPosition">
|
||||||
<enum>QTabWidget::North</enum>
|
<enum>QTabWidget::North</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Editor</string>
|
<string>Editor</string>
|
||||||
|
@ -257,9 +260,23 @@
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Fonts</string>
|
<string>Rendering</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<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>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -553,7 +553,7 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
|
||||||
times.append(findBranchTime(children[i], info));
|
times.append(findBranchTime(children[i], info));
|
||||||
|
|
||||||
/* Now we figure out which branch to select */
|
/* 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;
|
int branch = 0;
|
||||||
while(timeLeft > 0)
|
while(timeLeft > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,7 @@ screenwidth ; Screen Width ; spin(0,800) ; 300
|
||||||
screenheight ; Screen Height ; spin(0,800) ; 200
|
screenheight ; Screen Height ; spin(0,800) ; 200
|
||||||
remotewidth ; Remote Width ; spin(0,800) ; 100
|
remotewidth ; Remote Width ; spin(0,800) ; 100
|
||||||
remoteheight ; Remote Height ; spin(0,800); 50
|
remoteheight ; Remote Height ; spin(0,800); 50
|
||||||
|
simtime ; Simulation Time ; fspin(0, 100000) ; 60.0
|
||||||
showviewports ; Show Viewports ; check ; false
|
showviewports ; Show Viewports ; check ; false
|
||||||
rendersbs ; Render SBS If Available ; check ; true
|
rendersbs ; Render SBS If Available ; check ; true
|
||||||
rtl ; Right-To-Left Language ; check ; false
|
rtl ; Right-To-Left Language ; check ; false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue