mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
Ref T554, auto publish dialog in swift mapping tool
This commit is contained in:
committed by
Mat Sutcliffe
parent
16e3042cfb
commit
0f4629d8f4
@@ -11,15 +11,17 @@
|
|||||||
#include "blackgui/components/dbmappingcomponent.h"
|
#include "blackgui/components/dbmappingcomponent.h"
|
||||||
#include "blackgui/components/logcomponent.h"
|
#include "blackgui/components/logcomponent.h"
|
||||||
#include "blackgui/components/datasettingscomponent.h"
|
#include "blackgui/components/datasettingscomponent.h"
|
||||||
|
#include "blackgui/components/autopublishdialog.h"
|
||||||
#include "blackgui/guiapplication.h"
|
#include "blackgui/guiapplication.h"
|
||||||
#include "blackgui/stylesheetutility.h"
|
#include "blackgui/stylesheetutility.h"
|
||||||
#include "blackcore/data/globalsetup.h"
|
#include "blackcore/data/globalsetup.h"
|
||||||
|
#include "blackmisc/simulation/autopublishdata.h"
|
||||||
|
#include "blackmisc/simulation/distributorlist.h"
|
||||||
#include "blackmisc/loghandler.h"
|
#include "blackmisc/loghandler.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
#include "blackmisc/logpattern.h"
|
#include "blackmisc/logpattern.h"
|
||||||
#include "blackmisc/network/url.h"
|
#include "blackmisc/network/url.h"
|
||||||
#include "blackmisc/simulation/distributorlist.h"
|
|
||||||
#include "blackconfig/buildconfig.h"
|
#include "blackconfig/buildconfig.h"
|
||||||
#include "ui_swiftdata.h"
|
#include "ui_swiftdata.h"
|
||||||
|
|
||||||
@@ -28,6 +30,7 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
@@ -58,8 +61,7 @@ void CSwiftData::initStyleSheet()
|
|||||||
CStyleSheetUtility::fileNameFonts(),
|
CStyleSheetUtility::fileNameFonts(),
|
||||||
CStyleSheetUtility::fileNameStandardWidget(),
|
CStyleSheetUtility::fileNameStandardWidget(),
|
||||||
CStyleSheetUtility::fileNameSwiftData()
|
CStyleSheetUtility::fileNameSwiftData()
|
||||||
}
|
});
|
||||||
);
|
|
||||||
this->setStyleSheet(s);
|
this->setStyleSheet(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,8 +115,15 @@ void CSwiftData::init()
|
|||||||
this->setWindowTitle(QStringLiteral("%1 %2").arg(this->windowTitle(), s.getDbHomePageUrl().toQString(true)));
|
this->setWindowTitle(QStringLiteral("%1 %2").arg(this->windowTitle(), s.getDbHomePageUrl().toQString(true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
sGui->triggerNewVersionCheck(15 * 1000);
|
sGui->triggerNewVersionCheck(20 * 1000);
|
||||||
QTimer::singleShot(15 * 1000, this, &CSwiftData::checkMinimumVersion);
|
QPointer<CSwiftData> myself(this);
|
||||||
|
QTimer::singleShot(15 * 1000, this, [ = ]
|
||||||
|
{
|
||||||
|
if (!myself || !sGui || sGui->isShuttingDown()) { return; }
|
||||||
|
this->checkMinimumVersion();
|
||||||
|
this->checkAutoPublishing();
|
||||||
|
});
|
||||||
|
|
||||||
emit sGui->startUpCompleted(true);
|
emit sGui->startUpCompleted(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,3 +212,11 @@ void CSwiftData::checkMinimumVersion()
|
|||||||
this->displayInOverlayWindow(sm);
|
this->displayInOverlayWindow(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSwiftData::checkAutoPublishing()
|
||||||
|
{
|
||||||
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
|
if (!CAutoPublishData::existAutoPublishFiles()) { return; }
|
||||||
|
if (!m_autoPublishDialog) { m_autoPublishDialog = new CAutoPublishDialog(this); }
|
||||||
|
m_autoPublishDialog->readAndShow();
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,10 +22,9 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace Ui { class CSwiftData; }
|
namespace Ui { class CSwiftData; }
|
||||||
namespace BlackCore { class CWebDataServices; }
|
namespace BlackCore { class CWebDataServices; }
|
||||||
|
namespace BlackGui { namespace Components { class CAutoPublishDialog; }}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* swift data entry control (aka mapping tool)
|
* swift data entry control (aka mapping tool)
|
||||||
@@ -46,8 +45,7 @@ public:
|
|||||||
virtual ~CSwiftData() override;
|
virtual ~CSwiftData() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! \name QMainWindow events
|
//! \name QMainWindow events @[
|
||||||
//! @[
|
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
@@ -61,8 +59,7 @@ private:
|
|||||||
//! Menu clicked
|
//! Menu clicked
|
||||||
void onMenuClicked();
|
void onMenuClicked();
|
||||||
|
|
||||||
//! Init functions
|
//! Init functions @{
|
||||||
//! @{
|
|
||||||
void init();
|
void init();
|
||||||
void initLogDisplay();
|
void initLogDisplay();
|
||||||
void initStyleSheet();
|
void initStyleSheet();
|
||||||
@@ -70,6 +67,9 @@ private:
|
|||||||
void initDynamicMenus();
|
void initDynamicMenus();
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! Check auto-publishing
|
||||||
|
void checkAutoPublishing();
|
||||||
|
|
||||||
void performGracefulShutdown();
|
void performGracefulShutdown();
|
||||||
void consolidationSettingChanged();
|
void consolidationSettingChanged();
|
||||||
|
|
||||||
@@ -81,6 +81,9 @@ private:
|
|||||||
BlackGui::CManagedStatusBar m_statusBar;
|
BlackGui::CManagedStatusBar m_statusBar;
|
||||||
BlackCore::Db::CBackgroundDataUpdater *m_updater = nullptr; //!< consolidate with DB data
|
BlackCore::Db::CBackgroundDataUpdater *m_updater = nullptr; //!< consolidate with DB data
|
||||||
BlackMisc::CSettingReadOnly<BlackGui::Settings::TBackgroundConsolidation> m_consolidationSettings { this, &CSwiftData::consolidationSettingChanged }; //!< consolidation time
|
BlackMisc::CSettingReadOnly<BlackGui::Settings::TBackgroundConsolidation> m_consolidationSettings { this, &CSwiftData::consolidationSettingChanged }; //!< consolidation time
|
||||||
|
|
||||||
|
// auto update
|
||||||
|
BlackGui::Components::CAutoPublishDialog *m_autoPublishDialog = nullptr; //!< auto publishing dialog
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
Reference in New Issue
Block a user