bug: Fix re-show chatdialog
Change-Id: Ia11aabc1c22ed3f92fc24be2fcd8a60e49044aad
diff --git a/src/chat-dialog.cpp b/src/chat-dialog.cpp
index f2bdf86..0079f4f 100644
--- a/src/chat-dialog.cpp
+++ b/src/chat-dialog.cpp
@@ -240,7 +240,7 @@
"system tray. To close the chatroom, "
"choose <b>Close chatroom</b> in the "
"context memu of the system tray entry."));
- hide();//ymj
+ hide();
e->ignore();
}
@@ -1018,6 +1018,14 @@
}
void
+ChatDialog::onShow()
+{
+ this->show();
+ this->raise();
+ this->activateWindow();
+}
+
+void
ChatDialog::onClose()
{
hide();
diff --git a/src/chat-dialog.hpp b/src/chat-dialog.hpp
index 9c4008e..7c63b30 100644
--- a/src/chat-dialog.hpp
+++ b/src/chat-dialog.hpp
@@ -249,6 +249,9 @@
public slots:
void
+ onShow();
+
+ void
onLocalPrefixUpdated(const QString& localPrefix);
void
diff --git a/src/controller.cpp b/src/controller.cpp
index 313c673..fc4037b 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -547,7 +547,7 @@
QAction* chatAction = new QAction(chatroomName, this);
m_chatActionList[chatroomName.toStdString()] = chatAction;
connect(chatAction, SIGNAL(triggered()),
- chatDialog, SLOT(raise()));//ymj
+ chatDialog, SLOT(onShow()));
QAction* closeAction = new QAction(chatroomName, this);
m_closeActionList[chatroomName.toStdString()] = closeAction;