Window Alerts for messagelogwidget and chatwidget
This commit is contained in:
parent
4beb990f38
commit
f5193edead
3 changed files with 18 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <QtGui>
|
||||
#include <QApplication>
|
||||
#include "chatwidget.h"
|
||||
#include "client.h"
|
||||
|
||||
|
@ -65,6 +66,7 @@ void ChannelWidget::leaveEvent(const QString &playerName)
|
|||
void ChannelWidget::sayEvent(const QString &playerName, const QString &s)
|
||||
{
|
||||
textEdit->append(QString("<font color=\"red\">%1:</font> %2").arg(playerName).arg(s));
|
||||
QApplication::alert(this);
|
||||
}
|
||||
|
||||
void ChannelWidget::serverMessageEvent(const QString &s)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "game.h"
|
||||
#include "player.h"
|
||||
#include "cardzone.h"
|
||||
#include <QApplication>
|
||||
|
||||
QString MessageLogWidget::sanitizeHtml(QString dirty) const
|
||||
{
|
||||
|
@ -286,6 +287,20 @@ void MessageLogWidget::connectToGame(Game *game)
|
|||
connect(game, SIGNAL(logStopDumpZone(Player *, CardZone *, Player *)), this, SLOT(logStopDumpZone(Player *, CardZone *, Player *)));
|
||||
connect(game, SIGNAL(logSetActivePlayer(Player *)), this, SLOT(logSetActivePlayer(Player *)));
|
||||
connect(game, SIGNAL(setActivePhase(int)), this, SLOT(logSetActivePhase(int)));
|
||||
|
||||
//Alert Test
|
||||
connect(game, SIGNAL(logSay(Player *, QString)), this, SLOT(msgAlert()));
|
||||
connect(game, SIGNAL(logJoin(Player *)), this, SLOT(msgAlert()));
|
||||
connect(game, SIGNAL(logLeave(Player *)), this, SLOT(msgAlert()));
|
||||
connect(game, SIGNAL(logSetActivePlayer(Player *)), this, SLOT(msgAlert()));
|
||||
connect(game, SIGNAL(setActivePhase(int)), this, SLOT(msgAlert()));
|
||||
connect(game, SIGNAL(logDraw(Player *, int)), this, SLOT(msgAlert()));
|
||||
connect(game, SIGNAL(logMoveCard(Player *, QString, CardZone *, int, CardZone *, int)), this, SLOT(msgAlert()));
|
||||
}
|
||||
|
||||
void MessageLogWidget::msgAlert()
|
||||
{
|
||||
QApplication::alert(this);
|
||||
}
|
||||
|
||||
MessageLogWidget::MessageLogWidget(QWidget *parent)
|
||||
|
|
|
@ -41,6 +41,7 @@ private slots:
|
|||
void logStopDumpZone(Player *player, CardZone *zone, Player *zoneOwner);
|
||||
void logSetActivePlayer(Player *player);
|
||||
void logSetActivePhase(int phase);
|
||||
void msgAlert();
|
||||
public:
|
||||
void connectToGame(Game *game);
|
||||
MessageLogWidget(QWidget *parent = 0);
|
||||
|
|
Loading…
Reference in a new issue