diff options
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 174 |
1 files changed, 84 insertions, 90 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 3412b47ff9..34a1990aa6 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "rbzip.h" | 34 | #include "rbzip.h" |
35 | #include "sysinfo.h" | 35 | #include "sysinfo.h" |
36 | #include "detect.h" | 36 | #include "detect.h" |
37 | #include "rbsettings.h" | ||
37 | 38 | ||
38 | #include "progressloggerinterface.h" | 39 | #include "progressloggerinterface.h" |
39 | 40 | ||
@@ -60,8 +61,6 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
60 | { | 61 | { |
61 | absolutePath = qApp->applicationDirPath(); | 62 | absolutePath = qApp->applicationDirPath(); |
62 | 63 | ||
63 | settings = new RbSettings(); | ||
64 | settings->open(); | ||
65 | HttpGet::setGlobalUserAgent("rbutil/"VERSION); | 64 | HttpGet::setGlobalUserAgent("rbutil/"VERSION); |
66 | // init startup & autodetection | 65 | // init startup & autodetection |
67 | ui.setupUi(this); | 66 | ui.setupUi(this); |
@@ -154,13 +153,13 @@ void RbUtilQt::downloadInfo() | |||
154 | connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); | 153 | connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); |
155 | connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); | 154 | connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); |
156 | connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); | 155 | connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); |
157 | if(settings->value(RbSettings::CacheOffline).toBool()) | 156 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) |
158 | daily->setCache(true); | 157 | daily->setCache(true); |
159 | else | 158 | else |
160 | daily->setCache(false); | 159 | daily->setCache(false); |
161 | qDebug() << "downloading build info"; | 160 | qDebug() << "downloading build info"; |
162 | daily->setFile(&buildInfo); | 161 | daily->setFile(&buildInfo); |
163 | daily->getFile(QUrl(settings->value(RbSettings::ServerConfUrl).toString())); | 162 | daily->getFile(QUrl(RbSettings::value(RbSettings::ServerConfUrl).toString())); |
164 | } | 163 | } |
165 | 164 | ||
166 | 165 | ||
@@ -181,7 +180,7 @@ void RbUtilQt::downloadDone(bool error) | |||
181 | versmap.insert("arch_date", info.value("dailies/date").toString()); | 180 | versmap.insert("arch_date", info.value("dailies/date").toString()); |
182 | 181 | ||
183 | info.beginGroup("release"); | 182 | info.beginGroup("release"); |
184 | versmap.insert("rel_rev", info.value(settings->value(RbSettings::CurBuildserverModel).toString()).toString()); | 183 | versmap.insert("rel_rev", info.value(RbSettings::value(RbSettings::CurBuildserverModel).toString()).toString()); |
185 | info.endGroup(); | 184 | info.endGroup(); |
186 | 185 | ||
187 | if(versmap.value("rel_rev").isEmpty()) { | 186 | if(versmap.value("rel_rev").isEmpty()) { |
@@ -197,12 +196,12 @@ void RbUtilQt::downloadDone(bool error) | |||
197 | connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); | 196 | connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); |
198 | connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); | 197 | connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); |
199 | connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); | 198 | connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); |
200 | if(settings->value(RbSettings::CacheOffline).toBool()) | 199 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) |
201 | bleeding->setCache(true); | 200 | bleeding->setCache(true); |
202 | bleeding->setFile(&bleedingInfo); | 201 | bleeding->setFile(&bleedingInfo); |
203 | bleeding->getFile(QUrl(settings->value(RbSettings::BleedingInfo).toString())); | 202 | bleeding->getFile(QUrl(RbSettings::value(RbSettings::BleedingInfo).toString())); |
204 | 203 | ||
205 | if(settings->value(RbSettings::RbutilVersion) != PUREVERSION) { | 204 | if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) { |
206 | QApplication::processEvents(); | 205 | QApplication::processEvents(); |
207 | QMessageBox::information(this, tr("New installation"), | 206 | QMessageBox::information(this, tr("New installation"), |
208 | tr("This is a new installation of Rockbox Utility, or a new version. " | 207 | tr("This is a new installation of Rockbox Utility, or a new version. " |
@@ -291,7 +290,6 @@ void RbUtilQt::help() | |||
291 | void RbUtilQt::configDialog() | 290 | void RbUtilQt::configDialog() |
292 | { | 291 | { |
293 | Config *cw = new Config(this); | 292 | Config *cw = new Config(this); |
294 | cw->setSettings(settings); | ||
295 | connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); | 293 | connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); |
296 | connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); | 294 | connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); |
297 | cw->show(); | 295 | cw->show(); |
@@ -303,23 +301,23 @@ void RbUtilQt::updateSettings() | |||
303 | qDebug() << "updateSettings()"; | 301 | qDebug() << "updateSettings()"; |
304 | updateDevice(); | 302 | updateDevice(); |
305 | updateManual(); | 303 | updateManual(); |
306 | if(settings->value(RbSettings::ProxyType) == "system") { | 304 | if(RbSettings::value(RbSettings::ProxyType) == "system") { |
307 | HttpGet::setGlobalProxy(Detect::systemProxy()); | 305 | HttpGet::setGlobalProxy(Detect::systemProxy()); |
308 | } | 306 | } |
309 | else if(settings->value(RbSettings::ProxyType) == "manual") { | 307 | else if(RbSettings::value(RbSettings::ProxyType) == "manual") { |
310 | HttpGet::setGlobalProxy(settings->value(RbSettings::Proxy).toString()); | 308 | HttpGet::setGlobalProxy(RbSettings::value(RbSettings::Proxy).toString()); |
311 | } | 309 | } |
312 | else { | 310 | else { |
313 | HttpGet::setGlobalProxy(QUrl("")); | 311 | HttpGet::setGlobalProxy(QUrl("")); |
314 | } | 312 | } |
315 | HttpGet::setGlobalCache(settings->value(RbSettings::CachePath).toString()); | 313 | HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString()); |
316 | HttpGet::setGlobalDumbCache(settings->value(RbSettings::CacheOffline).toBool()); | 314 | HttpGet::setGlobalDumbCache(RbSettings::value(RbSettings::CacheOffline).toBool()); |
317 | } | 315 | } |
318 | 316 | ||
319 | 317 | ||
320 | void RbUtilQt::updateDevice() | 318 | void RbUtilQt::updateDevice() |
321 | { | 319 | { |
322 | if(settings->value(RbSettings::CurBootloaderMethod) == "none" ) { | 320 | if(RbSettings::value(RbSettings::CurBootloaderMethod) == "none" ) { |
323 | ui.buttonBootloader->setEnabled(false); | 321 | ui.buttonBootloader->setEnabled(false); |
324 | ui.buttonRemoveBootloader->setEnabled(false); | 322 | ui.buttonRemoveBootloader->setEnabled(false); |
325 | ui.labelBootloader->setEnabled(false); | 323 | ui.labelBootloader->setEnabled(false); |
@@ -328,7 +326,7 @@ void RbUtilQt::updateDevice() | |||
328 | else { | 326 | else { |
329 | ui.buttonBootloader->setEnabled(true); | 327 | ui.buttonBootloader->setEnabled(true); |
330 | ui.labelBootloader->setEnabled(true); | 328 | ui.labelBootloader->setEnabled(true); |
331 | if(settings->value(RbSettings::CurBootloaderMethod) == "fwpatcher") { | 329 | if(RbSettings::value(RbSettings::CurBootloaderMethod) == "fwpatcher") { |
332 | ui.labelRemoveBootloader->setEnabled(false); | 330 | ui.labelRemoveBootloader->setEnabled(false); |
333 | ui.buttonRemoveBootloader->setEnabled(false); | 331 | ui.buttonRemoveBootloader->setEnabled(false); |
334 | } | 332 | } |
@@ -339,9 +337,9 @@ void RbUtilQt::updateDevice() | |||
339 | } | 337 | } |
340 | 338 | ||
341 | // displayed device info | 339 | // displayed device info |
342 | QString mountpoint = settings->value(RbSettings::Mountpoint).toString(); | 340 | QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString(); |
343 | QString brand = settings->value(RbSettings::CurBrand).toString(); | 341 | QString brand = RbSettings::value(RbSettings::CurBrand).toString(); |
344 | QString name = settings->value(RbSettings::CurName).toString(); | 342 | QString name = RbSettings::value(RbSettings::CurName).toString(); |
345 | if(name.isEmpty()) name = "<none>"; | 343 | if(name.isEmpty()) name = "<none>"; |
346 | if(mountpoint.isEmpty()) mountpoint = "<invalid>"; | 344 | if(mountpoint.isEmpty()) mountpoint = "<invalid>"; |
347 | ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>") | 345 | ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>") |
@@ -351,17 +349,17 @@ void RbUtilQt::updateDevice() | |||
351 | 349 | ||
352 | void RbUtilQt::updateManual() | 350 | void RbUtilQt::updateManual() |
353 | { | 351 | { |
354 | if(settings->value(RbSettings::Platform) != "") | 352 | if(RbSettings::value(RbSettings::Platform) != "") |
355 | { | 353 | { |
356 | QString manual= settings->value(RbSettings::CurManual).toString(); | 354 | QString manual= RbSettings::value(RbSettings::CurManual).toString(); |
357 | 355 | ||
358 | if(manual == "") | 356 | if(manual == "") |
359 | manual = "rockbox-" + settings->value(RbSettings::Platform).toString(); | 357 | manual = "rockbox-" + RbSettings::value(RbSettings::Platform).toString(); |
360 | QString pdfmanual; | 358 | QString pdfmanual; |
361 | pdfmanual = settings->value(RbSettings::ManualUrl).toString() | 359 | pdfmanual = RbSettings::value(RbSettings::ManualUrl).toString() |
362 | + "/" + manual + ".pdf"; | 360 | + "/" + manual + ".pdf"; |
363 | QString htmlmanual; | 361 | QString htmlmanual; |
364 | htmlmanual = settings->value(RbSettings::ManualUrl).toString() | 362 | htmlmanual = RbSettings::value(RbSettings::ManualUrl).toString() |
365 | + "/" + manual + "/rockbox-build.html"; | 363 | + "/" + manual + "/rockbox-build.html"; |
366 | ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>") | 364 | ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>") |
367 | .arg(pdfmanual)); | 365 | .arg(pdfmanual)); |
@@ -455,7 +453,7 @@ void RbUtilQt::smallInstall() | |||
455 | 453 | ||
456 | bool RbUtilQt::smallInstallInner() | 454 | bool RbUtilQt::smallInstallInner() |
457 | { | 455 | { |
458 | QString mountpoint = settings->value(RbSettings::Mountpoint).toString(); | 456 | QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString(); |
459 | // show dialog with error if mount point is wrong | 457 | // show dialog with error if mount point is wrong |
460 | if(!QFileInfo(mountpoint).isDir()) { | 458 | if(!QFileInfo(mountpoint).isDir()) { |
461 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); | 459 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); |
@@ -463,7 +461,7 @@ bool RbUtilQt::smallInstallInner() | |||
463 | return true; | 461 | return true; |
464 | } | 462 | } |
465 | // Bootloader | 463 | // Bootloader |
466 | if(settings->value(RbSettings::CurBootloaderMethod) != "none") | 464 | if(RbSettings::value(RbSettings::CurBootloaderMethod) != "none") |
467 | { | 465 | { |
468 | m_error = false; | 466 | m_error = false; |
469 | m_installed = false; | 467 | m_installed = false; |
@@ -515,17 +513,17 @@ void RbUtilQt::installBtn() | |||
515 | bool RbUtilQt::installAuto() | 513 | bool RbUtilQt::installAuto() |
516 | { | 514 | { |
517 | QString file = QString("%1/%2/rockbox-%3-%4.zip") | 515 | QString file = QString("%1/%2/rockbox-%3-%4.zip") |
518 | .arg(settings->value(RbSettings::ReleaseUrl).toString(), | 516 | .arg(RbSettings::value(RbSettings::ReleaseUrl).toString(), |
519 | versmap.value("rel_rev"), | 517 | versmap.value("rel_rev"), |
520 | settings->value(RbSettings::CurBuildserverModel).toString(), | 518 | RbSettings::value(RbSettings::CurBuildserverModel).toString(), |
521 | versmap.value("rel_rev")); | 519 | versmap.value("rel_rev")); |
522 | buildInfo.open(); | 520 | buildInfo.open(); |
523 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 521 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
524 | buildInfo.close(); | 522 | buildInfo.close(); |
525 | 523 | ||
526 | // check installed Version and Target | 524 | // check installed Version and Target |
527 | QString rbVersion = Detect::installedVersion(settings->value(RbSettings::Mountpoint).toString()); | 525 | QString rbVersion = Detect::installedVersion(RbSettings::value(RbSettings::Mountpoint).toString()); |
528 | QString warning = Detect::check(settings, false); | 526 | QString warning = Detect::check(false); |
529 | 527 | ||
530 | if(!warning.isEmpty()) | 528 | if(!warning.isEmpty()) |
531 | { | 529 | { |
@@ -546,7 +544,7 @@ bool RbUtilQt::installAuto() | |||
546 | QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) | 544 | QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) |
547 | { | 545 | { |
548 | logger->addItem(tr("Starting backup..."),LOGINFO); | 546 | logger->addItem(tr("Starting backup..."),LOGINFO); |
549 | QString backupName = settings->value(RbSettings::Mountpoint).toString() | 547 | QString backupName = RbSettings::value(RbSettings::Mountpoint).toString() |
550 | + "/.backup/rockbox-backup-" + rbVersion + ".zip"; | 548 | + "/.backup/rockbox-backup-" + rbVersion + ".zip"; |
551 | 549 | ||
552 | //! create dir, if it doesnt exist | 550 | //! create dir, if it doesnt exist |
@@ -561,7 +559,7 @@ bool RbUtilQt::installAuto() | |||
561 | RbZip backup; | 559 | RbZip backup; |
562 | connect(&backup,SIGNAL(zipProgress(int,int)),logger, SLOT(setProgress(int,int))); | 560 | connect(&backup,SIGNAL(zipProgress(int,int)),logger, SLOT(setProgress(int,int))); |
563 | if(backup.createZip(backupName, | 561 | if(backup.createZip(backupName, |
564 | settings->value(RbSettings::Mountpoint).toString() + "/.rockbox") == Zip::Ok) | 562 | RbSettings::value(RbSettings::Mountpoint).toString() + "/.rockbox") == Zip::Ok) |
565 | { | 563 | { |
566 | logger->addItem(tr("Backup successful"),LOGOK); | 564 | logger->addItem(tr("Backup successful"),LOGOK); |
567 | } | 565 | } |
@@ -579,9 +577,9 @@ bool RbUtilQt::installAuto() | |||
579 | installer->setUrl(file); | 577 | installer->setUrl(file); |
580 | installer->setLogSection("Rockbox (Base)"); | 578 | installer->setLogSection("Rockbox (Base)"); |
581 | installer->setLogVersion(versmap.value("rel_rev")); | 579 | installer->setLogVersion(versmap.value("rel_rev")); |
582 | if(!settings->value(RbSettings::CacheDisabled).toBool()) | 580 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) |
583 | installer->setCache(true); | 581 | installer->setCache(true); |
584 | installer->setMountPoint(settings->value(RbSettings::Mountpoint).toString()); | 582 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); |
585 | 583 | ||
586 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); | 584 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); |
587 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | 585 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); |
@@ -595,7 +593,7 @@ bool RbUtilQt::installAuto() | |||
595 | 593 | ||
596 | void RbUtilQt::install() | 594 | void RbUtilQt::install() |
597 | { | 595 | { |
598 | Install *installWindow = new Install(settings,this); | 596 | Install *installWindow = new Install(this); |
599 | 597 | ||
600 | buildInfo.open(); | 598 | buildInfo.open(); |
601 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 599 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
@@ -626,13 +624,13 @@ void RbUtilQt::installBootloaderBtn() | |||
626 | 624 | ||
627 | void RbUtilQt::installBootloader() | 625 | void RbUtilQt::installBootloader() |
628 | { | 626 | { |
629 | QString platform = settings->value(RbSettings::Platform).toString(); | 627 | QString platform = RbSettings::value(RbSettings::Platform).toString(); |
630 | QString backupDestination = ""; | 628 | QString backupDestination = ""; |
631 | m_error = false; | 629 | m_error = false; |
632 | 630 | ||
633 | // create installer | 631 | // create installer |
634 | BootloaderInstallBase *bl; | 632 | BootloaderInstallBase *bl; |
635 | QString type = settings->value(RbSettings::CurBootloaderMethod).toString(); | 633 | QString type = RbSettings::value(RbSettings::CurBootloaderMethod).toString(); |
636 | if(type == "mi4") { | 634 | if(type == "mi4") { |
637 | bl = new BootloaderInstallMi4(this); | 635 | bl = new BootloaderInstallMi4(this); |
638 | } | 636 | } |
@@ -656,23 +654,23 @@ void RbUtilQt::installBootloader() | |||
656 | 654 | ||
657 | // set bootloader filename. Do this now as installed() needs it. | 655 | // set bootloader filename. Do this now as installed() needs it. |
658 | QString blfile; | 656 | QString blfile; |
659 | blfile = settings->value(RbSettings::Mountpoint).toString() | 657 | blfile = RbSettings::value(RbSettings::Mountpoint).toString() |
660 | + settings->value(RbSettings::CurBootloaderFile).toString(); | 658 | + RbSettings::value(RbSettings::CurBootloaderFile).toString(); |
661 | // special case for H10 pure: this player can have a different | 659 | // special case for H10 pure: this player can have a different |
662 | // bootloader file filename. This is handled here to keep the install | 660 | // bootloader file filename. This is handled here to keep the install |
663 | // class clean, though having it here is also not the nicest solution. | 661 | // class clean, though having it here is also not the nicest solution. |
664 | if(settings->value(RbSettings::Platform).toString() == "h10_ums" | 662 | if(RbSettings::value(RbSettings::Platform).toString() == "h10_ums" |
665 | || settings->value(RbSettings::Platform) == "h10_mtp") { | 663 | || RbSettings::value(RbSettings::Platform) == "h10_mtp") { |
666 | if(resolvePathCase(blfile).isEmpty()) | 664 | if(resolvePathCase(blfile).isEmpty()) |
667 | blfile = settings->value(RbSettings::Mountpoint).toString() | 665 | blfile = RbSettings::value(RbSettings::Mountpoint).toString() |
668 | + settings->value(RbSettings::CurBootloaderName).toString() | 666 | + RbSettings::value(RbSettings::CurBootloaderName).toString() |
669 | .replace("H10", "H10EMP", Qt::CaseInsensitive); | 667 | .replace("H10", "H10EMP", Qt::CaseInsensitive); |
670 | } | 668 | } |
671 | bl->setBlFile(blfile); | 669 | bl->setBlFile(blfile); |
672 | QUrl url(settings->value(RbSettings::BootloaderUrl).toString() | 670 | QUrl url(RbSettings::value(RbSettings::BootloaderUrl).toString() |
673 | + settings->value(RbSettings::CurBootloaderName).toString()); | 671 | + RbSettings::value(RbSettings::CurBootloaderName).toString()); |
674 | bl->setBlUrl(url); | 672 | bl->setBlUrl(url); |
675 | bl->setLogfile(settings->value(RbSettings::Mountpoint).toString() | 673 | bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString() |
676 | + "/.rockbox/rbutil.log"); | 674 | + "/.rockbox/rbutil.log"); |
677 | 675 | ||
678 | if(bl->installed() == BootloaderInstallBase::BootloaderRockbox) { | 676 | if(bl->installed() == BootloaderInstallBase::BootloaderRockbox) { |
@@ -695,7 +693,7 @@ void RbUtilQt::installBootloader() | |||
695 | else if(bl->installed() == BootloaderInstallBase::BootloaderOther | 693 | else if(bl->installed() == BootloaderInstallBase::BootloaderOther |
696 | && bl->capabilities() & BootloaderInstallBase::Backup) | 694 | && bl->capabilities() & BootloaderInstallBase::Backup) |
697 | { | 695 | { |
698 | QString targetFolder = settings->value(RbSettings::CurPlatformName).toString() | 696 | QString targetFolder = RbSettings::value(RbSettings::CurPlatformName).toString() |
699 | + " Firmware Backup"; | 697 | + " Firmware Backup"; |
700 | // remove invalid character(s) | 698 | // remove invalid character(s) |
701 | targetFolder.remove(QRegExp("[:/]")); | 699 | targetFolder.remove(QRegExp("[:/]")); |
@@ -790,7 +788,7 @@ void RbUtilQt::installBootloaderPost(bool error) | |||
790 | return; | 788 | return; |
791 | 789 | ||
792 | QString msg = BootloaderInstallBase::postinstallHints( | 790 | QString msg = BootloaderInstallBase::postinstallHints( |
793 | settings->value(RbSettings::Platform).toString()); | 791 | RbSettings::value(RbSettings::Platform).toString()); |
794 | if(!msg.isEmpty()) { | 792 | if(!msg.isEmpty()) { |
795 | QMessageBox::information(this, tr("Manual steps required"), msg); | 793 | QMessageBox::information(this, tr("Manual steps required"), msg); |
796 | logger->close(); | 794 | logger->close(); |
@@ -822,11 +820,11 @@ void RbUtilQt::installFonts() | |||
822 | // create zip installer | 820 | // create zip installer |
823 | installer = new ZipInstaller(this); | 821 | installer = new ZipInstaller(this); |
824 | 822 | ||
825 | installer->setUrl(settings->value(RbSettings::FontUrl).toString()); | 823 | installer->setUrl(RbSettings::value(RbSettings::FontUrl).toString()); |
826 | installer->setLogSection("Fonts"); | 824 | installer->setLogSection("Fonts"); |
827 | installer->setLogVersion(versmap.value("arch_date")); | 825 | installer->setLogVersion(versmap.value("arch_date")); |
828 | installer->setMountPoint(settings->value(RbSettings::Mountpoint).toString()); | 826 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); |
829 | if(!settings->value(RbSettings::CacheDisabled).toBool()) | 827 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) |
830 | installer->setCache(true); | 828 | installer->setCache(true); |
831 | 829 | ||
832 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); | 830 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); |
@@ -860,17 +858,17 @@ void RbUtilQt::installVoice() | |||
860 | // create zip installer | 858 | // create zip installer |
861 | installer = new ZipInstaller(this); | 859 | installer = new ZipInstaller(this); |
862 | 860 | ||
863 | QString voiceurl = settings->value(RbSettings::VoiceUrl).toString(); | 861 | QString voiceurl = RbSettings::value(RbSettings::VoiceUrl).toString(); |
864 | 862 | ||
865 | voiceurl += settings->value(RbSettings::CurConfigureModel).toString() + "-" + | 863 | voiceurl += RbSettings::value(RbSettings::CurConfigureModel).toString() + "-" + |
866 | versmap.value("arch_date") + "-english.zip"; | 864 | versmap.value("arch_date") + "-english.zip"; |
867 | qDebug() << voiceurl; | 865 | qDebug() << voiceurl; |
868 | 866 | ||
869 | installer->setUrl(voiceurl); | 867 | installer->setUrl(voiceurl); |
870 | installer->setLogSection("Voice"); | 868 | installer->setLogSection("Voice"); |
871 | installer->setLogVersion(versmap.value("arch_date")); | 869 | installer->setLogVersion(versmap.value("arch_date")); |
872 | installer->setMountPoint(settings->value(RbSettings::Mountpoint).toString()); | 870 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); |
873 | if(!settings->value(RbSettings::CacheDisabled).toBool()) | 871 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) |
874 | installer->setCache(true); | 872 | installer->setCache(true); |
875 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | 873 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); |
876 | connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | 874 | connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); |
@@ -906,7 +904,7 @@ bool RbUtilQt::installDoomAuto() | |||
906 | 904 | ||
907 | bool RbUtilQt::hasDoom() | 905 | bool RbUtilQt::hasDoom() |
908 | { | 906 | { |
909 | QFile doomrock(settings->value(RbSettings::Mountpoint).toString() | 907 | QFile doomrock(RbSettings::value(RbSettings::Mountpoint).toString() |
910 | +"/.rockbox/rocks/games/doom.rock"); | 908 | +"/.rockbox/rocks/games/doom.rock"); |
911 | return doomrock.exists(); | 909 | return doomrock.exists(); |
912 | } | 910 | } |
@@ -916,11 +914,11 @@ void RbUtilQt::installDoom() | |||
916 | // create zip installer | 914 | // create zip installer |
917 | installer = new ZipInstaller(this); | 915 | installer = new ZipInstaller(this); |
918 | 916 | ||
919 | installer->setUrl(settings->value(RbSettings::DoomUrl).toString()); | 917 | installer->setUrl(RbSettings::value(RbSettings::DoomUrl).toString()); |
920 | installer->setLogSection("Game Addons"); | 918 | installer->setLogSection("Game Addons"); |
921 | installer->setLogVersion(versmap.value("arch_date")); | 919 | installer->setLogVersion(versmap.value("arch_date")); |
922 | installer->setMountPoint(settings->value(RbSettings::Mountpoint).toString()); | 920 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); |
923 | if(!settings->value(RbSettings::CacheDisabled).toBool()) | 921 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) |
924 | installer->setCache(true); | 922 | installer->setCache(true); |
925 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); | 923 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); |
926 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | 924 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); |
@@ -935,7 +933,6 @@ void RbUtilQt::installThemes() | |||
935 | { | 933 | { |
936 | if(chkConfig(true)) return; | 934 | if(chkConfig(true)) return; |
937 | ThemesInstallWindow* tw = new ThemesInstallWindow(this); | 935 | ThemesInstallWindow* tw = new ThemesInstallWindow(this); |
938 | tw->setSettings(settings); | ||
939 | tw->setModal(true); | 936 | tw->setModal(true); |
940 | tw->show(); | 937 | tw->show(); |
941 | } | 938 | } |
@@ -944,7 +941,6 @@ void RbUtilQt::createTalkFiles(void) | |||
944 | { | 941 | { |
945 | if(chkConfig(true)) return; | 942 | if(chkConfig(true)) return; |
946 | InstallTalkWindow *installWindow = new InstallTalkWindow(this); | 943 | InstallTalkWindow *installWindow = new InstallTalkWindow(this); |
947 | installWindow->setSettings(settings); | ||
948 | 944 | ||
949 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); | 945 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); |
950 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); | 946 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); |
@@ -956,8 +952,7 @@ void RbUtilQt::createVoiceFile(void) | |||
956 | { | 952 | { |
957 | if(chkConfig(true)) return; | 953 | if(chkConfig(true)) return; |
958 | CreateVoiceWindow *installWindow = new CreateVoiceWindow(this); | 954 | CreateVoiceWindow *installWindow = new CreateVoiceWindow(this); |
959 | installWindow->setSettings(settings); | 955 | |
960 | |||
961 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); | 956 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); |
962 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); | 957 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); |
963 | installWindow->show(); | 958 | installWindow->show(); |
@@ -967,7 +962,6 @@ void RbUtilQt::uninstall(void) | |||
967 | { | 962 | { |
968 | if(chkConfig(true)) return; | 963 | if(chkConfig(true)) return; |
969 | UninstallWindow *uninstallWindow = new UninstallWindow(this); | 964 | UninstallWindow *uninstallWindow = new UninstallWindow(this); |
970 | uninstallWindow->setSettings(settings); | ||
971 | uninstallWindow->show(); | 965 | uninstallWindow->show(); |
972 | 966 | ||
973 | } | 967 | } |
@@ -983,11 +977,11 @@ void RbUtilQt::uninstallBootloader(void) | |||
983 | logger->setProgressVisible(false); | 977 | logger->setProgressVisible(false); |
984 | logger->show(); | 978 | logger->show(); |
985 | 979 | ||
986 | QString platform = settings->value(RbSettings::Platform).toString(); | 980 | QString platform = RbSettings::value(RbSettings::Platform).toString(); |
987 | 981 | ||
988 | // create installer | 982 | // create installer |
989 | BootloaderInstallBase *bl; | 983 | BootloaderInstallBase *bl; |
990 | QString type = settings->value(RbSettings::CurBootloaderMethod).toString(); | 984 | QString type = RbSettings::value(RbSettings::CurBootloaderMethod).toString(); |
991 | if(type == "mi4") { | 985 | if(type == "mi4") { |
992 | bl = new BootloaderInstallMi4(); | 986 | bl = new BootloaderInstallMi4(); |
993 | } | 987 | } |
@@ -1009,13 +1003,13 @@ void RbUtilQt::uninstallBootloader(void) | |||
1009 | return; | 1003 | return; |
1010 | } | 1004 | } |
1011 | 1005 | ||
1012 | QString blfile = settings->value(RbSettings::Mountpoint).toString() | 1006 | QString blfile = RbSettings::value(RbSettings::Mountpoint).toString() |
1013 | + settings->value(RbSettings::CurBootloaderFile).toString(); | 1007 | + RbSettings::value(RbSettings::CurBootloaderFile).toString(); |
1014 | if(settings->value(RbSettings::Platform).toString() == "h10_ums" | 1008 | if(RbSettings::value(RbSettings::Platform).toString() == "h10_ums" |
1015 | || settings->value(RbSettings::Platform).toString() == "h10_mtp") { | 1009 | || RbSettings::value(RbSettings::Platform).toString() == "h10_mtp") { |
1016 | if(resolvePathCase(blfile).isEmpty()) | 1010 | if(resolvePathCase(blfile).isEmpty()) |
1017 | blfile = settings->value(RbSettings::Mountpoint).toString() | 1011 | blfile = RbSettings::value(RbSettings::Mountpoint).toString() |
1018 | + settings->value(RbSettings::CurBootloaderName).toString() | 1012 | + RbSettings::value(RbSettings::CurBootloaderName).toString() |
1019 | .replace("H10", "H10EMP", Qt::CaseInsensitive); | 1013 | .replace("H10", "H10EMP", Qt::CaseInsensitive); |
1020 | } | 1014 | } |
1021 | bl->setBlFile(blfile); | 1015 | bl->setBlFile(blfile); |
@@ -1044,7 +1038,7 @@ void RbUtilQt::downloadManual(void) | |||
1044 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 1038 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
1045 | buildInfo.close(); | 1039 | buildInfo.close(); |
1046 | 1040 | ||
1047 | QString manual = settings->value(RbSettings::CurManual).toString(); | 1041 | QString manual = RbSettings::value(RbSettings::CurManual).toString(); |
1048 | 1042 | ||
1049 | QString date = (info.value("dailies/date").toString()); | 1043 | QString date = (info.value("dailies/date").toString()); |
1050 | 1044 | ||
@@ -1059,14 +1053,14 @@ void RbUtilQt::downloadManual(void) | |||
1059 | target = "/" + manual + "-" + date + "-html.zip"; | 1053 | target = "/" + manual + "-" + date + "-html.zip"; |
1060 | section = "Manual (HTML)"; | 1054 | section = "Manual (HTML)"; |
1061 | } | 1055 | } |
1062 | manualurl = settings->value(RbSettings::ManualUrl).toString() + "/" + target; | 1056 | manualurl = RbSettings::value(RbSettings::ManualUrl).toString() + "/" + target; |
1063 | qDebug() << "manualurl =" << manualurl; | 1057 | qDebug() << "manualurl =" << manualurl; |
1064 | 1058 | ||
1065 | ProgressLoggerGui* logger = new ProgressLoggerGui(this); | 1059 | ProgressLoggerGui* logger = new ProgressLoggerGui(this); |
1066 | logger->show(); | 1060 | logger->show(); |
1067 | installer = new ZipInstaller(this); | 1061 | installer = new ZipInstaller(this); |
1068 | installer->setMountPoint(settings->value(RbSettings::Mountpoint).toString()); | 1062 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); |
1069 | if(!settings->value(RbSettings::CacheDisabled).toBool()) | 1063 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) |
1070 | installer->setCache(true); | 1064 | installer->setCache(true); |
1071 | installer->setLogSection(section); | 1065 | installer->setLogSection(section); |
1072 | installer->setLogVersion(date); | 1066 | installer->setLogVersion(date); |
@@ -1096,28 +1090,28 @@ void RbUtilQt::installPortable(void) | |||
1096 | logger->addItem(tr("Installing Rockbox Utility"), LOGINFO); | 1090 | logger->addItem(tr("Installing Rockbox Utility"), LOGINFO); |
1097 | 1091 | ||
1098 | // check mountpoint | 1092 | // check mountpoint |
1099 | if(!QFileInfo(settings->value(RbSettings::Mountpoint).toString()).isDir()) { | 1093 | if(!QFileInfo(RbSettings::value(RbSettings::Mountpoint).toString()).isDir()) { |
1100 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); | 1094 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); |
1101 | logger->setFinished(); | 1095 | logger->setFinished(); |
1102 | return; | 1096 | return; |
1103 | } | 1097 | } |
1104 | 1098 | ||
1105 | // remove old files first. | 1099 | // remove old files first. |
1106 | QFile::remove(settings->value(RbSettings::Mountpoint).toString() | 1100 | QFile::remove(RbSettings::value(RbSettings::Mountpoint).toString() |
1107 | + "/RockboxUtility.exe"); | 1101 | + "/RockboxUtility.exe"); |
1108 | QFile::remove(settings->value(RbSettings::Mountpoint).toString() | 1102 | QFile::remove(RbSettings::value(RbSettings::Mountpoint).toString() |
1109 | + "/RockboxUtility.ini"); | 1103 | + "/RockboxUtility.ini"); |
1110 | // copy currently running binary and currently used settings file | 1104 | // copy currently running binary and currently used settings file |
1111 | if(!QFile::copy(qApp->applicationFilePath(), | 1105 | if(!QFile::copy(qApp->applicationFilePath(), |
1112 | settings->value(RbSettings::Mountpoint).toString() | 1106 | RbSettings::value(RbSettings::Mountpoint).toString() |
1113 | + "/RockboxUtility.exe")) { | 1107 | + "/RockboxUtility.exe")) { |
1114 | logger->addItem(tr("Error installing Rockbox Utility"), LOGERROR); | 1108 | logger->addItem(tr("Error installing Rockbox Utility"), LOGERROR); |
1115 | logger->setFinished(); | 1109 | logger->setFinished(); |
1116 | return; | 1110 | return; |
1117 | } | 1111 | } |
1118 | logger->addItem(tr("Installing user configuration"), LOGINFO); | 1112 | logger->addItem(tr("Installing user configuration"), LOGINFO); |
1119 | if(!QFile::copy(settings->userSettingFilename(), | 1113 | if(!QFile::copy(RbSettings::userSettingFilename(), |
1120 | settings->value(RbSettings::Mountpoint).toString() | 1114 | RbSettings::value(RbSettings::Mountpoint).toString() |
1121 | + "/RockboxUtility.ini")) { | 1115 | + "/RockboxUtility.ini")) { |
1122 | logger->addItem(tr("Error installing user configuration"), LOGERROR); | 1116 | logger->addItem(tr("Error installing user configuration"), LOGERROR); |
1123 | logger->setFinished(); | 1117 | logger->setFinished(); |
@@ -1135,7 +1129,7 @@ void RbUtilQt::updateInfo() | |||
1135 | { | 1129 | { |
1136 | qDebug() << "RbUtilQt::updateInfo()"; | 1130 | qDebug() << "RbUtilQt::updateInfo()"; |
1137 | 1131 | ||
1138 | QSettings log(settings->value(RbSettings::Mountpoint).toString() | 1132 | QSettings log(RbSettings::value(RbSettings::Mountpoint).toString() |
1139 | + "/.rockbox/rbutil.log", QSettings::IniFormat, this); | 1133 | + "/.rockbox/rbutil.log", QSettings::IniFormat, this); |
1140 | QStringList groups = log.childGroups(); | 1134 | QStringList groups = log.childGroups(); |
1141 | QList<QTreeWidgetItem *> items; | 1135 | QList<QTreeWidgetItem *> items; |
@@ -1172,7 +1166,7 @@ void RbUtilQt::updateInfo() | |||
1172 | 1166 | ||
1173 | for(int b = 0; b < keys.size(); b++) { | 1167 | for(int b = 0; b < keys.size(); b++) { |
1174 | QString file; | 1168 | QString file; |
1175 | file = settings->value(RbSettings::Mountpoint).toString() + "/" + keys.at(b); | 1169 | file = RbSettings::value(RbSettings::Mountpoint).toString() + "/" + keys.at(b); |
1176 | if(QFileInfo(file).isDir()) | 1170 | if(QFileInfo(file).isDir()) |
1177 | continue; | 1171 | continue; |
1178 | w2 = new QTreeWidgetItem(w, QStringList() << "/" | 1172 | w2 = new QTreeWidgetItem(w, QStringList() << "/" |
@@ -1197,9 +1191,9 @@ void RbUtilQt::updateInfo() | |||
1197 | 1191 | ||
1198 | QUrl RbUtilQt::proxy() | 1192 | QUrl RbUtilQt::proxy() |
1199 | { | 1193 | { |
1200 | if(settings->value(RbSettings::ProxyType) == "manual") | 1194 | if(RbSettings::value(RbSettings::ProxyType) == "manual") |
1201 | return QUrl(settings->value(RbSettings::Proxy).toString()); | 1195 | return QUrl(RbSettings::value(RbSettings::Proxy).toString()); |
1202 | else if(settings->value(RbSettings::ProxyType) == "system") | 1196 | else if(RbSettings::value(RbSettings::ProxyType) == "system") |
1203 | return Detect::systemProxy(); | 1197 | return Detect::systemProxy(); |
1204 | return QUrl(""); | 1198 | return QUrl(""); |
1205 | } | 1199 | } |
@@ -1208,9 +1202,9 @@ QUrl RbUtilQt::proxy() | |||
1208 | bool RbUtilQt::chkConfig(bool warn) | 1202 | bool RbUtilQt::chkConfig(bool warn) |
1209 | { | 1203 | { |
1210 | bool error = false; | 1204 | bool error = false; |
1211 | if(settings->value(RbSettings::Platform).toString().isEmpty() | 1205 | if(RbSettings::value(RbSettings::Platform).toString().isEmpty() |
1212 | || settings->value(RbSettings::Mountpoint).toString().isEmpty() | 1206 | || RbSettings::value(RbSettings::Mountpoint).toString().isEmpty() |
1213 | || !QFileInfo(settings->value(RbSettings::Mountpoint).toString()).isWritable()) { | 1207 | || !QFileInfo(RbSettings::value(RbSettings::Mountpoint).toString()).isWritable()) { |
1214 | error = true; | 1208 | error = true; |
1215 | 1209 | ||
1216 | if(warn) QMessageBox::critical(this, tr("Configuration error"), | 1210 | if(warn) QMessageBox::critical(this, tr("Configuration error"), |