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
6e2ea1e1
Commit
6e2ea1e1
authored
Apr 05, 2015
by
Zach
Browse files
Merge pull request #912 from poixen/mention_popup_fix
Mention popup fix
parents
8ca2135f
b20ae971
Changes
4
Show whitespace changes
Inline
Side-by-side
cockatrice/src/chatview.cpp
View file @
6e2ea1e1
...
@@ -5,13 +5,11 @@
...
@@ -5,13 +5,11 @@
#include
<QDesktopServices>
#include
<QDesktopServices>
#include
<QApplication>
#include
<QApplication>
#include
<QDebug>
#include
<QDebug>
#include
<QSystemTrayIcon>
#include
"chatview.h"
#include
"chatview.h"
#include
"user_level.h"
#include
"user_level.h"
#include
"user_context_menu.h"
#include
"user_context_menu.h"
#include
"pixmapgenerator.h"
#include
"pixmapgenerator.h"
#include
"settingscache.h"
#include
"settingscache.h"
#include
"main.h"
#include
"tab_userlists.h"
#include
"tab_userlists.h"
const
QColor
DEFAULT_MENTION_COLOR
=
QColor
(
194
,
31
,
47
);
const
QColor
DEFAULT_MENTION_COLOR
=
QColor
(
194
,
31
,
47
);
...
@@ -282,9 +280,7 @@ bool ChatView::shouldShowSystemPopup() {
...
@@ -282,9 +280,7 @@ bool ChatView::shouldShowSystemPopup() {
}
}
void
ChatView
::
showSystemPopup
(
QString
&
sender
)
{
void
ChatView
::
showSystemPopup
(
QString
&
sender
)
{
disconnect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
0
,
0
);
emit
showMentionPopup
(
sender
);
trayIcon
->
showMessage
(
sender
+
tr
(
" mentioned you."
),
tr
(
"Click to view"
));
connect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
this
,
SLOT
(
actMessageClicked
()));
}
}
...
...
cockatrice/src/chatview.h
View file @
6e2ea1e1
...
@@ -65,6 +65,7 @@ signals:
...
@@ -65,6 +65,7 @@ signals:
void
deleteCardInfoPopup
(
QString
cardName
);
void
deleteCardInfoPopup
(
QString
cardName
);
void
addMentionTag
(
QString
mentionTag
);
void
addMentionTag
(
QString
mentionTag
);
void
messageClickedSignal
();
void
messageClickedSignal
();
void
showMentionPopup
(
QString
&
sender
);
};
};
#endif
#endif
cockatrice/src/tab_room.cpp
View file @
6e2ea1e1
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include
<QToolButton>
#include
<QToolButton>
#include
<QSplitter>
#include
<QSplitter>
#include
<QApplication>
#include
<QApplication>
#include
<QSystemTrayIcon>
#include
"tab_supervisor.h"
#include
"tab_supervisor.h"
#include
"tab_room.h"
#include
"tab_room.h"
#include
"tab_userlists.h"
#include
"tab_userlists.h"
...
@@ -18,6 +19,7 @@
...
@@ -18,6 +19,7 @@
#include
"chatview.h"
#include
"chatview.h"
#include
"gameselector.h"
#include
"gameselector.h"
#include
"settingscache.h"
#include
"settingscache.h"
#include
"main.h"
#include
"get_pb_extension.h"
#include
"get_pb_extension.h"
#include
"pb/room_commands.pb.h"
#include
"pb/room_commands.pb.h"
...
@@ -43,6 +45,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
...
@@ -43,6 +45,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
connect
(
userList
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)));
connect
(
userList
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)));
chatView
=
new
ChatView
(
tabSupervisor
,
0
,
true
);
chatView
=
new
ChatView
(
tabSupervisor
,
0
,
true
);
connect
(
chatView
,
SIGNAL
(
showMentionPopup
(
QString
&
)),
this
,
SLOT
(
actShowMentionPopup
(
QString
&
)));
connect
(
chatView
,
SIGNAL
(
messageClickedSignal
()),
this
,
SLOT
(
focusTab
()));
connect
(
chatView
,
SIGNAL
(
messageClickedSignal
()),
this
,
SLOT
(
focusTab
()));
connect
(
chatView
,
SIGNAL
(
openMessageDialog
(
QString
,
bool
)),
this
,
SIGNAL
(
openMessageDialog
(
QString
,
bool
)));
connect
(
chatView
,
SIGNAL
(
openMessageDialog
(
QString
,
bool
)),
this
,
SIGNAL
(
openMessageDialog
(
QString
,
bool
)));
connect
(
chatView
,
SIGNAL
(
showCardInfoPopup
(
QPoint
,
QString
)),
this
,
SLOT
(
showCardInfoPopup
(
QPoint
,
QString
)));
connect
(
chatView
,
SIGNAL
(
showCardInfoPopup
(
QPoint
,
QString
)),
this
,
SLOT
(
showCardInfoPopup
(
QPoint
,
QString
)));
...
@@ -132,6 +135,15 @@ void TabRoom::focusTab() {
...
@@ -132,6 +135,15 @@ void TabRoom::focusTab() {
tabSupervisor
->
setCurrentIndex
(
tabSupervisor
->
indexOf
(
this
));
tabSupervisor
->
setCurrentIndex
(
tabSupervisor
->
indexOf
(
this
));
}
}
void
TabRoom
::
actShowMentionPopup
(
QString
&
sender
)
{
if
(
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
)
||
QApplication
::
activeWindow
()
==
0
||
QApplication
::
focusWidget
()
==
0
)
{
disconnect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
0
,
0
);
trayIcon
->
showMessage
(
sender
+
tr
(
" mentioned you."
),
tr
(
"Click to view"
));
connect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
chatView
,
SLOT
(
actMessageClicked
()));
}
}
void
TabRoom
::
closeRequest
()
void
TabRoom
::
closeRequest
()
{
{
actLeaveRoom
();
actLeaveRoom
();
...
...
cockatrice/src/tab_room.h
View file @
6e2ea1e1
...
@@ -57,6 +57,7 @@ private slots:
...
@@ -57,6 +57,7 @@ private slots:
void
actOpenChatSettings
();
void
actOpenChatSettings
();
void
addMentionTag
(
QString
mentionTag
);
void
addMentionTag
(
QString
mentionTag
);
void
focusTab
();
void
focusTab
();
void
actShowMentionPopup
(
QString
&
sender
);
void
processListGamesEvent
(
const
Event_ListGames
&
event
);
void
processListGamesEvent
(
const
Event_ListGames
&
event
);
void
processJoinRoomEvent
(
const
Event_JoinRoom
&
event
);
void
processJoinRoomEvent
(
const
Event_JoinRoom
&
event
);
...
...
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