mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-04 07:05:26 -04:00
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:
parent
4422d6557b
commit
3cba51abf4
24 changed files with 749 additions and 642 deletions
|
@ -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()))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue