mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
* changed user componet to use new component * all new components (aircraft, ATC stations) will use this timer * it is implemented as "has a" timer based component, as inheriting from 2 QObjects would be problematic
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
#ifndef BLACKGUI_USERCOMPONENT_H
|
|
#define BLACKGUI_USERCOMPONENT_H
|
|
|
|
#include "blackgui/runtimebasedcomponent.h"
|
|
#include "blackgui/timerbasedcomponent.h"
|
|
#include "blackmisc/nwuserlist.h"
|
|
|
|
#include <QTabWidget>
|
|
#include <QTimer>
|
|
|
|
namespace Ui { class CUserComponent; }
|
|
|
|
namespace BlackGui
|
|
{
|
|
|
|
//! User componenet (users, clients)
|
|
class CUserComponent : public QTabWidget, public CRuntimeBasedComponent
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
//! Constructor
|
|
explicit CUserComponent(QWidget *parent = nullptr);
|
|
|
|
//! Destructor
|
|
~CUserComponent();
|
|
|
|
//! Timer for updating
|
|
CTimerBasedComponent *getTimerComponent() { return this->m_timerComponent; }
|
|
|
|
public slots:
|
|
//! Update users
|
|
void update();
|
|
|
|
//! \copydoc CTimerBasedComponent::setUpdateIntervalSeconds
|
|
void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateIntervalSeconds(seconds); }
|
|
|
|
//! \copydoc CTimerBasedComponent::setUpdateInterval
|
|
void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateInterval(milliSeconds); }
|
|
|
|
//! \copydoc CTimerBasedComponent::stopTimer
|
|
void stopTimer() { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->stopTimer(); }
|
|
|
|
private:
|
|
Ui::CUserComponent *ui;
|
|
CTimerBasedComponent *m_timerComponent;
|
|
};
|
|
}
|
|
|
|
#endif // guard
|