mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 07:52:16 -07:00
get UserListProxy from TabSupervisor instead of passing it in the constructor (#5490)
This commit is contained in:
parent
92a903b035
commit
2bc71095dd
14 changed files with 32 additions and 52 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#include "pb/response_warn_list.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
#include "user_info_box.h"
|
||||
#include "user_list_manager.h"
|
||||
#include "user_list_proxy.h"
|
||||
#include "user_list_widget.h"
|
||||
|
||||
|
|
@ -28,12 +29,9 @@
|
|||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
UserContextMenu::UserContextMenu(TabSupervisor *_tabSupervisor,
|
||||
const UserListProxy *_userListProxy,
|
||||
QWidget *parent,
|
||||
TabGame *_game)
|
||||
UserContextMenu::UserContextMenu(TabSupervisor *_tabSupervisor, QWidget *parent, TabGame *_game)
|
||||
: QObject(parent), client(_tabSupervisor->getClient()), tabSupervisor(_tabSupervisor),
|
||||
userListProxy(_userListProxy), game(_game)
|
||||
userListProxy(_tabSupervisor->getUserListManager()), game(_game)
|
||||
{
|
||||
aUserName = new QAction(QString(), this);
|
||||
aUserName->setEnabled(false);
|
||||
|
|
|
|||
|
|
@ -54,10 +54,7 @@ private slots:
|
|||
void gamesOfUserReceived(const Response &resp, const CommandContainer &commandContainer);
|
||||
|
||||
public:
|
||||
UserContextMenu(TabSupervisor *_tabSupervisor,
|
||||
const UserListProxy *_userListProxy,
|
||||
QWidget *_parent,
|
||||
TabGame *_game = 0);
|
||||
UserContextMenu(TabSupervisor *_tabSupervisor, QWidget *_parent, TabGame *_game = 0);
|
||||
void retranslateUi();
|
||||
void showContextMenu(const QPoint &pos,
|
||||
const QString &userName,
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ UserListWidget::UserListWidget(TabSupervisor *_tabSupervisor,
|
|||
: QGroupBox(parent), tabSupervisor(_tabSupervisor), client(_client), type(_type), onlineCount(0)
|
||||
{
|
||||
itemDelegate = new UserListItemDelegate(this);
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, tabSupervisor->getUserListManager(), this);
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, this);
|
||||
connect(userContextMenu, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool)));
|
||||
|
||||
userTree = new QTreeWidget;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue