mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 01:01:40 -04:00
Added Sound Notifications changes by callix, for Friend Connects and Chat Messages, need to be set a *.wav file on Sound Settings.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2849 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8b9b8e9f6b
commit
c720a32610
11 changed files with 273 additions and 350 deletions
|
@ -65,3 +65,21 @@ void OnlineToaster::chatButtonSlot() {
|
|||
chatButtonClicked();
|
||||
close();
|
||||
}
|
||||
|
||||
void OnlineToaster::play(){
|
||||
_settings = new RshareSettings();
|
||||
_settings->beginGroup("Sound");
|
||||
_settings->beginGroup("SoundFilePath");
|
||||
QString OnlineSound= _settings->value("User_go_Online","").toString();
|
||||
_settings->endGroup();
|
||||
_settings->beginGroup("Enable");
|
||||
bool flag= _settings->value("User_go_Online",false).toBool();
|
||||
_settings->endGroup();
|
||||
_settings->endGroup();
|
||||
if(!OnlineSound.isEmpty()&&flag)
|
||||
if(QSound::isAvailable())
|
||||
QSound::play(OnlineSound);
|
||||
|
||||
|
||||
// delete _settings;
|
||||
}
|
||||
|
|
|
@ -16,57 +16,61 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ONLINETOASTER_H
|
||||
#define ONLINETOASTER_H
|
||||
|
||||
#ifndef ONLINETOASTER_H
|
||||
#define ONLINETOASTER_H
|
||||
|
||||
#include "IQtToaster.h"
|
||||
#include <gui/settings/rsharesettings.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QSound>
|
||||
|
||||
class QtToaster;
|
||||
|
||||
class QWidget;
|
||||
class QString;
|
||||
class QPixmap;
|
||||
namespace Ui { class OnlineToaster; }
|
||||
namespace Ui { class OnlineToaster; }
|
||||
|
||||
/**
|
||||
* Shows a toaster when friend is Online .
|
||||
*
|
||||
*
|
||||
*/
|
||||
class OnlineToaster : public QObject, public IQtToaster {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
OnlineToaster();
|
||||
*/
|
||||
class OnlineToaster : public QObject, public IQtToaster {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
OnlineToaster();
|
||||
|
||||
~OnlineToaster();
|
||||
|
||||
|
||||
void setMessage(const QString & message);
|
||||
|
||||
|
||||
void setPixmap(const QPixmap & pixmap);
|
||||
|
||||
void show();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
void chatButtonClicked();
|
||||
void show();
|
||||
void play();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
void chatButtonClicked();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
void chatButtonSlot();
|
||||
|
||||
void close();
|
||||
|
||||
private:
|
||||
|
||||
Ui::OnlineToaster * _ui;
|
||||
private:
|
||||
RshareSettings* _settings;
|
||||
|
||||
QWidget * _onlineToasterWidget;
|
||||
Ui::OnlineToaster * _ui;
|
||||
|
||||
QtToaster * _toaster;
|
||||
};
|
||||
|
||||
#endif //MESSAGETOASTER_H
|
||||
QWidget * _onlineToasterWidget;
|
||||
|
||||
QtToaster * _toaster;
|
||||
};
|
||||
|
||||
#endif //MESSAGETOASTER_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue