mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
Ref T632, filter out clients not in range
This commit is contained in:
@@ -6,18 +6,20 @@
|
|||||||
* or distributed except according to the terms contained in the LICENSE file.
|
* or distributed except according to the terms contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackcore/context/contextnetwork.h"
|
|
||||||
#include "blackcore/network.h"
|
|
||||||
#include "blackgui/components/usercomponent.h"
|
#include "blackgui/components/usercomponent.h"
|
||||||
#include "blackgui/guiapplication.h"
|
#include "blackgui/guiapplication.h"
|
||||||
#include "blackgui/guiutility.h"
|
#include "blackgui/guiutility.h"
|
||||||
#include "blackgui/views/clientview.h"
|
#include "blackgui/views/clientview.h"
|
||||||
#include "blackgui/views/userview.h"
|
#include "blackgui/views/userview.h"
|
||||||
|
#include "blackcore/context/contextnetwork.h"
|
||||||
|
#include "blackcore/network.h"
|
||||||
|
#include "blackmisc/network/userlist.h"
|
||||||
#include "ui_usercomponent.h"
|
#include "ui_usercomponent.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
|
|
||||||
|
using namespace BlackMisc::Network;
|
||||||
using namespace BlackGui;
|
using namespace BlackGui;
|
||||||
using namespace BlackGui::Views;
|
using namespace BlackGui::Views;
|
||||||
using namespace BlackGui::Settings;
|
using namespace BlackGui::Settings;
|
||||||
@@ -62,7 +64,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CUserComponent::update()
|
void CUserComponent::update()
|
||||||
{
|
{
|
||||||
if (!sGui || !sGui->getIContextNetwork()) { return; }
|
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork()) { return; }
|
||||||
Q_ASSERT(ui->tvp_AllUsers);
|
Q_ASSERT(ui->tvp_AllUsers);
|
||||||
Q_ASSERT(ui->tvp_Clients);
|
Q_ASSERT(ui->tvp_Clients);
|
||||||
|
|
||||||
@@ -76,8 +78,9 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load data
|
// load data
|
||||||
ui->tvp_Clients->updateContainer(sGui->getIContextNetwork()->getClients());
|
const CUserList users = sGui->getIContextNetwork()->getUsers();
|
||||||
ui->tvp_AllUsers->updateContainer(sGui->getIContextNetwork()->getUsers());
|
ui->tvp_AllUsers->updateContainer(users);
|
||||||
|
ui->tvp_Clients->updateContainer(sGui->getIContextNetwork()->getClientsForCallsigns(users.getCallsigns()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace BlackGui
|
|||||||
explicit CUserComponent(QWidget *parent = nullptr);
|
explicit CUserComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CUserComponent();
|
virtual ~CUserComponent() override;
|
||||||
|
|
||||||
//! Number of clients
|
//! Number of clients
|
||||||
int countClients() const;
|
int countClients() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user