mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +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/logcomponent.h"
|
||||
#include "blackgui/components/datasettingscomponent.h"
|
||||
#include "blackgui/components/autopublishdialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/stylesheetutility.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackmisc/simulation/autopublishdata.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/logpattern.h"
|
||||
#include "blackmisc/network/url.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "ui_swiftdata.h"
|
||||
|
||||
@@ -28,6 +30,7 @@
|
||||
#include <QStyle>
|
||||
#include <QtGlobal>
|
||||
#include <QVersionNumber>
|
||||
#include <QPointer>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -58,8 +61,7 @@ void CSwiftData::initStyleSheet()
|
||||
CStyleSheetUtility::fileNameFonts(),
|
||||
CStyleSheetUtility::fileNameStandardWidget(),
|
||||
CStyleSheetUtility::fileNameSwiftData()
|
||||
}
|
||||
);
|
||||
});
|
||||
this->setStyleSheet(s);
|
||||
}
|
||||
|
||||
@@ -113,8 +115,15 @@ void CSwiftData::init()
|
||||
this->setWindowTitle(QStringLiteral("%1 %2").arg(this->windowTitle(), s.getDbHomePageUrl().toQString(true)));
|
||||
}
|
||||
|
||||
sGui->triggerNewVersionCheck(15 * 1000);
|
||||
QTimer::singleShot(15 * 1000, this, &CSwiftData::checkMinimumVersion);
|
||||
sGui->triggerNewVersionCheck(20 * 1000);
|
||||
QPointer<CSwiftData> myself(this);
|
||||
QTimer::singleShot(15 * 1000, this, [ = ]
|
||||
{
|
||||
if (!myself || !sGui || sGui->isShuttingDown()) { return; }
|
||||
this->checkMinimumVersion();
|
||||
this->checkAutoPublishing();
|
||||
});
|
||||
|
||||
emit sGui->startUpCompleted(true);
|
||||
}
|
||||
|
||||
@@ -203,3 +212,11 @@ void CSwiftData::checkMinimumVersion()
|
||||
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 <QScopedPointer>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace Ui { class CSwiftData; }
|
||||
namespace BlackCore { class CWebDataServices; }
|
||||
namespace BlackGui { namespace Components { class CAutoPublishDialog; }}
|
||||
|
||||
/*!
|
||||
* swift data entry control (aka mapping tool)
|
||||
@@ -46,8 +45,7 @@ public:
|
||||
virtual ~CSwiftData() override;
|
||||
|
||||
protected:
|
||||
//! \name QMainWindow events
|
||||
//! @[
|
||||
//! \name QMainWindow events @[
|
||||
virtual void closeEvent(QCloseEvent *event) override;
|
||||
//! @}
|
||||
|
||||
@@ -61,8 +59,7 @@ private:
|
||||
//! Menu clicked
|
||||
void onMenuClicked();
|
||||
|
||||
//! Init functions
|
||||
//! @{
|
||||
//! Init functions @{
|
||||
void init();
|
||||
void initLogDisplay();
|
||||
void initStyleSheet();
|
||||
@@ -70,6 +67,9 @@ private:
|
||||
void initDynamicMenus();
|
||||
//! @}
|
||||
|
||||
//! Check auto-publishing
|
||||
void checkAutoPublishing();
|
||||
|
||||
void performGracefulShutdown();
|
||||
void consolidationSettingChanged();
|
||||
|
||||
@@ -81,6 +81,9 @@ private:
|
||||
BlackGui::CManagedStatusBar m_statusBar;
|
||||
BlackCore::Db::CBackgroundDataUpdater *m_updater = nullptr; //!< consolidate with DB data
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user