mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 21:13:55 -07:00
room stuff and minor fixes
This commit is contained in:
parent
80277ff573
commit
78d81ae65a
19 changed files with 159 additions and 99 deletions
|
|
@ -3,8 +3,9 @@
|
|||
|
||||
#include <QGroupBox>
|
||||
#include <QTreeWidget>
|
||||
#include <QTextBrowser>
|
||||
#include "tab.h"
|
||||
#include "protocol_datastructures.h"
|
||||
//#include "protocol_datastructures.h"
|
||||
|
||||
class AbstractClient;
|
||||
class QTextEdit;
|
||||
|
|
@ -17,6 +18,8 @@ class Event_ServerMessage;
|
|||
class Event_UserJoined;
|
||||
class Event_UserLeft;
|
||||
class ProtocolResponse;
|
||||
class ServerInfo_User;
|
||||
class ServerInfo_Room;
|
||||
|
||||
class RoomSelector : public QGroupBox {
|
||||
Q_OBJECT
|
||||
|
|
@ -37,25 +40,13 @@ public:
|
|||
void retranslateUi();
|
||||
};
|
||||
|
||||
class ServerMessageLog : public QGroupBox {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QTextEdit *textEdit;
|
||||
private slots:
|
||||
void processServerMessageEvent(Event_ServerMessage *event);
|
||||
public:
|
||||
ServerMessageLog(AbstractClient *_client, QWidget *parent = 0);
|
||||
void retranslateUi();
|
||||
};
|
||||
|
||||
class UserInfoBox : public QWidget {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QLabel *avatarLabel, *nameLabel, *countryLabel1, *countryLabel2, *userLevelLabel1, *userLevelLabel2, *userLevelLabel3;
|
||||
private slots:
|
||||
void processResponse(ProtocolResponse *response);
|
||||
void updateInfo(ServerInfo_User *user);
|
||||
public:
|
||||
UserInfoBox(AbstractClient *_client, QWidget *parent = 0);
|
||||
UserInfoBox(ServerInfo_User *userInfo, QWidget *parent = 0);
|
||||
void retranslateUi();
|
||||
};
|
||||
|
||||
|
|
@ -63,21 +54,21 @@ class TabServer : public Tab {
|
|||
Q_OBJECT
|
||||
signals:
|
||||
void roomJoined(ServerInfo_Room *info);
|
||||
// void gameJoined(int gameId);
|
||||
void openMessageDialog(const QString &userName, bool focus);
|
||||
void userLeft(const QString &userName);
|
||||
private slots:
|
||||
void processListUsersResponse(ProtocolResponse *response);
|
||||
void processUserJoinedEvent(Event_UserJoined *event);
|
||||
void processUserLeftEvent(Event_UserLeft *event);
|
||||
void processServerMessageEvent(Event_ServerMessage *event);
|
||||
private:
|
||||
AbstractClient *client;
|
||||
RoomSelector *roomSelector;
|
||||
ServerMessageLog *serverMessageLog;
|
||||
QTextBrowser *serverInfoBox;
|
||||
UserList *userList;
|
||||
UserInfoBox *userInfoBox;
|
||||
public:
|
||||
TabServer(AbstractClient *_client, QWidget *parent = 0);
|
||||
TabServer(AbstractClient *_client, ServerInfo_User *userInfo, QWidget *parent = 0);
|
||||
void retranslateUi();
|
||||
QString getTabText() const { return tr("Server"); }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue