Cockatrice/cockatrice/src/tab_room.h
Matt Lowe 81a8141fe5 Added system tray icon
+ Can be used for setting client size and closing the client.

Will expand on by sending client alerts to the tray.

Updated to push message notifactions to the toolbar

Preview image:

Added setting to enable/disable message popups

Added functionality

+ updated popup message and translation
+ Double clicking tray icon will now bring up the app/minimize it
+ can now be alerted of mentions
+ added setting to set if you want mentions on desktop
+ clicking mention message will take you to the main chat
+ added translations for icon menu
+ removed maximize/minimize/restore from menu, not needed.

Added disconnect

+ Disconnects any previous message slots/signals from the system icon
message bubble
2015-03-26 18:37:57 +01:00

82 lines
2.3 KiB
C++

#ifndef TAB_ROOM_H
#define TAB_ROOM_H
#include "tab.h"
#include <QGroupBox>
#include <QMap>
namespace google { namespace protobuf { class Message; } }
class AbstractClient;
class UserList;
class QLabel;
class ChatView;
class QLineEdit;
class QPushButton;
class QTextTable;
class RoomEvent;
class ServerInfo_Room;
class ServerInfo_Game;
class Event_ListGames;
class Event_JoinRoom;
class Event_LeaveRoom;
class Event_RoomSay;
class GameSelector;
class Response;
class PendingCommand;
class ServerInfo_User;
class TabRoom : public Tab {
Q_OBJECT
private:
AbstractClient *client;
int roomId;
QString roomName;
ServerInfo_User *ownUser;
QMap<int, QString> gameTypes;
GameSelector *gameSelector;
UserList *userList;
ChatView *chatView;
QLabel *sayLabel;
QLineEdit *sayEdit;
QGroupBox *chatGroupBox;
QMenu *roomMenu;
QAction *aLeaveRoom;
QAction *aOpenChatSettings;
QAction * aClearChat;
QString sanitizeHtml(QString dirty) const;
signals:
void roomClosing(TabRoom *tab);
void openMessageDialog(const QString &userName, bool focus);
private slots:
void sendMessage();
void sayFinished(const Response &response);
void actLeaveRoom();
void actClearChat();
void actOpenChatSettings();
void addMentionTag(QString mentionTag);
void focusTab();
void processListGamesEvent(const Event_ListGames &event);
void processJoinRoomEvent(const Event_JoinRoom &event);
void processLeaveRoomEvent(const Event_LeaveRoom &event);
void processRoomSayEvent(const Event_RoomSay &event);
public:
TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerInfo_User *_ownUser, const ServerInfo_Room &info);
~TabRoom();
void retranslateUi();
void closeRequest();
void tabActivated();
void processRoomEvent(const RoomEvent &event);
int getRoomId() const { return roomId; }
const QMap<int, QString> &getGameTypes() const { return gameTypes; }
QString getChannelName() const { return roomName; }
QString getTabText() const { return roomName; }
const ServerInfo_User *getUserInfo() const { return ownUser; }
PendingCommand *prepareRoomCommand(const ::google::protobuf::Message &cmd);
void sendRoomCommand(PendingCommand *pend);
};
#endif