summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp4
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h4
-rw-r--r--rbutil/rbutilqt/base/zipinstaller.cpp3
-rw-r--r--rbutil/rbutilqt/gui/selectiveinstallwidget.cpp552
-rw-r--r--rbutil/rbutilqt/gui/selectiveinstallwidget.h66
-rw-r--r--rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui266
-rw-r--r--rbutil/rbutilqt/installwindow.cpp316
-rw-r--r--rbutil/rbutilqt/installwindow.h63
-rw-r--r--rbutil/rbutilqt/installwindowfrm.ui251
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp552
-rw-r--r--rbutil/rbutilqt/rbutilqt.h24
-rw-r--r--rbutil/rbutilqt/rbutilqt.pri6
-rw-r--r--rbutil/rbutilqt/rbutilqtfrm.ui397
13 files changed, 945 insertions, 1559 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index f6a936ab9a..a42b33c1bd 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -41,6 +41,10 @@ const static struct {
41 { RbSettings::Platform, "platform", "" }, 41 { RbSettings::Platform, "platform", "" },
42 { RbSettings::Language, "lang", "" }, 42 { RbSettings::Language, "lang", "" },
43 { RbSettings::BackupPath, "backuppath", "" }, 43 { RbSettings::BackupPath, "backuppath", "" },
44 { RbSettings::InstallRockbox, "install_rockbox", "true" },
45 { RbSettings::InstallFonts, "install_fonts", "true" },
46 { RbSettings::InstallThemes, "install_themes", "false" },
47 { RbSettings::InstallGamefiles, "install_gamefiles", "true" },
44#if defined(Q_OS_WIN32) 48#if defined(Q_OS_WIN32)
45 { RbSettings::Tts, "tts", "sapi" }, 49 { RbSettings::Tts, "tts", "sapi" },
46#elif defined(Q_OS_MACX) 50#elif defined(Q_OS_MACX)
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
index 21234a4e9a..7aada6e78c 100644
--- a/rbutil/rbutilqt/base/rbsettings.h
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -41,6 +41,10 @@ class RbSettings : public QObject
41 Platform, 41 Platform,
42 Language, 42 Language,
43 BackupPath, 43 BackupPath,
44 InstallRockbox,
45 InstallFonts,
46 InstallThemes,
47 InstallGamefiles,
44 Tts, 48 Tts,
45 UseTtsCorrections, 49 UseTtsCorrections,
46 TalkFolders, 50 TalkFolders,
diff --git a/rbutil/rbutilqt/base/zipinstaller.cpp b/rbutil/rbutilqt/base/zipinstaller.cpp
index 117fa2dae9..c41304e3b4 100644
--- a/rbutil/rbutilqt/base/zipinstaller.cpp
+++ b/rbutil/rbutilqt/base/zipinstaller.cpp
@@ -63,8 +63,7 @@ void ZipInstaller::installContinue()
63 installStart(); 63 installStart();
64 } 64 }
65 else { 65 else {
66 emit logItem(tr("Installation finished successfully."), LOGOK); 66 emit logItem(tr("Package installation finished successfully."), LOGOK);
67
68 emit done(false); 67 emit done(false);
69 return; 68 return;
70 } 69 }
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
new file mode 100644
index 0000000000..360ff546eb
--- /dev/null
+++ b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
@@ -0,0 +1,552 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2012 by Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 ****************************************************************************/
18
19#include <QtGui>
20#include "selectiveinstallwidget.h"
21#include "ui_selectiveinstallwidgetfrm.h"
22#include "serverinfo.h"
23#include "rbsettings.h"
24#include "rockboxinfo.h"
25#include "systeminfo.h"
26#include "progressloggergui.h"
27#include "bootloaderinstallbase.h"
28#include "bootloaderinstallhelper.h"
29#include "themesinstallwindow.h"
30#include "utils.h"
31
32SelectiveInstallWidget::SelectiveInstallWidget(QWidget* parent) : QWidget(parent)
33{
34 ui.setupUi(this);
35 ui.rockboxCheckbox->setChecked(RbSettings::value(RbSettings::InstallRockbox).toBool());
36 ui.fontsCheckbox->setChecked(RbSettings::value(RbSettings::InstallFonts).toBool());
37 ui.themesCheckbox->setChecked(RbSettings::value(RbSettings::InstallThemes).toBool());
38 ui.gamefileCheckbox->setChecked(RbSettings::value(RbSettings::InstallGamefiles).toBool());
39
40 // check if Rockbox is installed by looking after rockbox-info.txt.
41 // If installed uncheck bootloader installation.
42 RockboxInfo info(m_mountpoint);
43 ui.bootloaderCheckbox->setChecked(!info.success());
44
45 m_logger = NULL;
46 m_zipinstaller = NULL;
47 m_themesinstaller = NULL;
48
49 connect(ui.installButton, SIGNAL(clicked()), this, SLOT(startInstall()));
50 connect(this, SIGNAL(installSkipped(bool)), this, SLOT(continueInstall(bool)));
51 connect(ui.themesCustomize, SIGNAL(clicked()), this, SLOT(customizeThemes()));
52 connect(ui.selectedVersion, SIGNAL(currentIndexChanged(int)),
53 this, SLOT(selectedVersionChanged(int)));
54 // update version information. This also handles setting the previously
55 // selected build type and bootloader disabling.
56 updateVersion();
57}
58
59
60void SelectiveInstallWidget::selectedVersionChanged(int index)
61{
62 QString current = ui.selectedVersion->itemData(index).toString();
63 if(current == "release")
64 ui.selectedDescription->setText(tr("This is the latest stable "
65 "release available."));
66 if(current == "current")
67 ui.selectedDescription->setText(tr("The development version is "
68 "updated on every code change. Last update was on %1").arg(
69 ServerInfo::value(ServerInfo::BleedingDate).toString()));
70 if(current == "rc")
71 ui.selectedDescription->setText(tr("This will eventually become the "
72 "next Rockbox version. Install it to help testing."));
73}
74
75
76void SelectiveInstallWidget::updateVersion(void)
77{
78 // get some configuration values globally
79 m_mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
80 m_target = RbSettings::value(RbSettings::CurrentPlatform).toString();
81 m_blmethod = SystemInfo::platformValue(m_target,
82 SystemInfo::CurBootloaderMethod).toString();
83
84 if(m_logger != NULL) {
85 delete m_logger;
86 m_logger = NULL;
87 }
88
89 // re-populate all version items
90 m_versions.clear();
91 m_versions.insert("release", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
92 m_versions.insert("current", ServerInfo::value(ServerInfo::BleedingRevision).toString());
93 m_versions.insert("rc", ServerInfo::value(ServerInfo::RelCandidateVersion).toString());
94
95 ui.selectedVersion->clear();
96 if(!m_versions["release"].isEmpty()) {
97 ui.selectedVersion->addItem(tr("Stable Release (Version %1)").arg(
98 m_versions["release"]), "release");
99 }
100 if(!m_versions["current"].isEmpty()) {
101 ui.selectedVersion->addItem(tr("Development Version (Revison %1)").arg(
102 m_versions["current"]), "current");
103 }
104 if(!m_versions["rc"].isEmpty()) {
105 ui.selectedVersion->addItem(tr("Release Candidate (Revison %1)").arg(
106 m_versions["rc"]), "rc");
107 }
108
109 // select previously selected version
110 int index = ui.selectedVersion->findData(RbSettings::value(RbSettings::Build).toString());
111 if(index != -1) {
112 ui.selectedVersion->setCurrentIndex(index);
113 }
114 else {
115 index = ui.selectedVersion->findData("release");
116 ui.selectedVersion->setCurrentIndex(index);
117 }
118 // check if Rockbox is installed. If it is untick the bootloader option, as
119 // well as if the selected player doesn't need a bootloader.
120 if(m_blmethod == "none") {
121 ui.bootloaderCheckbox->setEnabled(false);
122 ui.bootloaderLabel->setEnabled(false);
123 ui.bootloaderLabel->setText(tr("The selected player doesn't need a bootloader."));
124 }
125 else {
126 ui.bootloaderCheckbox->setEnabled(true);
127 ui.bootloaderLabel->setEnabled(true);
128 ui.bootloaderLabel->setText(tr("The bootloader is required for starting "
129 "Rockbox. Installation of the bootloader is only necessary "
130 "on first time installation."));
131 }
132
133 // check if Rockbox is installed by looking after rockbox-info.txt.
134 // If installed uncheck bootloader installation.
135 RockboxInfo info(m_mountpoint);
136 ui.bootloaderCheckbox->setChecked(!info.success());
137
138}
139
140
141void SelectiveInstallWidget::saveSettings(void)
142{
143 qDebug() << "[SelectiveInstallWidget] saving current settings";
144
145 RbSettings::setValue(RbSettings::InstallRockbox, ui.rockboxCheckbox->isChecked());
146 RbSettings::setValue(RbSettings::InstallFonts, ui.fontsCheckbox->isChecked());
147 RbSettings::setValue(RbSettings::InstallThemes, ui.themesCheckbox->isChecked());
148 RbSettings::setValue(RbSettings::InstallGamefiles, ui.gamefileCheckbox->isChecked());
149}
150
151
152void SelectiveInstallWidget::startInstall(void)
153{
154 qDebug() << "[SelectiveInstallWidget] starting installation";
155 saveSettings();
156 m_installStage = 0;
157 if(m_logger != NULL) delete m_logger;
158 m_logger = new ProgressLoggerGui(this);
159 m_logger->show();
160 if(!QFileInfo(m_mountpoint).isDir()) {
161 m_logger->addItem(tr("Mountpoint is wrong"), LOGERROR);
162 m_logger->setFinished();
163 return;
164 }
165 // start installation. No errors until now.
166 continueInstall(false);
167
168}
169
170
171void SelectiveInstallWidget::continueInstall(bool error)
172{
173 qDebug() << "[SelectiveInstallWidget] continuing install with stage" << m_installStage;
174 if(error) {
175 qDebug() << "[SelectiveInstallWidget] Last part returned error.";
176 m_logger->setFinished();
177 m_installStage = 7;
178 }
179 m_installStage++;
180 switch(m_installStage) {
181 case 0: qDebug() << "[SelectiveInstallWidget] Something wrong!"; break;
182 case 1: installBootloader(); break;
183 case 2: installRockbox(); break;
184 case 3: installFonts(); break;
185 case 4: installThemes(); break;
186 case 5: installGamefiles(); break;
187 case 6: installBootloaderPost(); break;
188 default: break;
189 }
190
191 if(m_installStage > 6) {
192 qDebug() << "[SelectiveInstallWidget] All install stages done.";
193 m_logger->setFinished();
194 // check if Rockbox is installed by looking after rockbox-info.txt.
195 // If installed uncheck bootloader installation.
196 RockboxInfo info(m_mountpoint);
197 ui.bootloaderCheckbox->setChecked(!info.success());
198 }
199}
200
201
202void SelectiveInstallWidget::installBootloader(void)
203{
204 if(ui.bootloaderCheckbox->isChecked()) {
205 qDebug() << "[SelectiveInstallWidget] installing bootloader";
206
207 QString platform = RbSettings::value(RbSettings::Platform).toString();
208 QString backupDestination = "";
209
210 // create installer
211 BootloaderInstallBase *bl =
212 BootloaderInstallHelper::createBootloaderInstaller(this,
213 SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
214 if(bl == NULL) {
215 m_logger->addItem(tr("No install method known."), LOGERROR);
216 m_logger->setFinished();
217 return;
218 }
219
220 // the bootloader install class does NOT use any GUI stuff.
221 // All messages are passed via signals.
222 connect(bl, SIGNAL(done(bool)), m_logger, SLOT(setFinished()));
223 connect(bl, SIGNAL(done(bool)), this, SLOT(continueInstall(bool)));
224 connect(bl, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int)));
225 connect(bl, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int)));
226
227 // set bootloader filename. Do this now as installed() needs it.
228 QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList();
229 QStringList blfilepath;
230 for(int a = 0; a < blfile.size(); a++) {
231 blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
232 + blfile.at(a));
233 }
234 bl->setBlFile(blfilepath);
235 QUrl url(SystemInfo::value(SystemInfo::BootloaderUrl).toString()
236 + SystemInfo::value(SystemInfo::CurBootloaderName).toString());
237 bl->setBlUrl(url);
238 bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString()
239 + "/.rockbox/rbutil.log");
240
241 if(bl->installed() == BootloaderInstallBase::BootloaderRockbox) {
242 if(QMessageBox::question(this, tr("Bootloader detected"),
243 tr("Bootloader already installed. Do you want to reinstall the bootloader?"),
244 QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
245 // keep m_logger open for auto installs.
246 // don't consider abort as error in auto-mode.
247 m_logger->addItem(tr("Bootloader installation skipped"), LOGINFO);
248 delete bl;
249 emit installSkipped(true);
250 return;
251 }
252 }
253 else if(bl->installed() == BootloaderInstallBase::BootloaderOther
254 && bl->capabilities() & BootloaderInstallBase::Backup)
255 {
256 QString targetFolder = SystemInfo::value(SystemInfo::CurPlatformName).toString()
257 + " Firmware Backup";
258 // remove invalid character(s)
259 targetFolder.remove(QRegExp("[:/]"));
260 if(QMessageBox::question(this, tr("Create Bootloader backup"),
261 tr("You can create a backup of the original bootloader "
262 "file. Press \"Yes\" to select an output folder on your "
263 "computer to save the file to. The file will get placed "
264 "in a new folder \"%1\" created below the selected folder.\n"
265 "Press \"No\" to skip this step.").arg(targetFolder),
266 QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
267 backupDestination = QFileDialog::getExistingDirectory(this,
268 tr("Browse backup folder"), QDir::homePath());
269 if(!backupDestination.isEmpty())
270 backupDestination += "/" + targetFolder;
271
272 qDebug() << "[RbUtil] backing up to" << backupDestination;
273 // backup needs to be done after the m_logger has been set up.
274 }
275 }
276
277 if(bl->capabilities() & BootloaderInstallBase::NeedsOf)
278 {
279 int ret;
280 ret = QMessageBox::information(this, tr("Prerequisites"),
281 bl->ofHint(),QMessageBox::Ok | QMessageBox::Abort);
282 if(ret != QMessageBox::Ok) {
283 // consider aborting an error to close window / abort automatic
284 // installation.
285 m_logger->addItem(tr("Bootloader installation aborted"), LOGINFO);
286 m_logger->setFinished();
287 emit installSkipped(true);
288 return;
289 }
290 // open dialog to browse to of file
291 QString offile;
292 QString filter
293 = SystemInfo::value(SystemInfo::CurBootloaderFilter).toString();
294 if(!filter.isEmpty()) {
295 filter = tr("Bootloader files (%1)").arg(filter) + ";;";
296 }
297 filter += tr("All files (*)");
298 offile = QFileDialog::getOpenFileName(this,
299 tr("Select firmware file"), QDir::homePath(), filter);
300 if(!QFileInfo(offile).isReadable()) {
301 m_logger->addItem(tr("Error opening firmware file"), LOGERROR);
302 m_logger->setFinished();
303 emit installSkipped(true);
304 return;
305 }
306 if(!bl->setOfFile(offile, blfile)) {
307 m_logger->addItem(tr("Error reading firmware file"), LOGERROR);
308 m_logger->setFinished();
309 emit installSkipped(true);
310 return;
311 }
312 }
313
314 // start install.
315 if(!backupDestination.isEmpty()) {
316 if(!bl->backup(backupDestination)) {
317 if(QMessageBox::warning(this, tr("Backup error"),
318 tr("Could not create backup file. Continue?"),
319 QMessageBox::No | QMessageBox::Yes)
320 == QMessageBox::No) {
321 m_logger->setFinished();
322 return;
323 }
324 }
325 }
326 bl->install();
327
328 }
329 else {
330 qDebug() << "[SelectiveInstallWidget] Bootloader install disabled.";
331 emit installSkipped(false);
332 }
333}
334
335void SelectiveInstallWidget::installBootloaderPost()
336{
337 // don't do anything if no bootloader install has been done.
338 if(ui.bootloaderCheckbox->isChecked()) {
339 QString msg = BootloaderInstallHelper::postinstallHints(
340 RbSettings::value(RbSettings::Platform).toString());
341 if(!msg.isEmpty()) {
342 QMessageBox::information(this, tr("Manual steps required"), msg);
343 }
344 }
345 emit installSkipped(false);
346}
347
348
349void SelectiveInstallWidget::installRockbox(void)
350{
351 if(ui.rockboxCheckbox->isChecked()) {
352 qDebug() << "[SelectiveInstallWidget] installing Rockbox";
353 QString url;
354
355 QString selected = ui.selectedVersion->itemData(ui.selectedVersion->currentIndex()).toString();
356 RbSettings::setValue(RbSettings::Build, selected);
357 RbSettings::sync();
358
359 QString warning = Utils::checkEnvironment(false);
360 if(!warning.isEmpty())
361 {
362 warning += "<br/>" + tr("Continue with installation?");
363 if(QMessageBox::warning(this, tr("Really continue?"), warning,
364 QMessageBox::Ok | QMessageBox::Abort, QMessageBox::Abort)
365 == QMessageBox::Abort)
366 {
367 m_logger->addItem(tr("Aborted!"),LOGERROR);
368 m_logger->setFinished();
369 emit installSkipped(true);
370 return;
371 }
372 }
373
374 if(selected == "release") url = ServerInfo::platformValue(m_target,
375 ServerInfo::CurReleaseUrl).toString();
376 else if(selected == "current") url = ServerInfo::platformValue(m_target,
377 ServerInfo::CurDevelUrl).toString();
378 else if(selected == "rc") url = ServerInfo::platformValue(m_target,
379 ServerInfo::RelCandidateUrl).toString();
380
381#if 0
382 RockboxInfo info(m_mountpoint);
383 if(info.success()) {
384 // existing installation found. Ask for backup.
385 QMessageBox::information(this, tr("Backup existing installation?"),
386 tr("Existing installation detected. Create a backup before installing?"),
387 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
388
389 }
390#endif
391#if 0
392 //! check if we should backup
393 if(ui.backup->isChecked())
394 {
395 m_logger->addItem(tr("Beginning Backup..."),LOGINFO);
396 QCoreApplication::processEvents();
397
398 //! create dir, if it doesnt exist
399 QFileInfo backupFile(m_backupName);
400 if(!QDir(backupFile.path()).exists())
401 {
402 QDir a;
403 a.mkpath(backupFile.path());
404 }
405
406 //! create backup
407 bool result = true;
408 ZipUtil zip(this);
409 connect(&zip, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int)));
410 connect(&zip, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int)));
411 zip.open(m_backupName, QuaZip::mdCreate);
412 QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
413 QString folder = mp + "/.rockbox";
414 result = zip.appendDirToArchive(folder, mp);
415 zip.close();
416 if(result) {
417 m_logger->addItem(tr("Backup finished."), LOGINFO);
418 }
419 else {
420 m_logger->addItem(tr("Backup failed!"), LOGERROR);
421 m_logger->setFinished();
422 return;
423 }
424 }
425#endif
426
427 //! install build
428 if(m_zipinstaller != NULL) delete m_zipinstaller;
429 m_zipinstaller = new ZipInstaller(this);
430 m_zipinstaller->setUrl(url);
431 m_zipinstaller->setLogSection("Rockbox (Base)");
432 if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
433 m_zipinstaller->setCache(true);
434 m_zipinstaller->setLogVersion(m_versions[selected]);
435 m_zipinstaller->setMountPoint(m_mountpoint);
436
437 connect(m_zipinstaller, SIGNAL(done(bool)), this, SLOT(continueInstall(bool)));
438
439 connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int)));
440 connect(m_zipinstaller, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int)));
441 connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort()));
442 m_zipinstaller->install();
443
444 }
445 else {
446 qDebug() << "[SelectiveInstallWidget] Rockbox install disabled.";
447 emit installSkipped(false);
448 }
449}
450
451
452void SelectiveInstallWidget::installFonts(void)
453{
454 if(ui.fontsCheckbox->isChecked()) {
455 qDebug() << "[SelectiveInstallWidget] installing Fonts";
456
457 RockboxInfo installInfo(m_mountpoint);
458 QString fontsurl;
459 QString logversion;
460 QString relversion = installInfo.release();
461 if(relversion.isEmpty()) {
462 // release is empty for non-release versions (i.e. daily / current)
463 fontsurl = SystemInfo::value(SystemInfo::DailyFontUrl).toString();
464 }
465 else {
466 fontsurl = SystemInfo::value(SystemInfo::ReleaseFontUrl).toString();
467 logversion = installInfo.release();
468 }
469 fontsurl.replace("%RELEASEVER%", relversion);
470
471 // create new zip installer
472 if(m_zipinstaller != NULL) delete m_zipinstaller;
473 m_zipinstaller = new ZipInstaller(this);
474 m_zipinstaller->setUrl(fontsurl);
475 m_zipinstaller->setLogSection("Fonts");
476 m_zipinstaller->setLogVersion(logversion);
477 m_zipinstaller->setMountPoint(m_mountpoint);
478 if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
479 m_zipinstaller->setCache(true);
480
481 connect(m_zipinstaller, SIGNAL(done(bool)), this, SLOT(continueInstall(bool)));
482 connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int)));
483 connect(m_zipinstaller, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int)));
484 connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort()));
485 m_zipinstaller->install();
486 }
487 else {
488 qDebug() << "[SelectiveInstallWidget] Fonts install disabled.";
489 emit installSkipped(false);
490 }
491}
492
493void SelectiveInstallWidget::customizeThemes(void)
494{
495 if(m_themesinstaller == NULL)
496 m_themesinstaller = new ThemesInstallWindow(this);
497
498 m_themesinstaller->setSelectOnly(true);
499 m_themesinstaller->show();
500}
501
502
503void SelectiveInstallWidget::installThemes(void)
504{
505 if(ui.themesCheckbox->isChecked()) {
506 qDebug() << "[SelectiveInstallWidget] installing themes";
507 if(m_themesinstaller == NULL)
508 m_themesinstaller = new ThemesInstallWindow(this);
509
510 m_themesinstaller->setLogger(m_logger);
511 m_themesinstaller->setModal(true);
512 m_themesinstaller->install();
513 connect(m_themesinstaller, SIGNAL(done(bool)), this, SLOT(continueInstall(bool)));
514 }
515 else {
516 qDebug() << "[SelectiveInstallWidget] Themes install disabled.";
517 emit installSkipped(false);
518 }
519}
520
521
522void SelectiveInstallWidget::installGamefiles(void)
523{
524 if(ui.gamefileCheckbox->isChecked()) {
525 // check if installed Rockbox has doom plugin. If not disable doom.
526 if(!QFileInfo(m_mountpoint + "/.rockbox/rocks/games/doom.rock").exists()) {
527 m_logger->addItem(tr("Your installation doesn't require game files, skipping."), LOGINFO);
528 emit installSkipped(false);
529 }
530 qDebug() << "[SelectiveInstallWidget] installing gamefiles";
531 // create new zip installer
532 if(m_zipinstaller != NULL) delete m_zipinstaller;
533 m_zipinstaller = new ZipInstaller(this);
534
535 m_zipinstaller->setUrl(SystemInfo::value(SystemInfo::DoomUrl).toString());
536 m_zipinstaller->setLogSection("Game Addons");
537 m_zipinstaller->setLogVersion();
538 m_zipinstaller->setMountPoint(m_mountpoint);
539 if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
540 m_zipinstaller->setCache(true);
541 connect(m_zipinstaller, SIGNAL(done(bool)), this, SLOT(continueInstall(bool)));
542 connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int)));
543 connect(m_zipinstaller, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int)));
544 connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort()));
545 m_zipinstaller->install();
546 }
547 else {
548 qDebug() << "[SelectiveInstallWidget] Gamefile install disabled.";
549 emit installSkipped(false);
550 }
551}
552
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidget.h b/rbutil/rbutilqt/gui/selectiveinstallwidget.h
new file mode 100644
index 0000000000..72820b23d4
--- /dev/null
+++ b/rbutil/rbutilqt/gui/selectiveinstallwidget.h
@@ -0,0 +1,66 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2012 by Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 ****************************************************************************/
18
19#ifndef SELECTIVEINSTALLWIDGET_H
20#define SELECTIVEINSTALLWIDGET_H
21
22#include <QWidget>
23#include "ui_selectiveinstallwidgetfrm.h"
24#include "progressloggergui.h"
25#include "zipinstaller.h"
26#include "themesinstallwindow.h"
27
28class SelectiveInstallWidget : public QWidget
29{
30 Q_OBJECT
31 public:
32 SelectiveInstallWidget(QWidget* parent = 0);
33
34 public slots:
35 void updateVersion(void);
36 void saveSettings(void);
37 void startInstall(void);
38
39 private slots:
40 void continueInstall(bool);
41 void installBootloader(void);
42 void installRockbox(void);
43 void installFonts(void);
44 void installThemes(void);
45 void installGamefiles(void);
46 void installBootloaderPost(void);
47 void customizeThemes(void);
48 void selectedVersionChanged(int);
49
50 signals:
51 void installSkipped(bool);
52
53 private:
54 Ui::SelectiveInstallWidget ui;
55 QString m_target;
56 QString m_blmethod;
57 QString m_mountpoint;
58 ProgressLoggerGui *m_logger;
59 int m_installStage;
60 ZipInstaller *m_zipinstaller;
61 QMap<QString, QString> m_versions;
62 ThemesInstallWindow *m_themesinstaller;
63};
64
65#endif
66
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui b/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui
new file mode 100644
index 0000000000..25cf44ba90
--- /dev/null
+++ b/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui
@@ -0,0 +1,266 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>SelectiveInstallWidget</class>
4 <widget class="QWidget" name="SelectiveInstallWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>663</width>
10 <height>369</height>
11 </rect>
12 </property>
13 <property name="sizePolicy">
14 <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
15 <horstretch>0</horstretch>
16 <verstretch>0</verstretch>
17 </sizepolicy>
18 </property>
19 <property name="windowTitle">
20 <string>Form</string>
21 </property>
22 <layout class="QGridLayout" name="gridLayout_3">
23 <item row="0" column="0">
24 <widget class="QGroupBox" name="versionSelectGroupBox">
25 <property name="title">
26 <string>Rockbox version to install</string>
27 </property>
28 <layout class="QGridLayout" name="gridLayout">
29 <item row="0" column="0">
30 <widget class="QComboBox" name="selectedVersion"/>
31 </item>
32 <item row="0" column="1">
33 <widget class="QLabel" name="selectedDescription">
34 <property name="text">
35 <string>Version information not available yet.</string>
36 </property>
37 <property name="wordWrap">
38 <bool>true</bool>
39 </property>
40 </widget>
41 </item>
42 </layout>
43 </widget>
44 </item>
45 <item row="1" column="0">
46 <widget class="QGroupBox" name="groupBox">
47 <property name="sizePolicy">
48 <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
49 <horstretch>0</horstretch>
50 <verstretch>0</verstretch>
51 </sizepolicy>
52 </property>
53 <property name="title">
54 <string>Rockbox components to install</string>
55 </property>
56 <layout class="QGridLayout" name="gridLayout_2">
57 <item row="0" column="0">
58 <widget class="QCheckBox" name="bootloaderCheckbox">
59 <property name="text">
60 <string>&amp;Bootloader</string>
61 </property>
62 <property name="icon">
63 <iconset resource="../rbutilqt.qrc">
64 <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
65 </property>
66 <property name="checked">
67 <bool>true</bool>
68 </property>
69 </widget>
70 </item>
71 <item row="1" column="1">
72 <widget class="QLabel" name="rockboxLabel">
73 <property name="sizePolicy">
74 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
75 <horstretch>0</horstretch>
76 <verstretch>0</verstretch>
77 </sizepolicy>
78 </property>
79 <property name="text">
80 <string>The main Rockbox firmware.</string>
81 </property>
82 <property name="wordWrap">
83 <bool>true</bool>
84 </property>
85 </widget>
86 </item>
87 <item row="2" column="0">
88 <widget class="QCheckBox" name="fontsCheckbox">
89 <property name="text">
90 <string>Fonts</string>
91 </property>
92 <property name="icon">
93 <iconset resource="../rbutilqt.qrc">
94 <normaloff>:/icons/font_btn.png</normaloff>:/icons/font_btn.png</iconset>
95 </property>
96 <property name="checked">
97 <bool>true</bool>
98 </property>
99 </widget>
100 </item>
101 <item row="1" column="0">
102 <widget class="QCheckBox" name="rockboxCheckbox">
103 <property name="text">
104 <string>&amp;Rockbox</string>
105 </property>
106 <property name="icon">
107 <iconset resource="../rbutilqt.qrc">
108 <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
109 </property>
110 <property name="checked">
111 <bool>true</bool>
112 </property>
113 </widget>
114 </item>
115 <item row="6" column="1">
116 <widget class="QLabel" name="gameLabel">
117 <property name="sizePolicy">
118 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
119 <horstretch>0</horstretch>
120 <verstretch>0</verstretch>
121 </sizepolicy>
122 </property>
123 <property name="text">
124 <string>Some game plugins require additional files.</string>
125 </property>
126 <property name="wordWrap">
127 <bool>true</bool>
128 </property>
129 </widget>
130 </item>
131 <item row="2" column="1">
132 <widget class="QLabel" name="fontsLabel">
133 <property name="sizePolicy">
134 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
135 <horstretch>0</horstretch>
136 <verstretch>0</verstretch>
137 </sizepolicy>
138 </property>
139 <property name="text">
140 <string>Additional fonts for the User Interface.</string>
141 </property>
142 <property name="wordWrap">
143 <bool>true</bool>
144 </property>
145 </widget>
146 </item>
147 <item row="0" column="1">
148 <widget class="QLabel" name="bootloaderLabel">
149 <property name="sizePolicy">
150 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
151 <horstretch>0</horstretch>
152 <verstretch>0</verstretch>
153 </sizepolicy>
154 </property>
155 <property name="text">
156 <string>The bootloader is required for starting Rockbox. Only necessary for first time install.</string>
157 </property>
158 <property name="wordWrap">
159 <bool>true</bool>
160 </property>
161 </widget>
162 </item>
163 <item row="6" column="0">
164 <widget class="QCheckBox" name="gamefileCheckbox">
165 <property name="text">
166 <string>Game Files</string>
167 </property>
168 <property name="icon">
169 <iconset resource="../rbutilqt.qrc">
170 <normaloff>:/icons/doom_btn.png</normaloff>:/icons/doom_btn.png</iconset>
171 </property>
172 </widget>
173 </item>
174 <item row="3" column="3">
175 <widget class="QPushButton" name="themesCustomize">
176 <property name="text">
177 <string>Customize</string>
178 </property>
179 </widget>
180 </item>
181 <item row="3" column="0">
182 <widget class="QCheckBox" name="themesCheckbox">
183 <property name="text">
184 <string>Themes</string>
185 </property>
186 <property name="icon">
187 <iconset resource="../rbutilqt.qrc">
188 <normaloff>:/icons/themes_btn.png</normaloff>:/icons/themes_btn.png</iconset>
189 </property>
190 </widget>
191 </item>
192 <item row="3" column="1">
193 <widget class="QLabel" name="themesLabel">
194 <property name="sizePolicy">
195 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
196 <horstretch>0</horstretch>
197 <verstretch>0</verstretch>
198 </sizepolicy>
199 </property>
200 <property name="text">
201 <string>Themes allow adjusting the user interface of Rockbox. Use &quot;Customize&quot; to select themes.</string>
202 </property>
203 <property name="wordWrap">
204 <bool>true</bool>
205 </property>
206 </widget>
207 </item>
208 <item row="1" column="2">
209 <spacer name="horizontalSpacer">
210 <property name="orientation">
211 <enum>Qt::Horizontal</enum>
212 </property>
213 <property name="sizeType">
214 <enum>QSizePolicy::Minimum</enum>
215 </property>
216 <property name="sizeHint" stdset="0">
217 <size>
218 <width>1</width>
219 <height>1</height>
220 </size>
221 </property>
222 </spacer>
223 </item>
224 </layout>
225 </widget>
226 </item>
227 <item row="2" column="0">
228 <spacer name="verticalSpacer">
229 <property name="orientation">
230 <enum>Qt::Vertical</enum>
231 </property>
232 <property name="sizeType">
233 <enum>QSizePolicy::Expanding</enum>
234 </property>
235 <property name="sizeHint" stdset="0">
236 <size>
237 <width>20</width>
238 <height>1</height>
239 </size>
240 </property>
241 </spacer>
242 </item>
243 <item row="3" column="0">
244 <widget class="QPushButton" name="installButton">
245 <property name="text">
246 <string>&amp;Install</string>
247 </property>
248 </widget>
249 </item>
250 </layout>
251 </widget>
252 <tabstops>
253 <tabstop>selectedVersion</tabstop>
254 <tabstop>bootloaderCheckbox</tabstop>
255 <tabstop>rockboxCheckbox</tabstop>
256 <tabstop>fontsCheckbox</tabstop>
257 <tabstop>themesCheckbox</tabstop>
258 <tabstop>themesCustomize</tabstop>
259 <tabstop>gamefileCheckbox</tabstop>
260 <tabstop>installButton</tabstop>
261 </tabstops>
262 <resources>
263 <include location="../rbutilqt.qrc"/>
264 </resources>
265 <connections/>
266</ui>
diff --git a/rbutil/rbutilqt/installwindow.cpp b/rbutil/rbutilqt/installwindow.cpp
deleted file mode 100644
index 17d0495bc4..0000000000
--- a/rbutil/rbutilqt/installwindow.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 ****************************************************************************/
18
19#include "installwindow.h"
20#include "ui_installwindowfrm.h"
21#include "system.h"
22#include "rbsettings.h"
23#include "serverinfo.h"
24#include "systeminfo.h"
25#include "utils.h"
26#include "rockboxinfo.h"
27#include "ziputil.h"
28
29InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
30{
31 ui.setupUi(this);
32
33 connect(ui.radioStable, SIGNAL(toggled(bool)), this, SLOT(setDetailsStable(bool)));
34 connect(ui.radioCandidate, SIGNAL(toggled(bool)), this, SLOT(setDetailsCandidate(bool)));
35 connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
36 connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath()));
37 connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int)));
38
39 //! check if rockbox is already installed
40 RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString());
41 QString version = rbinfo.version();
42
43 if(version != "") {
44 ui.Backupgroup->show();
45 m_backupName = RbSettings::value(RbSettings::Mountpoint).toString();
46 if(!m_backupName.endsWith("/")) m_backupName += "/";
47 m_backupName += ".backup/rockbox-backup-"+version+".zip";
48 // for some reason the label doesn't return its final size yet.
49 // Delay filling ui.backupLocation until the checkbox is changed.
50 }
51 else {
52 ui.Backupgroup->hide();
53 }
54 backupCheckboxChanged(Qt::Unchecked);
55
56 if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
57 ui.radioStable->setEnabled(false);
58 }
59
60 // try to use the old selection first. If no selection has been made
61 // in the past, use a preselection based on released status.
62 QString lastinstalled = RbSettings::value(RbSettings::Build).toString();
63 if(lastinstalled == "stable"
64 && !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
65 ui.radioStable->setChecked(true);
66 }
67 else if(lastinstalled == "rc"
68 && !ServerInfo::value(ServerInfo::RelCandidateVersion).toString().isEmpty()) {
69 ui.radioCandidate->setChecked(true);
70 }
71 else if(lastinstalled == "current") {
72 ui.radioCurrent->setChecked(true);
73 }
74 else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
75 ui.radioStable->setChecked(true);
76 ui.radioStable->setEnabled(true);
77 }
78 else {
79 ui.radioCurrent->setChecked(true);
80 ui.radioStable->setEnabled(false);
81 ui.radioStable->setChecked(false);
82 }
83 if(ServerInfo::value(ServerInfo::RelCandidateVersion).toString().isEmpty()) {
84 ui.radioCandidate->setEnabled(false);
85 }
86
87}
88
89
90void InstallWindow::resizeEvent(QResizeEvent *e)
91{
92 (void)e;
93
94 // recalculate width of elided text.
95 updateBackupLocation();
96}
97
98
99void InstallWindow::updateBackupLocation(void)
100{
101 ui.backupLocation->setText(QDir::toNativeSeparators(
102 fontMetrics().elidedText(tr("Backup to %1").arg(m_backupName),
103 Qt::ElideMiddle, ui.backupLocation->size().width())));
104}
105
106
107void InstallWindow::backupCheckboxChanged(int state)
108{
109 if(state == Qt::Checked)
110 {
111 ui.backupLocation->show();
112 ui.changeBackup->show();
113 // update backup location display.
114 updateBackupLocation();
115 }
116 else
117 {
118 ui.backupLocation->hide();
119 ui.changeBackup->hide();
120 }
121}
122
123
124void InstallWindow::accept()
125{
126 QString url;
127 logger = new ProgressLoggerGui(this);
128 logger->show();
129 QString mountPoint = RbSettings::value(RbSettings::Mountpoint).toString();
130 qDebug() << "[Install] mountpoint:" << mountPoint;
131 // show dialog with error if mount point is wrong
132 if(!QFileInfo(mountPoint).isDir()) {
133 logger->addItem(tr("Mount point is wrong!"),LOGERROR);
134 logger->setFinished();
135 return;
136 }
137
138 QString myversion;
139 if(ui.radioStable->isChecked()) {
140 url = ServerInfo::value(ServerInfo::CurReleaseUrl).toString();
141 RbSettings::setValue(RbSettings::Build, "stable");
142 myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString();
143 }
144 else if(ui.radioCurrent->isChecked()) {
145 url = ServerInfo::value(ServerInfo::CurDevelUrl).toString();
146 RbSettings::setValue(RbSettings::Build, "current");
147 myversion = "r" + ServerInfo::value(ServerInfo::BleedingRevision).toString();
148 }
149 else if(ui.radioCandidate->isChecked()) {
150 url = ServerInfo::value(ServerInfo::RelCandidateUrl).toString();
151 RbSettings::setValue(RbSettings::Build, "rc");
152 myversion = ServerInfo::value(ServerInfo::RelCandidateVersion).toString();
153 }
154 else {
155 qDebug() << "[Install] no build selected -- this shouldn't happen";
156 return;
157 }
158 RbSettings::sync();
159
160 QString warning = Utils::checkEnvironment(false);
161 if(!warning.isEmpty())
162 {
163 if(QMessageBox::warning(this, tr("Really continue?"), warning,
164 QMessageBox::Ok | QMessageBox::Abort, QMessageBox::Abort)
165 == QMessageBox::Abort)
166 {
167 logger->addItem(tr("Aborted!"),LOGERROR);
168 logger->setFinished();
169 return;
170 }
171 }
172
173 //! check if we should backup
174 if(ui.backup->isChecked())
175 {
176 logger->addItem(tr("Beginning Backup..."),LOGINFO);
177 QCoreApplication::processEvents();
178
179 //! create dir, if it doesnt exist
180 QFileInfo backupFile(m_backupName);
181 if(!QDir(backupFile.path()).exists())
182 {
183 QDir a;
184 a.mkpath(backupFile.path());
185 }
186
187 //! create backup
188 bool result = true;
189 ZipUtil zip(this);
190 connect(&zip, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
191 connect(&zip, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
192 zip.open(m_backupName, QuaZip::mdCreate);
193 QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
194 QString folder = mp + "/.rockbox";
195 result = zip.appendDirToArchive(folder, mp);
196 zip.close();
197 if(result) {
198 logger->addItem(tr("Backup finished."), LOGINFO);
199 }
200 else {
201 logger->addItem(tr("Backup failed!"), LOGERROR);
202 logger->setFinished();
203 return;
204 }
205 }
206
207 //! install build
208 installer = new ZipInstaller(this);
209 installer->setUrl(url);
210 installer->setLogSection("Rockbox (Base)");
211 if(!RbSettings::value(RbSettings::CacheDisabled).toBool()
212 && !ui.checkBoxCache->isChecked())
213 {
214 installer->setCache(true);
215 }
216 installer->setLogVersion(myversion);
217 installer->setMountPoint(mountPoint);
218
219 connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
220
221 connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
222 connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
223 connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished()));
224 connect(logger, SIGNAL(aborted()), installer, SLOT(abort()));
225 installer->install();
226
227}
228
229void InstallWindow::changeBackupPath()
230{
231 QString backupString = QFileDialog::getSaveFileName(this,
232 tr("Select Backup Filename"), m_backupName, "*.zip");
233 // only update if a filename was entered, ignore if cancelled
234 if(!backupString.isEmpty()) {
235 m_backupName = backupString;
236 updateBackupLocation();
237 }
238}
239
240
241// Zip installer has finished
242void InstallWindow::done(bool error)
243{
244 qDebug() << "[Install] done, error:" << error;
245
246 if(error)
247 {
248 logger->setFinished();
249 return;
250 }
251
252 // no error, close the window, when the logger is closed
253 connect(logger,SIGNAL(closed()),this,SLOT(close()));
254 // add platform info to log file for later detection
255 QSettings installlog(RbSettings::value(RbSettings::Mountpoint).toString()
256 + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
257 installlog.setValue("platform", RbSettings::value(RbSettings::Platform).toString());
258 installlog.sync();
259}
260
261
262void InstallWindow::setDetailsCurrent(bool show)
263{
264 if(show) {
265 ui.labelDetails->setText(tr("This is the absolute up to the minute "
266 "Rockbox built. The development version will get updated every time "
267 "a change is made. Latest development version is %1 (%2).")
268 .arg(ServerInfo::value(ServerInfo::BleedingRevision).toString(),
269 ServerInfo::value(ServerInfo::BleedingDate).toString()));
270 }
271}
272
273
274void InstallWindow::setDetailsStable(bool show)
275{
276 if(show) {
277 ui.labelDetails->setText(
278 tr("This is the last released version of Rockbox."));
279
280 if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
281 ui.labelNote->setText(tr("<b>Note:</b> "
282 "The lastest stable version is %1.")
283 .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()));
284 else ui.labelNote->setText("");
285 }
286}
287
288
289void InstallWindow::setDetailsCandidate(bool show)
290{
291 if(show) {
292 ui.labelDetails->setText(
293 tr("This is the release candidate for the next Rockbox version."
294 "<br/>A release candidate is intended for testing. It will "
295 "receive bugfixes and eventually become the next stable "
296 "release of Rockbox. If you want to help testing Rockbox and "
297 "improve the next release install the release candidate."));
298
299 if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
300 ui.labelNote->setText(tr("<b>Note:</b> "
301 "The lastest release candidate is %1.")
302 .arg(ServerInfo::value(ServerInfo::RelCandidateVersion).toString()));
303 else ui.labelNote->setText("");
304 }
305}
306
307
308void InstallWindow::changeEvent(QEvent *e)
309{
310 if(e->type() == QEvent::LanguageChange) {
311 ui.retranslateUi(this);
312 } else {
313 QWidget::changeEvent(e);
314 }
315}
316
diff --git a/rbutil/rbutilqt/installwindow.h b/rbutil/rbutilqt/installwindow.h
deleted file mode 100644
index 140782088d..0000000000
--- a/rbutil/rbutilqt/installwindow.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Riebeling
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21#ifndef INSTALL_H
22#define INSTALL_H
23
24#include <QtGui>
25
26#include "ui_installwindowfrm.h"
27#include "zipinstaller.h"
28#include "progressloggergui.h"
29
30class InstallWindow : public QDialog
31{
32 Q_OBJECT
33 public:
34 InstallWindow(QWidget *parent);
35
36 public slots:
37 void accept(void);
38
39 private:
40 Ui::InstallWindowFrm ui;
41 ProgressLoggerGui* logger;
42 QHttp *download;
43 QFile *target;
44 ZipInstaller* installer;
45 QString m_backupName;
46 void resizeEvent(QResizeEvent*);
47 void changeEvent(QEvent *event);
48
49 void changeBackupPath(QString);
50 void updateBackupLocation(void);
51
52 private slots:
53 void setDetailsCurrent(bool);
54 void setDetailsStable(bool);
55 void setDetailsCandidate(bool);
56 void done(bool);
57 void changeBackupPath(void);
58 void backupCheckboxChanged(int state);
59
60};
61
62
63#endif
diff --git a/rbutil/rbutilqt/installwindowfrm.ui b/rbutil/rbutilqt/installwindowfrm.ui
deleted file mode 100644
index 67ab40b991..0000000000
--- a/rbutil/rbutilqt/installwindowfrm.ui
+++ /dev/null
@@ -1,251 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0" >
3 <class>InstallWindowFrm</class>
4 <widget class="QDialog" name="InstallWindowFrm" >
5 <property name="windowModality" >
6 <enum>Qt::WindowModal</enum>
7 </property>
8 <property name="geometry" >
9 <rect>
10 <x>0</x>
11 <y>0</y>
12 <width>644</width>
13 <height>448</height>
14 </rect>
15 </property>
16 <property name="windowTitle" >
17 <string>Install Rockbox</string>
18 </property>
19 <layout class="QGridLayout" name="gridLayout_2" >
20 <item row="0" column="0" rowspan="9" >
21 <widget class="QLabel" name="label" >
22 <property name="text" >
23 <string/>
24 </property>
25 <property name="pixmap" >
26 <pixmap resource="rbutilqt.qrc" >:/icons/wizard.jpg</pixmap>
27 </property>
28 <property name="alignment" >
29 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
30 </property>
31 </widget>
32 </item>
33 <item row="0" column="1" colspan="3" >
34 <widget class="QLabel" name="label_4" >
35 <property name="text" >
36 <string>Please select the Rockbox version you want to install on your player:</string>
37 </property>
38 <property name="wordWrap" >
39 <bool>true</bool>
40 </property>
41 </widget>
42 </item>
43 <item row="1" column="1" colspan="3" >
44 <widget class="QGroupBox" name="groupBox" >
45 <property name="title" >
46 <string>Version</string>
47 </property>
48 <layout class="QVBoxLayout" >
49 <item>
50 <widget class="QRadioButton" name="radioStable" >
51 <property name="text" >
52 <string>&amp;Stable release</string>
53 </property>
54 </widget>
55 </item>
56 <item>
57 <widget class="QRadioButton" name="radioCandidate" >
58 <property name="text" >
59 <string>Release &amp;Candidate</string>
60 </property>
61 </widget>
62 </item>
63 <item>
64 <widget class="QRadioButton" name="radioCurrent" >
65 <property name="text" >
66 <string>&amp;Development build</string>
67 </property>
68 </widget>
69 </item>
70 </layout>
71 </widget>
72 </item>
73 <item row="2" column="1" colspan="3" >
74 <widget class="QGroupBox" name="groupBox_2" >
75 <property name="sizePolicy" >
76 <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding" >
77 <horstretch>0</horstretch>
78 <verstretch>0</verstretch>
79 </sizepolicy>
80 </property>
81 <property name="title" >
82 <string>Details</string>
83 </property>
84 <layout class="QGridLayout" name="gridLayout_3" >
85 <item row="0" column="0" >
86 <widget class="QLabel" name="labelDetails" >
87 <property name="text" >
88 <string>Details about the selected version</string>
89 </property>
90 <property name="wordWrap" >
91 <bool>true</bool>
92 </property>
93 </widget>
94 </item>
95 <item row="1" column="0" >
96 <widget class="QLabel" name="labelNote" >
97 <property name="text" >
98 <string>Note</string>
99 </property>
100 <property name="wordWrap" >
101 <bool>true</bool>
102 </property>
103 </widget>
104 </item>
105 </layout>
106 </widget>
107 </item>
108 <item row="8" column="1" >
109 <spacer>
110 <property name="orientation" >
111 <enum>Qt::Horizontal</enum>
112 </property>
113 <property name="sizeHint" stdset="0" >
114 <size>
115 <width>40</width>
116 <height>20</height>
117 </size>
118 </property>
119 </spacer>
120 </item>
121 <item row="8" column="2" colspan="2" >
122 <layout class="QHBoxLayout" >
123 <item>
124 <widget class="QPushButton" name="buttonOk" >
125 <property name="text" >
126 <string>&amp;Install</string>
127 </property>
128 <property name="icon" >
129 <iconset resource="rbutilqt.qrc" >
130 <normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
131 </property>
132 </widget>
133 </item>
134 <item>
135 <widget class="QPushButton" name="buttonCancel" >
136 <property name="text" >
137 <string>&amp;Cancel</string>
138 </property>
139 <property name="icon" >
140 <iconset resource="rbutilqt.qrc" >
141 <normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
142 </property>
143 </widget>
144 </item>
145 </layout>
146 </item>
147 <item row="7" column="2" >
148 <spacer>
149 <property name="orientation" >
150 <enum>Qt::Vertical</enum>
151 </property>
152 <property name="sizeHint" stdset="0" >
153 <size>
154 <width>20</width>
155 <height>1</height>
156 </size>
157 </property>
158 </spacer>
159 </item>
160 <item row="3" column="1" colspan="3" >
161 <widget class="QGroupBox" name="Backupgroup" >
162 <property name="title" >
163 <string>Backup</string>
164 </property>
165 <layout class="QGridLayout" name="gridLayout" >
166 <item row="0" column="0" colspan="2" >
167 <widget class="QCheckBox" name="backup" >
168 <property name="text" >
169 <string>Backup before installing</string>
170 </property>
171 </widget>
172 </item>
173 <item row="1" column="0" colspan="2" >
174 <widget class="QLabel" name="backupLocation" >
175 <property name="text" >
176 <string>Backup location</string>
177 </property>
178 </widget>
179 </item>
180 <item row="1" column="2" >
181 <widget class="QPushButton" name="changeBackup" >
182 <property name="sizePolicy" >
183 <sizepolicy hsizetype="Minimum" vsizetype="Fixed" >
184 <horstretch>0</horstretch>
185 <verstretch>0</verstretch>
186 </sizepolicy>
187 </property>
188 <property name="maximumSize" >
189 <size>
190 <width>60</width>
191 <height>16777215</height>
192 </size>
193 </property>
194 <property name="text" >
195 <string>Change</string>
196 </property>
197 </widget>
198 </item>
199 </layout>
200 </widget>
201 </item>
202 <item row="5" column="1" >
203 <widget class="QCheckBox" name="checkBoxCache" >
204 <property name="toolTip" >
205 <string>Rockbox Utility stores copies of Rockbox it has downloaded on the local hard disk to save network traffic. If your local copy is no longer working, tick this box to download a fresh copy.</string>
206 </property>
207 <property name="text" >
208 <string>&amp;Don't use locally cached copy</string>
209 </property>
210 </widget>
211 </item>
212 </layout>
213 </widget>
214 <resources>
215 <include location="rbutilqt.qrc" />
216 </resources>
217 <connections>
218 <connection>
219 <sender>buttonOk</sender>
220 <signal>clicked()</signal>
221 <receiver>InstallWindowFrm</receiver>
222 <slot>accept()</slot>
223 <hints>
224 <hint type="sourcelabel" >
225 <x>562</x>
226 <y>420</y>
227 </hint>
228 <hint type="destinationlabel" >
229 <x>500</x>
230 <y>352</y>
231 </hint>
232 </hints>
233 </connection>
234 <connection>
235 <sender>buttonCancel</sender>
236 <signal>clicked()</signal>
237 <receiver>InstallWindowFrm</receiver>
238 <slot>reject()</slot>
239 <hints>
240 <hint type="sourcelabel" >
241 <x>658</x>
242 <y>429</y>
243 </hint>
244 <hint type="destinationlabel" >
245 <x>611</x>
246 <y>360</y>
247 </hint>
248 </hints>
249 </connection>
250 </connections>
251</ui>
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 575859fd46..b1065936f7 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -23,7 +23,6 @@
23#include "ui_rbutilqtfrm.h" 23#include "ui_rbutilqtfrm.h"
24#include "ui_aboutbox.h" 24#include "ui_aboutbox.h"
25#include "configure.h" 25#include "configure.h"
26#include "installwindow.h"
27#include "installtalkwindow.h" 26#include "installtalkwindow.h"
28#include "createvoicewindow.h" 27#include "createvoicewindow.h"
29#include "httpget.h" 28#include "httpget.h"
@@ -40,6 +39,7 @@
40#include "ziputil.h" 39#include "ziputil.h"
41#include "manualwidget.h" 40#include "manualwidget.h"
42#include "infowidget.h" 41#include "infowidget.h"
42#include "selectiveinstallwidget.h"
43#include "backupdialog.h" 43#include "backupdialog.h"
44 44
45#include "progressloggerinterface.h" 45#include "progressloggerinterface.h"
@@ -122,18 +122,19 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
122 manual = new ManualWidget(this); 122 manual = new ManualWidget(this);
123 mantablayout->addWidget(manual); 123 mantablayout->addWidget(manual);
124 124
125 // selective "install" tab.
126 QGridLayout *selectivetablayout = new QGridLayout(this);
127 ui.selective->setLayout(selectivetablayout);
128 selectiveinstallwidget = new SelectiveInstallWidget(this);
129 selectivetablayout->addWidget(selectiveinstallwidget);
130 connect(ui.buttonChangeDevice, SIGNAL(clicked()), selectiveinstallwidget, SLOT(saveSettings()));
131
125 // info tab 132 // info tab
126 QGridLayout *infotablayout = new QGridLayout(this); 133 QGridLayout *infotablayout = new QGridLayout(this);
127 ui.info->setLayout(infotablayout); 134 ui.info->setLayout(infotablayout);
128 info = new InfoWidget(this); 135 info = new InfoWidget(this);
129 infotablayout->addWidget(info); 136 infotablayout->addWidget(info);
130 137
131 // disable quick install until version info is available
132 ui.buttonSmall->setEnabled(false);
133 ui.buttonComplete->setEnabled(false);
134 ui.actionSmall_Installation->setEnabled(false);
135 ui.actionComplete_Installation->setEnabled(false);
136
137 connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int))); 138 connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
138 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); 139 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
139 connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about())); 140 connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
@@ -141,28 +142,14 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
141 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog())); 142 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
142 connect(ui.actionE_xit, SIGNAL(triggered()), this, SLOT(shutdown())); 143 connect(ui.actionE_xit, SIGNAL(triggered()), this, SLOT(shutdown()));
143 connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog())); 144 connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog()));
144 connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(installBtn()));
145 connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBootloaderBtn()));
146 connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFontsBtn()));
147 connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoomBtn()));
148 connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles())); 145 connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles()));
149 connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile())); 146 connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile()));
150 connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice())); 147 connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice()));
151 connect(ui.buttonThemes, SIGNAL(clicked()), this, SLOT(installThemes()));
152 connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); 148 connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall()));
153 connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader())); 149 connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader()));
154 connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall()));
155 connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall()));
156 connect(ui.buttonBackup, SIGNAL(clicked()), this, SLOT(backup())); 150 connect(ui.buttonBackup, SIGNAL(clicked()), this, SLOT(backup()));
157 151
158 // actions accessible from the menu 152 // actions accessible from the menu
159 connect(ui.actionComplete_Installation, SIGNAL(triggered()), this, SLOT(completeInstall()));
160 connect(ui.actionSmall_Installation, SIGNAL(triggered()), this, SLOT(smallInstall()));
161 connect(ui.actionInstall_Bootloader, SIGNAL(triggered()), this, SLOT(installBootloaderBtn()));
162 connect(ui.actionInstall_Rockbox, SIGNAL(triggered()), this, SLOT(installBtn()));
163 connect(ui.actionFonts_Package, SIGNAL(triggered()), this, SLOT(installFontsBtn()));
164 connect(ui.actionInstall_Themes, SIGNAL(triggered()), this, SLOT(installThemes()));
165 connect(ui.actionInstall_Game_Files, SIGNAL(triggered()), this, SLOT(installDoomBtn()));
166 connect(ui.actionInstall_Voice_File, SIGNAL(triggered()), this, SLOT(installVoice())); 153 connect(ui.actionInstall_Voice_File, SIGNAL(triggered()), this, SLOT(installVoice()));
167 connect(ui.actionCreate_Voice_File, SIGNAL(triggered()), this, SLOT(createVoiceFile())); 154 connect(ui.actionCreate_Voice_File, SIGNAL(triggered()), this, SLOT(createVoiceFile()));
168 connect(ui.actionCreate_Talk_Files, SIGNAL(triggered()), this, SLOT(createTalkFiles())); 155 connect(ui.actionCreate_Talk_Files, SIGNAL(triggered()), this, SLOT(createTalkFiles()));
@@ -336,6 +323,7 @@ void RbUtilQt::updateSettings()
336 "now open to allow you to correct the problem.")); 323 "now open to allow you to correct the problem."));
337 configDialog(); 324 configDialog();
338 } 325 }
326 selectiveinstallwidget->updateVersion();
339} 327}
340 328
341 329
@@ -347,9 +335,6 @@ void RbUtilQt::updateDevice()
347 /* Enable bootloader installation, if possible */ 335 /* Enable bootloader installation, if possible */
348 bool bootloaderInstallable = 336 bool bootloaderInstallable =
349 SystemInfo::value(SystemInfo::CurBootloaderMethod) != "none"; 337 SystemInfo::value(SystemInfo::CurBootloaderMethod) != "none";
350 ui.buttonBootloader->setEnabled(bootloaderInstallable);
351 ui.labelBootloader->setEnabled(bootloaderInstallable);
352 ui.actionInstall_Bootloader->setEnabled(bootloaderInstallable);
353 338
354 /* Enable bootloader uninstallation, if possible */ 339 /* Enable bootloader uninstallation, if possible */
355 bool bootloaderUninstallable = bootloaderInstallable && 340 bool bootloaderUninstallable = bootloaderInstallable &&
@@ -387,12 +372,6 @@ void RbUtilQt::updateDevice()
387 pm = pm.scaledToHeight(QFontMetrics(QApplication::font()).height() * 3); 372 pm = pm.scaledToHeight(QFontMetrics(QApplication::font()).height() * 3);
388 ui.labelPlayerPic->setPixmap(pm); 373 ui.labelPlayerPic->setPixmap(pm);
389 374
390 // hide quickstart buttons if no release available
391 bool installable = !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty();
392 ui.buttonSmall->setEnabled(installable);
393 ui.buttonComplete->setEnabled(installable);
394 ui.actionSmall_Installation->setEnabled(installable);
395 ui.actionComplete_Installation->setEnabled(installable);
396} 375}
397 376
398 377
@@ -400,131 +379,9 @@ void RbUtilQt::backup(void)
400{ 379{
401 backupdialog = new BackupDialog(this); 380 backupdialog = new BackupDialog(this);
402 backupdialog->show(); 381 backupdialog->show();
403}
404
405
406void RbUtilQt::completeInstall()
407{
408 if(chkConfig(this)) return;
409 if(QMessageBox::question(this, tr("Confirm Installation"),
410 tr("Do you really want to perform a complete installation?\n\n"
411 "This will install Rockbox %1. To install the most recent "
412 "development build available press \"Cancel\" and "
413 "use the \"Installation\" tab.")
414 .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()),
415 QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
416 return;
417 // create logger
418 logger = new ProgressLoggerGui(this);
419 logger->show();
420
421 if(smallInstallInner())
422 return;
423 logger->setRunning();
424 // Fonts
425 m_error = false;
426 m_installed = false;
427 if(!installFontsAuto())
428 return;
429 else
430 {
431 // wait for installation finished
432 while(!m_installed)
433 QApplication::processEvents();
434 }
435 if(m_error) return;
436 logger->setRunning();
437
438 // Doom
439 if(hasDoom())
440 {
441 m_error = false;
442 m_installed = false;
443 if(!installDoomAuto())
444 return;
445 else
446 {
447 // wait for installation finished
448 while(!m_installed)
449 QApplication::processEvents();
450 }
451 if(m_error) return;
452 }
453
454 // theme
455 // this is a window
456 // it has its own logger window,so close our.
457 logger->close();
458 installThemes();
459 382
460} 383}
461 384
462void RbUtilQt::smallInstall()
463{
464 if(chkConfig(this)) return;
465 if(QMessageBox::question(this, tr("Confirm Installation"),
466 tr("Do you really want to perform a minimal installation? "
467 "A minimal installation will contain only the absolutely "
468 "necessary parts to run Rockbox.\n\n"
469 "This will install Rockbox %1. To install the most recent "
470 "development build available press \"Cancel\" and "
471 "use the \"Installation\" tab.")
472 .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()),
473 QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
474 return;
475
476 // create logger
477 logger = new ProgressLoggerGui(this);
478 logger->show();
479
480 smallInstallInner();
481}
482
483bool RbUtilQt::smallInstallInner()
484{
485 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
486 // show dialog with error if mount point is wrong
487 if(!QFileInfo(mountpoint).isDir()) {
488 logger->addItem(tr("Mount point is wrong!"),LOGERROR);
489 logger->setFinished();
490 return true;
491 }
492 // Bootloader
493 if(SystemInfo::value(SystemInfo::CurBootloaderMethod) != "none")
494 {
495 m_error = false;
496 m_installed = false;
497 m_auto = true;
498 if(!installBootloaderAuto()) {
499 logger->setFinished();
500 return true;
501 }
502 else
503 {
504 // wait for boot loader installation finished
505 while(!m_installed)
506 QApplication::processEvents();
507 }
508 m_auto = false;
509 if(m_error) return true;
510 logger->setRunning();
511 }
512
513 // Rockbox
514 m_error = false;
515 m_installed = false;
516 if(!installAuto())
517 return true;
518 else
519 {
520 // wait for installation finished
521 while(!m_installed)
522 QApplication::processEvents();
523 }
524
525 installBootloaderPost(false);
526 return false;
527}
528 385
529void RbUtilQt::installdone(bool error) 386void RbUtilQt::installdone(bool error)
530{ 387{
@@ -533,339 +390,6 @@ void RbUtilQt::installdone(bool error)
533 m_error = error; 390 m_error = error;
534} 391}
535 392
536void RbUtilQt::installBtn()
537{
538 if(chkConfig(this)) return;
539 install();
540}
541
542bool RbUtilQt::installAuto()
543{
544 QString file = ServerInfo::value(ServerInfo::CurReleaseUrl).toString();
545
546 // check installed Version and Target
547 QString warning = Utils::checkEnvironment(false);
548 if(!warning.isEmpty())
549 {
550 if(QMessageBox::warning(this, tr("Really continue?"), warning,
551 QMessageBox::Ok | QMessageBox::Abort, QMessageBox::Abort)
552 == QMessageBox::Abort)
553 {
554 logger->addItem(tr("Aborted!"), LOGERROR);
555 logger->setFinished();
556 return false;
557 }
558 }
559
560 // check version
561 RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString());
562 if(rbinfo.version() != "")
563 {
564 if(QMessageBox::question(this, tr("Installed Rockbox detected"),
565 tr("Rockbox installation detected. Do you want to backup first?"),
566 QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
567 {
568 bool result;
569 logger->addItem(tr("Starting backup..."),LOGINFO);
570 QString backupName = RbSettings::value(RbSettings::Mountpoint).toString()
571 + "/.backup/rockbox-backup-" + rbinfo.version() + ".zip";
572
573 //! create dir, if it doesnt exist
574 QFileInfo backupFile(backupName);
575 if(!QDir(backupFile.path()).exists())
576 {
577 QDir a;
578 a.mkpath(backupFile.path());
579 }
580
581 logger->addItem(tr("Beginning Backup..."),LOGINFO);
582 QCoreApplication::processEvents();
583
584 //! create backup
585 ZipUtil zip(this);
586 connect(&zip, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
587 connect(&zip, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
588 zip.open(backupName, QuaZip::mdCreate);
589 QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
590 QString folder = mp + "/.rockbox";
591 result = zip.appendDirToArchive(folder, mp);
592 zip.close();
593 if(result)
594 {
595 logger->addItem(tr("Backup successful"),LOGOK);
596 }
597 else
598 {
599 logger->addItem(tr("Backup failed!"),LOGERROR);
600 logger->setFinished();
601 return false;
602 }
603 }
604 }
605
606 //! install current build
607 ZipInstaller* installer = new ZipInstaller(this);
608 installer->setUrl(file);
609 installer->setLogSection("Rockbox (Base)");
610 installer->setLogVersion(ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
611 if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
612 installer->setCache(true);
613 installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
614
615 connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool)));
616 connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
617 connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
618 connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished()));
619 connect(logger, SIGNAL(aborted()), installer, SLOT(abort()));
620 installer->install();
621 return true;
622}
623
624
625void RbUtilQt::install()
626{
627 InstallWindow *installWindow = new InstallWindow(this);
628 installWindow->show();
629}
630
631bool RbUtilQt::installBootloaderAuto()
632{
633 installBootloader();
634 return !m_error;
635}
636
637void RbUtilQt::installBootloaderBtn()
638{
639 if(chkConfig(this)) return;
640 if(QMessageBox::question(this, tr("Confirm Installation"),
641 tr("Do you really want to install the Bootloader?"),
642 QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
643
644 // create logger
645 logger = new ProgressLoggerGui(this);
646 logger->show();
647 installBootloader();
648}
649
650void RbUtilQt::installBootloader()
651{
652 QString platform = RbSettings::value(RbSettings::Platform).toString();
653 QString backupDestination = "";
654 m_error = false;
655
656 // create installer
657 BootloaderInstallBase *bl =
658 BootloaderInstallHelper::createBootloaderInstaller(this,
659 SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
660 if(bl == NULL) {
661 logger->addItem(tr("No install method known."), LOGERROR);
662 logger->setFinished();
663 return;
664 }
665
666 // the bootloader install class does NOT use any GUI stuff.
667 // All messages are passed via signals.
668 connect(bl, SIGNAL(done(bool)), logger, SLOT(setFinished()));
669 connect(bl, SIGNAL(done(bool)), this, SLOT(installBootloaderPost(bool)));
670 connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
671 connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
672
673 // set bootloader filename. Do this now as installed() needs it.
674 QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList();
675 QStringList blfilepath;
676 for(int a = 0; a < blfile.size(); a++) {
677 blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
678 + blfile.at(a));
679 }
680 bl->setBlFile(blfilepath);
681 QUrl url(SystemInfo::value(SystemInfo::BootloaderUrl).toString()
682 + SystemInfo::value(SystemInfo::CurBootloaderName).toString());
683 bl->setBlUrl(url);
684 bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString()
685 + "/.rockbox/rbutil.log");
686
687 if(bl->installed() == BootloaderInstallBase::BootloaderRockbox) {
688 if(QMessageBox::question(this, tr("Bootloader detected"),
689 tr("Bootloader already installed. Do you want to reinstall the bootloader?"),
690 QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
691 if(m_auto) {
692 // keep logger open for auto installs.
693 // don't consider abort as error in auto-mode.
694 logger->addItem(tr("Bootloader installation skipped"), LOGINFO);
695 installBootloaderPost(false);
696 }
697 else {
698 logger->close();
699 installBootloaderPost(true);
700 }
701 delete bl;
702 return;
703 }
704 }
705 else if(bl->installed() == BootloaderInstallBase::BootloaderOther
706 && bl->capabilities() & BootloaderInstallBase::Backup)
707 {
708 QString targetFolder = SystemInfo::value(SystemInfo::CurPlatformName).toString()
709 + " Firmware Backup";
710 // remove invalid character(s)
711 targetFolder.remove(QRegExp("[:/]"));
712 if(QMessageBox::question(this, tr("Create Bootloader backup"),
713 tr("You can create a backup of the original bootloader "
714 "file. Press \"Yes\" to select an output folder on your "
715 "computer to save the file to. The file will get placed "
716 "in a new folder \"%1\" created below the selected folder.\n"
717 "Press \"No\" to skip this step.").arg(targetFolder),
718 QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
719 backupDestination = QFileDialog::getExistingDirectory(this,
720 tr("Browse backup folder"), QDir::homePath());
721 if(!backupDestination.isEmpty())
722 backupDestination += "/" + targetFolder;
723
724 qDebug() << "[RbUtil] backing up to" << backupDestination;
725 // backup needs to be done after the logger has been set up.
726 }
727 }
728
729 if(bl->capabilities() & BootloaderInstallBase::NeedsOf)
730 {
731 int ret;
732 ret = QMessageBox::information(this, tr("Prerequisites"),
733 bl->ofHint(),QMessageBox::Ok | QMessageBox::Abort);
734 if(ret != QMessageBox::Ok) {
735 // consider aborting an error to close window / abort automatic
736 // installation.
737 m_error = true;
738 logger->addItem(tr("Bootloader installation aborted"), LOGINFO);
739 logger->setFinished();
740 return;
741 }
742 // open dialog to browse to of file
743 QString offile;
744 QString filter
745 = SystemInfo::value(SystemInfo::CurBootloaderFilter).toString();
746 if(!filter.isEmpty()) {
747 filter = tr("Bootloader files (%1)").arg(filter) + ";;";
748 }
749 filter += tr("All files (*)");
750 offile = QFileDialog::getOpenFileName(this,
751 tr("Select firmware file"), QDir::homePath(), filter);
752 if(!QFileInfo(offile).isReadable()) {
753 logger->addItem(tr("Error opening firmware file"), LOGERROR);
754 logger->setFinished();
755 m_error = true;
756 return;
757 }
758 if(!bl->setOfFile(offile, blfile)) {
759 logger->addItem(tr("Error reading firmware file"), LOGERROR);
760 logger->setFinished();
761 m_error = true;
762 return;
763 }
764 }
765
766 // start install.
767 if(!backupDestination.isEmpty()) {
768 if(!bl->backup(backupDestination)) {
769 if(QMessageBox::warning(this, tr("Backup error"),
770 tr("Could not create backup file. Continue?"),
771 QMessageBox::No | QMessageBox::Yes)
772 == QMessageBox::No) {
773 logger->setFinished();
774 return;
775 }
776 }
777 }
778 bl->install();
779}
780
781void RbUtilQt::installBootloaderPost(bool error)
782{
783 qDebug() << "[RbUtil] Bootloader Post-Installation, error state:" << error;
784 // if an error occured don't perform post install steps.
785 if(error) {
786 m_error = true;
787 return;
788 }
789 else
790 m_error = false;
791
792 m_installed = true;
793 // end here if automated install
794 if(m_auto)
795 return;
796
797 QString msg = BootloaderInstallHelper::postinstallHints(
798 RbSettings::value(RbSettings::Platform).toString());
799 if(!msg.isEmpty()) {
800 QMessageBox::information(this, tr("Manual steps required"), msg);
801 logger->close();
802 }
803
804}
805
806void RbUtilQt::installFontsBtn()
807{
808 if(chkConfig(this)) return;
809 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
810 RockboxInfo installInfo(mountpoint);
811 if(installInfo.revision().isEmpty() && installInfo.release().isEmpty()) {
812 QMessageBox::critical(this, tr("No Rockbox installation found"),
813 tr("Could not determine the installed Rockbox version. "
814 "Please install a Rockbox build before installing "
815 "fonts."));
816 return;
817 }
818 if(QMessageBox::question(this, tr("Confirm Installation"),
819 tr("Do you really want to install the fonts package?"),
820 QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
821 // create logger
822 logger = new ProgressLoggerGui(this);
823 logger->show();
824 installFonts();
825}
826
827bool RbUtilQt::installFontsAuto()
828{
829 installFonts();
830
831 return !m_error;
832}
833
834void RbUtilQt::installFonts()
835{
836 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
837 RockboxInfo installInfo(mountpoint);
838 QString fontsurl;
839 QString logversion;
840 QString relversion = installInfo.release();
841 if(relversion.isEmpty()) {
842 // release is empty for non-release versions (i.e. daily / current)
843 fontsurl = SystemInfo::value(SystemInfo::DailyFontUrl).toString();
844 }
845 else {
846 fontsurl = SystemInfo::value(SystemInfo::ReleaseFontUrl).toString();
847 logversion = installInfo.release();
848 }
849 fontsurl.replace("%RELEASEVER%", relversion);
850
851 // create zip installer
852 installer = new ZipInstaller(this);
853 installer->setUrl(fontsurl);
854 installer->setLogSection("Fonts");
855 installer->setLogVersion(logversion);
856 installer->setMountPoint(mountpoint);
857 if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
858 installer->setCache(true);
859
860 connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool)));
861 connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
862 connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
863 connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished()));
864 connect(logger, SIGNAL(aborted()), installer, SLOT(abort()));
865 installer->install();
866}
867
868
869void RbUtilQt::installVoice() 393void RbUtilQt::installVoice()
870{ 394{
871 if(chkConfig(this)) return; 395 if(chkConfig(this)) return;
@@ -938,64 +462,6 @@ void RbUtilQt::installVoice()
938 462
939} 463}
940 464
941void RbUtilQt::installDoomBtn()
942{
943 if(chkConfig(this)) return;
944 if(!hasDoom()){
945 QMessageBox::critical(this, tr("Error"),
946 tr("Your device doesn't have a doom plugin. Aborting."));
947 return;
948 }
949
950 if(QMessageBox::question(this, tr("Confirm Installation"),
951 tr("Do you really want to install the game addon files?"),
952 QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
953 // create logger
954 logger = new ProgressLoggerGui(this);
955 logger->show();
956
957 installDoom();
958}
959bool RbUtilQt::installDoomAuto()
960{
961 installDoom();
962 return !m_error;
963}
964
965bool RbUtilQt::hasDoom()
966{
967 QFile doomrock(RbSettings::value(RbSettings::Mountpoint).toString()
968 +"/.rockbox/rocks/games/doom.rock");
969 return doomrock.exists();
970}
971
972void RbUtilQt::installDoom()
973{
974 // create zip installer
975 installer = new ZipInstaller(this);
976
977 installer->setUrl(SystemInfo::value(SystemInfo::DoomUrl).toString());
978 installer->setLogSection("Game Addons");
979 installer->setLogVersion();
980 installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
981 if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
982 installer->setCache(true);
983 connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool)));
984 connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
985 connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
986 connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished()));
987 connect(logger, SIGNAL(aborted()), installer, SLOT(abort()));
988 installer->install();
989
990}
991
992void RbUtilQt::installThemes()
993{
994 if(chkConfig(this)) return;
995 ThemesInstallWindow* tw = new ThemesInstallWindow(this);
996 tw->setModal(true);
997 tw->show();
998}
999 465
1000void RbUtilQt::createTalkFiles(void) 466void RbUtilQt::createTalkFiles(void)
1001{ 467{
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h
index 3e57af589b..1db100430a 100644
--- a/rbutil/rbutilqt/rbutilqt.h
+++ b/rbutil/rbutilqt/rbutilqt.h
@@ -34,6 +34,7 @@
34#include "bootloaderinstallbase.h" 34#include "bootloaderinstallbase.h"
35#include "manualwidget.h" 35#include "manualwidget.h"
36#include "infowidget.h" 36#include "infowidget.h"
37#include "selectiveinstallwidget.h"
37#include "backupdialog.h" 38#include "backupdialog.h"
38 39
39class RbUtilQt : public QMainWindow 40class RbUtilQt : public QMainWindow
@@ -48,6 +49,7 @@ class RbUtilQt : public QMainWindow
48 private: 49 private:
49 ManualWidget *manual; 50 ManualWidget *manual;
50 InfoWidget *info; 51 InfoWidget *info;
52 SelectiveInstallWidget* selectiveinstallwidget;
51 BackupDialog *backupdialog; 53 BackupDialog *backupdialog;
52 Ui::RbUtilQtFrm ui; 54 Ui::RbUtilQtFrm ui;
53 55
@@ -81,29 +83,8 @@ class RbUtilQt : public QMainWindow
81 void updateDevice(void); 83 void updateDevice(void);
82 void updateSettings(void); 84 void updateSettings(void);
83 85
84 void completeInstall(void);
85 void smallInstall(void);
86 bool smallInstallInner(void);
87 void installdone(bool error); 86 void installdone(bool error);
88 87
89 void installBtn(void);
90 bool installAuto(void);
91 void install(void);
92
93 void installBootloaderBtn(void);
94 bool installBootloaderAuto(void);
95 void installBootloader(void);
96 void installBootloaderPost(bool error);
97
98 void installFontsBtn(void);
99 bool installFontsAuto(void);
100 void installFonts(void);
101
102 bool hasDoom(void);
103 void installDoomBtn(void);
104 bool installDoomAuto(void);
105 void installDoom(void);
106
107 void createTalkFiles(void); 88 void createTalkFiles(void);
108 void createVoiceFile(void); 89 void createVoiceFile(void);
109 void downloadDone(bool); 90 void downloadDone(bool);
@@ -111,7 +92,6 @@ class RbUtilQt : public QMainWindow
111 void backup(void); 92 void backup(void);
112 93
113 void installVoice(void); 94 void installVoice(void);
114 void installThemes(void);
115 void uninstall(void); 95 void uninstall(void);
116 void uninstallBootloader(void); 96 void uninstallBootloader(void);
117 void installPortable(void); 97 void installPortable(void);
diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri
index 330a3cd19a..ebb49f09ec 100644
--- a/rbutil/rbutilqt/rbutilqt.pri
+++ b/rbutil/rbutilqt/rbutilqt.pri
@@ -21,7 +21,6 @@ SOURCES += \
21 gui/infowidget.cpp \ 21 gui/infowidget.cpp \
22 rbutilqt.cpp \ 22 rbutilqt.cpp \
23 main.cpp \ 23 main.cpp \
24 installwindow.cpp \
25 base/httpget.cpp \ 24 base/httpget.cpp \
26 configure.cpp \ 25 configure.cpp \
27 base/zipinstaller.cpp \ 26 base/zipinstaller.cpp \
@@ -78,6 +77,7 @@ SOURCES += \
78 quazip/ioapi.c \ 77 quazip/ioapi.c \
79 base/ziputil.cpp \ 78 base/ziputil.cpp \
80 comboboxviewdelegate.cpp \ 79 comboboxviewdelegate.cpp \
80 gui/selectiveinstallwidget.cpp \
81 gui/backupdialog.cpp \ 81 gui/backupdialog.cpp \
82 82
83 83
@@ -85,7 +85,6 @@ HEADERS += \
85 gui/manualwidget.h \ 85 gui/manualwidget.h \
86 gui/infowidget.h \ 86 gui/infowidget.h \
87 rbutilqt.h \ 87 rbutilqt.h \
88 installwindow.h \
89 base/httpget.h \ 88 base/httpget.h \
90 configure.h \ 89 configure.h \
91 version.h \ 90 version.h \
@@ -150,6 +149,7 @@ HEADERS += \
150 base/ziputil.h \ 149 base/ziputil.h \
151 lame/lame.h \ 150 lame/lame.h \
152 comboboxviewdelegate.h \ 151 comboboxviewdelegate.h \
152 gui/selectiveinstallwidget.h \
153 gui/backupdialog.h \ 153 gui/backupdialog.h \
154 154
155 155
@@ -158,7 +158,6 @@ FORMS += \
158 gui/infowidgetfrm.ui \ 158 gui/infowidgetfrm.ui \
159 rbutilqtfrm.ui \ 159 rbutilqtfrm.ui \
160 aboutbox.ui \ 160 aboutbox.ui \
161 installwindowfrm.ui \
162 progressloggerfrm.ui \ 161 progressloggerfrm.ui \
163 configurefrm.ui \ 162 configurefrm.ui \
164 installtalkfrm.ui \ 163 installtalkfrm.ui \
@@ -168,6 +167,7 @@ FORMS += \
168 createvoicefrm.ui \ 167 createvoicefrm.ui \
169 sysinfofrm.ui \ 168 sysinfofrm.ui \
170 systracefrm.ui \ 169 systracefrm.ui \
170 gui/selectiveinstallwidgetfrm.ui \
171 gui/backupdialogfrm.ui \ 171 gui/backupdialogfrm.ui \
172 172
173 173
diff --git a/rbutil/rbutilqt/rbutilqtfrm.ui b/rbutil/rbutilqt/rbutilqtfrm.ui
index 561a9aa3ae..85da42ed01 100644
--- a/rbutil/rbutilqt/rbutilqtfrm.ui
+++ b/rbutil/rbutilqt/rbutilqtfrm.ui
@@ -18,34 +18,15 @@
18 <normaloff>:/icons/rockbox-32.png</normaloff>:/icons/rockbox-32.png</iconset> 18 <normaloff>:/icons/rockbox-32.png</normaloff>:/icons/rockbox-32.png</iconset>
19 </property> 19 </property>
20 <widget class="QWidget" name="centralwidget"> 20 <widget class="QWidget" name="centralwidget">
21 <layout class="QGridLayout"> 21 <layout class="QGridLayout" name="gridLayout_3">
22 <item row="0" column="0"> 22 <item row="0" column="1">
23 <widget class="QLabel" name="logoLabel"> 23 <widget class="QGroupBox" name="groupBoxDevice">
24 <property name="sizePolicy"> 24 <property name="sizePolicy">
25 <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 25 <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
26 <horstretch>0</horstretch> 26 <horstretch>0</horstretch>
27 <verstretch>0</verstretch> 27 <verstretch>0</verstretch>
28 </sizepolicy> 28 </sizepolicy>
29 </property> 29 </property>
30 <property name="baseSize">
31 <size>
32 <width>0</width>
33 <height>0</height>
34 </size>
35 </property>
36 <property name="text">
37 <string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox."/>
38 </property>
39 <property name="pixmap">
40 <pixmap resource="rbutilqt.qrc">:/icons/rblogo.png</pixmap>
41 </property>
42 <property name="scaledContents">
43 <bool>false</bool>
44 </property>
45 </widget>
46 </item>
47 <item row="0" column="1">
48 <widget class="QGroupBox" name="groupBoxDevice">
49 <property name="title"> 30 <property name="title">
50 <string>Device</string> 31 <string>Device</string>
51 </property> 32 </property>
@@ -121,316 +102,43 @@
121 </layout> 102 </layout>
122 </widget> 103 </widget>
123 </item> 104 </item>
105 <item row="0" column="0">
106 <widget class="QLabel" name="logoLabel">
107 <property name="sizePolicy">
108 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
109 <horstretch>0</horstretch>
110 <verstretch>0</verstretch>
111 </sizepolicy>
112 </property>
113 <property name="baseSize">
114 <size>
115 <width>0</width>
116 <height>0</height>
117 </size>
118 </property>
119 <property name="text">
120 <string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox."/>
121 </property>
122 <property name="pixmap">
123 <pixmap resource="rbutilqt.qrc">:/icons/rblogo.png</pixmap>
124 </property>
125 <property name="scaledContents">
126 <bool>false</bool>
127 </property>
128 </widget>
129 </item>
124 <item row="1" column="0" colspan="2"> 130 <item row="1" column="0" colspan="2">
125 <widget class="QTabWidget" name="tabWidget"> 131 <widget class="QTabWidget" name="tabWidget">
126 <property name="currentIndex"> 132 <property name="currentIndex">
127 <number>7</number> 133 <number>7</number>
128 </property> 134 </property>
129 <widget class="QWidget" name="quickStart"> 135 <widget class="QWidget" name="selective">
130 <attribute name="title">
131 <string>&amp;Quick Start</string>
132 </attribute>
133 <attribute name="toolTip">
134 <string>Welcome</string>
135 </attribute>
136 <layout class="QGridLayout">
137 <item row="0" column="0">
138 <widget class="QToolButton" name="buttonComplete">
139 <property name="text">
140 <string>Complete Installation</string>
141 </property>
142 <property name="icon">
143 <iconset resource="rbutilqt.qrc">
144 <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
145 </property>
146 <property name="iconSize">
147 <size>
148 <width>56</width>
149 <height>46</height>
150 </size>
151 </property>
152 </widget>
153 </item>
154 <item row="0" column="1">
155 <widget class="QLabel" name="labelComplete">
156 <property name="text">
157 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Complete Installation&lt;/span&gt;&lt;br/&gt;This installs the bootloader, the most recent release and the extras package. This is the recommended method for new installations.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
158 </property>
159 <property name="textFormat">
160 <enum>Qt::AutoText</enum>
161 </property>
162 <property name="wordWrap">
163 <bool>true</bool>
164 </property>
165 </widget>
166 </item>
167 <item row="1" column="0">
168 <widget class="QToolButton" name="buttonSmall">
169 <property name="text">
170 <string>Minimal Installation</string>
171 </property>
172 <property name="icon">
173 <iconset resource="rbutilqt.qrc">
174 <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
175 </property>
176 <property name="iconSize">
177 <size>
178 <width>56</width>
179 <height>46</height>
180 </size>
181 </property>
182 </widget>
183 </item>
184 <item row="1" column="1">
185 <widget class="QLabel" name="labelSmall">
186 <property name="text">
187 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Minimal installation&lt;/span&gt;&lt;br/&gt;This installs bootloader and the most recent release of Rockbox. If you don't want the extras package, choose this option.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
188 </property>
189 <property name="wordWrap">
190 <bool>true</bool>
191 </property>
192 <property name="buddy">
193 <cstring>buttonRockbox</cstring>
194 </property>
195 </widget>
196 </item>
197 <item row="2" column="0">
198 <spacer>
199 <property name="orientation">
200 <enum>Qt::Vertical</enum>
201 </property>
202 <property name="sizeHint" stdset="0">
203 <size>
204 <width>20</width>
205 <height>91</height>
206 </size>
207 </property>
208 </spacer>
209 </item>
210 <item row="2" column="1">
211 <spacer>
212 <property name="orientation">
213 <enum>Qt::Vertical</enum>
214 </property>
215 <property name="sizeHint" stdset="0">
216 <size>
217 <width>20</width>
218 <height>81</height>
219 </size>
220 </property>
221 </spacer>
222 </item>
223 </layout>
224 </widget>
225 <widget class="QWidget" name="installation">
226 <attribute name="title"> 136 <attribute name="title">
227 <string>&amp;Installation</string> 137 <string>&amp;Installation</string>
228 </attribute> 138 </attribute>
229 <attribute name="toolTip"> 139 <attribute name="toolTip">
230 <string>Basic Rockbox installation</string> 140 <string>Welcome</string>
231 </attribute>
232 <layout class="QGridLayout">
233 <item row="0" column="0">
234 <widget class="QToolButton" name="buttonBootloader">
235 <property name="text">
236 <string>Install Bootloader</string>
237 </property>
238 <property name="icon">
239 <iconset resource="rbutilqt.qrc">
240 <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
241 </property>
242 <property name="iconSize">
243 <size>
244 <width>56</width>
245 <height>46</height>
246 </size>
247 </property>
248 </widget>
249 </item>
250 <item row="0" column="1">
251 <widget class="QLabel" name="labelBootloader">
252 <property name="text">
253 <string>&lt;b&gt;Install the bootloader&lt;/b&gt;&lt;br/&gt;Before Rockbox can be run on your audio player, you may have to install a bootloader. This is only necessary the first time Rockbox is installed.</string>
254 </property>
255 <property name="wordWrap">
256 <bool>true</bool>
257 </property>
258 </widget>
259 </item>
260 <item row="1" column="0">
261 <widget class="QToolButton" name="buttonRockbox">
262 <property name="text">
263 <string>Install Rockbox</string>
264 </property>
265 <property name="icon">
266 <iconset resource="rbutilqt.qrc">
267 <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
268 </property>
269 <property name="iconSize">
270 <size>
271 <width>56</width>
272 <height>46</height>
273 </size>
274 </property>
275 </widget>
276 </item>
277 <item row="1" column="1">
278 <widget class="QLabel" name="labelInstall">
279 <property name="text">
280 <string>&lt;b&gt;Install Rockbox&lt;/b&gt; on your audio player</string>
281 </property>
282 <property name="alignment">
283 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
284 </property>
285 <property name="wordWrap">
286 <bool>true</bool>
287 </property>
288 </widget>
289 </item>
290 <item row="2" column="0">
291 <spacer>
292 <property name="orientation">
293 <enum>Qt::Vertical</enum>
294 </property>
295 <property name="sizeHint" stdset="0">
296 <size>
297 <width>20</width>
298 <height>91</height>
299 </size>
300 </property>
301 </spacer>
302 </item>
303 <item row="2" column="1">
304 <spacer>
305 <property name="orientation">
306 <enum>Qt::Vertical</enum>
307 </property>
308 <property name="sizeHint" stdset="0">
309 <size>
310 <width>20</width>
311 <height>81</height>
312 </size>
313 </property>
314 </spacer>
315 </item>
316 </layout>
317 </widget>
318 <widget class="QWidget" name="extras">
319 <attribute name="title">
320 <string>&amp;Extras</string>
321 </attribute>
322 <attribute name="toolTip">
323 <string>Install extras for Rockbox</string>
324 </attribute> 141 </attribute>
325 <layout class="QGridLayout">
326 <item row="0" column="0">
327 <widget class="QToolButton" name="buttonFonts">
328 <property name="text">
329 <string>Install Fonts package</string>
330 </property>
331 <property name="icon">
332 <iconset resource="rbutilqt.qrc">
333 <normaloff>:/icons/font_btn.png</normaloff>:/icons/font_btn.png</iconset>
334 </property>
335 <property name="iconSize">
336 <size>
337 <width>56</width>
338 <height>46</height>
339 </size>
340 </property>
341 </widget>
342 </item>
343 <item row="0" column="1">
344 <widget class="QLabel" name="labelFonts">
345 <property name="text">
346 <string>&lt;b&gt;Fonts Package&lt;/b&gt;&lt;br/&gt;The Fonts Package contains a couple of commonly used fonts. Installation is highly recommended.</string>
347 </property>
348 <property name="wordWrap">
349 <bool>true</bool>
350 </property>
351 </widget>
352 </item>
353 <item row="1" column="0">
354 <widget class="QToolButton" name="buttonThemes">
355 <property name="text">
356 <string>Install themes</string>
357 </property>
358 <property name="icon">
359 <iconset resource="rbutilqt.qrc">
360 <normaloff>:/icons/themes_btn.png</normaloff>:/icons/themes_btn.png</iconset>
361 </property>
362 <property name="iconSize">
363 <size>
364 <width>56</width>
365 <height>46</height>
366 </size>
367 </property>
368 </widget>
369 </item>
370 <item row="1" column="1">
371 <widget class="QLabel" name="labelThemes">
372 <property name="text">
373 <string>&lt;b&gt;Install Themes&lt;/b&gt;&lt;br/&gt;Rockbox's look can be customized by themes. You can choose and install several officially distributed themes.</string>
374 </property>
375 <property name="wordWrap">
376 <bool>true</bool>
377 </property>
378 </widget>
379 </item>
380 <item row="2" column="0">
381 <widget class="QToolButton" name="buttonGames">
382 <property name="text">
383 <string>Install game files</string>
384 </property>
385 <property name="icon">
386 <iconset resource="rbutilqt.qrc">
387 <normaloff>:/icons/doom_btn.png</normaloff>:/icons/doom_btn.png</iconset>
388 </property>
389 <property name="iconSize">
390 <size>
391 <width>56</width>
392 <height>46</height>
393 </size>
394 </property>
395 </widget>
396 </item>
397 <item row="2" column="1">
398 <widget class="QLabel" name="labelGames">
399 <property name="text">
400 <string>&lt;b&gt;Install Game Files&lt;/b&gt;&lt;br/&gt;Doom needs a base wad file to run.</string>
401 </property>
402 <property name="openExternalLinks">
403 <bool>true</bool>
404 </property>
405 </widget>
406 </item>
407 <item row="4" column="0">
408 <spacer>
409 <property name="orientation">
410 <enum>Qt::Vertical</enum>
411 </property>
412 <property name="sizeHint" stdset="0">
413 <size>
414 <width>20</width>
415 <height>40</height>
416 </size>
417 </property>
418 </spacer>
419 </item>
420 <item row="4" column="1">
421 <spacer>
422 <property name="orientation">
423 <enum>Qt::Vertical</enum>
424 </property>
425 <property name="sizeHint" stdset="0">
426 <size>
427 <width>20</width>
428 <height>40</height>
429 </size>
430 </property>
431 </spacer>
432 </item>
433 </layout>
434 </widget> 142 </widget>
435 <widget class="QWidget" name="accessibility"> 143 <widget class="QWidget" name="accessibility">
436 <attribute name="title"> 144 <attribute name="title">
@@ -610,9 +318,6 @@
610 <property name="wordWrap"> 318 <property name="wordWrap">
611 <bool>true</bool> 319 <bool>true</bool>
612 </property> 320 </property>
613 <property name="buddy">
614 <cstring>buttonRockbox</cstring>
615 </property>
616 </widget> 321 </widget>
617 </item> 322 </item>
618 <item row="2" column="0"> 323 <item row="2" column="0">
@@ -716,28 +421,6 @@
716 <property name="title"> 421 <property name="title">
717 <string>Action&amp;s</string> 422 <string>Action&amp;s</string>
718 </property> 423 </property>
719 <widget class="QMenu" name="menuInstallation">
720 <property name="title">
721 <string>&amp;Installation</string>
722 </property>
723 <addaction name="actionInstall_Bootloader"/>
724 <addaction name="actionInstall_Rockbox"/>
725 </widget>
726 <widget class="QMenu" name="menuQuick_Start">
727 <property name="title">
728 <string>&amp;Quick Start</string>
729 </property>
730 <addaction name="actionComplete_Installation"/>
731 <addaction name="actionSmall_Installation"/>
732 </widget>
733 <widget class="QMenu" name="menuExtras">
734 <property name="title">
735 <string>&amp;Extras</string>
736 </property>
737 <addaction name="actionFonts_Package"/>
738 <addaction name="actionInstall_Themes"/>
739 <addaction name="actionInstall_Game_Files"/>
740 </widget>
741 <widget class="QMenu" name="menuAccessibility"> 424 <widget class="QMenu" name="menuAccessibility">
742 <property name="title"> 425 <property name="title">
743 <string>&amp;Accessibility</string> 426 <string>&amp;Accessibility</string>
@@ -753,9 +436,7 @@
753 <addaction name="actionRemove_bootloader"/> 436 <addaction name="actionRemove_bootloader"/>
754 <addaction name="actionUninstall_Rockbox"/> 437 <addaction name="actionUninstall_Rockbox"/>
755 </widget> 438 </widget>
756 <addaction name="menuQuick_Start"/> 439 <addaction name="action_Installation"/>
757 <addaction name="menuInstallation"/>
758 <addaction name="menuExtras"/>
759 <addaction name="menuAccessibility"/> 440 <addaction name="menuAccessibility"/>
760 <addaction name="menuUninstallation"/> 441 <addaction name="menuUninstallation"/>
761 </widget> 442 </widget>
@@ -948,19 +629,17 @@
948 <string>System &amp;Trace</string> 629 <string>System &amp;Trace</string>
949 </property> 630 </property>
950 </action> 631 </action>
632 <action name="action_Installation">
633 <property name="text">
634 <string>&amp;Installation</string>
635 </property>
636 </action>
951 </widget> 637 </widget>
952 <tabstops> 638 <tabstops>
953 <tabstop>tabWidget</tabstop> 639 <tabstop>tabWidget</tabstop>
954 <tabstop>buttonComplete</tabstop> 640 <tabstop>buttonChangeDevice</tabstop>
955 <tabstop>buttonSmall</tabstop>
956 <tabstop>buttonBootloader</tabstop>
957 <tabstop>buttonRockbox</tabstop>
958 <tabstop>buttonFonts</tabstop>
959 <tabstop>buttonThemes</tabstop>
960 <tabstop>buttonGames</tabstop>
961 <tabstop>buttonRemoveBootloader</tabstop> 641 <tabstop>buttonRemoveBootloader</tabstop>
962 <tabstop>buttonRemoveRockbox</tabstop> 642 <tabstop>buttonRemoveRockbox</tabstop>
963 <tabstop>buttonChangeDevice</tabstop>
964 <tabstop>buttonVoice</tabstop> 643 <tabstop>buttonVoice</tabstop>
965 <tabstop>buttonCreateVoice</tabstop> 644 <tabstop>buttonCreateVoice</tabstop>
966 <tabstop>buttonTalk</tabstop> 645 <tabstop>buttonTalk</tabstop>