mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 13:35:34 +08:00
refactor: Clean up setup file reader
Previously we already switch to loading the bootstrap file only from the
local file (ec42553910).
This removes the remaining parts of loading the bootstrap file from a
remote location.
This also updates the UI in case of parsing errors of the bootstrap.json.
This commit is contained in:
@@ -129,7 +129,6 @@ namespace BlackGui
|
||||
{
|
||||
CGuiApplication::registerMetadata();
|
||||
CApplication::init(false); // base class without metadata
|
||||
if (this->hasSetupReader()) { this->getSetupReader()->setCheckCmdLineBootstrapUrl(false); } // no connect checks on setup reader (handled with interactive setup loading)
|
||||
CGuiApplication::adjustPalette();
|
||||
this->setWindowIcon(icon);
|
||||
this->settingsChanged();
|
||||
@@ -138,9 +137,6 @@ namespace BlackGui
|
||||
|
||||
connect(&m_styleSheetUtility, &CStyleSheetUtility::styleSheetsChanged, this, &CGuiApplication::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
connect(this, &CGuiApplication::startUpCompleted, this, &CGuiApplication::superviseWindowMinSizes, Qt::QueuedConnection);
|
||||
|
||||
// splash screen
|
||||
connect(this->getSetupReader(), &CSetupReader::setupLoadingMessages, this, &CGuiApplication::displaySplashMessages, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1094,48 +1090,21 @@ namespace BlackGui
|
||||
m_minHeightChars = heightChars;
|
||||
}
|
||||
|
||||
bool CGuiApplication::interactivelySynchronizeSetup(int timeoutMs)
|
||||
void CGuiApplication::displaySetupLoadFailure(BlackMisc::CStatusMessageList msgs)
|
||||
{
|
||||
bool ok = false;
|
||||
do
|
||||
if (msgs.hasErrorMessages())
|
||||
{
|
||||
const CStatusMessageList msgs = this->synchronizeSetup(timeoutMs);
|
||||
if (msgs.hasErrorMessages())
|
||||
CSetupLoadingDialog dialog(msgs, BlackGui::CGuiApplication::mainApplicationWidget());
|
||||
if (sGui)
|
||||
{
|
||||
CSetupLoadingDialog dialog(msgs, this->mainApplicationWidget());
|
||||
if (sGui)
|
||||
{
|
||||
static const QString style = sGui->getStyleSheetUtility().styles(
|
||||
{ CStyleSheetUtility::fileNameFonts(),
|
||||
CStyleSheetUtility::fileNameStandardWidget() });
|
||||
dialog.setStyleSheet(style);
|
||||
}
|
||||
static const QString style = sGui->getStyleSheetUtility().styles(
|
||||
{ CStyleSheetUtility::fileNameFonts(),
|
||||
CStyleSheetUtility::fileNameStandardWidget() });
|
||||
dialog.setStyleSheet(style);
|
||||
}
|
||||
|
||||
const int r = dialog.exec();
|
||||
if (r == QDialog::Rejected)
|
||||
{
|
||||
break; // exit with false state, as file was not loaded
|
||||
}
|
||||
else
|
||||
{
|
||||
// run loop again and sync again
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup loaded
|
||||
ok = true;
|
||||
break;
|
||||
}
|
||||
dialog.exec();
|
||||
}
|
||||
while (!ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool CGuiApplication::parseAndSynchronizeSetup(int timeoutMs)
|
||||
{
|
||||
if (!this->parseAndStartupCheck()) { return false; }
|
||||
return this->interactivelySynchronizeSetup(timeoutMs);
|
||||
}
|
||||
|
||||
QDialog::DialogCode CGuiApplication::showCloseDialog(QMainWindow *mainWindow, QCloseEvent *closeEvent)
|
||||
|
||||
Reference in New Issue
Block a user