diff options
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index a2ac2b73ea..f06669d5c5 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -96,7 +96,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
96 | connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); | 96 | connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); |
97 | connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall())); | 97 | connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall())); |
98 | connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall())); | 98 | connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall())); |
99 | 99 | ||
100 | #if !defined(STATIC) | 100 | #if !defined(STATIC) |
101 | ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false); | 101 | ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false); |
102 | #else | 102 | #else |
@@ -145,7 +145,7 @@ void RbUtilQt::downloadDone(bool error) | |||
145 | return; | 145 | return; |
146 | } | 146 | } |
147 | qDebug() << "network status:" << daily->error(); | 147 | qDebug() << "network status:" << daily->error(); |
148 | 148 | ||
149 | buildInfo.open(); | 149 | buildInfo.open(); |
150 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 150 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
151 | buildInfo.close(); | 151 | buildInfo.close(); |
@@ -195,7 +195,7 @@ void RbUtilQt::about() | |||
195 | Ui::aboutBox about; | 195 | Ui::aboutBox about; |
196 | about.setupUi(window); | 196 | about.setupUi(window); |
197 | window->setModal(true); | 197 | window->setModal(true); |
198 | 198 | ||
199 | QFile licence(":/docs/gpl-2.0.html"); | 199 | QFile licence(":/docs/gpl-2.0.html"); |
200 | licence.open(QIODevice::ReadOnly); | 200 | licence.open(QIODevice::ReadOnly); |
201 | QTextStream c(&licence); | 201 | QTextStream c(&licence); |
@@ -288,7 +288,7 @@ void RbUtilQt::updateManual() | |||
288 | devices->beginGroup(userSettings->value("platform").toString()); | 288 | devices->beginGroup(userSettings->value("platform").toString()); |
289 | QString manual; | 289 | QString manual; |
290 | manual = devices->value("manualname", "").toString(); | 290 | manual = devices->value("manualname", "").toString(); |
291 | 291 | ||
292 | if(manual == "") | 292 | if(manual == "") |
293 | manual = "rockbox-" + devices->value("platform").toString(); | 293 | manual = "rockbox-" + devices->value("platform").toString(); |
294 | devices->endGroup(); | 294 | devices->endGroup(); |
@@ -314,18 +314,18 @@ void RbUtilQt::completeInstall() | |||
314 | if(QMessageBox::question(this, tr("Confirm Installation"), | 314 | if(QMessageBox::question(this, tr("Confirm Installation"), |
315 | tr("Do you really want to make a complete Installation?"), | 315 | tr("Do you really want to make a complete Installation?"), |
316 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; | 316 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; |
317 | 317 | ||
318 | // create logger | 318 | // create logger |
319 | logger = new ProgressLoggerGui(this); | 319 | logger = new ProgressLoggerGui(this); |
320 | logger->show(); | 320 | logger->show(); |
321 | 321 | ||
322 | QString mountpoint = userSettings->value("mountpoint").toString(); | 322 | QString mountpoint = userSettings->value("mountpoint").toString(); |
323 | // show dialog with error if mount point is wrong | 323 | // show dialog with error if mount point is wrong |
324 | if(!QFileInfo(mountpoint).isDir()) { | 324 | if(!QFileInfo(mountpoint).isDir()) { |
325 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); | 325 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); |
326 | logger->abort(); | 326 | logger->abort(); |
327 | return; | 327 | return; |
328 | } | 328 | } |
329 | // Bootloader | 329 | // Bootloader |
330 | devices->beginGroup(userSettings->value("platform").toString()); | 330 | devices->beginGroup(userSettings->value("platform").toString()); |
331 | if(devices->value("needsbootloader", "") == "yes") { | 331 | if(devices->value("needsbootloader", "") == "yes") { |
@@ -357,7 +357,7 @@ void RbUtilQt::completeInstall() | |||
357 | } | 357 | } |
358 | if(m_error) return; | 358 | if(m_error) return; |
359 | logger->undoAbort(); | 359 | logger->undoAbort(); |
360 | 360 | ||
361 | // Fonts | 361 | // Fonts |
362 | m_error = false; | 362 | m_error = false; |
363 | m_installed = false; | 363 | m_installed = false; |
@@ -371,7 +371,7 @@ void RbUtilQt::completeInstall() | |||
371 | } | 371 | } |
372 | if(m_error) return; | 372 | if(m_error) return; |
373 | logger->undoAbort(); | 373 | logger->undoAbort(); |
374 | 374 | ||
375 | // Doom | 375 | // Doom |
376 | if(hasDoom()) | 376 | if(hasDoom()) |
377 | { | 377 | { |
@@ -393,7 +393,7 @@ void RbUtilQt::completeInstall() | |||
393 | // it has its own logger window,so close our. | 393 | // it has its own logger window,so close our. |
394 | logger->close(); | 394 | logger->close(); |
395 | installThemes(); | 395 | installThemes(); |
396 | 396 | ||
397 | } | 397 | } |
398 | 398 | ||
399 | void RbUtilQt::smallInstall() | 399 | void RbUtilQt::smallInstall() |
@@ -401,7 +401,7 @@ void RbUtilQt::smallInstall() | |||
401 | if(QMessageBox::question(this, tr("Confirm Installation"), | 401 | if(QMessageBox::question(this, tr("Confirm Installation"), |
402 | tr("Do you really want to make a small Installation?"), | 402 | tr("Do you really want to make a small Installation?"), |
403 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; | 403 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; |
404 | 404 | ||
405 | // create logger | 405 | // create logger |
406 | logger = new ProgressLoggerGui(this); | 406 | logger = new ProgressLoggerGui(this); |
407 | logger->show(); | 407 | logger->show(); |
@@ -412,7 +412,7 @@ void RbUtilQt::smallInstall() | |||
412 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); | 412 | logger->addItem(tr("Mount point is wrong!"),LOGERROR); |
413 | logger->abort(); | 413 | logger->abort(); |
414 | return; | 414 | return; |
415 | } | 415 | } |
416 | // Bootloader | 416 | // Bootloader |
417 | devices->beginGroup(userSettings->value("platform").toString()); | 417 | devices->beginGroup(userSettings->value("platform").toString()); |
418 | if(devices->value("needsbootloader", "") == "yes") { | 418 | if(devices->value("needsbootloader", "") == "yes") { |
@@ -461,7 +461,7 @@ bool RbUtilQt::installAuto() | |||
461 | QString file = QString("%1%2/rockbox.zip") | 461 | QString file = QString("%1%2/rockbox.zip") |
462 | .arg(devices->value("bleeding_url").toString(), | 462 | .arg(devices->value("bleeding_url").toString(), |
463 | userSettings->value("platform").toString()); | 463 | userSettings->value("platform").toString()); |
464 | 464 | ||
465 | buildInfo.open(); | 465 | buildInfo.open(); |
466 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 466 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
467 | buildInfo.close(); | 467 | buildInfo.close(); |
@@ -475,9 +475,9 @@ bool RbUtilQt::installAuto() | |||
475 | versmap.insert("rel_rev", devices->value("last_release").toString()); | 475 | versmap.insert("rel_rev", devices->value("last_release").toString()); |
476 | versmap.insert("rel_date", ""); // FIXME: provide the release timestamp | 476 | versmap.insert("rel_date", ""); // FIXME: provide the release timestamp |
477 | } | 477 | } |
478 | 478 | ||
479 | QString myversion = "r" + versmap.value("bleed_rev"); | 479 | QString myversion = "r" + versmap.value("bleed_rev"); |
480 | 480 | ||
481 | ZipInstaller* installer = new ZipInstaller(this); | 481 | ZipInstaller* installer = new ZipInstaller(this); |
482 | installer->setUrl(file); | 482 | installer->setUrl(file); |
483 | installer->setProxy(proxy()); | 483 | installer->setProxy(proxy()); |
@@ -487,9 +487,9 @@ bool RbUtilQt::installAuto() | |||
487 | installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); | 487 | installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); |
488 | installer->setMountPoint(userSettings->value("mountpoint").toString()); | 488 | installer->setMountPoint(userSettings->value("mountpoint").toString()); |
489 | installer->install(logger); | 489 | installer->install(logger); |
490 | 490 | ||
491 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); | 491 | connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); |
492 | 492 | ||
493 | return true; | 493 | return true; |
494 | } | 494 | } |
495 | 495 | ||
@@ -530,23 +530,23 @@ void RbUtilQt::installBootloaderBtn() | |||
530 | if(QMessageBox::question(this, tr("Confirm Installation"), | 530 | if(QMessageBox::question(this, tr("Confirm Installation"), |
531 | tr("Do you really want to install the Bootloader?"), | 531 | tr("Do you really want to install the Bootloader?"), |
532 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; | 532 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; |
533 | 533 | ||
534 | // create logger | 534 | // create logger |
535 | logger = new ProgressLoggerGui(this); | 535 | logger = new ProgressLoggerGui(this); |
536 | logger->show(); | 536 | logger->show(); |
537 | 537 | ||
538 | installBootloader(); | 538 | installBootloader(); |
539 | } | 539 | } |
540 | 540 | ||
541 | void RbUtilQt::installBootloader() | 541 | void RbUtilQt::installBootloader() |
542 | { | 542 | { |
543 | QString platform = userSettings->value("platform").toString(); | 543 | QString platform = userSettings->value("platform").toString(); |
544 | 544 | ||
545 | // create installer | 545 | // create installer |
546 | blinstaller = new BootloaderInstaller(this); | 546 | blinstaller = new BootloaderInstaller(this); |
547 | 547 | ||
548 | blinstaller->setMountPoint(userSettings->value("mountpoint").toString()); | 548 | blinstaller->setMountPoint(userSettings->value("mountpoint").toString()); |
549 | 549 | ||
550 | blinstaller->setProxy(proxy()); | 550 | blinstaller->setProxy(proxy()); |
551 | blinstaller->setDevice(platform); | 551 | blinstaller->setDevice(platform); |
552 | blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString()); | 552 | blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString()); |
@@ -560,7 +560,7 @@ void RbUtilQt::installBootloader() | |||
560 | m_error = true; | 560 | m_error = true; |
561 | return; | 561 | return; |
562 | } | 562 | } |
563 | 563 | ||
564 | if(blinstaller->uptodate()) | 564 | if(blinstaller->uptodate()) |
565 | { | 565 | { |
566 | int ret = QMessageBox::question(this, tr("Bootloader Installation"), | 566 | int ret = QMessageBox::question(this, tr("Bootloader Installation"), |
@@ -583,7 +583,7 @@ void RbUtilQt::installBootloader() | |||
583 | return; | 583 | return; |
584 | } | 584 | } |
585 | } | 585 | } |
586 | 586 | ||
587 | // if fwpatcher , ask for extra file | 587 | // if fwpatcher , ask for extra file |
588 | QString offirmware; | 588 | QString offirmware; |
589 | if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher") | 589 | if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher") |
@@ -616,7 +616,7 @@ void RbUtilQt::installBootloader() | |||
616 | } | 616 | } |
617 | } | 617 | } |
618 | blinstaller->setOrigFirmwarePath(offirmware); | 618 | blinstaller->setOrigFirmwarePath(offirmware); |
619 | 619 | ||
620 | blinstaller->install(logger); | 620 | blinstaller->install(logger); |
621 | } | 621 | } |
622 | 622 | ||
@@ -642,7 +642,7 @@ void RbUtilQt::installFonts() | |||
642 | { | 642 | { |
643 | // create zip installer | 643 | // create zip installer |
644 | installer = new ZipInstaller(this); | 644 | installer = new ZipInstaller(this); |
645 | 645 | ||
646 | installer->setUrl(devices->value("font_url").toString()); | 646 | installer->setUrl(devices->value("font_url").toString()); |
647 | installer->setProxy(proxy()); | 647 | installer->setProxy(proxy()); |
648 | installer->setLogSection("Fonts"); | 648 | installer->setLogSection("Fonts"); |
@@ -650,7 +650,7 @@ void RbUtilQt::installFonts() | |||
650 | installer->setMountPoint(userSettings->value("mountpoint").toString()); | 650 | installer->setMountPoint(userSettings->value("mountpoint").toString()); |
651 | if(!userSettings->value("cachedisable").toBool()) | 651 | if(!userSettings->value("cachedisable").toBool()) |
652 | installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); | 652 | installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); |
653 | installer->install(logger); | 653 | installer->install(logger); |
654 | } | 654 | } |
655 | 655 | ||
656 | 656 | ||
@@ -666,7 +666,7 @@ void RbUtilQt::installVoice() | |||
666 | // create zip installer | 666 | // create zip installer |
667 | installer = new ZipInstaller(this); | 667 | installer = new ZipInstaller(this); |
668 | installer->setUnzip(false); | 668 | installer->setUnzip(false); |
669 | 669 | ||
670 | QString voiceurl = devices->value("voice_url").toString() + "/" + | 670 | QString voiceurl = devices->value("voice_url").toString() + "/" + |
671 | userSettings->value("platform").toString() + "-" + | 671 | userSettings->value("platform").toString() + "-" + |
672 | versmap.value("arch_date") + "-english.voice"; | 672 | versmap.value("arch_date") + "-english.voice"; |
@@ -681,7 +681,7 @@ void RbUtilQt::installVoice() | |||
681 | if(!userSettings->value("cachedisable").toBool()) | 681 | if(!userSettings->value("cachedisable").toBool()) |
682 | installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); | 682 | installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); |
683 | installer->install(logger); | 683 | installer->install(logger); |
684 | 684 | ||
685 | //connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); | 685 | //connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); |
686 | } | 686 | } |
687 | 687 | ||
@@ -718,7 +718,7 @@ void RbUtilQt::installDoom() | |||
718 | { | 718 | { |
719 | // create zip installer | 719 | // create zip installer |
720 | installer = new ZipInstaller(this); | 720 | installer = new ZipInstaller(this); |
721 | 721 | ||
722 | installer->setUrl(devices->value("doom_url").toString()); | 722 | installer->setUrl(devices->value("doom_url").toString()); |
723 | installer->setProxy(proxy()); | 723 | installer->setProxy(proxy()); |
724 | installer->setLogSection("Game Addons"); | 724 | installer->setLogSection("Game Addons"); |
@@ -767,7 +767,7 @@ void RbUtilQt::uninstallBootloader(void) | |||
767 | // create logger | 767 | // create logger |
768 | ProgressLoggerGui* logger = new ProgressLoggerGui(this); | 768 | ProgressLoggerGui* logger = new ProgressLoggerGui(this); |
769 | logger->show(); | 769 | logger->show(); |
770 | 770 | ||
771 | QString plattform = userSettings->value("platform").toString(); | 771 | QString plattform = userSettings->value("platform").toString(); |
772 | BootloaderInstaller blinstaller(this); | 772 | BootloaderInstaller blinstaller(this); |
773 | blinstaller.setMountPoint(userSettings->value("mountpoint").toString()); | 773 | blinstaller.setMountPoint(userSettings->value("mountpoint").toString()); |
@@ -782,9 +782,9 @@ void RbUtilQt::uninstallBootloader(void) | |||
782 | logger->abort(); | 782 | logger->abort(); |
783 | return; | 783 | return; |
784 | } | 784 | } |
785 | 785 | ||
786 | blinstaller.uninstall(logger); | 786 | blinstaller.uninstall(logger); |
787 | 787 | ||
788 | } | 788 | } |
789 | 789 | ||
790 | 790 | ||
@@ -795,18 +795,18 @@ void RbUtilQt::downloadManual(void) | |||
795 | "to the root folder of your player."), | 795 | "to the root folder of your player."), |
796 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) | 796 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) |
797 | return; | 797 | return; |
798 | 798 | ||
799 | buildInfo.open(); | 799 | buildInfo.open(); |
800 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 800 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
801 | buildInfo.close(); | 801 | buildInfo.close(); |
802 | 802 | ||
803 | devices->beginGroup(userSettings->value("platform").toString()); | 803 | devices->beginGroup(userSettings->value("platform").toString()); |
804 | QString manual; | 804 | QString manual; |
805 | manual = devices->value("manualname", "rockbox-" + devices->value("platform").toString()).toString(); | 805 | manual = devices->value("manualname", "rockbox-" + devices->value("platform").toString()).toString(); |
806 | devices->endGroup(); | 806 | devices->endGroup(); |
807 | 807 | ||
808 | QString date = (info.value("dailies/date").toString()); | 808 | QString date = (info.value("dailies/date").toString()); |
809 | 809 | ||
810 | QString manualurl; | 810 | QString manualurl; |
811 | QString target; | 811 | QString target; |
812 | QString section; | 812 | QString section; |
@@ -872,7 +872,7 @@ void RbUtilQt::installPortable(void) | |||
872 | } | 872 | } |
873 | logger->addItem(tr("Successfully installed Rockbox Utility."), LOGOK); | 873 | logger->addItem(tr("Successfully installed Rockbox Utility."), LOGOK); |
874 | logger->abort(); | 874 | logger->abort(); |
875 | 875 | ||
876 | } | 876 | } |
877 | 877 | ||
878 | 878 | ||
@@ -913,7 +913,7 @@ void RbUtilQt::updateInfo() | |||
913 | if(log.value(keys.at(b)).toString() < min) | 913 | if(log.value(keys.at(b)).toString() < min) |
914 | min = log.value(keys.at(b)).toString(); | 914 | min = log.value(keys.at(b)).toString(); |
915 | } | 915 | } |
916 | 916 | ||
917 | for(int b = 0; b < keys.size(); b++) { | 917 | for(int b = 0; b < keys.size(); b++) { |
918 | QString file; | 918 | QString file; |
919 | file = userSettings->value("mountpoint").toString() + "/" + keys.at(b); | 919 | file = userSettings->value("mountpoint").toString() + "/" + keys.at(b); |