Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
f5193ede
Commit
f5193ede
authored
Aug 30, 2009
by
marcus
Browse files
Window Alerts for messagelogwidget and chatwidget
parent
4beb990f
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/chatwidget.cpp
View file @
f5193ede
#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
)
...
...
cockatrice/src/messagelogwidget.cpp
View file @
f5193ede
...
...
@@ -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
)
...
...
cockatrice/src/messagelogwidget.h
View file @
f5193ede
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment