diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 6463ed7bf..fbd953419 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -1,4 +1,4 @@ -CONFIG += qt gui uic qrc resources uitools release # pluginmgr debug +CONFIG += qt gui uic qrc resources uitools debug # pluginmgr release QT += network xml script TEMPLATE = app TARGET = RetroShare @@ -75,7 +75,7 @@ LIBS += -L"../../../../lib" -lretroshare -lminiupnpc -lssl -lcrypto # ########################################### -LIBS += -lz -lgpgme +LIBS += -lz #-lgpgme LIBS += -lQtUiTools DEPENDPATH += . \ @@ -139,6 +139,7 @@ HEADERS += rshare.h \ gui/SharedFilesDialog.h \ gui/ShareManager.h \ gui/StatisticDialog.h \ + gui/SoundManager.h \ gui/HelpDialog.h \ gui/LogoBar.h \ gui/xprogressbar.h \ @@ -191,6 +192,7 @@ HEADERS += rshare.h \ gui/Preferences/rsettings.h \ gui/Preferences/FileAssotiationsDialog.h \ gui/Preferences/AddFileAssotiationDialog.h \ + gui/Preferences/SoundDialog.h \ gui/toaster/MessageToaster.h \ gui/toaster/OnlineToaster.h \ gui/toaster/ChatToaster.h \ @@ -289,7 +291,8 @@ FORMS += gui/BlogDialog.ui \ gui/Preferences/GeneralDialog.ui \ gui/Preferences/PreferencesWindow.ui \ gui/Preferences/ServerDialog.ui \ - gui/Preferences/NotifyDialog.ui \ + gui/Preferences/NotifyDialog.ui \ + gui/Preferences/SoundDialog.ui \ gui/Preferences/ConfirmQuitDialog.ui \ gui/toaster/CallToaster.ui \ gui/toaster/ChatToaster.ui \ @@ -355,6 +358,7 @@ SOURCES += main.cpp \ gui/SharedFilesDialog.cpp \ gui/ShareManager.cpp \ gui/StatisticDialog.cpp \ + gui/SoundManager.cpp \ gui/MessagesDialog.cpp \ gui/MessagesPopupDialog.cpp \ gui/im_history/IMHistoryKeeper.cpp \ @@ -401,6 +405,7 @@ SOURCES += main.cpp \ gui/Preferences/rsettings.cpp \ gui/Preferences/FileAssotiationsDialog.cpp \ gui/Preferences/AddFileAssotiationDialog.cpp \ + gui/Preferences/SoundDialog.cpp \ gui/common/vmessagebox.cpp \ gui/common/rwindow.cpp \ gui/common/html.cpp \ diff --git a/retroshare-gui/src/gui/Preferences/GeneralDialog.cpp b/retroshare-gui/src/gui/Preferences/GeneralDialog.cpp index adac84077..8cf46a340 100644 --- a/retroshare-gui/src/gui/Preferences/GeneralDialog.cpp +++ b/retroshare-gui/src/gui/Preferences/GeneralDialog.cpp @@ -39,8 +39,8 @@ GeneralDialog::GeneralDialog(QWidget *parent) /* Hide platform specific features */ #ifndef Q_WS_WIN ui.chkRunRetroshareAtSystemStartup->setVisible(false); - ui.autologincheckBox->setEnabled(false) ; - ui.autologincheckBox->setChecked(false) ; + //ui.autologincheckBox->setEnabled(false) ; + //ui.autologincheckBox->setChecked(false) ; #endif } diff --git a/retroshare-gui/src/gui/Preferences/GeneralDialog.ui b/retroshare-gui/src/gui/Preferences/GeneralDialog.ui index 6c159e01d..2b07e40b5 100644 --- a/retroshare-gui/src/gui/Preferences/GeneralDialog.ui +++ b/retroshare-gui/src/gui/Preferences/GeneralDialog.ui @@ -1,7 +1,8 @@ - + + GeneralDialog - - + + 0 0 @@ -9,162 +10,162 @@ 267 - + 0 64 - + - - - + + + 0 0 0 - - - + + + 208 208 208 - - - + + + 255 255 255 - - - + + + 247 247 247 - - - + + + 104 104 104 - - - + + + 139 139 139 - - - + + + 0 0 0 - - - + + + 255 255 255 - - - + + + 0 0 0 - - - + + + 255 255 255 - - - + + + 240 240 240 - - - + + + 0 0 0 - - - + + + 0 0 128 - - - + + + 255 255 255 - - - + + + 0 0 255 - - - + + + 255 0 255 - - - + + + 231 231 231 @@ -173,153 +174,153 @@ - - - + + + 0 0 0 - - - + + + 208 208 208 - - - + + + 255 255 255 - - - + + + 247 247 247 - - - + + + 104 104 104 - - - + + + 139 139 139 - - - + + + 0 0 0 - - - + + + 255 255 255 - - - + + + 0 0 0 - - - + + + 255 255 255 - - - + + + 240 240 240 - - - + + + 0 0 0 - - - + + + 192 192 192 - - - + + + 0 0 0 - - - + + + 0 0 255 - - - + + + 255 0 255 - - - + + + 231 231 231 @@ -328,153 +329,153 @@ - - - + + + 104 104 104 - - - + + + 208 208 208 - - - + + + 255 255 255 - - - + + + 247 247 247 - - - + + + 104 104 104 - - - + + + 139 139 139 - - - + + + 104 104 104 - - - + + + 255 255 255 - - - + + + 104 104 104 - - - + + + 240 240 240 - - - + + + 240 240 240 - - - + + + 0 0 0 - - - + + + 0 0 128 - - - + + + 255 255 255 - - - + + + 0 0 255 - - - + + + 255 0 255 - - - + + + 231 231 231 @@ -484,7 +485,7 @@ - + Arial 10 @@ -495,79 +496,41 @@ false - + Qt::NoContextMenu - - + + 6 - - 6 - - - 6 - - - 6 - - + 0 - - 0 - - - - - - 0 - 48 - - - - Login - - - - - 10 - 20 - 141 - 18 - - - - Auto Login - - - - - - - + + + 0 80 - + Startup - - - - + + + + Start RetroShare when my system starts - - - + + + Start minimized - + true @@ -575,12 +538,12 @@ - + - + Qt::Vertical - + 401 91 @@ -591,7 +554,7 @@ - + diff --git a/retroshare-gui/src/gui/Preferences/PreferencesWindow.cpp b/retroshare-gui/src/gui/Preferences/PreferencesWindow.cpp index 8407ac3eb..e37f6cee8 100644 --- a/retroshare-gui/src/gui/Preferences/PreferencesWindow.cpp +++ b/retroshare-gui/src/gui/Preferences/PreferencesWindow.cpp @@ -32,16 +32,17 @@ /* Images for toolbar icons */ #define IMAGE_PREFERENCES ":/images/kcmsystem24.png" -#define IMAGE_SERVER ":/images/server_24x24.png" -#define IMAGE_DIRECTORIES ":/images/folder_doments.png" +#define IMAGE_SERVER ":/images/server_24x24.png" +#define IMAGE_DIRECTORIES ":/images/folder_doments.png" #define IMAGE_CRYPTOGRAPHY ":/images/encrypted32.png" -#define IMAGE_LOG ":/images/log_24x24.png" -#define IMAGE_ABOUT ":/images/informations_24x24.png" -#define IMAGE_SAVE ":/images/media-floppy.png" +#define IMAGE_LOG ":/images/log_24x24.png" +#define IMAGE_ABOUT ":/images/informations_24x24.png" +#define IMAGE_SAVE ":/images/media-floppy.png" #define IMAGE_HELP ":/images/help24.png" #define IMAGE_APPEARRANCE ":/images/looknfeel.png" #define IMAGE_FILE_ASSOTIATIONS ":/images/filetype-association.png" #define IMAGE_NOTIFY ":/images/status_unknown.png" +#define IMAGE_SOUND ":/images/sound.png" @@ -75,7 +76,11 @@ PreferencesWindow::PreferencesWindow(QWidget *parent, Qt::WFlags flags) ui.stackPages->add(new FileAssotiationsDialog(ui.stackPages), createPageAction(QIcon(IMAGE_FILE_ASSOTIATIONS), tr("File Associations"), grp)); - +#ifdef RS_RELEASE_VERSION +#else + ui.stackPages->add(new SoundDialog(ui.stackPages), + createPageAction(QIcon(IMAGE_SOUND), tr("Sound"), grp)); +#endif /*foreach (ConfigPage *page, ui.stackPages->pages()) { @@ -94,7 +99,6 @@ PreferencesWindow::PreferencesWindow(QWidget *parent, Qt::WFlags flags) /* Select the first action */ grp->actions()[0]->setChecked(true); -// setFixedSize(QSize(480, 450)); connect(ui.okButton, SIGNAL(clicked( bool )), this, SLOT( saveChanges()) ); connect(ui.cancelprefButton, SIGNAL(clicked( bool )), this, SLOT( cancelpreferences()) ); diff --git a/retroshare-gui/src/gui/Preferences/PreferencesWindow.h b/retroshare-gui/src/gui/Preferences/PreferencesWindow.h index 337ebc747..c4b7befc4 100644 --- a/retroshare-gui/src/gui/Preferences/PreferencesWindow.h +++ b/retroshare-gui/src/gui/Preferences/PreferencesWindow.h @@ -32,6 +32,7 @@ #include "AppearanceDialog.h" #include "NotifyDialog.h" #include "FileAssotiationsDialog.h" +#include "SoundDialog.h" #include "gui/help/browser/helpbrowser.h" #include @@ -46,12 +47,13 @@ public: /** Preferences dialog pages. */ enum Page { General = 0, /** Preferences page. */ - Server, /** Server page. */ - Directories, /** Directories page. */ - Appearance, /** Appearance page. */ - Notify, /** Notify page. */ - Security, /** Security page. */ - FileAssotiations /** File assotiations page. */ + Server, /** Server page. */ + Directories, /** Directories page. */ + Appearance, /** Appearance page. */ + Notify, /** Notify page. */ + Security, /** Security page. */ + FileAssotiations, /** File assotiations page. */ + Sound /** Sound page. */ }; /** Default Constructor */ diff --git a/retroshare-gui/src/gui/Preferences/ServerDialog.cpp b/retroshare-gui/src/gui/Preferences/ServerDialog.cpp index 47459ef5e..b1a71f78c 100644 --- a/retroshare-gui/src/gui/Preferences/ServerDialog.cpp +++ b/retroshare-gui/src/gui/Preferences/ServerDialog.cpp @@ -275,10 +275,10 @@ void ServerDialog::toggleUPnP() //ui.discComboBox->setEnabled(true); ui.discComboBox->setEnabled(false); - ui.localAddress->setEnabled(false); - ui.localPort -> setEnabled(true); - ui.extAddress -> setEnabled(false); - ui.extPort -> setEnabled(true); + ui.localAddress->setReadOnly (true); + ui.localPort -> setEnabled (true); + ui.extAddress -> setReadOnly (true); + ui.extPort -> setEnabled (true); } else { diff --git a/retroshare-gui/src/gui/Preferences/SoundDialog.cpp b/retroshare-gui/src/gui/Preferences/SoundDialog.cpp new file mode 100644 index 000000000..16948f541 --- /dev/null +++ b/retroshare-gui/src/gui/Preferences/SoundDialog.cpp @@ -0,0 +1,174 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006 - 2009 RetroShare Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + + +#include +#include "SoundDialog.h" + + +/** Constructor */ +SoundDialog::SoundDialog(QWidget *parent) +: ConfigPage(parent) +{ + /* Invoke the Qt Designer generated object setup routine */ + ui.setupUi(this); + + /* Create RshareSettings object */ + _settings = new RshareSettings(); + + connect(ui.cmd_openFile, SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile())); + connect(ui.cmd_openFile_2,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile2())); + connect(ui.cmd_openFile_3,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile3())); + connect(ui.cmd_openFile_4,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile4())); + connect(ui.cmd_openFile_5,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile5())); + connect(ui.cmd_openFile_6,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile6())); + + /* Hide platform specific features */ +#ifdef Q_WS_WIN + +#endif +} + +/** Saves the changes on this page */ +bool +SoundDialog::save(QString &errmsg) +{ + _settings->beginGroup("Sound"); + _settings->beginGroup("Enable"); + _settings->setValue("User_go_Online",ui.checkBoxSound->isChecked()); + _settings->setValue("User_go_Offline",ui.checkBoxSound_2->isChecked()); + _settings->setValue("FileSend_Finished",ui.checkBoxSound_3->isChecked()); + _settings->setValue("FileRecive_Incoming",ui.checkBoxSound_4->isChecked()); + _settings->setValue("FileRecive_Finished",ui.checkBoxSound_5->isChecked()); + _settings->setValue("NewChatMessage",ui.checkBoxSound_6->isChecked()); + _settings->endGroup(); + _settings->beginGroup("SoundFilePath"); + _settings->setValue("User_go_Online",ui.txt_SoundFile->text()); + _settings->setValue("User_go_Offline",ui.txt_SoundFile2->text()); + _settings->setValue("FileSend_Finished",ui.txt_SoundFile3->text()); + _settings->setValue("FileRecive_Incoming",ui.txt_SoundFile4->text()); + _settings->setValue("FileRecive_Finished",ui.txt_SoundFile5->text()); + _settings->setValue("NewChatMessage",ui.txt_SoundFile6->text()); + _settings->endGroup(); + _settings->endGroup(); + + return true; +} + + + +/** Loads the settings for this page */ +void +SoundDialog::load() +{ + _settings->beginGroup("Sound"); + _settings->beginGroup("SoundFilePath"); + ui.txt_SoundFile->setText(_settings->value("User_go_Online","").toString()); + ui.txt_SoundFile2->setText(_settings->value("User_go_Offline","").toString()); + ui.txt_SoundFile3->setText(_settings->value("FileSend_Finished","").toString()); + ui.txt_SoundFile4->setText(_settings->value("FileRecive_Incoming","").toString()); + ui.txt_SoundFile5->setText(_settings->value("FileRecive_Finished","").toString()); + ui.txt_SoundFile6->setText(_settings->value("NewChatMessage","").toString()); + + if(!ui.txt_SoundFile->text().isEmpty())ui.checkBoxSound->setEnabled(true); + if(!ui.txt_SoundFile2->text().isEmpty())ui.checkBoxSound_2->setEnabled(true); + if(!ui.txt_SoundFile3->text().isEmpty())ui.checkBoxSound_3->setEnabled(true); + if(!ui.txt_SoundFile4->text().isEmpty())ui.checkBoxSound_4->setEnabled(true); + if(!ui.txt_SoundFile5->text().isEmpty())ui.checkBoxSound_5->setEnabled(true); + if(!ui.txt_SoundFile6->text().isEmpty())ui.checkBoxSound_6->setEnabled(true); + + _settings->endGroup(); + + _settings->beginGroup("Enable"); + ui.checkBoxSound->setChecked(_settings->value("User_go_Online",false).toBool()); + ui.checkBoxSound_2->setChecked(_settings->value("User_go_Offline",false).toBool()); + ui.checkBoxSound_3->setChecked(_settings->value("FileSend_Finished",false).toBool()); + ui.checkBoxSound_4->setChecked(_settings->value("FileRecive_Incoming",false).toBool()); + ui.checkBoxSound_5->setChecked(_settings->value("FileRecive_Finished",false).toBool()); + ui.checkBoxSound_6->setChecked(_settings->value("NewChatMessage",false).toBool()); + _settings->endGroup(); + _settings->endGroup(); +} + +void SoundDialog::on_cmd_openFile() +{ + + ui.txt_SoundFile->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); + if(ui.txt_SoundFile->text().isEmpty()){ + ui.checkBoxSound->setChecked(false); + ui.checkBoxSound->setEnabled(false); + } + else + ui.checkBoxSound->setEnabled(true); +} + +void SoundDialog::on_cmd_openFile2() +{ + ui.txt_SoundFile2->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); + if(ui.txt_SoundFile2->text().isEmpty()){ + ui.checkBoxSound_2->setChecked(false); + ui.checkBoxSound_2->setEnabled(false); + } + else + ui.checkBoxSound_2->setEnabled(true); + +} +void SoundDialog::on_cmd_openFile3() +{ + ui.txt_SoundFile3->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); + if(ui.txt_SoundFile3->text().isEmpty()){ + ui.checkBoxSound_3->setChecked(false); + ui.checkBoxSound_3->setEnabled(false); + } + else + ui.checkBoxSound_3->setEnabled(true); +} +void SoundDialog::on_cmd_openFile4() +{ + ui.txt_SoundFile4->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); + if(ui.txt_SoundFile4->text().isEmpty()){ + ui.checkBoxSound_4->setChecked(false); + ui.checkBoxSound_4->setEnabled(false); + } + else + ui.checkBoxSound_4->setEnabled(true); +} +void SoundDialog::on_cmd_openFile5() +{ + ui.txt_SoundFile5->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); + if(ui.txt_SoundFile5->text().isEmpty()){ + ui.checkBoxSound_5->setChecked(false); + ui.checkBoxSound_5->setEnabled(false); + } + else + ui.checkBoxSound_5->setEnabled(true); +} +void SoundDialog::on_cmd_openFile6() +{ + ui.txt_SoundFile6->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); + if(ui.txt_SoundFile6->text().isEmpty()){ + ui.checkBoxSound_6->setChecked(false); + ui.checkBoxSound_6->setEnabled(false); + } + else + ui.checkBoxSound_6->setEnabled(true); + +} diff --git a/retroshare-gui/src/gui/Preferences/SoundDialog.h b/retroshare-gui/src/gui/Preferences/SoundDialog.h new file mode 100644 index 000000000..56a5be985 --- /dev/null +++ b/retroshare-gui/src/gui/Preferences/SoundDialog.h @@ -0,0 +1,64 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006 - 2009 RetroShare Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + +#ifndef _SOUNDDIALOG_H +#define _SOUNDDIALOG_H + +#include + +#include + +#include "configpage.h" +#include "ui_SoundDialog.h" + +class SoundDialog : public ConfigPage +{ + Q_OBJECT + +public: + /** Default Constructor */ + SoundDialog(QWidget *parent = 0); + /** Default Destructor */ + + /** Saves the changes on this page */ + bool save(QString &errmsg); + /** Loads the settings for this page */ + void load(); + +private slots: + + void on_cmd_openFile(); + void on_cmd_openFile2(); + void on_cmd_openFile3(); + void on_cmd_openFile4(); + void on_cmd_openFile5(); + void on_cmd_openFile6(); + +private: + /** A RshareSettings object used for saving/loading settings */ + RshareSettings* _settings; + + /** Qt Designer generated object */ + Ui::SoundDialog ui; +}; + +#endif + diff --git a/retroshare-gui/src/gui/Preferences/SoundDialog.ui b/retroshare-gui/src/gui/Preferences/SoundDialog.ui new file mode 100644 index 000000000..cdd29c7fe --- /dev/null +++ b/retroshare-gui/src/gui/Preferences/SoundDialog.ui @@ -0,0 +1,814 @@ + + + SoundDialog + + + + 0 + 0 + 468 + 407 + + + + + + + + + 0 + 0 + 0 + + + + + + + 208 + 208 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 247 + 247 + + + + + + + 104 + 104 + 104 + + + + + + + 139 + 139 + 139 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 240 + 240 + 240 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + 0 + 0 + 0 + + + + + + + 208 + 208 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 247 + 247 + + + + + + + 104 + 104 + 104 + + + + + + + 139 + 139 + 139 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 240 + 240 + 240 + + + + + + + 0 + 0 + 0 + + + + + + + 192 + 192 + 192 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + 104 + 104 + 104 + + + + + + + 208 + 208 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 247 + 247 + + + + + + + 104 + 104 + 104 + + + + + + + 139 + 139 + 139 + + + + + + + 104 + 104 + 104 + + + + + + + 255 + 255 + 255 + + + + + + + 104 + 104 + 104 + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + Arial + 8 + 50 + false + false + false + false + + + + Qt::NoContextMenu + + + + + + Sound Events + + + + + 10 + 20 + 421 + 81 + + + + User + + + + false + + + + 10 + 20 + 80 + 23 + + + + go Online + + + + + false + + + + 10 + 50 + 80 + 23 + + + + go Offline + + + + + false + + + + 90 + 20 + 281 + 24 + + + + + + false + + + + 90 + 50 + 281 + 24 + + + + + + + 380 + 20 + 31 + 21 + + + + ... + + + + + + 380 + 50 + 31 + 21 + + + + ... + + + + + + + 10 + 100 + 421 + 61 + + + + FileSend + + + + false + + + + 90 + 20 + 281 + 24 + + + + + + + 380 + 20 + 31 + 21 + + + + ... + + + + + false + + + + 10 + 20 + 80 + 23 + + + + Finished + + + + + + + 10 + 160 + 421 + 91 + + + + FileRecive + + + + false + + + + 10 + 20 + 80 + 23 + + + + Incoming + + + + + false + + + + 90 + 20 + 281 + 24 + + + + + + + 380 + 20 + 31 + 21 + + + + ... + + + + + + 380 + 50 + 31 + 21 + + + + ... + + + + + false + + + + 10 + 50 + 80 + 23 + + + + Finished + + + + + false + + + + 90 + 50 + 281 + 24 + + + + + + + + 10 + 260 + 421 + 111 + + + + Chatmessage + + + + + 380 + 20 + 31 + 21 + + + + ... + + + + + false + + + + 10 + 20 + 80 + 23 + + + + New + + + + + false + + + + 90 + 20 + 281 + 24 + + + + + + + + + + + + + diff --git a/retroshare-gui/src/gui/SoundManager.cpp b/retroshare-gui/src/gui/SoundManager.cpp new file mode 100644 index 000000000..8e9af108a --- /dev/null +++ b/retroshare-gui/src/gui/SoundManager.cpp @@ -0,0 +1,104 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006 - 2009 RetroShare Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ +#include "SoundManager.h" + +SoundManager::SoundManager() +{ + /* Create RshareSettings object */ + _settings = new RshareSettings(); + + isMute=false; + reInit(); +} + +void SoundManager::doMute(bool t) +{ + isMute=t; +} + +void SoundManager::event_User_go_Online() +{ + if(isMute==true) return; + + if(enable_eventUser_go_Online) + QSound::play(SoundFileUser_go_Online); +} +void SoundManager::event_User_go_Offline() +{ + if(isMute==true) return; + if(enable_eventUser_go_Offline) + QSound::play(SoundFileUser_go_Offline); +} +void SoundManager::event_FileSend_Finished() +{ + if(isMute==true) return; + if(enable_eventFileSend_Finished) + QSound::play(SoundFileFileSend_Finished); +} +void SoundManager::event_FileRecive_Incoming() +{ + if(isMute==true) return; + if(enable_eventFileRecive_Incoming) + QSound::play(SoundFileFileRecive_Incoming); +} + +void SoundManager::event_FileRecive_Finished() +{ + if(isMute==true) return; + if(enable_eventFileRecive_Finished) + QSound::play(SoundFileFileRecive_Finished); +} + + +void SoundManager::event_NewChatMessage() +{ + if(isMute==true) return; + if(enable_eventNewChatMessage) + { + QSound::play(SoundFileNewChatMessage); + + } +} + +void SoundManager::reInit() +{ + _settings->beginGroup("Sound"); + _settings->beginGroup("Enable"); + enable_eventUser_go_Online = _settings->value("User_go_Online",false).toBool(); + enable_eventUser_go_Offline = _settings->value("User_go_Offline",false).toBool(); + enable_eventFileSend_Finished = _settings->value("FileSend_Finished",false).toBool(); + enable_eventFileRecive_Incoming = _settings->value("FileRecive_Incoming",false).toBool(); + enable_eventFileRecive_Finished = _settings->value("FileRecive_Finished",false).toBool(); + enable_eventNewChatMessage = _settings->value("NewChatMessage",false).toBool(); + _settings->endGroup(); + + _settings->beginGroup("SoundFilePath"); + SoundFileUser_go_Online = _settings->value("User_go_Online","").toString(); + SoundFileUser_go_Offline =_settings->value("User_go_Offline","").toString(); + SoundFileFileSend_Finished = _settings->value("FileSend_Finished","").toString(); + SoundFileFileRecive_Incoming = _settings->value("FileRecive_Incoming","").toString(); + SoundFileFileRecive_Finished = _settings->value("FileRecive_Finished","").toString(); + SoundFileNewChatMessage = _settings->value("NewChatMessage","").toString(); + _settings->endGroup(); + _settings->endGroup(); + delete _settings; +} + diff --git a/retroshare-gui/src/gui/SoundManager.h b/retroshare-gui/src/gui/SoundManager.h new file mode 100644 index 000000000..327637579 --- /dev/null +++ b/retroshare-gui/src/gui/SoundManager.h @@ -0,0 +1,67 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006, 2007 crypton + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ +#ifndef SOUND_MANAGER_H +#define SOUND_MANAGER_H + +#include +#include +#include + +#include + + +class SoundManager :public QObject +{ + Q_OBJECT + public: + SoundManager(); + + public slots: + void doMute(bool t); + void event_User_go_Online(); + void event_User_go_Offline(); + void event_FileSend_Finished(); + void event_FileRecive_Incoming(); + void event_FileRecive_Finished(); + void event_NewChatMessage(); + void reInit(); + + + private: + bool isMute; + QString SoundFileUser_go_Online; + QString SoundFileUser_go_Offline; + QString SoundFileFileSend_Finished; + QString SoundFileFileRecive_Incoming; + QString SoundFileFileRecive_Finished; + QString SoundFileNewChatMessage; + + bool enable_eventUser_go_Online; + bool enable_eventUser_go_Offline; + bool enable_eventFileSend_Finished; + bool enable_eventFileRecive_Incoming; + bool enable_eventFileRecive_Finished; + bool enable_eventNewChatMessage; + + /** A RshareSettings object used for saving/loading settings */ + RshareSettings* _settings; +}; +#endif diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 2963ebf93..301204c19 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -30,7 +30,7 @@ images/Client3.png images/Client4.png images/denied16.png - images/filetype-association.png + images/filetype-association.png images/FileTypeAny.png images/FileTypeArchive.png images/FileTypeAudio.png @@ -296,6 +296,7 @@ images/status_unknown.png images/startall.png images/server_24x24.png + images/sound.png images/transferupdown.png images/typing.png images/uploads.png diff --git a/retroshare-gui/src/gui/images/sound.png b/retroshare-gui/src/gui/images/sound.png new file mode 100644 index 000000000..fe37e137e Binary files /dev/null and b/retroshare-gui/src/gui/images/sound.png differ diff --git a/retroshare-gui/src/gui/images/sound_off.png b/retroshare-gui/src/gui/images/sound_off.png new file mode 100644 index 000000000..a7b048e8b Binary files /dev/null and b/retroshare-gui/src/gui/images/sound_off.png differ diff --git a/retroshare-gui/src/sounds/File.wav b/retroshare-gui/src/sounds/File.wav new file mode 100644 index 000000000..1cbc55f73 Binary files /dev/null and b/retroshare-gui/src/sounds/File.wav differ diff --git a/retroshare-gui/src/sounds/Notify.wav b/retroshare-gui/src/sounds/Notify.wav new file mode 100644 index 000000000..76fd968c8 Binary files /dev/null and b/retroshare-gui/src/sounds/Notify.wav differ diff --git a/retroshare-gui/src/sounds/Startup.wav b/retroshare-gui/src/sounds/Startup.wav new file mode 100644 index 000000000..f9f45e1b4 Binary files /dev/null and b/retroshare-gui/src/sounds/Startup.wav differ