summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-17 00:35:54 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-17 00:35:54 +0000
commit4a4699692270906976a9bc99d4c11f625fd756c6 (patch)
treeeeb68f77beb19321b643860f1934ba7b15207e32
parent025147effbee00db8bae931b3ef3df25052e0d96 (diff)
downloadrockbox-4a4699692270906976a9bc99d4c11f625fd756c6.tar.gz
rockbox-4a4699692270906976a9bc99d4c11f625fd756c6.zip
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
-rw-r--r--utils/themeeditor/gui/editorwindow.cpp1
-rw-r--r--utils/themeeditor/gui/newprojectdialog.cpp43
-rw-r--r--utils/themeeditor/gui/newprojectdialog.h1
-rw-r--r--utils/themeeditor/models/targetdata.h5
4 files changed, 49 insertions, 1 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp
index 043c08badd..b5eea633f9 100644
--- a/utils/themeeditor/gui/editorwindow.cpp
+++ b/utils/themeeditor/gui/editorwindow.cpp
@@ -332,6 +332,7 @@ void EditorWindow::newProject()
332 332
333 /* Generating the config file */ 333 /* Generating the config file */
334 QString config = tr("# Config file for ") + info.name + "\n"; 334 QString config = tr("# Config file for ") + info.name + "\n";
335 config.append("#target: " + info.target + "\n\n");
335 QString wpsBase = "/.rockbox/wps/"; 336 QString wpsBase = "/.rockbox/wps/";
336 if(info.sbs) 337 if(info.sbs)
337 config.append("sbs: " + wpsBase + info.name + ".sbs\n"); 338 config.append("sbs: " + wpsBase + info.name + ".sbs\n");
diff --git a/utils/themeeditor/gui/newprojectdialog.cpp b/utils/themeeditor/gui/newprojectdialog.cpp
index 0df3250c5b..2e9cbd609c 100644
--- a/utils/themeeditor/gui/newprojectdialog.cpp
+++ b/utils/themeeditor/gui/newprojectdialog.cpp
@@ -49,10 +49,13 @@ NewProjectDialog::NewProjectDialog(QWidget *parent) :
49 { 49 {
50 ui->targetBox->insertItem(i, QIcon(), targets.name(i), targets.id(i)); 50 ui->targetBox->insertItem(i, QIcon(), targets.name(i), targets.id(i));
51 } 51 }
52 targetChange(0);
52 53
53 /* Connecting the browse button */ 54 /* Connecting the browse button and target box */
54 QObject::connect(ui->browseButton, SIGNAL(clicked()), 55 QObject::connect(ui->browseButton, SIGNAL(clicked()),
55 this, SLOT(browse())); 56 this, SLOT(browse()));
57 QObject::connect(ui->targetBox, SIGNAL(currentIndexChanged(int)),
58 this, SLOT(targetChange(int)));
56} 59}
57 60
58NewProjectDialog::~NewProjectDialog() 61NewProjectDialog::~NewProjectDialog()
@@ -114,3 +117,41 @@ void NewProjectDialog::browse()
114 ui->locationBox->text()); 117 ui->locationBox->text());
115 ui->locationBox->setText(path); 118 ui->locationBox->setText(path);
116} 119}
120
121void NewProjectDialog::targetChange(int target)
122{
123 TargetData targets;
124
125 if(targets.fm(target))
126 {
127 ui->fmsBox->setEnabled(true);
128 ui->rfmsBox->setEnabled(true);
129 }
130 else
131 {
132 ui->fmsBox->setChecked(false);
133 ui->rfmsBox->setChecked(false);
134
135 ui->fmsBox->setEnabled(false);
136 ui->rfmsBox->setEnabled(false);
137 }
138
139 if(targets.remoteDepth(target) == TargetData::None)
140 {
141 ui->rwpsBox->setChecked(false);
142 ui->rsbsBox->setChecked(false);
143 ui->rfmsBox->setChecked(false);
144
145 ui->rsbsBox->setEnabled(false);
146 ui->rwpsBox->setEnabled(false);
147 ui->rfmsBox->setEnabled(false);
148 }
149 else
150 {
151 ui->rsbsBox->setEnabled(true);
152 ui->rwpsBox->setEnabled(true);
153 if(targets.fm(target))
154 ui->rfmsBox->setEnabled(true);
155 }
156
157}
diff --git a/utils/themeeditor/gui/newprojectdialog.h b/utils/themeeditor/gui/newprojectdialog.h
index 6a54a133bc..7d1a710a1d 100644
--- a/utils/themeeditor/gui/newprojectdialog.h
+++ b/utils/themeeditor/gui/newprojectdialog.h
@@ -88,6 +88,7 @@ public slots:
88 88
89private slots: 89private slots:
90 void browse(); 90 void browse();
91 void targetChange(int target);
91 92
92private: 93private:
93 Ui::NewProjectDialog *ui; 94 Ui::NewProjectDialog *ui;
diff --git a/utils/themeeditor/models/targetdata.h b/utils/themeeditor/models/targetdata.h
index 6178509514..ef7ac5c8a9 100644
--- a/utils/themeeditor/models/targetdata.h
+++ b/utils/themeeditor/models/targetdata.h
@@ -47,6 +47,11 @@ public:
47 47
48 QString id(int index){ return indices.key(index, ""); } 48 QString id(int index){ return indices.key(index, ""); }
49 QString name(int index){ return entries[index].name; } 49 QString name(int index){ return entries[index].name; }
50 QRect screenSize(int index){ return entries[index].size; }
51 QRect remoteSize(int index){ return entries[index].rSize; }
52 ScreenDepth screenDepth(int index){ return entries[index].depth; }
53 ScreenDepth remoteDepth(int index){ return entries[index].rDepth; }
54 bool fm(int index){ return entries[index].fm; }
50 55
51private: 56private:
52 struct Entry 57 struct Entry