Files
pilotclient/src/swiftdata/swiftdata.h
Klaus Basan fb046ae1fb refs #485, moved central GUI functionality to sGui
* allow to send status message to main window (from everywhere)
* Use sGui::changedStylesheet where possible
* message when model is stashed
* improved application startup
2016-03-18 01:09:11 +00:00

87 lines
2.4 KiB
C++

/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef SWIFTDATA_H
#define SWIFTDATA_H
#include "blackgui/systemtraywindow.h"
#include "blackgui/managedstatusbar.h"
#include "blackgui/mainwindowaccess.h"
#include "blackcore/corefacade.h"
#include "blackcore/data/globalsetup.h"
#include "blackcore/data/updateinfo.h"
#include "blackcore/setupreader.h"
#include "blackmisc/statusmessage.h"
#include "blackmisc/identifiable.h"
#include <QScopedPointer>
namespace Ui { class CSwiftData; }
namespace BlackCore { class CWebDataServices; }
/*!
* swift data entry control (aka mapping tool)
*/
class CSwiftData :
public QMainWindow,
public BlackMisc::CIdentifiable,
public BlackGui::IMainWindowAccess
{
Q_OBJECT
public:
//! Constructor
CSwiftData(QWidget *parent = nullptr);
//! Destructor
~CSwiftData();
//! \name direct access to main application window
//! @{
virtual bool displayInStatusBar(const BlackMisc::CStatusMessage &message) override;
virtual bool displayInOverlayWindow(const BlackMisc::CStatusMessage &message) override;
//! }@
protected:
//! \copydoc QMainWindow::closeEvent
virtual void closeEvent(QCloseEvent *event) override;
private slots:
//! Append log message
void ps_appendLogMessage(const BlackMisc::CStatusMessage &message);
//! Style sheet has changed
void ps_onStyleSheetsChanged();
//! Menu clicked
void ps_onMenuClicked();
//! Setup has been changed
void ps_setupChanged();
private:
void init();
void initLogDisplay();
void initStyleSheet();
void initMenu();
void initDynamicMenus();
void performGracefulShutdown();
void displayConsole();
void displayLog();
QScopedPointer<Ui::CSwiftData> ui;
BlackGui::CManagedStatusBar m_statusBar;
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this, &CSwiftData::ps_setupChanged}; //!< setup cache
BlackMisc::CData<BlackCore::Data::UpdateInfo> m_updateInfo { this }; //!< download / version data
};
#endif // guard