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
ebcee34e
Commit
ebcee34e
authored
Apr 10, 2015
by
poixen
Browse files
Merge pull request #923 from poixen/popup_fix
Fixed issue with clicking on PM/mention bubbles
parents
1fd75f4c
6b307469
Changes
9
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/chatview.cpp
View file @
ebcee34e
...
...
@@ -275,8 +275,7 @@ void ChatView::actMessageClicked() {
}
bool
ChatView
::
shouldShowSystemPopup
()
{
return
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
)
||
QApplication
::
activeWindow
()
==
0
||
QApplication
::
focusWidget
()
==
0
;
return
QApplication
::
activeWindow
()
==
0
||
QApplication
::
focusWidget
()
==
0
||
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
);
}
void
ChatView
::
showSystemPopup
(
QString
&
sender
)
{
...
...
cockatrice/src/tab_message.cpp
View file @
ebcee34e
...
...
@@ -118,9 +118,8 @@ void TabMessage::processUserMessageEvent(const Event_UserMessage &event)
}
bool
TabMessage
::
shouldShowSystemPopup
(
const
Event_UserMessage
&
event
)
{
return
(
event
.
sender_name
()
==
otherUserInfo
->
name
()
&&
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
))
||
QApplication
::
activeWindow
()
==
0
||
QApplication
::
focusWidget
()
==
0
;
return
(
QApplication
::
activeWindow
()
==
0
||
QApplication
::
focusWidget
()
==
0
||
event
.
sender_name
()
==
otherUserInfo
->
name
()
&&
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
));
}
void
TabMessage
::
showSystemPopup
(
const
Event_UserMessage
&
event
)
{
...
...
@@ -132,6 +131,7 @@ void TabMessage::showSystemPopup(const Event_UserMessage &event) {
void
TabMessage
::
messageClicked
()
{
tabSupervisor
->
setCurrentIndex
(
tabSupervisor
->
indexOf
(
this
));
QApplication
::
setActiveWindow
(
this
);
emit
maximizeClient
();
}
void
TabMessage
::
processUserLeft
()
...
...
cockatrice/src/tab_message.h
View file @
ebcee34e
...
...
@@ -25,6 +25,7 @@ private:
QAction
*
aLeave
;
signals:
void
talkClosing
(
TabMessage
*
tab
);
void
maximizeClient
();
private
slots
:
void
sendMessage
();
void
actLeave
();
...
...
cockatrice/src/tab_room.cpp
View file @
ebcee34e
...
...
@@ -133,6 +133,7 @@ void TabRoom::retranslateUi()
void
TabRoom
::
focusTab
()
{
QApplication
::
setActiveWindow
(
this
);
tabSupervisor
->
setCurrentIndex
(
tabSupervisor
->
indexOf
(
this
));
emit
maximizeClient
();
}
void
TabRoom
::
actShowMentionPopup
(
QString
&
sender
)
{
...
...
cockatrice/src/tab_room.h
View file @
ebcee34e
...
...
@@ -49,6 +49,7 @@ private:
signals:
void
roomClosing
(
TabRoom
*
tab
);
void
openMessageDialog
(
const
QString
&
userName
,
bool
focus
);
void
maximizeClient
();
private
slots
:
void
sendMessage
();
void
sayFinished
(
const
Response
&
response
);
...
...
cockatrice/src/tab_supervisor.cpp
View file @
ebcee34e
...
...
@@ -364,6 +364,7 @@ void TabSupervisor::gameLeft(TabGame *tab)
void
TabSupervisor
::
addRoomTab
(
const
ServerInfo_Room
&
info
,
bool
setCurrent
)
{
TabRoom
*
tab
=
new
TabRoom
(
this
,
client
,
userInfo
,
info
);
connect
(
tab
,
SIGNAL
(
maximizeClient
()),
this
,
SLOT
(
maximizeMainWindow
()));
connect
(
tab
,
SIGNAL
(
roomClosing
(
TabRoom
*
)),
this
,
SLOT
(
roomLeft
(
TabRoom
*
)));
connect
(
tab
,
SIGNAL
(
openMessageDialog
(
const
QString
&
,
bool
)),
this
,
SLOT
(
addMessageTab
(
const
QString
&
,
bool
)));
int
tabIndex
=
myAddTab
(
tab
);
...
...
@@ -422,6 +423,7 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
tab
=
new
TabMessage
(
this
,
client
,
*
userInfo
,
otherUser
);
connect
(
tab
,
SIGNAL
(
talkClosing
(
TabMessage
*
)),
this
,
SLOT
(
talkLeft
(
TabMessage
*
)));
connect
(
tab
,
SIGNAL
(
maximizeClient
()),
this
,
SLOT
(
maximizeMainWindow
()));
int
tabIndex
=
myAddTab
(
tab
);
addCloseButtonToTab
(
tab
,
tabIndex
);
messageTabs
.
insert
(
receiverName
,
tab
);
...
...
@@ -430,6 +432,10 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
return
tab
;
}
void
TabSupervisor
::
maximizeMainWindow
()
{
emit
maximize
();
}
void
TabSupervisor
::
talkLeft
(
TabMessage
*
tab
)
{
if
(
tab
==
currentWidget
())
...
...
cockatrice/src/tab_supervisor.h
View file @
ebcee34e
...
...
@@ -78,9 +78,11 @@ signals:
void
setMenu
(
const
QList
<
QMenu
*>
&
newMenuList
=
QList
<
QMenu
*>
());
void
localGameEnded
();
void
adminLockChanged
(
bool
lock
);
void
maximize
();
public
slots
:
TabDeckEditor
*
addDeckEditorTab
(
const
DeckLoader
*
deckToOpen
);
void
openReplay
(
GameReplay
*
replay
);
void
maximizeMainWindow
();
private
slots
:
void
closeButtonPressed
();
void
updateCurrent
(
int
index
);
...
...
cockatrice/src/window_main.cpp
View file @
ebcee34e
...
...
@@ -409,6 +409,7 @@ MainWindow::MainWindow(QWidget *parent)
tabSupervisor
=
new
TabSupervisor
(
client
);
connect
(
tabSupervisor
,
SIGNAL
(
setMenu
(
QList
<
QMenu
*>
)),
this
,
SLOT
(
updateTabMenu
(
QList
<
QMenu
*>
)));
connect
(
tabSupervisor
,
SIGNAL
(
localGameEnded
()),
this
,
SLOT
(
localGameEnded
()));
connect
(
tabSupervisor
,
SIGNAL
(
maximize
()),
this
,
SLOT
(
maximize
()));
tabSupervisor
->
addDeckEditorTab
(
0
);
setCentralWidget
(
tabSupervisor
);
...
...
@@ -508,3 +509,7 @@ void MainWindow::pixmapCacheSizeChanged(int newSizeInMBs)
// translate MBs to KBs
QPixmapCache
::
setCacheLimit
(
newSizeInMBs
*
1024
);
}
void
MainWindow
::
maximize
()
{
showNormal
();
}
cockatrice/src/window_main.h
View file @
ebcee34e
...
...
@@ -59,6 +59,8 @@ private slots:
void
actAbout
();
void
iconActivated
(
QSystemTrayIcon
::
ActivationReason
reason
);
void
maximize
();
private:
static
const
QString
appName
;
void
setClientStatusTitle
();
...
...
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