mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-29 13:20:18 +02:00
Fixed java refresh button
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
889f604a41
commit
1c96ae5807
@ -55,7 +55,7 @@ Downloader::Downloader(QWidget* parent) : QDialog(parent), ui(new Ui::JavaDownlo
|
|||||||
ui->javaVersionSelect->setEmptyString(tr("No java versions are currently available for your OS."));
|
ui->javaVersionSelect->setEmptyString(tr("No java versions are currently available for your OS."));
|
||||||
ui->javaVersionSelect->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
ui->javaVersionSelect->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
||||||
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Retry)->setText(tr("Refresh"));
|
ui->buttonBox->button(QDialogButtonBox::Reset)->setText(tr("Refresh"));
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Download"));
|
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Download"));
|
||||||
|
|
||||||
connect(ui->majorVersionSelect, &VersionSelectWidget::selectedVersionChanged, this, &Downloader::setSelectedVersion);
|
connect(ui->majorVersionSelect, &VersionSelectWidget::selectedVersionChanged, this, &Downloader::setSelectedVersion);
|
||||||
@ -98,6 +98,7 @@ void Downloader::accept()
|
|||||||
connect(task.get(), &Task::failed, this, deletePath);
|
connect(task.get(), &Task::failed, this, deletePath);
|
||||||
connect(task.get(), &Task::aborted, this, deletePath);
|
connect(task.get(), &Task::aborted, this, deletePath);
|
||||||
ProgressDialog pg(this);
|
ProgressDialog pg(this);
|
||||||
|
pg.setSkipButton(true, tr("Abort"));
|
||||||
pg.execWithTask(task.get());
|
pg.execWithTask(task.get());
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Retry</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -71,8 +71,8 @@
|
|||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>248</x>
|
<x>257</x>
|
||||||
<y>254</y>
|
<y>583</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>157</x>
|
<x>157</x>
|
||||||
@ -87,8 +87,8 @@
|
|||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>316</x>
|
<x>325</x>
|
||||||
<y>260</y>
|
<y>583</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>286</x>
|
<x>286</x>
|
||||||
|
@ -104,10 +104,12 @@ bool sortJavas(BaseVersion::Ptr left, BaseVersion::Ptr right)
|
|||||||
|
|
||||||
void VersionList::sortVersions()
|
void VersionList::sortVersions()
|
||||||
{
|
{
|
||||||
|
if (!m_version || !m_version->data())
|
||||||
|
return;
|
||||||
QString versionStr = SysInfo::getSupportedJavaArchitecture();
|
QString versionStr = SysInfo::getSupportedJavaArchitecture();
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
auto runtimes = m_version->data()->runtimes;
|
auto runtimes = m_version->data()->runtimes;
|
||||||
if (!versionStr.isEmpty() && runtimes.contains(versionStr)) {
|
if (!versionStr.isEmpty() && !runtimes.isEmpty() && runtimes.contains(versionStr)) {
|
||||||
m_vlist = runtimes.value(versionStr);
|
m_vlist = runtimes.value(versionStr);
|
||||||
std::sort(m_vlist.begin(), m_vlist.end(), sortJavas);
|
std::sort(m_vlist.begin(), m_vlist.end(), sortJavas);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user