mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
"Try to fix" for setup loading dialog
This commit is contained in:
@@ -44,6 +44,7 @@ namespace BlackGui
|
|||||||
connect(ui->pb_Help, &QPushButton::clicked, this, &CSetupLoadingDialog::openHelpPage);
|
connect(ui->pb_Help, &QPushButton::clicked, this, &CSetupLoadingDialog::openHelpPage);
|
||||||
connect(ui->pb_CopyFromSwift, &QPushButton::clicked, this, &CSetupLoadingDialog::copyFromOtherSwiftVersions);
|
connect(ui->pb_CopyFromSwift, &QPushButton::clicked, this, &CSetupLoadingDialog::copyFromOtherSwiftVersions);
|
||||||
connect(ui->pb_OpemDirectory, &QPushButton::clicked, this, &CSetupLoadingDialog::openDirectory);
|
connect(ui->pb_OpemDirectory, &QPushButton::clicked, this, &CSetupLoadingDialog::openDirectory);
|
||||||
|
connect(ui->pb_TryToFix, &QPushButton::clicked, this, &CSetupLoadingDialog::tryToFix);
|
||||||
|
|
||||||
QPushButton *retry = ui->bb_Dialog->button(QDialogButtonBox::Retry);
|
QPushButton *retry = ui->bb_Dialog->button(QDialogButtonBox::Retry);
|
||||||
retry->setDefault(true);
|
retry->setDefault(true);
|
||||||
@@ -117,6 +118,14 @@ namespace BlackGui
|
|||||||
this->accept();
|
this->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSetupLoadingDialog::tryToFix()
|
||||||
|
{
|
||||||
|
this->prefillSetupCache();
|
||||||
|
QPushButton *retry = ui->bb_Dialog->button(QDialogButtonBox::Retry);
|
||||||
|
if (!retry) { return; }
|
||||||
|
retry->click();
|
||||||
|
}
|
||||||
|
|
||||||
void CSetupLoadingDialog::prefillSetupCache()
|
void CSetupLoadingDialog::prefillSetupCache()
|
||||||
{
|
{
|
||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
@@ -145,6 +154,7 @@ namespace BlackGui
|
|||||||
const bool hasCachedSetup = this->hasCachedSetup();
|
const bool hasCachedSetup = this->hasCachedSetup();
|
||||||
ui->pb_LoadFromDisk->setEnabled(!hasCachedSetup);
|
ui->pb_LoadFromDisk->setEnabled(!hasCachedSetup);
|
||||||
ui->pb_LoadFromDisk->setToolTip(hasCachedSetup ? "Cached setup already available" : "No cached setup");
|
ui->pb_LoadFromDisk->setToolTip(hasCachedSetup ? "Cached setup already available" : "No cached setup");
|
||||||
|
ui->pb_TryToFix->setEnabled(!hasCachedSetup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSetupLoadingDialog::displayOtherVersionsInfo()
|
void CSetupLoadingDialog::displayOtherVersionsInfo()
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ namespace BlackGui
|
|||||||
//! Try again without explicit bootstrap URL
|
//! Try again without explicit bootstrap URL
|
||||||
void tryAgainWithoutBootstrapUrl();
|
void tryAgainWithoutBootstrapUrl();
|
||||||
|
|
||||||
|
//! Try to fix
|
||||||
|
void tryToFix();
|
||||||
|
|
||||||
//! Prefill setup cache
|
//! Prefill setup cache
|
||||||
void prefillSetupCache();
|
void prefillSetupCache();
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="2" colspan="2">
|
||||||
|
<widget class="QPushButton" name="pb_TryToFix">
|
||||||
|
<property name="text">
|
||||||
|
<string>try to fix</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user