mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #227, view/model for client class
* model * view * and GUI component which now encapsulates the user table view
This commit is contained in:
43
src/blackgui/usercomponent.h
Normal file
43
src/blackgui/usercomponent.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef BLACKGUI_USERCOMPONENT_H
|
||||
#define BLACKGUI_USERCOMPONENT_H
|
||||
|
||||
#include "blackgui/runtimebasedcomponent.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();
|
||||
|
||||
public slots:
|
||||
//! Update users
|
||||
void update();
|
||||
|
||||
//! Update time, time < 100 stops updates
|
||||
void setUpdateInterval(int milliSeconds);
|
||||
|
||||
//! Update time
|
||||
void setUpdateIntervalSeconds(int seconds) { this->setUpdateInterval(1000 * seconds); }
|
||||
|
||||
private:
|
||||
Ui::CUserComponent *ui;
|
||||
QTimer *m_timer;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user