author | nemo |
Sun, 21 Feb 2010 22:01:59 +0000 | |
changeset 2838 | 4a79fd4f04a8 |
parent 2779 | e1ae0019d43f |
child 2845 | 19db164dd20d |
permissions | -rw-r--r-- |
480 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
486 | 3 |
* Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com> |
480 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
461 | 19 |
#ifndef _CHAT_WIDGET_INCLUDED |
20 |
#define _CHAT_WIDGET_INCLUDED |
|
21 |
||
22 |
#include <QWidget> |
|
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
23 |
#include <QListWidget> |
461 | 24 |
#include <QString> |
25 |
#include <QGridLayout> |
|
26 |
||
2775 | 27 |
#include "SDLs.h" |
28 |
||
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
29 |
class QTextBrowser; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
30 |
class QLineEdit; |
461 | 31 |
class QListWidget; |
2773
e94f240a8a41
Have game beep when someone joins lobby/room. Controlled by Sound option
nemo
parents:
2706
diff
changeset
|
32 |
class QSettings; |
e94f240a8a41
Have game beep when someone joins lobby/room. Controlled by Sound option
nemo
parents:
2706
diff
changeset
|
33 |
class SDLInteraction; |
461 | 34 |
|
35 |
class HWChatWidget : public QWidget |
|
36 |
{ |
|
37 |
Q_OBJECT |
|
38 |
||
39 |
public: |
|
2775 | 40 |
HWChatWidget(QWidget* parent, QSettings * gameSettings, SDLInteraction * sdli, bool notify); |
461 | 41 |
|
42 |
public slots: |
|
1360 | 43 |
void onChatString(const QString& str); |
1587 | 44 |
void onServerMessage(const QString& str); |
2777 | 45 |
void nickAdded(const QString& nick, bool notifyNick); |
465 | 46 |
void nickRemoved(const QString& nick); |
47 |
void clear(); |
|
1405 | 48 |
void setReadyStatus(const QString & nick, bool isReady); |
1860 | 49 |
void adminAccess(bool); |
461 | 50 |
|
51 |
signals: |
|
52 |
void chatLine(const QString& str); |
|
1391 | 53 |
void kick(const QString & str); |
1860 | 54 |
void ban(const QString & str); |
1577 | 55 |
void info(const QString & str); |
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
56 |
void follow(const QString &); |
461 | 57 |
|
58 |
private: |
|
59 |
QGridLayout mainLayout; |
|
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
60 |
QTextBrowser* chatText; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
61 |
QStringList chatStrings; |
462 | 62 |
QListWidget* chatNicks; |
461 | 63 |
QLineEdit* chatEditLine; |
1860 | 64 |
QAction * acInfo; |
65 |
QAction * acKick; |
|
66 |
QAction * acBan; |
|
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
67 |
QAction * acFollow; |
2773
e94f240a8a41
Have game beep when someone joins lobby/room. Controlled by Sound option
nemo
parents:
2706
diff
changeset
|
68 |
QSettings * gameSettings; |
e94f240a8a41
Have game beep when someone joins lobby/room. Controlled by Sound option
nemo
parents:
2706
diff
changeset
|
69 |
SDLInteraction * sdli; |
2779
e1ae0019d43f
Suggestion from Tiy. Use a random hi. Could maybe be shorter sounds, using the 4 shortest voicepacks already
nemo
parents:
2777
diff
changeset
|
70 |
Mix_Chunk *sound[4]; |
2775 | 71 |
bool notify; |
461 | 72 |
|
73 |
private slots: |
|
74 |
void returnPressed(); |
|
1860 | 75 |
void onBan(); |
1391 | 76 |
void onKick(); |
1577 | 77 |
void onInfo(); |
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
78 |
void onFollow(); |
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
79 |
void chatNickDoubleClicked(QListWidgetItem * item); |
461 | 80 |
}; |
81 |
||
82 |
#endif // _CHAT_WIDGET_INCLUDED |