diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-14 16:23:56 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-14 16:42:29 +0100 |
commit | 2509def164ee7f4aecbe6a786df57140f19e35f2 (patch) | |
tree | 63a7396e1b94482f9f05c3f3abf6c7cd77e10d26 /rbutil/rbutilqt/configure.cpp | |
parent | 440083af872da43c116c5374d8e1511cef65abf2 (diff) | |
download | rockbox-2509def164ee7f4aecbe6a786df57140f19e35f2.tar.gz rockbox-2509def164ee7f4aecbe6a786df57140f19e35f2.zip |
rbutil: Rework player configuration.
- Split internal configuration into player specific and common parts.
Always require passing the player for player specific data instead of
implicitly assuming the currently selected one; only use the currently
selected one if the player name is explicitly passed as empty.
- Similarly adjust handling of server info data; prepare for splitting
into build type specific values so the naming becomes cleaner.
Change-Id: I894e694f83bd9fe2d22ad46b3f8f7df3e2c68033
Diffstat (limited to 'rbutil/rbutilqt/configure.cpp')
-rw-r--r-- | rbutil/rbutilqt/configure.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index 5b81027eb8..182001e3b8 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp | |||
@@ -355,8 +355,8 @@ void Config::setDevices() | |||
355 | QMultiMap <QString, QString> manuf; | 355 | QMultiMap <QString, QString> manuf; |
356 | for(int it = 0; it < platformList.size(); it++) | 356 | for(int it = 0; it < platformList.size(); it++) |
357 | { | 357 | { |
358 | QString curbrand = SystemInfo::platformValue(platformList.at(it), | 358 | QString curbrand = SystemInfo::platformValue( |
359 | SystemInfo::CurBrand).toString(); | 359 | SystemInfo::CurBrand, platformList.at(it)).toString(); |
360 | manuf.insert(curbrand, platformList.at(it)); | 360 | manuf.insert(curbrand, platformList.at(it)); |
361 | } | 361 | } |
362 | 362 | ||
@@ -384,10 +384,10 @@ void Config::setDevices() | |||
384 | if(!manuf.values(brands.at(c)).contains(platformList.at(it))) | 384 | if(!manuf.values(brands.at(c)).contains(platformList.at(it))) |
385 | continue; | 385 | continue; |
386 | // construct display name | 386 | // construct display name |
387 | QString curname = SystemInfo::platformValue(platformList.at(it), | 387 | QString curname = SystemInfo::platformValue( |
388 | SystemInfo::CurName).toString() + | 388 | SystemInfo::CurName, platformList.at(it)).toString() + |
389 | " (" +ServerInfo::platformValue(platformList.at(it), | 389 | " (" +ServerInfo::platformValue( |
390 | ServerInfo::CurStatus).toString() +")"; | 390 | ServerInfo::CurStatus, platformList.at(it)).toString() +")"; |
391 | LOG_INFO() << "add supported device:" << brands.at(c) << curname; | 391 | LOG_INFO() << "add supported device:" << brands.at(c) << curname; |
392 | w2 = new QTreeWidgetItem(w, QStringList(curname)); | 392 | w2 = new QTreeWidgetItem(w, QStringList(curname)); |
393 | w2->setData(0, Qt::UserRole, platformList.at(it)); | 393 | w2->setData(0, Qt::UserRole, platformList.at(it)); |
@@ -471,10 +471,10 @@ void Config::updateEncState() | |||
471 | return; | 471 | return; |
472 | 472 | ||
473 | QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); | 473 | QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); |
474 | QString encoder = SystemInfo::platformValue(devname, | 474 | QString encoder = SystemInfo::platformValue( |
475 | SystemInfo::CurEncoder).toString(); | 475 | SystemInfo::CurEncoder, devname).toString(); |
476 | ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname, | 476 | ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue( |
477 | SystemInfo::CurEncoder).toString())); | 477 | SystemInfo::CurEncoder, devname).toString())); |
478 | 478 | ||
479 | EncoderBase* enc = EncoderBase::getEncoder(this,encoder); | 479 | EncoderBase* enc = EncoderBase::getEncoder(this,encoder); |
480 | 480 | ||
@@ -742,8 +742,8 @@ void Config::autodetect() | |||
742 | mp = tr("(unknown)"); | 742 | mp = tr("(unknown)"); |
743 | } | 743 | } |
744 | msg += QString("<li>%1</li>").arg(tr("%1 at %2").arg( | 744 | msg += QString("<li>%1</li>").arg(tr("%1 at %2").arg( |
745 | SystemInfo::platformValue(detected.at(i).device, | 745 | SystemInfo::platformValue( |
746 | SystemInfo::CurPlatformName).toString(), | 746 | SystemInfo::CurPlatformName, detected.at(i).device).toString(), |
747 | QDir::toNativeSeparators(mp))); | 747 | QDir::toNativeSeparators(mp))); |
748 | } | 748 | } |
749 | msg += "</ul>"; | 749 | msg += "</ul>"; |
@@ -768,22 +768,22 @@ void Config::autodetect() | |||
768 | case Autodetection::PlayerIncompatible: | 768 | case Autodetection::PlayerIncompatible: |
769 | msg += tr("Detected an unsupported player:\n%1\n" | 769 | msg += tr("Detected an unsupported player:\n%1\n" |
770 | "Sorry, Rockbox doesn't run on your player.") | 770 | "Sorry, Rockbox doesn't run on your player.") |
771 | .arg(SystemInfo::platformValue(detected.at(0).device, | 771 | .arg(SystemInfo::platformValue( |
772 | SystemInfo::CurName).toString()); | 772 | SystemInfo::CurName, detected.at(0).device).toString()); |
773 | break; | 773 | break; |
774 | case Autodetection::PlayerMtpMode: | 774 | case Autodetection::PlayerMtpMode: |
775 | msg = tr("%1 in MTP mode found!\n" | 775 | msg = tr("%1 in MTP mode found!\n" |
776 | "You need to change your player to MSC mode for installation. ") | 776 | "You need to change your player to MSC mode for installation. ") |
777 | .arg(SystemInfo::platformValue(detected.at(0).device, | 777 | .arg(SystemInfo::platformValue( |
778 | SystemInfo::CurName).toString()); | 778 | SystemInfo::CurName, detected.at(0).device).toString()); |
779 | break; | 779 | break; |
780 | case Autodetection::PlayerWrongFilesystem: | 780 | case Autodetection::PlayerWrongFilesystem: |
781 | if(SystemInfo::platformValue(detected.at(0).device, | 781 | if(SystemInfo::platformValue( |
782 | SystemInfo::CurBootloaderMethod) == "ipod") { | 782 | SystemInfo::CurBootloaderMethod, detected.at(0).device) == "ipod") { |
783 | msg = tr("%1 \"MacPod\" found!\n" | 783 | msg = tr("%1 \"MacPod\" found!\n" |
784 | "Rockbox needs a FAT formatted Ipod (so-called \"WinPod\") " | 784 | "Rockbox needs a FAT formatted Ipod (so-called \"WinPod\") " |
785 | "to run. ").arg(SystemInfo::platformValue( | 785 | "to run. ").arg(SystemInfo::platformValue( |
786 | detected.at(0).device, SystemInfo::CurName).toString()); | 786 | SystemInfo::CurName, detected.at(0).device).toString()); |
787 | } | 787 | } |
788 | else { | 788 | else { |
789 | msg = tr("The player contains an incompatible filesystem.\n" | 789 | msg = tr("The player contains an incompatible filesystem.\n" |
@@ -962,10 +962,10 @@ void Config::configEnc() | |||
962 | return; | 962 | return; |
963 | 963 | ||
964 | QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); | 964 | QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); |
965 | QString encoder = SystemInfo::platformValue(devname, | 965 | QString encoder = SystemInfo::platformValue( |
966 | SystemInfo::CurEncoder).toString(); | 966 | SystemInfo::CurEncoder, devname).toString(); |
967 | ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname, | 967 | ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue( |
968 | SystemInfo::CurEncoder).toString())); | 968 | SystemInfo::CurEncoder, devname).toString())); |
969 | 969 | ||
970 | 970 | ||
971 | EncoderBase* enc = EncoderBase::getEncoder(this,encoder); | 971 | EncoderBase* enc = EncoderBase::getEncoder(this,encoder); |