mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:38:15 +08:00
refs #300, moved components in own namespace and directory
This commit is contained in:
60
src/blackgui/components/usercomponent.h
Normal file
60
src/blackgui/components/usercomponent.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* 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_USERCOMPONENT_H
|
||||
#define BLACKGUI_USERCOMPONENT_H
|
||||
|
||||
#include "blackgui/components/runtimebasedcomponent.h"
|
||||
#include "blackgui/components/timerbasedcomponent.h"
|
||||
#include "blackmisc/nwuserlist.h"
|
||||
|
||||
#include <QTabWidget>
|
||||
#include <QTimer>
|
||||
|
||||
namespace Ui { class CUserComponent; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
//! 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
|
||||
Reference in New Issue
Block a user