diff options
author | flow <flowlnlnln@gmail.com> | 2022-06-24 09:26:35 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-07-03 12:43:05 -0300 |
commit | 145da82cd8ca6856975eca175fdad74f6d6a0659 (patch) | |
tree | 7a8c9548dec7a2a78e80b2d643ec5f95db399504 /launcher/ui/pages/modplatform | |
parent | 64776d6bacfd33317306d08c5ce35b7827714c04 (diff) | |
download | PrismLauncher-145da82cd8ca6856975eca175fdad74f6d6a0659.tar.gz PrismLauncher-145da82cd8ca6856975eca175fdad74f6d6a0659.tar.bz2 PrismLauncher-145da82cd8ca6856975eca175fdad74f6d6a0659.zip |
fix: show invalid version even when there's none
Having a blank instead of _anything_ is bad UX. Instead, even when
there's not a valid version (most likely disabled redistribution), we
show a message in the UI, to differentiate from the loading state.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui/pages/modplatform')
-rw-r--r-- | launcher/ui/pages/modplatform/flame/FlamePage.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp index e2a485dd..7d2ba2e2 100644 --- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp +++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp @@ -157,6 +157,10 @@ void FlamePage::onSelectionChanged(QModelIndex curr, QModelIndex prev) if (!listModel->setData(curr, current_updated, Qt::UserRole)) qWarning() << "Failed to cache versions for the current pack!"; + // TODO: Check whether it's a connection issue or the project disabled 3rd-party distribution. + if (current.versionsLoaded && ui->versionSelectionBox->count() < 1) { + ui->versionSelectionBox->addItem(tr("No version is available!"), -1); + } suggestCurrent(); }); QObject::connect(netJob, &NetJob::finished, this, [response, netJob] { @@ -172,6 +176,11 @@ void FlamePage::onSelectionChanged(QModelIndex curr, QModelIndex prev) suggestCurrent(); } + // TODO: Check whether it's a connection issue or the project disabled 3rd-party distribution. + if (current.versionsLoaded && ui->versionSelectionBox->count() < 1) { + ui->versionSelectionBox->addItem(tr("No version is available!"), -1); + } + updateUi(); } @@ -181,7 +190,7 @@ void FlamePage::suggestCurrent() return; } - if (selectedVersion.isEmpty()) { + if (selectedVersion.isEmpty() || selectedVersion == "-1") { dialog->setSuggestedPack(); return; } |