Merge pull request #806 from PhenomRetroShare/Fix_LobbySoundNotification

Fix Lobby's sound notification.
This commit is contained in:
csoler 2017-05-08 22:16:39 +02:00 committed by GitHub
commit d74bb2abad
2 changed files with 23 additions and 23 deletions

View File

@ -19,41 +19,37 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
* *
* ccr . 2016 Jan 26
*
* Play sound on incoming messages.
*
****************************************************************/ ****************************************************************/
#include <unistd.h>
#include <QMessageBox>
#include <QInputDialog> #include <QInputDialog>
#include <QMenu> #include <QMenu>
#include <QMessageBox>
#include <QWidgetAction> #include <QWidgetAction>
#include "ChatLobbyDialog.h" #include "ChatLobbyDialog.h"
#include "util/QtVersion.h"
#include "gui/ChatLobbyWidget.h"
#include "ChatTabWidget.h" #include "ChatTabWidget.h"
#include "gui/settings/rsharesettings.h" #include "gui/ChatLobbyWidget.h"
#include "gui/settings/RsharePeerSettings.h"
#include "gui/MainWindow.h"
#include "gui/FriendsDialog.h" #include "gui/FriendsDialog.h"
#include "gui/msgs/MessageComposer.h" #include "gui/MainWindow.h"
#include <gui/common/html.h> #include "gui/common/html.h"
#include "gui/common/RSTreeWidgetItem.h"
#include "gui/common/FriendSelectionDialog.h" #include "gui/common/FriendSelectionDialog.h"
#include "gui/gxs/GxsIdTreeWidgetItem.h" #include "gui/common/RSTreeWidgetItem.h"
#include "gui/gxs/GxsIdChooser.h" #include "gui/gxs/GxsIdChooser.h"
#include "gui/gxs/GxsIdDetails.h" #include "gui/gxs/GxsIdDetails.h"
#include "util/HandleRichText.h" #include "gui/gxs/GxsIdTreeWidgetItem.h"
#include "gui/SoundManager.h"
#include "gui/Identity/IdDialog.h" #include "gui/Identity/IdDialog.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/settings/RsharePeerSettings.h"
#include "gui/settings/rsharesettings.h"
#include "util/HandleRichText.h"
#include "util/QtVersion.h"
#include <retroshare/rsnotify.h> #include <retroshare/rsnotify.h>
#include <time.h> #include <time.h>
#include <unistd.h>
#define COLUMN_NAME 0 #define COLUMN_NAME 0
#define COLUMN_ACTIVITY 1 #define COLUMN_ACTIVITY 1
@ -477,7 +473,6 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg)
ui.chatWidget->addChatMsg(msg.incoming, name, gxs_id, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL); ui.chatWidget->addChatMsg(msg.incoming, name, gxs_id, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL);
emit messageReceived(msg.incoming, id(), sendTime, name, message) ; emit messageReceived(msg.incoming, id(), sendTime, name, message) ;
SoundManager::play(SOUND_NEW_LOBBY_MESSAGE);
// This is a trick to translate HTML into text. // This is a trick to translate HTML into text.
QTextEdit editor; QTextEdit editor;

View File

@ -21,15 +21,19 @@
#include <QTime> #include <QTime>
#include <QMenu> #include <QMenu>
#include "ChatLobbyUserNotify.h" #include "ChatLobbyUserNotify.h"
#include "gui/notifyqt.h"
#include "gui/MainWindow.h"
#include "gui/ChatLobbyWidget.h" #include "gui/ChatLobbyWidget.h"
#include "gui/MainWindow.h"
#include "gui/notifyqt.h"
#include "gui/SoundManager.h"
#include "gui/settings/rsharesettings.h" #include "gui/settings/rsharesettings.h"
#include "util/DateTime.h" #include "util/DateTime.h"
#include <retroshare/rsidentity.h>
#include <util/HandleRichText.h> #include <util/HandleRichText.h>
#include <retroshare/rsidentity.h>
ChatLobbyUserNotify::ChatLobbyUserNotify(QObject *parent) : ChatLobbyUserNotify::ChatLobbyUserNotify(QObject *parent) :
UserNotify(parent) UserNotify(parent)
{ {
@ -273,8 +277,9 @@ void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime ti
_listMsg[lobby_id][strAnchor]=msgData; _listMsg[lobby_id][strAnchor]=msgData;
emit countChanged(lobby_id, _listMsg[lobby_id].size()); emit countChanged(lobby_id, _listMsg[lobby_id].size());
updateIcon(); updateIcon();
} SoundManager::play(SOUND_NEW_LOBBY_MESSAGE);
}
} }
bool ChatLobbyUserNotify::checkWord(QString message, QString word) bool ChatLobbyUserNotify::checkWord(QString message, QString word)