diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 6fd1186b5..e7f604274 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -349,6 +349,7 @@ HEADERS += rshare.h \ gui/statusbar/ratesstatus.h \ gui/statusbar/hashingstatus.h \ gui/statusbar/discstatus.h \ + gui/statusbar/SoundStatus.h \ gui/advsearch/advancedsearchdialog.h \ gui/advsearch/expressionwidget.h \ gui/advsearch/guiexprelement.h \ @@ -609,6 +610,7 @@ SOURCES += main.cpp \ gui/statusbar/ratesstatus.cpp \ gui/statusbar/hashingstatus.cpp \ gui/statusbar/discstatus.cpp \ + gui/statusbar/SoundStatus.cpp \ gui/toaster/MessageToaster.cpp \ gui/toaster/DownloadToaster.cpp \ gui/toaster/OnlineToaster.cpp \ diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 2ae6eb8eb..0c1e4b40d 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include "retroshare/rsinit.h" #include "retroshare/rsnotify.h" @@ -792,21 +791,6 @@ void FriendsDialog::setCurrentFileName(const QString &fileName) setWindowModified(false); } -////play sound when recv a message -void FriendsDialog::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); -} - void FriendsDialog::on_actionMessageHistory_triggered() { ImHistoryBrowser imBrowser("", ui.lineEdit, this); diff --git a/retroshare-gui/src/gui/FriendsDialog.h b/retroshare-gui/src/gui/FriendsDialog.h index b5298e15f..59eb30e0b 100644 --- a/retroshare-gui/src/gui/FriendsDialog.h +++ b/retroshare-gui/src/gui/FriendsDialog.h @@ -124,9 +124,6 @@ private: void colorChanged(const QColor &c); void fontChanged(const QFont &font); - ///play the sound when recv a message - void playsound(); - QString fileName; ChatStyle style; diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 583550e3e..f808c4efe 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -56,6 +56,7 @@ #include "help/browser/helpbrowser.h" #include "chat/ChatDialog.h" #include "RetroShareLink.h" +#include "SoundManager.h" #ifdef UNFINISHED #include "unfinished/ApplicationWindow.h" @@ -75,6 +76,7 @@ #include "statusbar/dhtstatus.h" #include "statusbar/hashingstatus.h" #include "statusbar/discstatus.h" +#include "statusbar/SoundStatus.h" #include #include @@ -199,13 +201,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) /* WORK OUT IF WE"RE IN ADVANCED MODE OR NOT */ bool advancedMode = false; std::string advsetting; - if (rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES")) - { - advancedMode = true; + if (rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES")) { + advancedMode = true; } - - /* add url handler for RetroShare links */ QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "linkActivated"); @@ -231,7 +230,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT( showabout()) ); //connect(ui.actionColor, SIGNAL(triggered()), this, SLOT( setStyle()) ); - /** adjusted quit behaviour: trigger a warning that can be switched off in the saved config file RetroShare.conf */ connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(doQuit())); @@ -239,31 +237,24 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) /* load the StyleSheet*/ loadStyleSheet(Rshare::stylesheet()); - /* Create the Main pages and actions */ QActionGroup *grp = new QActionGroup(this); - ui.stackPages->add(networkDialog = new NetworkDialog(ui.stackPages), createPageAction(QIcon(IMAGE_NETWORK2), tr("Network"), grp)); - ui.stackPages->add(friendsDialog = new FriendsDialog(ui.stackPages), createPageAction(QIcon(IMAGE_PEERS), tr("Friends"), grp)); - ui.stackPages->add(searchDialog = new SearchDialog(ui.stackPages), createPageAction(QIcon(IMAGE_SEARCH), tr("Search"), grp)); - ui.stackPages->add(transfersDialog = new TransfersDialog(ui.stackPages), transferAction = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp)); - ui.stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui.stackPages), createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp)); - ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages), messageAction = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); @@ -316,7 +307,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) } #endif - /* Create the toolbar */ ui.toolBar->addActions(grp->actions()); @@ -363,6 +353,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) ratesstatus = new RatesStatus(); statusBar()->addPermanentWidget(ratesstatus); + + statusBar()->addPermanentWidget(new SoundStatus()); /** Status Bar end ******/ /* Creates a tray icon with a context menu and adds it to the system's * notification area. */ @@ -577,7 +569,7 @@ void MainWindow::createNotifyIcons() updateMessages(); updateForums(); updateChannels(NOTIFY_TYPE_ADD); - privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD); + privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, 0); // transfer #undef DELETE_OBJECT diff --git a/retroshare-gui/src/gui/SoundManager.cpp b/retroshare-gui/src/gui/SoundManager.cpp index ee78cbe01..f753b27a6 100644 --- a/retroshare-gui/src/gui/SoundManager.cpp +++ b/retroshare-gui/src/gui/SoundManager.cpp @@ -1,103 +1,131 @@ -/**************************************************************** - * 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 "SoundManager.h" -#include "settings/rsharesettings.h" - -SoundManager::SoundManager() -{ - 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(); -} +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2012 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 "SoundManager.h" +#include "settings/rsharesettings.h" + +#define GROUP_MAIN "Sound" +#define GROUP_ENABLE "Enable" +#define GROUP_SOUNDFILE "SoundFilePath" + +SoundManager *soundManager = NULL; + +static QString settingName(SoundManager::Events event) +{ + switch (event) { + case SoundManager::NEW_CHAT_MESSAGE: + return "NewChatMessage"; + case SoundManager::USER_ONLINE: + return "User_go_Online"; + } + + return ""; +} + +void SoundManager::create() +{ + if (soundManager == NULL) { + soundManager = new SoundManager; + } +} + +SoundManager::SoundManager() : QObject() +{ +} + +void SoundManager::setMute(bool mute) +{ + Settings->beginGroup(GROUP_MAIN); + Settings->setValue("mute", mute); + Settings->endGroup(); + + emit SoundManager::mute(mute); +} + +bool SoundManager::isMute() +{ + Settings->beginGroup(GROUP_MAIN); + bool mute = Settings->value("mute", false).toBool(); + Settings->endGroup(); + + return mute; +} + +bool SoundManager::eventEnabled(Events event) +{ + Settings->beginGroup(GROUP_MAIN); + Settings->beginGroup(GROUP_ENABLE); + bool enabled = Settings->value(settingName(event), false).toBool(); + Settings->endGroup(); + Settings->endGroup(); + + return enabled; +} + +void SoundManager::setEventEnabled(Events event, bool enabled) +{ + Settings->beginGroup(GROUP_MAIN); + Settings->beginGroup(GROUP_ENABLE); + Settings->setValue(settingName(event), enabled); + Settings->endGroup(); + Settings->endGroup(); +} + +QString SoundManager::eventFilename(Events event) +{ + Settings->beginGroup(GROUP_MAIN); + Settings->beginGroup(GROUP_SOUNDFILE); + QString filename = Settings->value(settingName(event)).toString(); + Settings->endGroup(); + Settings->endGroup(); + + return filename; +} + +void SoundManager::setEventFilename(Events event, const QString &filename) +{ + Settings->beginGroup(GROUP_MAIN); + Settings->beginGroup(GROUP_SOUNDFILE); + Settings->setValue(settingName(event), filename); + Settings->endGroup(); + Settings->endGroup(); +} + +void SoundManager::play(Events event) +{ + if (isMute() || !QSound::isAvailable() || !eventEnabled(event)) { + return; + } + + QString filename = eventFilename(event); + playFile(filename); +} + + +void SoundManager::playFile(const QString &filename) +{ + if (filename.isEmpty()) { + return; + } + QSound::play(filename); +} diff --git a/retroshare-gui/src/gui/SoundManager.h b/retroshare-gui/src/gui/SoundManager.h index a95c31553..b2eba3dec 100644 --- a/retroshare-gui/src/gui/SoundManager.h +++ b/retroshare-gui/src/gui/SoundManager.h @@ -1,60 +1,63 @@ -/**************************************************************** - * 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 - -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; - -}; -#endif +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2012 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 SOUNDMANAGER_H +#define SOUNDMANAGER_H + +#include + +class SoundManager : public QObject +{ + Q_OBJECT + +public: + enum Events { + NEW_CHAT_MESSAGE, + USER_ONLINE + }; + +public slots: + void setMute(bool mute); + +signals: + void mute(bool isMute); + +public: + static void create(); + + bool isMute(); + + void play(Events event); + void playFile(const QString &filename); + + bool eventEnabled(Events event); + void setEventEnabled(Events event, bool enabled); + + QString eventFilename(Events event); + void setEventFilename(Events event, const QString &filename); + +private: + SoundManager(); +}; + +extern SoundManager *soundManager; + +#endif //SOUNDMANAGER_H diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index 993e9c1c7..fb9b2d4a9 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -29,6 +29,7 @@ #include "PopupChatWindow.h" #include "gui/settings/rsharesettings.h" #include "gui/msgs/MessageComposer.h" +#include "gui/SoundManager.h" #include #include @@ -144,6 +145,9 @@ void ChatDialog::init(const std::string &peerId, const QString &title) /*static*/ void ChatDialog::chatChanged(int list, int type) { if (list == NOTIFY_LIST_PRIVATE_INCOMING_CHAT && type == NOTIFY_TYPE_ADD) { + // play sound when recv a message + soundManager->play(SoundManager::NEW_CHAT_MESSAGE); + std::list ids; if (rsMsgs->getPrivateChatQueueIds(true, ids)) { uint chatflags = Settings->getChatFlags(); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 8485e0601..b7b23703f 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #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()))) { diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index e158668ba..babdca3f2 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -18,6 +18,7 @@ images/btn_27.png images/btn_27_hover.png images/connect_established.png + images/connect_established_low.png images/connect_creating.png images/connect_no.png images/dht16.png @@ -301,6 +302,8 @@ images/message.png images/messages_new.png images/messenger.png + images/mute-off-16.png + images/mute-on-16.png images/network.png images/network16.png images/network32.png diff --git a/retroshare-gui/src/gui/images/mute-off-16.png b/retroshare-gui/src/gui/images/mute-off-16.png new file mode 100644 index 000000000..89cb44658 Binary files /dev/null and b/retroshare-gui/src/gui/images/mute-off-16.png differ diff --git a/retroshare-gui/src/gui/images/mute-on-16.png b/retroshare-gui/src/gui/images/mute-on-16.png new file mode 100644 index 000000000..57bdfafa1 Binary files /dev/null and b/retroshare-gui/src/gui/images/mute-on-16.png differ diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index 97aec0a9f..b65495ac2 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -44,6 +44,7 @@ #endif // MINIMAL_RSGUI #include "gui/settings/rsharesettings.h" +#include "SoundManager.h" #include #include @@ -489,6 +490,8 @@ void NotifyQt::UpdateGUI() } break; case RS_POPUP_CONNECT: + soundManager->play(SoundManager::USER_ONLINE); + if (popupflags & RS_POPUP_CONNECT) { toaster = new Toaster(new OnlineToaster(id, name)); diff --git a/retroshare-gui/src/gui/settings/SoundPage.cpp b/retroshare-gui/src/gui/settings/SoundPage.cpp index 05e03f51a..5ff2fe052 100644 --- a/retroshare-gui/src/gui/settings/SoundPage.cpp +++ b/retroshare-gui/src/gui/settings/SoundPage.cpp @@ -19,30 +19,44 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ - -#include #include "SoundPage.h" #include "rsharesettings.h" +#include "util/misc.h" +#define COLUMN_NAME 0 +#define COLUMN_FILENAME 1 +#define COLUMN_COUNT 2 +#define COLUMN_DATA COLUMN_NAME + +#define ROLE_EVENT Qt::UserRole + +#define TYPE_GROUP 0 +#define TYPE_ITEM 1 /** Constructor */ SoundPage::SoundPage(QWidget * parent, Qt::WFlags flags) : ConfigPage(parent, flags) { - /* Invoke the Qt Designer generated object setup routine */ - ui.setupUi(this); + /* Invoke the Qt Designer generated object setup routine */ + ui.setupUi(this); - 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())); - - ui.groupBox_13->hide(); - ui.groupBox_14->hide(); + connect(ui.eventTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(eventChanged(QTreeWidgetItem*, QTreeWidgetItem*))); + connect(ui.filenameEdit, SIGNAL(textChanged(QString)), this, SLOT(filenameChanged(QString))); + connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearButtonClicked())); + connect(ui.browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); + connect(ui.playButton, SIGNAL(clicked()), this, SLOT(playButtonClicked())); - /* Hide platform specific features */ + ui.clearButton->hide(); + ui.eventTreeWidget->setColumnCount(COLUMN_COUNT); + + QTreeWidgetItem *headerItem = ui.eventTreeWidget->headerItem(); + headerItem->setText(COLUMN_NAME, tr("Event")); + headerItem->setText(COLUMN_FILENAME, tr("Filename")); + + ui.eventTreeWidget->header()->setResizeMode(QHeaderView::Fixed); + ui.eventTreeWidget->setTextElideMode(Qt::ElideMiddle); + + /* Hide platform specific features */ #ifdef Q_WS_WIN #endif @@ -52,128 +66,116 @@ SoundPage::~SoundPage() { } -/** Saves the changes on this page */ -bool -SoundPage::save(QString &/*errmsg*/) +QTreeWidgetItem *SoundPage::addGroup(const QString &name) { - 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(); + QTreeWidgetItem *item = new QTreeWidgetItem(TYPE_GROUP); + item->setText(COLUMN_NAME, name); + ui.eventTreeWidget->insertTopLevelItem(ui.eventTreeWidget->topLevelItemCount(), item); + ui.eventTreeWidget->expandItem(item); + + return item; +} + +QTreeWidgetItem *SoundPage::addItem(QTreeWidgetItem *groupItem, const QString &name, SoundManager::Events event) +{ + QTreeWidgetItem *item = new QTreeWidgetItem(TYPE_ITEM); + item->setData(COLUMN_DATA, ROLE_EVENT, event); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(COLUMN_NAME, soundManager->eventEnabled(event) ? Qt::Checked : Qt::Unchecked); + item->setText(COLUMN_NAME, name); + item->setText(COLUMN_FILENAME, soundManager->eventFilename(event)); + groupItem->addChild(item); + + return item; +} + +/** Saves the changes on this page */ +bool SoundPage::save(QString &/*errmsg*/) +{ + QTreeWidgetItemIterator itemIterator(ui.eventTreeWidget); + QTreeWidgetItem *item = NULL; + while ((item = *itemIterator) != NULL) { + itemIterator++; + + if (item->type() == TYPE_ITEM) { + SoundManager::Events event = (SoundManager::Events) item->data(COLUMN_DATA, ROLE_EVENT).toInt(); + soundManager->setEventEnabled(event, item->checkState(COLUMN_NAME) == Qt::Checked); + soundManager->setEventFilename(event, item->text(COLUMN_FILENAME)); + } + } return true; } - - /** Loads the settings for this page */ -void -SoundPage::load() +void SoundPage::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()); + ui.eventTreeWidget->clear(); - 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); + QTreeWidgetItem *groupItem = addGroup(tr("Friend")); + QTreeWidgetItem *childItem = addItem(groupItem, tr("go Online"), SoundManager::USER_ONLINE); - Settings->endGroup(); + groupItem = addGroup(tr("Chatmessage")); + childItem = addItem(groupItem, tr("New Msg"), SoundManager::NEW_CHAT_MESSAGE); - 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(); + ui.eventTreeWidget->resizeColumnToContents(COLUMN_NAME); + + eventChanged(NULL, NULL); } -void SoundPage::on_cmd_openFile() +void SoundPage::eventChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) { - - 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); + if (!current || current->type() != TYPE_ITEM) { + ui.eventGroup->setEnabled(false); + ui.eventName->clear(); + ui.filenameEdit->clear(); + ui.playButton->setEnabled(false); + return; } - else - ui.checkBoxSound->setEnabled(true); + + ui.eventGroup->setEnabled(true); + ui.filenameEdit->setText(current->text(COLUMN_FILENAME)); + + QString eventName; + if (current->parent()) { + eventName = current->parent()->text(COLUMN_NAME) + ": "; + } + eventName += current->text(COLUMN_NAME); + ui.eventName->setText(eventName); } -/*void SoundPage::on_cmd_openFile2() +void SoundPage::filenameChanged(QString filename) { - 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); + ui.playButton->setEnabled(!filename.isEmpty()); + ui.clearButton->setVisible(!filename.isEmpty()); -}*/ -void SoundPage::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); + QTreeWidgetItem *item = ui.eventTreeWidget->currentItem(); + if (item) { + item->setText(COLUMN_FILENAME, filename); } - else - ui.checkBoxSound_3->setEnabled(true); } -void SoundPage::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 SoundPage::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 SoundPage::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); +void SoundPage::clearButtonClicked() +{ + ui.filenameEdit->clear(); +} + +void SoundPage::browseButtonClicked() +{ + QString filename; + if (!misc::getOpenFileName(this, RshareSettings::LASTDIR_SOUNDS, tr("Open File"), "wav (*.wav)", filename)) { + return; + } + ui.filenameEdit->setText(filename); +} + +void SoundPage::playButtonClicked() +{ + QTreeWidgetItem *item = ui.eventTreeWidget->currentItem(); + if (!item) { + return; + } + + QString filename = item->text(COLUMN_FILENAME); + soundManager->playFile(filename); } diff --git a/retroshare-gui/src/gui/settings/SoundPage.h b/retroshare-gui/src/gui/settings/SoundPage.h index 68cf813f8..557870139 100644 --- a/retroshare-gui/src/gui/settings/SoundPage.h +++ b/retroshare-gui/src/gui/settings/SoundPage.h @@ -26,34 +26,36 @@ #include "configpage.h" #include "ui_SoundPage.h" +#include "gui/SoundManager.h" class SoundPage : public ConfigPage { - Q_OBJECT + Q_OBJECT public: - /** Default Constructor */ - SoundPage(QWidget * parent = 0, Qt::WFlags flags = 0); - /** Default Destructor */ - ~SoundPage(); + /** Default Constructor */ + SoundPage(QWidget * parent = 0, Qt::WFlags flags = 0); + /** Default Destructor */ + ~SoundPage(); - /** Saves the changes on this page */ - bool save(QString &errmsg); - /** Loads the settings for this page */ - void load(); + /** 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(); + void eventChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); + void filenameChanged(QString filename); + void clearButtonClicked(); + void browseButtonClicked(); + void playButtonClicked(); private: - /** Qt Designer generated object */ - Ui::SoundPage ui; + QTreeWidgetItem *addGroup(const QString &name); + QTreeWidgetItem *addItem(QTreeWidgetItem *groupItem, const QString &name, SoundManager::Events event); + + /** Qt Designer generated object */ + Ui::SoundPage ui; }; #endif diff --git a/retroshare-gui/src/gui/settings/SoundPage.ui b/retroshare-gui/src/gui/settings/SoundPage.ui index 12b84c94f..ade92225b 100644 --- a/retroshare-gui/src/gui/settings/SoundPage.ui +++ b/retroshare-gui/src/gui/settings/SoundPage.ui @@ -490,190 +490,148 @@ false - - Qt::NoContextMenu - - - - Sound Events + + + QAbstractItemView::NoEditTriggers - - - - - Friend - - - - - - false - - - go Online - - - - - - - false - - - - - - - Browse - - - - - + + true + + + + 1 + + + + + + + + + + + + + 2 + + + + + + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + + MS Shell Dlg 2 + + + + Qt::NoFocus + + + Reset + + + QPushButton +{ + border-image: url(:/images/closenormal.png) +} + +QPushButton:hover +{ +border-image: url(:/images/closehover.png) +} + +QPushButton:pressed { +border-image: url(:/images/closepressed.png) +} + + + + + + + + + + + + Event name + + + + + + + Event: + + + + + + + Filename: + + + + - - - - Chatmessage - - - - - - false - - - New Msg - - - - - - - false - - - - - - - Browse - - - - - - - - - - FileSend - - - - - - false - - - - - - - Browse - - - - - - - false - - - Finished - - - - - - - - - - FileRecive - - - - - - false - - - Incoming - - - - - - - false - - - - - - - Browse - - - - - - - false - - - Finished - - - - - - - false - - - - - - - Browse - - - - - - - - - - Qt::Vertical - - - - 20 - 29 - - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Browse + + + + + + + + :/images/player_play.png:/images/player_play.png + + + + - + + + diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index 38473ab76..e52a2285b 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -190,6 +190,8 @@ static QString getKeyForLastDir(RshareSettings::enumLastDir type) return "Messages"; case RshareSettings::LASTDIR_BLOGS: return "Messages"; + case RshareSettings::LASTDIR_SOUNDS: + return "SOUNDS"; } return ""; } diff --git a/retroshare-gui/src/gui/settings/rsharesettings.h b/retroshare-gui/src/gui/settings/rsharesettings.h index 82c235e93..523af913d 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.h +++ b/retroshare-gui/src/gui/settings/rsharesettings.h @@ -67,7 +67,8 @@ public: LASTDIR_HISTORY, LASTDIR_IMAGES, LASTDIR_MESSAGES, - LASTDIR_BLOGS + LASTDIR_BLOGS, + LASTDIR_SOUNDS }; enum enumToasterPosition diff --git a/retroshare-gui/src/gui/statusbar/SoundStatus.cpp b/retroshare-gui/src/gui/statusbar/SoundStatus.cpp new file mode 100644 index 000000000..148f51de8 --- /dev/null +++ b/retroshare-gui/src/gui/statusbar/SoundStatus.cpp @@ -0,0 +1,59 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2012 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 + +#include "SoundStatus.h" +#include "gui/SoundManager.h" + +#define IMAGE_MUTE_ON ":/images/mute-on-16.png" +#define IMAGE_MUTE_OFF ":/images/mute-off-16.png" + +SoundStatus::SoundStatus(QWidget *parent) + : QWidget(parent) +{ + QHBoxLayout *hbox = new QHBoxLayout(this); + hbox->setMargin(0); + hbox->setSpacing(0); + + imageButton = new QPushButton(this); + imageButton->setFlat(true); + imageButton->setCheckable(true); + imageButton->setMaximumSize(24, 24); + hbox->addWidget(imageButton); + + setLayout(hbox); + + bool isMute = soundManager->isMute(); + imageButton->setChecked(isMute); + + connect(soundManager, SIGNAL(mute(bool)), this, SLOT(mute(bool))); + connect(imageButton, SIGNAL(toggled(bool)), soundManager, SLOT(setMute(bool))); + + mute(isMute); +} + +void SoundStatus::mute(bool isMute) +{ + imageButton->setIcon(QIcon(isMute ? IMAGE_MUTE_ON : IMAGE_MUTE_OFF)); + imageButton->setToolTip(isMute ? tr("Sound on") : tr("Sound off")); +} diff --git a/retroshare-gui/src/gui/statusbar/SoundStatus.h b/retroshare-gui/src/gui/statusbar/SoundStatus.h new file mode 100644 index 000000000..953232042 --- /dev/null +++ b/retroshare-gui/src/gui/statusbar/SoundStatus.h @@ -0,0 +1,43 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2012 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 SOUNDSTATUS_H +#define SOUNDSTATUS_H + +#include + +class QPushButton; + +class SoundStatus : public QWidget +{ + Q_OBJECT + +public: + SoundStatus(QWidget *parent = 0); + +private slots: + void mute(bool isMute); + +private: + QPushButton *imageButton; +}; + +#endif diff --git a/retroshare-gui/src/gui/toaster/OnlineToaster.cpp b/retroshare-gui/src/gui/toaster/OnlineToaster.cpp index c97cf4755..1f4fe7060 100644 --- a/retroshare-gui/src/gui/toaster/OnlineToaster.cpp +++ b/retroshare-gui/src/gui/toaster/OnlineToaster.cpp @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - #include "OnlineToaster.h" #include "gui/settings/rsharesettings.h" #include "gui/chat/ChatDialog.h" @@ -44,8 +42,6 @@ OnlineToaster::OnlineToaster(const std::string &peerId, const QString &name) : Q ui.pixmaplabel->setPixmap(avatar); WidgetBackgroundImage::setBackgroundImage(ui.windowFrame, ":images/toaster/backgroundtoaster.png", WidgetBackgroundImage::AdjustNone); - - play(); } void OnlineToaster::chatButtonSlot() @@ -53,19 +49,3 @@ void OnlineToaster::chatButtonSlot() ChatDialog::chatFriend(peerId); hide(); } - -void OnlineToaster::play() -{ - 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); -} diff --git a/retroshare-gui/src/gui/toaster/OnlineToaster.h b/retroshare-gui/src/gui/toaster/OnlineToaster.h index c2bf9fbba..e21c6b998 100644 --- a/retroshare-gui/src/gui/toaster/OnlineToaster.h +++ b/retroshare-gui/src/gui/toaster/OnlineToaster.h @@ -38,8 +38,6 @@ private slots: void chatButtonSlot(); private: - void play(); - std::string peerId; /** Qt Designer generated object */ diff --git a/retroshare-gui/src/lang/retroshare_de.qm b/retroshare-gui/src/lang/retroshare_de.qm index b132617b0..7fb20491a 100644 Binary files a/retroshare-gui/src/lang/retroshare_de.qm and b/retroshare-gui/src/lang/retroshare_de.qm differ diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index 22d2c0c46..cf4490e3b 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -691,7 +691,7 @@ p, li { white-space: pre-wrap; } CertificatePage - + Certificate files Zertifikat-Dateien @@ -1088,7 +1088,7 @@ p, li { white-space: pre-wrap; } ChatDialog - + Friend not Online Freund ist nicht online @@ -1102,7 +1102,7 @@ Do you want to send them a Message instead ChatLobbyDialog - + Lobby management Lobby Verwaltung @@ -1159,7 +1159,7 @@ p, li { white-space: pre-wrap; } Neue Chat Lobby erstellen - + Name Name @@ -1179,7 +1179,7 @@ p, li { white-space: pre-wrap; } Öffentliche Lobbies - + Create chat lobby Erstelle Chat Lobby @@ -1512,7 +1512,7 @@ p, li { white-space: pre-wrap; } Löscht den gespeicherten und angezeigten Chat Verlauf - + Paste RetroShare Link RetroShare Link einfügen @@ -1522,7 +1522,7 @@ p, li { white-space: pre-wrap; } tippt... - + Do you really want to physically delete the history? Möchtest du wirklich den Nachrichtenverlauf physisch löschen? @@ -1537,7 +1537,7 @@ p, li { white-space: pre-wrap; } Lade Bilddatei - + Save as... Speichern unter... @@ -1547,7 +1547,7 @@ p, li { white-space: pre-wrap; } Text Datei (*.txt );;Alle Dateien (*) - + apears to be Offline. ist Offline. @@ -1899,7 +1899,12 @@ und meinen GPG Schlüssel nicht unterzeichnet ConnectFriendWizard - + + Certificate Load Failed + Das Zertifikat konnte nicht geladen werden + + + Connect Friend Wizard Assistent um sich zu einem Freund zu verbinden @@ -4785,6 +4790,11 @@ p, li { white-space: pre-wrap; } Connect To Friend Zum Freund verbinden + + + Copy certificate link + + Copy RetroShare Link @@ -4842,13 +4852,13 @@ p, li { white-space: pre-wrap; } Alle reduzieren - + Available Verfügbar - + Do you want to remove this Friend? Möchtest du diesen Freund entfernen? @@ -4916,7 +4926,7 @@ p, li { white-space: pre-wrap; } Statusnachricht ändern - + Group Chat Gruppenchat @@ -5088,12 +5098,12 @@ p, li { white-space: pre-wrap; } Löscht den gespeicherten und angezeigten Chat Verlauf - + Chat lobbies Chat Lobbies - + Profile Profil @@ -5103,7 +5113,7 @@ p, li { white-space: pre-wrap; } Neuigkeiten - + Welcome to RetroShare's group chat. Willkommen bei RetroShare's Gruppenchat. @@ -5113,7 +5123,7 @@ p, li { white-space: pre-wrap; } ich - + Paste RetroShare Link RetroShare Link einfügen @@ -6617,22 +6627,22 @@ Die folgenden Wege sind möglich: MainWindow - + Network Netzwerk - + Friends Freunde - + Transfers Übertragungen - + Messages Nachrichten @@ -6652,7 +6662,7 @@ Die folgenden Wege sind möglich: - + Notify Meldungen @@ -6782,12 +6792,12 @@ Die folgenden Wege sind möglich: Schnellstart Assistent - + Search Suchen - + Files Dateien @@ -6848,7 +6858,7 @@ Die folgenden Wege sind möglich: Maximieren - + Unfinished unfertig @@ -6858,7 +6868,7 @@ Die folgenden Wege sind möglich: - + Help Hilfe @@ -6868,17 +6878,17 @@ Die folgenden Wege sind möglich: Über - + Forums Foren - + RetroShare %1 a secure decentralised communication platform RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform - + Open Messages Öffne Nachrichten @@ -6888,12 +6898,12 @@ Die folgenden Wege sind möglich: Anwendungen - + Plugins - + Do you really want to exit RetroShare ? Möchtest du RetroShare wirklich beenden? @@ -7796,7 +7806,7 @@ p, li { white-space: pre-wrap; } MessagesDialog - + New Message Neue Nachricht @@ -7822,14 +7832,14 @@ p, li { white-space: pre-wrap; } - + Date Datum - + From Von @@ -7974,7 +7984,7 @@ p, li { white-space: pre-wrap; } - + Subject Betreff @@ -7989,7 +7999,7 @@ p, li { white-space: pre-wrap; } Gewählte Nachricht weiterleiten - + Starred Gekennzeichnet @@ -8014,7 +8024,7 @@ p, li { white-space: pre-wrap; } Weiterleiten - + Click to sort by attachments Klicken, um nach Anhang zu sortieren @@ -8030,12 +8040,12 @@ p, li { white-space: pre-wrap; } - + Click to sort by from Klicken, um nach Von zu sortieren - + Click to sort by date Klicken, um nach Datum zu sortieren @@ -8045,13 +8055,13 @@ p, li { white-space: pre-wrap; } Klicken, um nach Schlagwörter zu sortieren - + Click to sort by to Klicken, um nach Empfänger zu sortieren - + Reply to All Allen antworten @@ -8077,7 +8087,7 @@ p, li { white-space: pre-wrap; } - + Trash @@ -8126,12 +8136,12 @@ p, li { white-space: pre-wrap; } An - + Click to sort by star Klicken, um nach Kennzeichnung zu sortieren - + No starred messages available. Stars let you give messages a special status to make them easier to find. To star a message, click on the light grey star beside any message. Es sind keine gekennzeichneten Nachrichten vorhanden. Durch die Kennzeichnung kannst du Nachrichten mit einem speziellen Status versehen, sodass sie leichter zu finden sind. Klicke zum Kennzeichnen einer Nachricht auf den hellgrauen Stern neben der jeweiligen Nachricht. @@ -8896,7 +8906,7 @@ p, li { white-space: pre-wrap; } NotifyQt - + GPG key passphrase GPG Schlüssel Passwort @@ -10130,7 +10140,7 @@ p, li { white-space: pre-wrap; } QObject - + RetroShare RetroShare @@ -10249,7 +10259,14 @@ Lockdatei: Der Empfänger der Nachricht ist unbekannt. - + + Click to add this RetroShare cert to your GPG keyring +and open the Make Friend Wizard. + + + + + Add file Datei hinzufügen @@ -10284,7 +10301,7 @@ Lockdatei: Bestätigung - + %1 of %2 RetroShare links processed. %1 von %2 RetroShare Links verarbeitet. @@ -10961,31 +10978,31 @@ p, li { white-space: pre-wrap; } Freunde - - - + + + x - - - + + + kB/s - + Friends of Friends - + General Allgemein - + Total: Gesamt: @@ -12372,61 +12389,106 @@ p, li { white-space: pre-wrap; } SoundPage - Sound Events - Soundereignisse + Soundereignisse - + + Event + Ereignis + + + + Filename + Dateiname + + + go Online Online - + + Open File + Datei öffnen + + FileSend - Dateitransfer + Dateitransfer - - Finished - Beendet + Beendet - FileRecive - Dateitransfer ankommend + Dateitransfer ankommend - Incoming - Eingehend + Eingehend - + Chatmessage Chatnachricht - + Friend Freund - - - - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Search forums</span></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Suche Foren</span></p></body></html> + + + + Reset + Zurücksetzen + + + + Event: + Ereignis: + + + + Filename: + Dateiname: + + Browse Durchsuchen - + New Msg Neue Nachricht + + SoundStatus + + + Sound on + Ton an + + + + Sound off + Ton aus + + SplashScreen @@ -12435,7 +12497,7 @@ p, li { white-space: pre-wrap; } Lade Profil - + Load configuration Lade Konfiguration diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 7665ce414..037681853 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -44,6 +44,7 @@ #include "gui/common/Emoticons.h" #include "util/EventReceiver.h" #include "gui/RetroShareLink.h" +#include "gui/SoundManager.h" /*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers. #include @@ -65,9 +66,9 @@ int main(int argc, char *argv[]) } #endif - QStringList args = char_array_to_stringlist(argv+1, argc-1); - - Q_INIT_RESOURCE(images); + QStringList args = char_array_to_stringlist(argv+1, argc-1); + + Q_INIT_RESOURCE(images); rsiface = NULL; @@ -75,7 +76,7 @@ int main(int argc, char *argv[]) createRsIface(*notify); createRsControl(*rsiface, *notify); - /* RetroShare Core Objects */ + /* RetroShare Core Objects */ RsInit::InitRsConfig(); int initResult = RsInit::InitRetroShare(argc, argv); @@ -177,23 +178,23 @@ int main(int argc, char *argv[]) } // true: note auto-login is active - std::string lockFile; - int retVal = RsInit::LockAndLoadCertificates(true, lockFile); + std::string lockFile; + int retVal = RsInit::LockAndLoadCertificates(true, lockFile); switch(retVal) { case 0: break; case 1: QMessageBox::warning( 0, QObject::tr("Multiple instances"), QObject::tr("Another RetroShare using the same profile is " - "already running on your system. Please close " - "that instance first\n Lock file:\n") + - QString::fromStdString(lockFile)); + "already running on your system. Please close " + "that instance first\n Lock file:\n") + + QString::fromStdString(lockFile)); return 1; case 2: QMessageBox::critical( 0, QObject::tr("Multiple instances"), QObject::tr("An unexpected error occurred when Retroshare" - "tried to acquire the single instance lock\n Lock file:\n") + - QString::fromStdString(lockFile)); + "tried to acquire the single instance lock\n Lock file:\n") + + QString::fromStdString(lockFile)); return 1; case 3: QMessageBox::critical( 0, QObject::tr("Login Failure"), @@ -210,10 +211,12 @@ int main(int argc, char *argv[]) return 1; } - /* recreate global settings object, now with correct path */ + /* recreate global settings object, now with correct path */ RshareSettings::Create(true); Rshare::resetLanguageAndStyle(); + SoundManager::create(); + splashScreen.showMessage(rshare.translate("SplashScreen", "Load configuration"), Qt::AlignHCenter | Qt::AlignBottom); rsicontrol->StartupRetroShare(); @@ -323,8 +326,11 @@ int main(int argc, char *argv[]) rsicontrol->rsGlobalShutDown(); + delete(soundManager); + soundManager = NULL; + Settings->sync(); - delete Settings; + delete(Settings); return ti ; }