mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
refs #300, moved components in own namespace and directory
This commit is contained in:
74
src/blackgui/components/infowindowcomponent.h
Normal file
74
src/blackgui/components/infowindowcomponent.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* Copyright (C) 2013
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKGUI_INFOWINDOW_H
|
||||
#define BLACKGUI_INFOWINDOW_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "blackmisc/nwtextmessage.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QWizardPage>
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class InfoWindow; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
/*!
|
||||
* Multi purpose info window (pop up window)
|
||||
*/
|
||||
class CInfoWindowComponent : public QWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
const static int DefaultDisplayTimeMs = 4000; //!< Display n milliseconds
|
||||
|
||||
//! Constructor
|
||||
explicit CInfoWindowComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CInfoWindowComponent();
|
||||
|
||||
public slots:
|
||||
|
||||
//! Info message, pure string
|
||||
void displayStringMessage(const QString &message, int displayTimeMs = DefaultDisplayTimeMs);
|
||||
|
||||
//! Info message, based on text message
|
||||
void displayTextMessage(const BlackMisc::Network::CTextMessage &textMessage, int displayTimeMs = DefaultDisplayTimeMs);
|
||||
|
||||
//! Info message, based on status message
|
||||
void displayStatusMessage(const BlackMisc::CStatusMessage &statusMessage, int displayTimeMs = DefaultDisplayTimeMs);
|
||||
|
||||
//! Display any of the specialized types
|
||||
void display(const BlackMisc::CVariant &variant, int displayTimeMs = DefaultDisplayTimeMs);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::InfoWindow> ui; //!< user interface
|
||||
QTimer *m_hideTimer;
|
||||
|
||||
//! Init the window
|
||||
void initWindow();
|
||||
|
||||
//! Show window, hide after some time
|
||||
void showWindow(int displayTimeMs);
|
||||
|
||||
//! Current page
|
||||
void setCurrentPage(QWidget *widget);
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user