Reworked SoundManager and SoundPage in the settings.

Added new icon in the statusbar to switch off the sound.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4832 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-01-22 22:58:23 +00:00
parent 4422d6557b
commit 3cba51abf4
24 changed files with 749 additions and 642 deletions

View file

@ -27,7 +27,6 @@
#include <QColorDialog>
#include <QFontDialog>
#include <QMessageBox>
#include <QSound>
#include "ChatWidget.h"
#include "ui_ChatWidget.h"
@ -52,25 +51,6 @@
* #define CHAT_DEBUG 1
*****/
// play sound when recv a message
void playsound()
{
Settings->beginGroup("Sound");
Settings->beginGroup("SoundFilePath");
QString OnlineSound = Settings->value("NewChatMessage","").toString();
Settings->endGroup();
Settings->beginGroup("Enable");
bool flag = Settings->value("NewChatMessage",false).toBool();
Settings->endGroup();
Settings->endGroup();
if (!OnlineSound.isEmpty() && flag) {
if (QSound::isAvailable()) {
QSound::play(OnlineSound);
}
}
}
ChatWidget::ChatWidget(QWidget *parent) :
QWidget(parent), ui(new Ui::ChatWidget)
{
@ -330,8 +310,6 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
resetStatusBar();
if (incoming && chatType == TYPE_NORMAL) {
playsound();
emit newMessage(this);
if (!isVisible() || (window() && (!window()->isActiveWindow() || window()->isMinimized()))) {