mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
committed by
Mathew Sutcliffe
parent
b475d7eff1
commit
d15d0db431
27
src/blackgui/userlistmodel.cpp
Normal file
27
src/blackgui/userlistmodel.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "userlistmodel.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include <QMetaProperty>
|
||||
#include <QBrush>
|
||||
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
CUserListModel::CUserListModel(QObject *parent) :
|
||||
CListModelBase<BlackMisc::Network::CUser, BlackMisc::Network::CUserList>("ViewUserList", parent)
|
||||
{
|
||||
this->m_columns.addColumn(CUser::IndexId, "id");
|
||||
this->m_columns.addColumn(CUser::IndexRealName, "realname");
|
||||
this->m_columns.addColumn(CUser::IndexId, "userid");
|
||||
this->m_columns.addColumn(CUser::IndexEmail, "email");
|
||||
|
||||
// force strings for translation in resource files
|
||||
(void)QT_TRANSLATE_NOOP("ViewUserList", "id");
|
||||
(void)QT_TRANSLATE_NOOP("ViewUserList", "realname");
|
||||
(void)QT_TRANSLATE_NOOP("ViewUserList", "userid");
|
||||
(void)QT_TRANSLATE_NOOP("ViewUserList", "email");
|
||||
}
|
||||
}
|
||||
31
src/blackgui/userlistmodel.h
Normal file
31
src/blackgui/userlistmodel.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef BLACKGUI_USERLISTMODEL_H
|
||||
#define BLACKGUI_USERLISTMODEL_H
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDBusConnection>
|
||||
#include "blackmisc/nwuserlist.h"
|
||||
#include "blackgui/listmodelbase.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
/*!
|
||||
* \brief Server list model
|
||||
*/
|
||||
class CUserListModel : public CListModelBase<BlackMisc::Network::CUser, BlackMisc::Network::CUserList>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param parent
|
||||
*/
|
||||
explicit CUserListModel(QObject *parent = nullptr);
|
||||
|
||||
/*!
|
||||
* \brief Destructor
|
||||
*/
|
||||
virtual ~CUserListModel() {}
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user