highlight lobbychat messages with own nick into

This commit is contained in:
doitux
2007-09-30 18:48:43 +00:00
parent 6fcc400443
commit 0e11228a95
4 changed files with 20 additions and 6 deletions
@@ -22,7 +22,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
{
setupUi(this);
myChat = new LobbyChat(this);
myChat = new LobbyChat(this, myConfig);
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
@@ -214,7 +214,7 @@ void gameLobbyDialogImpl::updateGameItem(QTreeWidgetItem *item, unsigned gameId)
if (info.mode == GAME_MODE_STARTED)
item->setData(2, Qt::DisplayRole, tr("running"));
else
item->setData(2, Qt::DisplayRole, tr("registering"));
item->setData(2, Qt::DisplayRole, tr("open"));
if (info.isPasswordProtected)
item->setIcon(3, QIcon(myAppDataPath+"gfx/gui/misc/lock.png"));
@@ -24,11 +24,12 @@
#include "gamelobbydialogimpl.h"
#include "session.h"
#include "configfile.h"
using namespace std;
LobbyChat::LobbyChat(gameLobbyDialogImpl* l) : myLobby(l)
LobbyChat::LobbyChat(gameLobbyDialogImpl* l, ConfigFile *c) : myLobby(l), myConfig(c)
{
}
@@ -113,8 +114,18 @@ void LobbyChat::playerLeft(QString playerName)
}
void LobbyChat::displayMessage(QString playerName, QString message) {
QString tempMsg;
cout << message.toStdString() << endl;
cout << QString::fromUtf8(myConfig->readConfigString("MyName").c_str()).toStdString() << endl;
myLobby->textBrowser_ChatDisplay->append(playerName + ": " + message);
if(message.contains(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()), Qt::CaseInsensitive)) {
tempMsg = QString("<b>"+message+"</b>");
}
else {
tempMsg = message;
}
myLobby->textBrowser_ChatDisplay->append(playerName + ": " + tempMsg);
}
void LobbyChat::checkInputLength(QString string) {
@@ -25,13 +25,14 @@
class gameLobbyDialogImpl;
class Session;
class ConfigFile;
class LobbyChat : public QObject
{
Q_OBJECT
public:
LobbyChat(gameLobbyDialogImpl*);
LobbyChat(gameLobbyDialogImpl*, ConfigFile*);
~LobbyChat();
@@ -53,8 +54,10 @@ public slots:
private:
gameLobbyDialogImpl *myLobby;
ConfigFile *myConfig;
QString myNick;
// friend class GuiWrapper;
};
@@ -459,7 +459,7 @@ void settingsDialogImpl::callManualBlindsOrderDialog() {
}
myAfterMBAlwaysDoubleBlinds = myManualBlindsOrderDialog->radioButton_alwaysDoubleBlinds->isChecked();
myAfterMBAlwaysRaiseAbout = myManualBlindsOrderDialog->radioButton_alwaysRaiseAbout->isChecked();
myAfterMBAlwaysRaiseAbout = myManualBlindsOrderDialog->radioButton_alwaysRaiseAbout->isChecked();
myAfterMBAlwaysRaiseValue = myManualBlindsOrderDialog->spinBox_alwaysRaiseValue->value();
myAfterMBStayAtLastBlind = myManualBlindsOrderDialog->radioButton_stayAtLastBlind->isChecked();