diff options
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/themeeditor/gui/editorwindow.cpp | 1 | ||||
| -rw-r--r-- | utils/themeeditor/gui/newprojectdialog.cpp | 43 | ||||
| -rw-r--r-- | utils/themeeditor/gui/newprojectdialog.h | 1 | ||||
| -rw-r--r-- | utils/themeeditor/models/targetdata.h | 5 |
4 files changed, 49 insertions, 1 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp index 043c08b..b5eea63 100644 --- a/utils/themeeditor/gui/editorwindow.cpp +++ b/utils/themeeditor/gui/editorwindow.cpp @@ -332,6 +332,7 @@ void EditorWindow::newProject() /* Generating the config file */ QString config = tr("# Config file for ") + info.name + "\n"; + config.append("#target: " + info.target + "\n\n"); QString wpsBase = "/.rockbox/wps/"; if(info.sbs) config.append("sbs: " + wpsBase + info.name + ".sbs\n"); diff --git a/utils/themeeditor/gui/newprojectdialog.cpp b/utils/themeeditor/gui/newprojectdialog.cpp index 0df3250..2e9cbd6 100644 --- a/utils/themeeditor/gui/newprojectdialog.cpp +++ b/utils/themeeditor/gui/newprojectdialog.cpp @@ -49,10 +49,13 @@ NewProjectDialog::NewProjectDialog(QWidget *parent) : { ui->targetBox->insertItem(i, QIcon(), targets.name(i), targets.id(i)); } + targetChange(0); - /* Connecting the browse button */ + /* Connecting the browse button and target box */ QObject::connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browse())); + QObject::connect(ui->targetBox, SIGNAL(currentIndexChanged(int)), + this, SLOT(targetChange(int))); } NewProjectDialog::~NewProjectDialog() @@ -114,3 +117,41 @@ void NewProjectDialog::browse() ui->locationBox->text()); ui->locationBox->setText(path); } + +void NewProjectDialog::targetChange(int target) +{ + TargetData targets; + + if(targets.fm(target)) + { + ui->fmsBox->setEnabled(true); + ui->rfmsBox->setEnabled(true); + } + else + { + ui->fmsBox->setChecked(false); + ui->rfmsBox->setChecked(false); + + ui->fmsBox->setEnabled(false); + ui->rfmsBox->setEnabled(false); + } + + if(targets.remoteDepth(target) == TargetData::None) + { + ui->rwpsBox->setChecked(false); + ui->rsbsBox->setChecked(false); + ui->rfmsBox->setChecked(false); + + ui->rsbsBox->setEnabled(false); + ui->rwpsBox->setEnabled(false); + ui->rfmsBox->setEnabled(false); + } + else + { + ui->rsbsBox->setEnabled(true); + ui->rwpsBox->setEnabled(true); + if(targets.fm(target)) + ui->rfmsBox->setEnabled(true); + } + +} diff --git a/utils/themeeditor/gui/newprojectdialog.h b/utils/themeeditor/gui/newprojectdialog.h index 6a54a13..7d1a710 100644 --- a/utils/themeeditor/gui/newprojectdialog.h +++ b/utils/themeeditor/gui/newprojectdialog.h @@ -88,6 +88,7 @@ public slots: private slots: void browse(); + void targetChange(int target); private: Ui::NewProjectDialog *ui; diff --git a/utils/themeeditor/models/targetdata.h b/utils/themeeditor/models/targetdata.h index 6178509..ef7ac5c 100644 --- a/utils/themeeditor/models/targetdata.h +++ b/utils/themeeditor/models/targetdata.h @@ -47,6 +47,11 @@ public: QString id(int index){ return indices.key(index, ""); } QString name(int index){ return entries[index].name; } + QRect screenSize(int index){ return entries[index].size; } + QRect remoteSize(int index){ return entries[index].rSize; } + ScreenDepth screenDepth(int index){ return entries[index].depth; } + ScreenDepth remoteDepth(int index){ return entries[index].rDepth; } + bool fm(int index){ return entries[index].fm; } private: struct Entry |