9#include "ui_usercomponent.h"
19using namespace swift::misc::network;
22using namespace swift::gui::settings;
24using namespace swift::core::context;
39 &CUserComponent::onConnectionStatusChanged);
41 this->onSettingsChanged();
48 Q_ASSERT(ui->tvp_Clients);
49 return ui->tvp_Clients->rowCount();
54 Q_ASSERT(ui->tvp_AllUsers);
55 return ui->tvp_AllUsers->rowCount();
60 if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork())
64 Q_ASSERT(ui->tvp_AllUsers);
65 Q_ASSERT(ui->tvp_Clients);
67 if (sGui->getIContextNetwork()->isConnected())
77 const CUserList users = sGui->getIContextNetwork()->getUsers();
78 ui->tvp_AllUsers->updateContainer(users);
79 ui->tvp_Clients->updateContainer(sGui->getIContextNetwork()->getClientsForCallsigns(users.
getCallsigns()));
83 void CUserComponent::onCountChanged(
int count,
bool withFilter)
87 int iu = this->
indexOf(ui->tb_AllUsers);
88 int ic = this->
indexOf(ui->tb_Clients);
102 ui->tvp_AllUsers->clear();
103 ui->tvp_Clients->clear();
104 m_updateTimer.
stop();
108 m_updateTimer.
start();
112 void CUserComponent::onSettingsChanged()
114 const CViewUpdateSettings settings = m_settings.get();
116 m_updateTimer.setInterval(ms);
void connectionStatusChanged(const swift::misc::network::CConnectionStatus &from, const swift::misc::network::CConnectionStatus &to)
Connection status changed.
static QString replaceTabCountValue(const QString &oldName, int count)
Replace count in name such as "stations (4)".
void requestTextMessageWidget(const swift::misc::aviation::CCallsign &callsign)
Request a text message.
void update()
Update users.
~CUserComponent()
Destructor.
CUserComponent(QWidget *parent=nullptr)
Constructor.
int countClients() const
Number of clients.
int countUsers() const
Number of users.
const swift::misc::physical_quantities::CTime & getAtcUpdateTime() const
Get time.
void requestTextMessageWidget(const swift::misc::aviation::CCallsign &callsign)
Request a text message.
void modelDataChangedDigest(int count, bool withFilter)
Model data changed,.
swift::misc::aviation::CCallsignSet getCallsigns() const
All callsigns.
Value object encapsulating information about a connection status.
bool isConnected() const
Query status.
bool isDisconnected() const
Query status.
Value object encapsulating a list of voice rooms.
int toMs() const
Convenience functions when used with timers etc.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Views, mainly QTableView.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
void setExpanding(bool enabled)
void setTabText(int index, const QString &text)
QString tabText(int index) const const