highlight lobbychat messages with own nick into
This commit is contained in:
@@ -22,7 +22,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
|
|||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
myChat = new LobbyChat(this);
|
myChat = new LobbyChat(this, myConfig);
|
||||||
|
|
||||||
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
|
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)
|
if (info.mode == GAME_MODE_STARTED)
|
||||||
item->setData(2, Qt::DisplayRole, tr("running"));
|
item->setData(2, Qt::DisplayRole, tr("running"));
|
||||||
else
|
else
|
||||||
item->setData(2, Qt::DisplayRole, tr("registering"));
|
item->setData(2, Qt::DisplayRole, tr("open"));
|
||||||
|
|
||||||
if (info.isPasswordProtected)
|
if (info.isPasswordProtected)
|
||||||
item->setIcon(3, QIcon(myAppDataPath+"gfx/gui/misc/lock.png"));
|
item->setIcon(3, QIcon(myAppDataPath+"gfx/gui/misc/lock.png"));
|
||||||
|
|||||||
@@ -24,11 +24,12 @@
|
|||||||
|
|
||||||
#include "gamelobbydialogimpl.h"
|
#include "gamelobbydialogimpl.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
|
||||||
using namespace std;
|
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) {
|
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) {
|
void LobbyChat::checkInputLength(QString string) {
|
||||||
|
|||||||
@@ -25,13 +25,14 @@
|
|||||||
|
|
||||||
class gameLobbyDialogImpl;
|
class gameLobbyDialogImpl;
|
||||||
class Session;
|
class Session;
|
||||||
|
class ConfigFile;
|
||||||
|
|
||||||
class LobbyChat : public QObject
|
class LobbyChat : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LobbyChat(gameLobbyDialogImpl*);
|
LobbyChat(gameLobbyDialogImpl*, ConfigFile*);
|
||||||
|
|
||||||
~LobbyChat();
|
~LobbyChat();
|
||||||
|
|
||||||
@@ -53,8 +54,10 @@ public slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
gameLobbyDialogImpl *myLobby;
|
gameLobbyDialogImpl *myLobby;
|
||||||
|
ConfigFile *myConfig;
|
||||||
|
|
||||||
QString myNick;
|
QString myNick;
|
||||||
|
|
||||||
// friend class GuiWrapper;
|
// friend class GuiWrapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ void settingsDialogImpl::callManualBlindsOrderDialog() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
myAfterMBAlwaysDoubleBlinds = myManualBlindsOrderDialog->radioButton_alwaysDoubleBlinds->isChecked();
|
myAfterMBAlwaysDoubleBlinds = myManualBlindsOrderDialog->radioButton_alwaysDoubleBlinds->isChecked();
|
||||||
myAfterMBAlwaysRaiseAbout = myManualBlindsOrderDialog->radioButton_alwaysRaiseAbout->isChecked();
|
myAfterMBAlwaysRaiseAbout = myManualBlindsOrderDialog->radioButton_alwaysRaiseAbout->isChecked();
|
||||||
myAfterMBAlwaysRaiseValue = myManualBlindsOrderDialog->spinBox_alwaysRaiseValue->value();
|
myAfterMBAlwaysRaiseValue = myManualBlindsOrderDialog->spinBox_alwaysRaiseValue->value();
|
||||||
myAfterMBStayAtLastBlind = myManualBlindsOrderDialog->radioButton_stayAtLastBlind->isChecked();
|
myAfterMBStayAtLastBlind = myManualBlindsOrderDialog->radioButton_stayAtLastBlind->isChecked();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user