This commit is contained in:
doitux
2007-12-09 13:44:23 +00:00
parent e3d027a25f
commit 5aa2647ade
5 changed files with 18 additions and 20 deletions
+8 -4
View File
@@ -20,12 +20,13 @@
#include "chattools.h"
#include "session.h"
#include "configfile.h"
#include "sdlplayer.h"
#include <iostream>
using namespace std;
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode, QTextBrowser *b, QTreeWidget *t) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myNotifyMode(notifyMode), myConfig(c)
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode, QTextBrowser *b, QTreeWidget *t, SDLPlayer *s, QDialog *p) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myNotifyMode(notifyMode), myConfig(c), mySDLPlayer(s), myParentDialog(p)
{
}
@@ -64,7 +65,6 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
break;
default:;
}
myTextBrowser->append(playerName + ": " + tempMsg);
}
else {
switch (myNotifyMode) {
@@ -75,9 +75,13 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
case 2: tempMsg = QString("<span style=\"color:#FFFFFF;\">"+message+"</span>");
break;
default:;
}
myTextBrowser->append(playerName + ": " + tempMsg);
}
}
myTextBrowser->append(playerName + ": " + tempMsg);
}
if(myParentDialog) {
if(myParentDialog->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification"))
mySDLPlayer->playSound("lobbychatnotify",0);
}
}
+4 -1
View File
@@ -26,13 +26,14 @@
class Session;
class ConfigFile;
class SDLPlayer;
class ChatTools : public QObject
{
Q_OBJECT
public:
ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode = 0, QTextBrowser *b = NULL, QTreeWidget *t = NULL );
ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode = 0, QTextBrowser *b = NULL, QTreeWidget *t = NULL, SDLPlayer *s = NULL, QDialog *p = NULL );
~ChatTools();
@@ -67,6 +68,8 @@ private:
Session *mySession;
int myNotifyMode; // 0 == no notification, 1 == bold notification, 2 == yellow notification
ConfigFile *myConfig;
SDLPlayer *mySDLPlayer;
QDialog *myParentDialog; //needed for visible check for audio-nick-notification
// friend class GuiWrapper;