mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #335, managed status bar
* auto init if required * auto clear (timer based) if required * to be used in floating widgets
This commit is contained in:
committed by
Roland Winklmeier
parent
ffc9cc1b77
commit
718965d78d
72
src/blackgui/managedstatusbar.h
Normal file
72
src/blackgui/managedstatusbar.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* Copyright (C) 2014
|
||||
* 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 BLACKGUI_MANAGEDSTATUSBAR_H
|
||||
#define BLACKGUI_MANAGEDSTATUSBAR_H
|
||||
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QStatusBar>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
|
||||
//! Managed status bar
|
||||
class CManagedStatusBar : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
explicit CManagedStatusBar(QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CManagedStatusBar();
|
||||
|
||||
//! Get the status bar
|
||||
QStatusBar *getStatusBar() const { return m_statusBar; }
|
||||
|
||||
//! Init
|
||||
void initStatusBar(QStatusBar *statusBar = nullptr);
|
||||
|
||||
//! Show
|
||||
void show();
|
||||
|
||||
//! Hide
|
||||
void hide();
|
||||
|
||||
public slots:
|
||||
//! Display status message
|
||||
void displayStatusMessage(const BlackMisc::CStatusMessage &statusMessage);
|
||||
|
||||
//! Display status messages
|
||||
void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages);
|
||||
|
||||
private slots:
|
||||
//! Clear status bar
|
||||
void ps_clearStatusBar();
|
||||
|
||||
private:
|
||||
QStatusBar *m_statusBar = nullptr; //!< the status bar itself
|
||||
QLabel *m_statusBarIcon = nullptr; //!< status bar icon
|
||||
QLabel *m_statusBarLabel = nullptr; //!< status bar label
|
||||
QTimer *m_timerStatusBar = nullptr; //!< cleaning up status bar (own cleaning as I need to clean window / icon)
|
||||
bool m_ownStatusBar = false;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user