forked from len0rd/rockbox
Theme Editor: Integrated target db with project creation code. Now changing the target option in the New Project dialog will change the available options for wps documents, and the target id is stored in the new config file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27451 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
025147effb
commit
4a46996922
4 changed files with 49 additions and 1 deletions
|
@ -332,6 +332,7 @@ void EditorWindow::newProject()
|
||||||
|
|
||||||
/* Generating the config file */
|
/* Generating the config file */
|
||||||
QString config = tr("# Config file for ") + info.name + "\n";
|
QString config = tr("# Config file for ") + info.name + "\n";
|
||||||
|
config.append("#target: " + info.target + "\n\n");
|
||||||
QString wpsBase = "/.rockbox/wps/";
|
QString wpsBase = "/.rockbox/wps/";
|
||||||
if(info.sbs)
|
if(info.sbs)
|
||||||
config.append("sbs: " + wpsBase + info.name + ".sbs\n");
|
config.append("sbs: " + wpsBase + info.name + ".sbs\n");
|
||||||
|
|
|
@ -49,10 +49,13 @@ NewProjectDialog::NewProjectDialog(QWidget *parent) :
|
||||||
{
|
{
|
||||||
ui->targetBox->insertItem(i, QIcon(), targets.name(i), targets.id(i));
|
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()),
|
QObject::connect(ui->browseButton, SIGNAL(clicked()),
|
||||||
this, SLOT(browse()));
|
this, SLOT(browse()));
|
||||||
|
QObject::connect(ui->targetBox, SIGNAL(currentIndexChanged(int)),
|
||||||
|
this, SLOT(targetChange(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
NewProjectDialog::~NewProjectDialog()
|
NewProjectDialog::~NewProjectDialog()
|
||||||
|
@ -114,3 +117,41 @@ void NewProjectDialog::browse()
|
||||||
ui->locationBox->text());
|
ui->locationBox->text());
|
||||||
ui->locationBox->setText(path);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ public slots:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void browse();
|
void browse();
|
||||||
|
void targetChange(int target);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::NewProjectDialog *ui;
|
Ui::NewProjectDialog *ui;
|
||||||
|
|
|
@ -47,6 +47,11 @@ public:
|
||||||
|
|
||||||
QString id(int index){ return indices.key(index, ""); }
|
QString id(int index){ return indices.key(index, ""); }
|
||||||
QString name(int index){ return entries[index].name; }
|
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:
|
private:
|
||||||
struct Entry
|
struct Entry
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue