mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T554, improved auto publishing handling during shutdown
This commit is contained in:
committed by
Mat Sutcliffe
parent
3e6c4f2ef1
commit
f87004c6c8
@@ -55,6 +55,11 @@ namespace BlackGui
|
||||
return r;
|
||||
}
|
||||
|
||||
bool CAutoPublishComponent::isEmpty() const
|
||||
{
|
||||
return m_data.isEmpty();
|
||||
}
|
||||
|
||||
void CAutoPublishComponent::analyzeAgainstDBData()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace BlackGui
|
||||
//! Read the files
|
||||
int readFiles();
|
||||
|
||||
//! Data empty
|
||||
bool isEmpty() const;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CAutoPublishComponent> ui;
|
||||
BlackMisc::Simulation::CAutoPublishData m_data;
|
||||
|
||||
@@ -217,8 +217,13 @@ void CSwiftData::checkMinimumVersion()
|
||||
|
||||
void CSwiftData::checkAutoPublishing()
|
||||
{
|
||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||
if (!CAutoPublishData::existAutoPublishFiles()) { return; }
|
||||
this->showAutoPublishing();
|
||||
}
|
||||
|
||||
void CSwiftData::showAutoPublishing()
|
||||
{
|
||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||
if (!m_autoPublishDialog) { m_autoPublishDialog = new CAutoPublishDialog(this); }
|
||||
m_autoPublishDialog->readAndShow();
|
||||
}
|
||||
|
||||
@@ -70,9 +70,11 @@ private:
|
||||
//! Check auto-publishing
|
||||
void checkAutoPublishing();
|
||||
|
||||
//! Show auto publishing
|
||||
void showAutoPublishing();
|
||||
|
||||
void performGracefulShutdown();
|
||||
void consolidationSettingChanged();
|
||||
|
||||
void displayConsole();
|
||||
void displayLog();
|
||||
void checkMinimumVersion();
|
||||
|
||||
@@ -55,7 +55,7 @@ void CSwiftData::initDynamicMenus()
|
||||
ui->menu_InfoAreas->addActions(ui->comp_MainInfoArea->getInfoAreaSelectActions(true, ui->menu_InfoAreas));
|
||||
|
||||
// menu entry for auto publish data
|
||||
ui->menu_Mapping->addAction(CIcons::database16(), "Auto publish data", this, &CSwiftData::checkAutoPublishing);
|
||||
ui->menu_Mapping->addAction(CIcons::database16(), "Auto publish data", this, &CSwiftData::showAutoPublishing);
|
||||
|
||||
QString resourceDir(CDirectoryUtils::shareDirectory());
|
||||
if (!resourceDir.isEmpty() && QDir(resourceDir).exists())
|
||||
|
||||
@@ -296,7 +296,7 @@ private:
|
||||
void copyXSwiftBusDialog(bool checkFileTimestamp);
|
||||
|
||||
//! Auto publish diloag
|
||||
void autoPublishDialog();
|
||||
int autoPublishDialog();
|
||||
|
||||
//! Show auto publish dialog if appropriate
|
||||
bool triggerAutoPublishDialog();
|
||||
|
||||
@@ -189,12 +189,12 @@ void SwiftGuiStd::copyXSwiftBusDialog(bool checkFileTimestamp)
|
||||
if (c > 0) { CLogMessage(this).info(u"Copied %1 files from build directory") << c; }
|
||||
}
|
||||
|
||||
void SwiftGuiStd::autoPublishDialog()
|
||||
int SwiftGuiStd::autoPublishDialog()
|
||||
{
|
||||
if (!m_autoPublishDialog)
|
||||
{
|
||||
m_autoPublishDialog.reset(new CAutoPublishDialog(this));
|
||||
}
|
||||
m_lastAutoPublish.set(QDateTime::currentMSecsSinceEpoch());
|
||||
m_autoPublishDialog->show();
|
||||
return m_autoPublishDialog->readAndShow();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user