mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CAutoPublishComponent::isEmpty() const
|
||||||
|
{
|
||||||
|
return m_data.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
void CAutoPublishComponent::analyzeAgainstDBData()
|
void CAutoPublishComponent::analyzeAgainstDBData()
|
||||||
{
|
{
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ namespace BlackGui
|
|||||||
//! Read the files
|
//! Read the files
|
||||||
int readFiles();
|
int readFiles();
|
||||||
|
|
||||||
|
//! Data empty
|
||||||
|
bool isEmpty() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CAutoPublishComponent> ui;
|
QScopedPointer<Ui::CAutoPublishComponent> ui;
|
||||||
BlackMisc::Simulation::CAutoPublishData m_data;
|
BlackMisc::Simulation::CAutoPublishData m_data;
|
||||||
|
|||||||
@@ -217,8 +217,13 @@ void CSwiftData::checkMinimumVersion()
|
|||||||
|
|
||||||
void CSwiftData::checkAutoPublishing()
|
void CSwiftData::checkAutoPublishing()
|
||||||
{
|
{
|
||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
|
||||||
if (!CAutoPublishData::existAutoPublishFiles()) { return; }
|
if (!CAutoPublishData::existAutoPublishFiles()) { return; }
|
||||||
|
this->showAutoPublishing();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSwiftData::showAutoPublishing()
|
||||||
|
{
|
||||||
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
if (!m_autoPublishDialog) { m_autoPublishDialog = new CAutoPublishDialog(this); }
|
if (!m_autoPublishDialog) { m_autoPublishDialog = new CAutoPublishDialog(this); }
|
||||||
m_autoPublishDialog->readAndShow();
|
m_autoPublishDialog->readAndShow();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,9 +70,11 @@ private:
|
|||||||
//! Check auto-publishing
|
//! Check auto-publishing
|
||||||
void checkAutoPublishing();
|
void checkAutoPublishing();
|
||||||
|
|
||||||
|
//! Show auto publishing
|
||||||
|
void showAutoPublishing();
|
||||||
|
|
||||||
void performGracefulShutdown();
|
void performGracefulShutdown();
|
||||||
void consolidationSettingChanged();
|
void consolidationSettingChanged();
|
||||||
|
|
||||||
void displayConsole();
|
void displayConsole();
|
||||||
void displayLog();
|
void displayLog();
|
||||||
void checkMinimumVersion();
|
void checkMinimumVersion();
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ void CSwiftData::initDynamicMenus()
|
|||||||
ui->menu_InfoAreas->addActions(ui->comp_MainInfoArea->getInfoAreaSelectActions(true, ui->menu_InfoAreas));
|
ui->menu_InfoAreas->addActions(ui->comp_MainInfoArea->getInfoAreaSelectActions(true, ui->menu_InfoAreas));
|
||||||
|
|
||||||
// menu entry for auto publish data
|
// 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());
|
QString resourceDir(CDirectoryUtils::shareDirectory());
|
||||||
if (!resourceDir.isEmpty() && QDir(resourceDir).exists())
|
if (!resourceDir.isEmpty() && QDir(resourceDir).exists())
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ private:
|
|||||||
void copyXSwiftBusDialog(bool checkFileTimestamp);
|
void copyXSwiftBusDialog(bool checkFileTimestamp);
|
||||||
|
|
||||||
//! Auto publish diloag
|
//! Auto publish diloag
|
||||||
void autoPublishDialog();
|
int autoPublishDialog();
|
||||||
|
|
||||||
//! Show auto publish dialog if appropriate
|
//! Show auto publish dialog if appropriate
|
||||||
bool triggerAutoPublishDialog();
|
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; }
|
if (c > 0) { CLogMessage(this).info(u"Copied %1 files from build directory") << c; }
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwiftGuiStd::autoPublishDialog()
|
int SwiftGuiStd::autoPublishDialog()
|
||||||
{
|
{
|
||||||
if (!m_autoPublishDialog)
|
if (!m_autoPublishDialog)
|
||||||
{
|
{
|
||||||
m_autoPublishDialog.reset(new CAutoPublishDialog(this));
|
m_autoPublishDialog.reset(new CAutoPublishDialog(this));
|
||||||
}
|
}
|
||||||
m_lastAutoPublish.set(QDateTime::currentMSecsSinceEpoch());
|
m_lastAutoPublish.set(QDateTime::currentMSecsSinceEpoch());
|
||||||
m_autoPublishDialog->show();
|
return m_autoPublishDialog->readAndShow();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user