"Try to fix" for setup loading dialog

This commit is contained in:
Klaus Basan
2018-07-16 15:47:12 +02:00
parent 52513db63f
commit 3bfb76c1e6
3 changed files with 20 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ namespace BlackGui
connect(ui->pb_Help, &QPushButton::clicked, this, &CSetupLoadingDialog::openHelpPage);
connect(ui->pb_CopyFromSwift, &QPushButton::clicked, this, &CSetupLoadingDialog::copyFromOtherSwiftVersions);
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);
retry->setDefault(true);
@@ -117,6 +118,14 @@ namespace BlackGui
this->accept();
}
void CSetupLoadingDialog::tryToFix()
{
this->prefillSetupCache();
QPushButton *retry = ui->bb_Dialog->button(QDialogButtonBox::Retry);
if (!retry) { return; }
retry->click();
}
void CSetupLoadingDialog::prefillSetupCache()
{
if (!sApp || sApp->isShuttingDown()) { return; }
@@ -145,6 +154,7 @@ namespace BlackGui
const bool hasCachedSetup = this->hasCachedSetup();
ui->pb_LoadFromDisk->setEnabled(!hasCachedSetup);
ui->pb_LoadFromDisk->setToolTip(hasCachedSetup ? "Cached setup already available" : "No cached setup");
ui->pb_TryToFix->setEnabled(!hasCachedSetup);
}
void CSetupLoadingDialog::displayOtherVersionsInfo()

View File

@@ -64,6 +64,9 @@ namespace BlackGui
//! Try again without explicit bootstrap URL
void tryAgainWithoutBootstrapUrl();
//! Try to fix
void tryToFix();
//! Prefill setup cache
void prefillSetupCache();

View File

@@ -195,6 +195,13 @@
</property>
</widget>
</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>
</widget>
</item>