mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -07:00
Rename UserList class to UserListWidget (#5473)
This commit is contained in:
parent
25caae6d0f
commit
d09b9eb533
14 changed files with 48 additions and 42 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#include "../../deck/custom_line_edit.h"
|
||||
#include "../../server/pending_command.h"
|
||||
#include "../../server/user/user_info_box.h"
|
||||
#include "../../server/user/user_list.h"
|
||||
#include "../../server/user/user_list_widget.h"
|
||||
#include "../game_logic/abstract_client.h"
|
||||
#include "../sound_engine.h"
|
||||
#include "pb/event_add_to_list.pb.h"
|
||||
|
|
@ -21,15 +21,15 @@
|
|||
TabAccount::TabAccount(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &userInfo)
|
||||
: Tab(_tabSupervisor), client(_client)
|
||||
{
|
||||
allUsersList = new UserList(_tabSupervisor, client, UserList::AllUsersList);
|
||||
buddyList = new UserList(_tabSupervisor, client, UserList::BuddyList);
|
||||
ignoreList = new UserList(_tabSupervisor, client, UserList::IgnoreList);
|
||||
allUsersList = new UserListWidget(_tabSupervisor, client, UserListWidget::AllUsersList);
|
||||
buddyList = new UserListWidget(_tabSupervisor, client, UserListWidget::BuddyList);
|
||||
ignoreList = new UserListWidget(_tabSupervisor, client, UserListWidget::IgnoreList);
|
||||
userInfoBox = new UserInfoBox(client, true);
|
||||
userInfoBox->updateInfo(userInfo);
|
||||
|
||||
connect(allUsersList, &UserList::openMessageDialog, this, &TabAccount::openMessageDialog);
|
||||
connect(buddyList, &UserList::openMessageDialog, this, &TabAccount::openMessageDialog);
|
||||
connect(ignoreList, &UserList::openMessageDialog, this, &TabAccount::openMessageDialog);
|
||||
connect(allUsersList, &UserListWidget::openMessageDialog, this, &TabAccount::openMessageDialog);
|
||||
connect(buddyList, &UserListWidget::openMessageDialog, this, &TabAccount::openMessageDialog);
|
||||
connect(ignoreList, &UserListWidget::openMessageDialog, this, &TabAccount::openMessageDialog);
|
||||
|
||||
connect(client, &AbstractClient::userJoinedEventReceived, this, &TabAccount::processUserJoinedEvent);
|
||||
connect(client, &AbstractClient::userLeftEventReceived, this, &TabAccount::processUserLeftEvent);
|
||||
|
|
@ -201,7 +201,7 @@ void TabAccount::processAddToListEvent(const Event_AddToList &event)
|
|||
const ServerInfo_User &info = event.user_info();
|
||||
bool online = allUsersList->getUsers().contains(QString::fromStdString(info.name()));
|
||||
QString list = QString::fromStdString(event.list_name());
|
||||
UserList *userList = 0;
|
||||
UserListWidget *userList = 0;
|
||||
if (list == "buddy")
|
||||
userList = buddyList;
|
||||
else if (list == "ignore")
|
||||
|
|
@ -217,7 +217,7 @@ void TabAccount::processRemoveFromListEvent(const Event_RemoveFromList &event)
|
|||
{
|
||||
QString list = QString::fromStdString(event.list_name());
|
||||
QString user = QString::fromStdString(event.user_name());
|
||||
UserList *userList = 0;
|
||||
UserListWidget *userList = 0;
|
||||
if (list == "buddy")
|
||||
userList = buddyList;
|
||||
else if (list == "ignore")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "tab.h"
|
||||
|
||||
class AbstractClient;
|
||||
class UserList;
|
||||
class UserListWidget;
|
||||
class UserInfoBox;
|
||||
class LineEditUnfocusable;
|
||||
|
||||
|
|
@ -37,9 +37,9 @@ private slots:
|
|||
|
||||
private:
|
||||
AbstractClient *client;
|
||||
UserList *allUsersList;
|
||||
UserList *buddyList;
|
||||
UserList *ignoreList;
|
||||
UserListWidget *allUsersList;
|
||||
UserListWidget *buddyList;
|
||||
UserListWidget *ignoreList;
|
||||
UserInfoBox *userInfoBox;
|
||||
LineEditUnfocusable *addBuddyEdit;
|
||||
LineEditUnfocusable *addIgnoreEdit;
|
||||
|
|
@ -52,15 +52,15 @@ public:
|
|||
{
|
||||
return tr("Account");
|
||||
}
|
||||
const UserList *getAllUsersList() const
|
||||
const UserListWidget *getAllUsersList() const
|
||||
{
|
||||
return allUsersList;
|
||||
}
|
||||
const UserList *getBuddyList() const
|
||||
const UserListWidget *getBuddyList() const
|
||||
{
|
||||
return buddyList;
|
||||
}
|
||||
const UserList *getIgnoreList() const
|
||||
const UserListWidget *getIgnoreList() const
|
||||
{
|
||||
return ignoreList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "../../main.h"
|
||||
#include "../../server/chat_view/chat_view.h"
|
||||
#include "../../server/pending_command.h"
|
||||
#include "../../server/user/user_list.h"
|
||||
#include "../../server/user/user_list_widget.h"
|
||||
#include "../../settings/cache_settings.h"
|
||||
#include "get_pb_extension.h"
|
||||
#include "pb/event_join_room.pb.h"
|
||||
|
|
@ -47,7 +47,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
|||
QMap<int, GameTypeMap> tempMap;
|
||||
tempMap.insert(info.room_id(), gameTypes);
|
||||
gameSelector = new GameSelector(client, tabSupervisor, this, QMap<int, QString>(), tempMap, true, true);
|
||||
userList = new UserList(tabSupervisor, client, UserList::RoomList);
|
||||
userList = new UserListWidget(tabSupervisor, client, UserListWidget::RoomList);
|
||||
connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this,
|
||||
SIGNAL(openMessageDialog(const QString &, bool)));
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Message;
|
|||
}
|
||||
} // namespace google
|
||||
class AbstractClient;
|
||||
class UserList;
|
||||
class UserListWidget;
|
||||
class QLabel;
|
||||
class ChatView;
|
||||
class QPushButton;
|
||||
|
|
@ -48,7 +48,7 @@ private:
|
|||
QMap<int, QString> gameTypes;
|
||||
|
||||
GameSelector *gameSelector;
|
||||
UserList *userList;
|
||||
UserListWidget *userList;
|
||||
ChatView *chatView;
|
||||
QLabel *sayLabel;
|
||||
LineEditCompleter *sayEdit;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "../../client/game_logic/abstract_client.h"
|
||||
#include "../../server/pending_command.h"
|
||||
#include "../../server/user/user_list.h"
|
||||
#include "../../server/user/user_list_widget.h"
|
||||
#include "pb/event_list_rooms.pb.h"
|
||||
#include "pb/event_server_message.pb.h"
|
||||
#include "pb/response_join_room.pb.h"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
class AbstractClient;
|
||||
class QTextEdit;
|
||||
class QLabel;
|
||||
class UserList;
|
||||
class UserListWidget;
|
||||
class QPushButton;
|
||||
|
||||
class Event_ListRooms;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "../../client/game_logic/abstract_client.h"
|
||||
#include "../../main.h"
|
||||
#include "../../server/user/user_list.h"
|
||||
#include "../../server/user/user_list_widget.h"
|
||||
#include "../../settings/cache_settings.h"
|
||||
#include "../ui/pixel_map_generator.h"
|
||||
#include "pb/event_game_joined.pb.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue