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

@ -349,6 +349,7 @@ HEADERS += rshare.h \
gui/statusbar/ratesstatus.h \ gui/statusbar/ratesstatus.h \
gui/statusbar/hashingstatus.h \ gui/statusbar/hashingstatus.h \
gui/statusbar/discstatus.h \ gui/statusbar/discstatus.h \
gui/statusbar/SoundStatus.h \
gui/advsearch/advancedsearchdialog.h \ gui/advsearch/advancedsearchdialog.h \
gui/advsearch/expressionwidget.h \ gui/advsearch/expressionwidget.h \
gui/advsearch/guiexprelement.h \ gui/advsearch/guiexprelement.h \
@ -609,6 +610,7 @@ SOURCES += main.cpp \
gui/statusbar/ratesstatus.cpp \ gui/statusbar/ratesstatus.cpp \
gui/statusbar/hashingstatus.cpp \ gui/statusbar/hashingstatus.cpp \
gui/statusbar/discstatus.cpp \ gui/statusbar/discstatus.cpp \
gui/statusbar/SoundStatus.cpp \
gui/toaster/MessageToaster.cpp \ gui/toaster/MessageToaster.cpp \
gui/toaster/DownloadToaster.cpp \ gui/toaster/DownloadToaster.cpp \
gui/toaster/OnlineToaster.cpp \ gui/toaster/OnlineToaster.cpp \

View File

@ -29,7 +29,6 @@
#include <QFontDialog> #include <QFontDialog>
#include <QMenu> #include <QMenu>
#include <QScrollBar> #include <QScrollBar>
#include <QSound>
#include "retroshare/rsinit.h" #include "retroshare/rsinit.h"
#include "retroshare/rsnotify.h" #include "retroshare/rsnotify.h"
@ -792,21 +791,6 @@ void FriendsDialog::setCurrentFileName(const QString &fileName)
setWindowModified(false); 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() void FriendsDialog::on_actionMessageHistory_triggered()
{ {
ImHistoryBrowser imBrowser("", ui.lineEdit, this); ImHistoryBrowser imBrowser("", ui.lineEdit, this);

View File

@ -124,9 +124,6 @@ private:
void colorChanged(const QColor &c); void colorChanged(const QColor &c);
void fontChanged(const QFont &font); void fontChanged(const QFont &font);
///play the sound when recv a message
void playsound();
QString fileName; QString fileName;
ChatStyle style; ChatStyle style;

View File

@ -56,6 +56,7 @@
#include "help/browser/helpbrowser.h" #include "help/browser/helpbrowser.h"
#include "chat/ChatDialog.h" #include "chat/ChatDialog.h"
#include "RetroShareLink.h" #include "RetroShareLink.h"
#include "SoundManager.h"
#ifdef UNFINISHED #ifdef UNFINISHED
#include "unfinished/ApplicationWindow.h" #include "unfinished/ApplicationWindow.h"
@ -75,6 +76,7 @@
#include "statusbar/dhtstatus.h" #include "statusbar/dhtstatus.h"
#include "statusbar/hashingstatus.h" #include "statusbar/hashingstatus.h"
#include "statusbar/discstatus.h" #include "statusbar/discstatus.h"
#include "statusbar/SoundStatus.h"
#include <retroshare/rsstatus.h> #include <retroshare/rsstatus.h>
#include <retroshare/rsiface.h> #include <retroshare/rsiface.h>
@ -199,13 +201,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
/* WORK OUT IF WE"RE IN ADVANCED MODE OR NOT */ /* WORK OUT IF WE"RE IN ADVANCED MODE OR NOT */
bool advancedMode = false; bool advancedMode = false;
std::string advsetting; std::string advsetting;
if (rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES")) if (rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES")) {
{ advancedMode = true;
advancedMode = true;
} }
/* add url handler for RetroShare links */ /* add url handler for RetroShare links */
QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "linkActivated"); 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.actionAbout, SIGNAL(triggered()), this, SLOT( showabout()) );
//connect(ui.actionColor, SIGNAL(triggered()), this, SLOT( setStyle()) ); //connect(ui.actionColor, SIGNAL(triggered()), this, SLOT( setStyle()) );
/** adjusted quit behaviour: trigger a warning that can be switched off in the saved /** adjusted quit behaviour: trigger a warning that can be switched off in the saved
config file RetroShare.conf */ config file RetroShare.conf */
connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(doQuit())); connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(doQuit()));
@ -239,31 +237,24 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
/* load the StyleSheet*/ /* load the StyleSheet*/
loadStyleSheet(Rshare::stylesheet()); loadStyleSheet(Rshare::stylesheet());
/* Create the Main pages and actions */ /* Create the Main pages and actions */
QActionGroup *grp = new QActionGroup(this); QActionGroup *grp = new QActionGroup(this);
ui.stackPages->add(networkDialog = new NetworkDialog(ui.stackPages), ui.stackPages->add(networkDialog = new NetworkDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_NETWORK2), tr("Network"), grp)); createPageAction(QIcon(IMAGE_NETWORK2), tr("Network"), grp));
ui.stackPages->add(friendsDialog = new FriendsDialog(ui.stackPages), ui.stackPages->add(friendsDialog = new FriendsDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_PEERS), tr("Friends"), grp)); createPageAction(QIcon(IMAGE_PEERS), tr("Friends"), grp));
ui.stackPages->add(searchDialog = new SearchDialog(ui.stackPages), ui.stackPages->add(searchDialog = new SearchDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_SEARCH), tr("Search"), grp)); createPageAction(QIcon(IMAGE_SEARCH), tr("Search"), grp));
ui.stackPages->add(transfersDialog = new TransfersDialog(ui.stackPages), ui.stackPages->add(transfersDialog = new TransfersDialog(ui.stackPages),
transferAction = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp)); transferAction = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp));
ui.stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui.stackPages), ui.stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp)); createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp));
ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages), ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages),
messageAction = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); messageAction = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
@ -316,7 +307,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
} }
#endif #endif
/* Create the toolbar */ /* Create the toolbar */
ui.toolBar->addActions(grp->actions()); ui.toolBar->addActions(grp->actions());
@ -363,6 +353,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
ratesstatus = new RatesStatus(); ratesstatus = new RatesStatus();
statusBar()->addPermanentWidget(ratesstatus); statusBar()->addPermanentWidget(ratesstatus);
statusBar()->addPermanentWidget(new SoundStatus());
/** Status Bar end ******/ /** Status Bar end ******/
/* Creates a tray icon with a context menu and adds it to the system's * notification area. */ /* 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(); updateMessages();
updateForums(); updateForums();
updateChannels(NOTIFY_TYPE_ADD); updateChannels(NOTIFY_TYPE_ADD);
privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD); privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, 0);
// transfer // transfer
#undef DELETE_OBJECT #undef DELETE_OBJECT

View File

@ -1,7 +1,7 @@
/**************************************************************** /****************************************************************
* RetroShare is distributed under the following license: * RetroShare is distributed under the following license:
* *
* Copyright (C) 2006 - 2009 RetroShare Team * Copyright (C) 2012 RetroShare Team
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -24,80 +24,108 @@
#include "SoundManager.h" #include "SoundManager.h"
#include "settings/rsharesettings.h" #include "settings/rsharesettings.h"
SoundManager::SoundManager() #define GROUP_MAIN "Sound"
#define GROUP_ENABLE "Enable"
#define GROUP_SOUNDFILE "SoundFilePath"
SoundManager *soundManager = NULL;
static QString settingName(SoundManager::Events event)
{ {
isMute=false; switch (event) {
reInit(); case SoundManager::NEW_CHAT_MESSAGE:
return "NewChatMessage";
case SoundManager::USER_ONLINE:
return "User_go_Online";
}
return "";
} }
void SoundManager::doMute(bool t) void SoundManager::create()
{ {
isMute=t; if (soundManager == NULL) {
} soundManager = new SoundManager;
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() SoundManager::SoundManager() : QObject()
{ {
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"); void SoundManager::setMute(bool mute)
SoundFileUser_go_Online = Settings->value("User_go_Online","").toString(); {
SoundFileUser_go_Offline = Settings->value("User_go_Offline","").toString(); Settings->beginGroup(GROUP_MAIN);
SoundFileFileSend_Finished = Settings->value("FileSend_Finished","").toString(); Settings->setValue("mute", mute);
SoundFileFileRecive_Incoming = Settings->value("FileRecive_Incoming","").toString(); Settings->endGroup();
SoundFileFileRecive_Finished = Settings->value("FileRecive_Finished","").toString();
SoundFileNewChatMessage = Settings->value("NewChatMessage","").toString(); emit SoundManager::mute(mute);
Settings->endGroup(); }
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(); 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);
}

View File

@ -1,7 +1,7 @@
/**************************************************************** /****************************************************************
* RetroShare is distributed under the following license: * RetroShare is distributed under the following license:
* *
* Copyright (C) 2006, 2007 crypton * Copyright (C) 2012 RetroShare Team
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -18,43 +18,46 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#ifndef SOUND_MANAGER_H
#define SOUND_MANAGER_H #ifndef SOUNDMANAGER_H
#define SOUNDMANAGER_H
#include <QObject> #include <QObject>
class SoundManager :public QObject class SoundManager : public QObject
{ {
Q_OBJECT Q_OBJECT
public:
SoundManager();
public slots: public:
void doMute(bool t); enum Events {
void event_User_go_Online(); NEW_CHAT_MESSAGE,
void event_User_go_Offline(); USER_ONLINE
void event_FileSend_Finished(); };
void event_FileRecive_Incoming();
void event_FileRecive_Finished();
void event_NewChatMessage();
void reInit();
public slots:
void setMute(bool mute);
private: signals:
bool isMute; void mute(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; public:
bool enable_eventUser_go_Offline; static void create();
bool enable_eventFileSend_Finished;
bool enable_eventFileRecive_Incoming;
bool enable_eventFileRecive_Finished;
bool enable_eventNewChatMessage;
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();
}; };
#endif
extern SoundManager *soundManager;
#endif //SOUNDMANAGER_H

View File

@ -29,6 +29,7 @@
#include "PopupChatWindow.h" #include "PopupChatWindow.h"
#include "gui/settings/rsharesettings.h" #include "gui/settings/rsharesettings.h"
#include "gui/msgs/MessageComposer.h" #include "gui/msgs/MessageComposer.h"
#include "gui/SoundManager.h"
#include <retroshare/rsiface.h> #include <retroshare/rsiface.h>
#include <retroshare/rsnotify.h> #include <retroshare/rsnotify.h>
@ -144,6 +145,9 @@ void ChatDialog::init(const std::string &peerId, const QString &title)
/*static*/ void ChatDialog::chatChanged(int list, int type) /*static*/ void ChatDialog::chatChanged(int list, int type)
{ {
if (list == NOTIFY_LIST_PRIVATE_INCOMING_CHAT && type == NOTIFY_TYPE_ADD) { 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<std::string> ids; std::list<std::string> ids;
if (rsMsgs->getPrivateChatQueueIds(true, ids)) { if (rsMsgs->getPrivateChatQueueIds(true, ids)) {
uint chatflags = Settings->getChatFlags(); uint chatflags = Settings->getChatFlags();

View File

@ -27,7 +27,6 @@
#include <QColorDialog> #include <QColorDialog>
#include <QFontDialog> #include <QFontDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QSound>
#include "ChatWidget.h" #include "ChatWidget.h"
#include "ui_ChatWidget.h" #include "ui_ChatWidget.h"
@ -52,25 +51,6 @@
* #define CHAT_DEBUG 1 * #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) : ChatWidget::ChatWidget(QWidget *parent) :
QWidget(parent), ui(new Ui::ChatWidget) QWidget(parent), ui(new Ui::ChatWidget)
{ {
@ -330,8 +310,6 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
resetStatusBar(); resetStatusBar();
if (incoming && chatType == TYPE_NORMAL) { if (incoming && chatType == TYPE_NORMAL) {
playsound();
emit newMessage(this); emit newMessage(this);
if (!isVisible() || (window() && (!window()->isActiveWindow() || window()->isMinimized()))) { if (!isVisible() || (window() && (!window()->isActiveWindow() || window()->isMinimized()))) {

View File

@ -18,6 +18,7 @@
<file>images/btn_27.png</file> <file>images/btn_27.png</file>
<file>images/btn_27_hover.png</file> <file>images/btn_27_hover.png</file>
<file>images/connect_established.png</file> <file>images/connect_established.png</file>
<file>images/connect_established_low.png</file>
<file>images/connect_creating.png</file> <file>images/connect_creating.png</file>
<file>images/connect_no.png</file> <file>images/connect_no.png</file>
<file>images/dht16.png</file> <file>images/dht16.png</file>
@ -301,6 +302,8 @@
<file>images/message.png</file> <file>images/message.png</file>
<file>images/messages_new.png</file> <file>images/messages_new.png</file>
<file>images/messenger.png</file> <file>images/messenger.png</file>
<file>images/mute-off-16.png</file>
<file>images/mute-on-16.png</file>
<file>images/network.png</file> <file>images/network.png</file>
<file>images/network16.png</file> <file>images/network16.png</file>
<file>images/network32.png</file> <file>images/network32.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

View File

@ -44,6 +44,7 @@
#endif // MINIMAL_RSGUI #endif // MINIMAL_RSGUI
#include "gui/settings/rsharesettings.h" #include "gui/settings/rsharesettings.h"
#include "SoundManager.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -489,6 +490,8 @@ void NotifyQt::UpdateGUI()
} }
break; break;
case RS_POPUP_CONNECT: case RS_POPUP_CONNECT:
soundManager->play(SoundManager::USER_ONLINE);
if (popupflags & RS_POPUP_CONNECT) if (popupflags & RS_POPUP_CONNECT)
{ {
toaster = new Toaster(new OnlineToaster(id, name)); toaster = new Toaster(new OnlineToaster(id, name));

View File

@ -19,30 +19,44 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#include <rshare.h>
#include "SoundPage.h" #include "SoundPage.h"
#include "rsharesettings.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 */ /** Constructor */
SoundPage::SoundPage(QWidget * parent, Qt::WFlags flags) SoundPage::SoundPage(QWidget * parent, Qt::WFlags flags)
: ConfigPage(parent, flags) : ConfigPage(parent, flags)
{ {
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
connect(ui.cmd_openFile, SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile())); connect(ui.eventTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(eventChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
//connect(ui.cmd_openFile_2,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile2())); connect(ui.filenameEdit, SIGNAL(textChanged(QString)), this, SLOT(filenameChanged(QString)));
connect(ui.cmd_openFile_3,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile3())); connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearButtonClicked()));
connect(ui.cmd_openFile_4,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile4())); connect(ui.browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
connect(ui.cmd_openFile_5,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile5())); connect(ui.playButton, SIGNAL(clicked()), this, SLOT(playButtonClicked()));
connect(ui.cmd_openFile_6,SIGNAL(clicked(bool) ),this,SLOT(on_cmd_openFile6()));
ui.groupBox_13->hide(); ui.clearButton->hide();
ui.groupBox_14->hide(); ui.eventTreeWidget->setColumnCount(COLUMN_COUNT);
/* Hide platform specific features */ 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 #ifdef Q_WS_WIN
#endif #endif
@ -52,128 +66,116 @@ SoundPage::~SoundPage()
{ {
} }
/** Saves the changes on this page */ QTreeWidgetItem *SoundPage::addGroup(const QString &name)
bool
SoundPage::save(QString &/*errmsg*/)
{ {
Settings->beginGroup("Sound"); QTreeWidgetItem *item = new QTreeWidgetItem(TYPE_GROUP);
Settings->beginGroup("Enable"); item->setText(COLUMN_NAME, name);
Settings->setValue("User_go_Online",ui.checkBoxSound->isChecked()); ui.eventTreeWidget->insertTopLevelItem(ui.eventTreeWidget->topLevelItemCount(), item);
//settings.setValue("User_go_Offline",ui.checkBoxSound_2->isChecked()); ui.eventTreeWidget->expandItem(item);
Settings->setValue("FileSend_Finished",ui.checkBoxSound_3->isChecked());
Settings->setValue("FileRecive_Incoming",ui.checkBoxSound_4->isChecked()); return item;
Settings->setValue("FileRecive_Finished",ui.checkBoxSound_5->isChecked()); }
Settings->setValue("NewChatMessage",ui.checkBoxSound_6->isChecked());
Settings->endGroup(); QTreeWidgetItem *SoundPage::addItem(QTreeWidgetItem *groupItem, const QString &name, SoundManager::Events event)
Settings->beginGroup("SoundFilePath"); {
Settings->setValue("User_go_Online",ui.txt_SoundFile->text()); QTreeWidgetItem *item = new QTreeWidgetItem(TYPE_ITEM);
//settings.setValue("User_go_Offline",ui.txt_SoundFile2->text()); item->setData(COLUMN_DATA, ROLE_EVENT, event);
Settings->setValue("FileSend_Finished",ui.txt_SoundFile3->text()); item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
Settings->setValue("FileRecive_Incoming",ui.txt_SoundFile4->text()); item->setCheckState(COLUMN_NAME, soundManager->eventEnabled(event) ? Qt::Checked : Qt::Unchecked);
Settings->setValue("FileRecive_Finished",ui.txt_SoundFile5->text()); item->setText(COLUMN_NAME, name);
Settings->setValue("NewChatMessage",ui.txt_SoundFile6->text()); item->setText(COLUMN_FILENAME, soundManager->eventFilename(event));
Settings->endGroup(); groupItem->addChild(item);
Settings->endGroup();
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; return true;
} }
/** Loads the settings for this page */ /** Loads the settings for this page */
void void SoundPage::load()
SoundPage::load()
{ {
Settings->beginGroup("Sound"); ui.eventTreeWidget->clear();
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); QTreeWidgetItem *groupItem = addGroup(tr("Friend"));
//if(!ui.txt_SoundFile2->text().isEmpty())ui.checkBoxSound_2->setEnabled(true); QTreeWidgetItem *childItem = addItem(groupItem, tr("go Online"), SoundManager::USER_ONLINE);
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(); groupItem = addGroup(tr("Chatmessage"));
childItem = addItem(groupItem, tr("New Msg"), SoundManager::NEW_CHAT_MESSAGE);
Settings->beginGroup("Enable"); ui.eventTreeWidget->resizeColumnToContents(COLUMN_NAME);
ui.checkBoxSound->setChecked(Settings->value("User_go_Online",false).toBool());
//ui.checkBoxSound_2->setChecked(settings.value("User_go_Offline",false).toBool()); eventChanged(NULL, NULL);
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 SoundPage::on_cmd_openFile() void SoundPage::eventChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
{ {
if (!current || current->type() != TYPE_ITEM) {
ui.txt_SoundFile->setText(QFileDialog::getOpenFileName(this,"Open File", ".", "wav (*.wav)")); ui.eventGroup->setEnabled(false);
if(ui.txt_SoundFile->text().isEmpty()){ ui.eventName->clear();
ui.checkBoxSound->setChecked(false); ui.filenameEdit->clear();
ui.checkBoxSound->setEnabled(false); 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)")); ui.playButton->setEnabled(!filename.isEmpty());
if(ui.txt_SoundFile2->text().isEmpty()){ ui.clearButton->setVisible(!filename.isEmpty());
ui.checkBoxSound_2->setChecked(false);
ui.checkBoxSound_2->setEnabled(false);
}
else
ui.checkBoxSound_2->setEnabled(true);
}*/ QTreeWidgetItem *item = ui.eventTreeWidget->currentItem();
void SoundPage::on_cmd_openFile3() if (item) {
{ item->setText(COLUMN_FILENAME, filename);
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 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);
} }

View File

@ -26,34 +26,36 @@
#include "configpage.h" #include "configpage.h"
#include "ui_SoundPage.h" #include "ui_SoundPage.h"
#include "gui/SoundManager.h"
class SoundPage : public ConfigPage class SoundPage : public ConfigPage
{ {
Q_OBJECT Q_OBJECT
public: public:
/** Default Constructor */ /** Default Constructor */
SoundPage(QWidget * parent = 0, Qt::WFlags flags = 0); SoundPage(QWidget * parent = 0, Qt::WFlags flags = 0);
/** Default Destructor */ /** Default Destructor */
~SoundPage(); ~SoundPage();
/** Saves the changes on this page */ /** Saves the changes on this page */
bool save(QString &errmsg); bool save(QString &errmsg);
/** Loads the settings for this page */ /** Loads the settings for this page */
void load(); void load();
private slots: private slots:
void eventChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_cmd_openFile(); void filenameChanged(QString filename);
//void on_cmd_openFile2(); void clearButtonClicked();
void on_cmd_openFile3(); void browseButtonClicked();
void on_cmd_openFile4(); void playButtonClicked();
void on_cmd_openFile5();
void on_cmd_openFile6();
private: private:
/** Qt Designer generated object */ QTreeWidgetItem *addGroup(const QString &name);
Ui::SoundPage ui; QTreeWidgetItem *addItem(QTreeWidgetItem *groupItem, const QString &name, SoundManager::Events event);
/** Qt Designer generated object */
Ui::SoundPage ui;
}; };
#endif #endif

View File

@ -490,190 +490,148 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox_11"> <widget class="QTreeWidget" name="eventTreeWidget">
<property name="title"> <property name="editTriggers">
<string>Sound Events</string> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
<layout class="QGridLayout" name="gridLayout_6"> <property name="allColumnsShowFocus">
<item row="0" column="0"> <bool>true</bool>
<widget class="QGroupBox" name="groupBox_12"> </property>
<property name="title"> <column>
<string>Friend</string> <property name="text">
</property> <string notr="true">1</string>
<layout class="QGridLayout" name="gridLayout_5"> </property>
<item row="0" column="0"> </column>
<widget class="QCheckBox" name="checkBoxSound"> </widget>
<property name="enabled"> </item>
<bool>false</bool> <item row="1" column="0">
</property> <widget class="QGroupBox" name="eventGroup">
<property name="text"> <layout class="QVBoxLayout" name="verticalLayout">
<string>go Online</string> <item>
</property> <layout class="QGridLayout" name="gridLayout_2">
</widget> <item row="3" column="1">
</item> <layout class="QHBoxLayout" name="horizontalLayout_1">
<item row="0" column="1"> <property name="spacing">
<widget class="QLineEdit" name="txt_SoundFile"> <number>2</number>
<property name="enabled"> </property>
<bool>false</bool> <item>
</property> <widget class="QLineEdit" name="filenameEdit">
</widget> <property name="toolTip">
</item> <string/>
<item row="0" column="2"> </property>
<widget class="QPushButton" name="cmd_openFile"> </widget>
<property name="text"> </item>
<string>Browse</string> <item>
</property> <widget class="QPushButton" name="clearButton">
</widget> <property name="minimumSize">
</item> <size>
</layout> <width>16</width>
</widget> <height>16</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="font">
<font>
<family>MS Shell Dlg 2</family>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Reset</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton
{
border-image: url(:/images/closenormal.png)
}
QPushButton:hover
{
border-image: url(:/images/closehover.png)
}
QPushButton:pressed {
border-image: url(:/images/closepressed.png)
}</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QLabel" name="eventName">
<property name="text">
<string notr="true">Event name</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="eventLabel">
<property name="text">
<string>Event:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Filename:</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QGroupBox" name="groupBox_15"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="title"> <item>
<string>Chatmessage</string> <spacer name="horizontalSpacer">
</property> <property name="orientation">
<layout class="QGridLayout" name="gridLayout_4"> <enum>Qt::Horizontal</enum>
<item row="0" column="0"> </property>
<widget class="QCheckBox" name="checkBoxSound_6"> <property name="sizeHint" stdset="0">
<property name="enabled"> <size>
<bool>false</bool> <width>40</width>
</property> <height>20</height>
<property name="text"> </size>
<string>New Msg</string> </property>
</property> </spacer>
</widget> </item>
</item> <item>
<item row="0" column="1"> <widget class="QPushButton" name="browseButton">
<widget class="QLineEdit" name="txt_SoundFile6"> <property name="text">
<property name="enabled"> <string>Browse</string>
<bool>false</bool> </property>
</property> </widget>
</widget> </item>
</item> <item>
<item row="0" column="2"> <widget class="QPushButton" name="playButton">
<widget class="QPushButton" name="cmd_openFile_6"> <property name="icon">
<property name="text"> <iconset resource="../images.qrc">
<string>Browse</string> <normaloff>:/images/player_play.png</normaloff>:/images/player_play.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_13">
<property name="title">
<string>FileSend</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="txt_SoundFile3">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="cmd_openFile_3">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxSound_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Finished</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox_14">
<property name="title">
<string>FileRecive</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxSound_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Incoming</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txt_SoundFile4">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="cmd_openFile_4">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBoxSound_5">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Finished</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txt_SoundFile5">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="cmd_openFile_5">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>29</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="../images.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -190,6 +190,8 @@ static QString getKeyForLastDir(RshareSettings::enumLastDir type)
return "Messages"; return "Messages";
case RshareSettings::LASTDIR_BLOGS: case RshareSettings::LASTDIR_BLOGS:
return "Messages"; return "Messages";
case RshareSettings::LASTDIR_SOUNDS:
return "SOUNDS";
} }
return ""; return "";
} }

View File

@ -67,7 +67,8 @@ public:
LASTDIR_HISTORY, LASTDIR_HISTORY,
LASTDIR_IMAGES, LASTDIR_IMAGES,
LASTDIR_MESSAGES, LASTDIR_MESSAGES,
LASTDIR_BLOGS LASTDIR_BLOGS,
LASTDIR_SOUNDS
}; };
enum enumToasterPosition enum enumToasterPosition

View File

@ -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 <QHBoxLayout>
#include <QPushButton>
#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"));
}

View File

@ -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 <QWidget>
class QPushButton;
class SoundStatus : public QWidget
{
Q_OBJECT
public:
SoundStatus(QWidget *parent = 0);
private slots:
void mute(bool isMute);
private:
QPushButton *imageButton;
};
#endif

View File

@ -17,8 +17,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <QSound>
#include "OnlineToaster.h" #include "OnlineToaster.h"
#include "gui/settings/rsharesettings.h" #include "gui/settings/rsharesettings.h"
#include "gui/chat/ChatDialog.h" #include "gui/chat/ChatDialog.h"
@ -44,8 +42,6 @@ OnlineToaster::OnlineToaster(const std::string &peerId, const QString &name) : Q
ui.pixmaplabel->setPixmap(avatar); ui.pixmaplabel->setPixmap(avatar);
WidgetBackgroundImage::setBackgroundImage(ui.windowFrame, ":images/toaster/backgroundtoaster.png", WidgetBackgroundImage::AdjustNone); WidgetBackgroundImage::setBackgroundImage(ui.windowFrame, ":images/toaster/backgroundtoaster.png", WidgetBackgroundImage::AdjustNone);
play();
} }
void OnlineToaster::chatButtonSlot() void OnlineToaster::chatButtonSlot()
@ -53,19 +49,3 @@ void OnlineToaster::chatButtonSlot()
ChatDialog::chatFriend(peerId); ChatDialog::chatFriend(peerId);
hide(); 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);
}

View File

@ -38,8 +38,6 @@ private slots:
void chatButtonSlot(); void chatButtonSlot();
private: private:
void play();
std::string peerId; std::string peerId;
/** Qt Designer generated object */ /** Qt Designer generated object */

View File

@ -691,7 +691,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>CertificatePage</name> <name>CertificatePage</name>
<message> <message>
<location filename="../gui/connect/ConnectFriendWizard.cpp" line="+703"/> <location filename="../gui/connect/ConnectFriendWizard.cpp" line="+733"/>
<source>Certificate files</source> <source>Certificate files</source>
<translation>Zertifikat-Dateien</translation> <translation>Zertifikat-Dateien</translation>
</message> </message>
@ -1088,7 +1088,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>ChatDialog</name> <name>ChatDialog</name>
<message> <message>
<location filename="../gui/chat/ChatDialog.cpp" line="+224"/> <location filename="../gui/chat/ChatDialog.cpp" line="+228"/>
<source>Friend not Online</source> <source>Friend not Online</source>
<translation>Freund ist nicht online</translation> <translation>Freund ist nicht online</translation>
</message> </message>
@ -1102,7 +1102,7 @@ Do you want to send them a Message instead</source>
<context> <context>
<name>ChatLobbyDialog</name> <name>ChatLobbyDialog</name>
<message> <message>
<location filename="../gui/chat/ChatLobbyDialog.cpp" line="+141"/> <location filename="../gui/chat/ChatLobbyDialog.cpp" line="+147"/>
<location line="+3"/> <location line="+3"/>
<source>Lobby management</source> <source>Lobby management</source>
<translation>Lobby Verwaltung</translation> <translation>Lobby Verwaltung</translation>
@ -1159,7 +1159,7 @@ p, li { white-space: pre-wrap; }
<translation>Neue Chat Lobby erstellen</translation> <translation>Neue Chat Lobby erstellen</translation>
</message> </message>
<message> <message>
<location filename="../gui/ChatLobbyWidget.cpp" line="+60"/> <location filename="../gui/ChatLobbyWidget.cpp" line="+53"/>
<source>Name</source> <source>Name</source>
<translation>Name</translation> <translation>Name</translation>
</message> </message>
@ -1179,7 +1179,7 @@ p, li { white-space: pre-wrap; }
<translation>Öffentliche Lobbies</translation> <translation>Öffentliche Lobbies</translation>
</message> </message>
<message> <message>
<location line="+25"/> <location line="+17"/>
<source>Create chat lobby</source> <source>Create chat lobby</source>
<translation>Erstelle Chat Lobby</translation> <translation>Erstelle Chat Lobby</translation>
</message> </message>
@ -1512,7 +1512,7 @@ p, li { white-space: pre-wrap; }
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation> <translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
</message> </message>
<message> <message>
<location filename="../gui/chat/ChatWidget.cpp" line="+351"/> <location filename="../gui/chat/ChatWidget.cpp" line="+336"/>
<source>Paste RetroShare Link</source> <source>Paste RetroShare Link</source>
<translation>RetroShare Link einfügen</translation> <translation>RetroShare Link einfügen</translation>
</message> </message>
@ -1522,7 +1522,7 @@ p, li { white-space: pre-wrap; }
<translation>tippt...</translation> <translation>tippt...</translation>
</message> </message>
<message> <message>
<location line="+120"/> <location line="+118"/>
<source>Do you really want to physically delete the history?</source> <source>Do you really want to physically delete the history?</source>
<translation>Möchtest du wirklich den Nachrichtenverlauf physisch löschen?</translation> <translation>Möchtest du wirklich den Nachrichtenverlauf physisch löschen?</translation>
</message> </message>
@ -1537,7 +1537,7 @@ p, li { white-space: pre-wrap; }
<translation>Lade Bilddatei</translation> <translation>Lade Bilddatei</translation>
</message> </message>
<message> <message>
<location line="+68"/> <location line="+67"/>
<source>Save as...</source> <source>Save as...</source>
<translation>Speichern unter...</translation> <translation>Speichern unter...</translation>
</message> </message>
@ -1547,7 +1547,7 @@ p, li { white-space: pre-wrap; }
<translation>Text Datei (*.txt );;Alle Dateien (*)</translation> <translation>Text Datei (*.txt );;Alle Dateien (*)</translation>
</message> </message>
<message> <message>
<location line="+25"/> <location line="+27"/>
<source>apears to be Offline.</source> <source>apears to be Offline.</source>
<translation>ist Offline.</translation> <translation>ist Offline.</translation>
</message> </message>
@ -1899,7 +1899,12 @@ und meinen GPG Schlüssel nicht unterzeichnet</translation>
<context> <context>
<name>ConnectFriendWizard</name> <name>ConnectFriendWizard</name>
<message> <message>
<location filename="../gui/connect/ConnectFriendWizard.cpp" line="-857"/> <location filename="../gui/connect/ConnectFriendWizard.cpp" line="-880"/>
<source>Certificate Load Failed</source>
<translation type="unfinished">Das Zertifikat konnte nicht geladen werden</translation>
</message>
<message>
<location line="+23"/>
<source>Connect Friend Wizard</source> <source>Connect Friend Wizard</source>
<translation>Assistent um sich zu einem Freund zu verbinden</translation> <translation>Assistent um sich zu einem Freund zu verbinden</translation>
</message> </message>
@ -4785,6 +4790,11 @@ p, li { white-space: pre-wrap; }
<source>Connect To Friend</source> <source>Connect To Friend</source>
<translation>Zum Freund verbinden</translation> <translation>Zum Freund verbinden</translation>
</message> </message>
<message>
<location line="+3"/>
<source>Copy certificate link</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location line="+3"/> <location line="+3"/>
<source>Copy RetroShare Link</source> <source>Copy RetroShare Link</source>
@ -4842,13 +4852,13 @@ p, li { white-space: pre-wrap; }
<translation>Alle reduzieren</translation> <translation>Alle reduzieren</translation>
</message> </message>
<message> <message>
<location line="+554"/> <location line="+564"/>
<location line="+2"/> <location line="+2"/>
<source>Available</source> <source>Available</source>
<translation>Verfügbar</translation> <translation>Verfügbar</translation>
</message> </message>
<message> <message>
<location line="+331"/> <location line="+345"/>
<source>Do you want to remove this Friend?</source> <source>Do you want to remove this Friend?</source>
<translation>Möchtest du diesen Freund entfernen?</translation> <translation>Möchtest du diesen Freund entfernen?</translation>
</message> </message>
@ -4916,7 +4926,7 @@ p, li { white-space: pre-wrap; }
<translation>Statusnachricht ändern</translation> <translation>Statusnachricht ändern</translation>
</message> </message>
<message> <message>
<location line="+38"/> <location line="+41"/>
<source>Group Chat</source> <source>Group Chat</source>
<translation>Gruppenchat</translation> <translation>Gruppenchat</translation>
</message> </message>
@ -5088,12 +5098,12 @@ p, li { white-space: pre-wrap; }
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation> <translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
</message> </message>
<message> <message>
<location filename="../gui/FriendsDialog.cpp" line="+92"/> <location filename="../gui/FriendsDialog.cpp" line="+96"/>
<source>Chat lobbies</source> <source>Chat lobbies</source>
<translation>Chat Lobbies</translation> <translation>Chat Lobbies</translation>
</message> </message>
<message> <message>
<location line="+2"/> <location line="+1"/>
<source>Profile</source> <source>Profile</source>
<translation>Profil</translation> <translation>Profil</translation>
</message> </message>
@ -5103,7 +5113,7 @@ p, li { white-space: pre-wrap; }
<translation>Neuigkeiten</translation> <translation>Neuigkeiten</translation>
</message> </message>
<message> <message>
<location line="+33"/> <location line="+37"/>
<source>Welcome to RetroShare&apos;s group chat.</source> <source>Welcome to RetroShare&apos;s group chat.</source>
<translation>Willkommen bei RetroShare&apos;s Gruppenchat.</translation> <translation>Willkommen bei RetroShare&apos;s Gruppenchat.</translation>
</message> </message>
@ -5113,7 +5123,7 @@ p, li { white-space: pre-wrap; }
<translation>ich</translation> <translation>ich</translation>
</message> </message>
<message> <message>
<location line="+61"/> <location line="+65"/>
<source>Paste RetroShare Link</source> <source>Paste RetroShare Link</source>
<translation>RetroShare Link einfügen</translation> <translation>RetroShare Link einfügen</translation>
</message> </message>
@ -6617,22 +6627,22 @@ Die folgenden Wege sind möglich:</translation>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+248"/> <location filename="../gui/MainWindow.cpp" line="+244"/>
<source>Network</source> <source>Network</source>
<translation>Netzwerk</translation> <translation>Netzwerk</translation>
</message> </message>
<message> <message>
<location line="+4"/> <location line="+3"/>
<source>Friends</source> <source>Friends</source>
<translation>Freunde</translation> <translation>Freunde</translation>
</message> </message>
<message> <message>
<location line="+8"/> <location line="+6"/>
<source>Transfers</source> <source>Transfers</source>
<translation>Übertragungen</translation> <translation>Übertragungen</translation>
</message> </message>
<message> <message>
<location line="+8"/> <location line="+6"/>
<source>Messages</source> <source>Messages</source>
<translation>Nachrichten</translation> <translation>Nachrichten</translation>
</message> </message>
@ -6652,7 +6662,7 @@ Die folgenden Wege sind möglich:</translation>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+122"/> <location line="+123"/>
<source>Notify</source> <source>Notify</source>
<translation>Meldungen</translation> <translation>Meldungen</translation>
</message> </message>
@ -6782,12 +6792,12 @@ Die folgenden Wege sind möglich:</translation>
<translation>Schnellstart Assistent</translation> <translation>Schnellstart Assistent</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="-206"/> <location filename="../gui/MainWindow.cpp" line="-204"/>
<source>Search</source> <source>Search</source>
<translation>Suchen</translation> <translation>Suchen</translation>
</message> </message>
<message> <message>
<location line="+8"/> <location line="+6"/>
<source>Files</source> <source>Files</source>
<translation>Dateien</translation> <translation>Dateien</translation>
</message> </message>
@ -6848,7 +6858,7 @@ Die folgenden Wege sind möglich:</translation>
<translation>Maximieren</translation> <translation>Maximieren</translation>
</message> </message>
<message> <message>
<location line="-128"/> <location line="-130"/>
<source>Unfinished</source> <source>Unfinished</source>
<translation>unfertig</translation> <translation>unfertig</translation>
</message> </message>
@ -6858,7 +6868,7 @@ Die folgenden Wege sind möglich:</translation>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+125"/> <location filename="../gui/MainWindow.cpp" line="+127"/>
<source>Help</source> <source>Help</source>
<translation>Hilfe</translation> <translation>Hilfe</translation>
</message> </message>
@ -6868,17 +6878,17 @@ Die folgenden Wege sind möglich:</translation>
<translation>Über</translation> <translation>Über</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="-174"/> <location filename="../gui/MainWindow.cpp" line="-175"/>
<source>Forums</source> <source>Forums</source>
<translation>Foren</translation> <translation>Foren</translation>
</message> </message>
<message> <message>
<location line="-82"/> <location line="-71"/>
<source>RetroShare %1 a secure decentralised communication platform</source> <source>RetroShare %1 a secure decentralised communication platform</source>
<translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation> <translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation>
</message> </message>
<message> <message>
<location line="+246"/> <location line="+236"/>
<source>Open Messages</source> <source>Open Messages</source>
<translation>Öffne Nachrichten</translation> <translation>Öffne Nachrichten</translation>
</message> </message>
@ -6888,12 +6898,12 @@ Die folgenden Wege sind möglich:</translation>
<translation>Anwendungen</translation> <translation>Anwendungen</translation>
</message> </message>
<message> <message>
<location line="-144"/> <location line="-145"/>
<source>Plugins</source> <source>Plugins</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+860"/> <location line="+861"/>
<source>Do you really want to exit RetroShare ?</source> <source>Do you really want to exit RetroShare ?</source>
<translation>Möchtest du RetroShare wirklich beenden?</translation> <translation>Möchtest du RetroShare wirklich beenden?</translation>
</message> </message>
@ -7796,7 +7806,7 @@ p, li { white-space: pre-wrap; }
<name>MessagesDialog</name> <name>MessagesDialog</name>
<message> <message>
<location filename="../gui/MessagesDialog.ui" line="+576"/> <location filename="../gui/MessagesDialog.ui" line="+576"/>
<location filename="../gui/MessagesDialog.cpp" line="+619"/> <location filename="../gui/MessagesDialog.cpp" line="+615"/>
<source>New Message</source> <source>New Message</source>
<translation>Neue Nachricht</translation> <translation>Neue Nachricht</translation>
</message> </message>
@ -7822,14 +7832,14 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location filename="../gui/MessagesDialog.ui" line="-409"/> <location filename="../gui/MessagesDialog.ui" line="-409"/>
<location filename="../gui/MessagesDialog.cpp" line="-406"/> <location filename="../gui/MessagesDialog.cpp" line="-402"/>
<source>Date</source> <source>Date</source>
<translation>Datum</translation> <translation>Datum</translation>
</message> </message>
<message> <message>
<location line="-5"/> <location line="-5"/>
<location filename="../gui/MessagesDialog.cpp" line="-1"/> <location filename="../gui/MessagesDialog.cpp" line="-1"/>
<location line="+739"/> <location line="+735"/>
<source>From</source> <source>From</source>
<translation>Von</translation> <translation>Von</translation>
</message> </message>
@ -7974,7 +7984,7 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="-410"/> <location line="-410"/>
<location filename="../gui/MessagesDialog.cpp" line="-690"/> <location filename="../gui/MessagesDialog.cpp" line="-686"/>
<source>Subject</source> <source>Subject</source>
<translation>Betreff</translation> <translation>Betreff</translation>
</message> </message>
@ -7989,7 +7999,7 @@ p, li { white-space: pre-wrap; }
<translation>Gewählte Nachricht weiterleiten</translation> <translation>Gewählte Nachricht weiterleiten</translation>
</message> </message>
<message> <message>
<location line="+182"/> <location line="+178"/>
<source>Starred</source> <source>Starred</source>
<translation>Gekennzeichnet</translation> <translation>Gekennzeichnet</translation>
</message> </message>
@ -8014,7 +8024,7 @@ p, li { white-space: pre-wrap; }
<translation>Weiterleiten</translation> <translation>Weiterleiten</translation>
</message> </message>
<message> <message>
<location filename="../gui/MessagesDialog.cpp" line="-401"/> <location filename="../gui/MessagesDialog.cpp" line="-397"/>
<source>Click to sort by attachments</source> <source>Click to sort by attachments</source>
<translation>Klicken, um nach Anhang zu sortieren</translation> <translation>Klicken, um nach Anhang zu sortieren</translation>
</message> </message>
@ -8030,12 +8040,12 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
<location line="+731"/> <location line="+727"/>
<source>Click to sort by from</source> <source>Click to sort by from</source>
<translation>Klicken, um nach Von zu sortieren</translation> <translation>Klicken, um nach Von zu sortieren</translation>
</message> </message>
<message> <message>
<location line="-730"/> <location line="-726"/>
<source>Click to sort by date</source> <source>Click to sort by date</source>
<translation>Klicken, um nach Datum zu sortieren</translation> <translation>Klicken, um nach Datum zu sortieren</translation>
</message> </message>
@ -8045,13 +8055,13 @@ p, li { white-space: pre-wrap; }
<translation>Klicken, um nach Schlagwörter zu sortieren</translation> <translation>Klicken, um nach Schlagwörter zu sortieren</translation>
</message> </message>
<message> <message>
<location line="+732"/> <location line="+728"/>
<source>Click to sort by to</source> <source>Click to sort by to</source>
<translation>Klicken, um nach Empfänger zu sortieren</translation> <translation>Klicken, um nach Empfänger zu sortieren</translation>
</message> </message>
<message> <message>
<location filename="../gui/MessagesDialog.ui" line="-9"/> <location filename="../gui/MessagesDialog.ui" line="-9"/>
<location filename="../gui/MessagesDialog.cpp" line="-689"/> <location filename="../gui/MessagesDialog.cpp" line="-685"/>
<source>Reply to All</source> <source>Reply to All</source>
<translation>Allen antworten</translation> <translation>Allen antworten</translation>
</message> </message>
@ -8077,7 +8087,7 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+172"/> <location line="+172"/>
<location filename="../gui/MessagesDialog.cpp" line="+602"/> <location filename="../gui/MessagesDialog.cpp" line="+598"/>
<location line="+881"/> <location line="+881"/>
<location line="+5"/> <location line="+5"/>
<source>Trash</source> <source>Trash</source>
@ -8126,12 +8136,12 @@ p, li { white-space: pre-wrap; }
<translation>An</translation> <translation>An</translation>
</message> </message>
<message> <message>
<location line="-730"/> <location line="-726"/>
<source>Click to sort by star</source> <source>Click to sort by star</source>
<translation>Klicken, um nach Kennzeichnung zu sortieren</translation> <translation>Klicken, um nach Kennzeichnung zu sortieren</translation>
</message> </message>
<message> <message>
<location line="+705"/> <location line="+701"/>
<source>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.</source> <source>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.</source>
<translation>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.</translation> <translation>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.</translation>
</message> </message>
@ -8896,7 +8906,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>NotifyQt</name> <name>NotifyQt</name>
<message> <message>
<location filename="../gui/notifyqt.cpp" line="+132"/> <location filename="../gui/notifyqt.cpp" line="+133"/>
<source>GPG key passphrase</source> <source>GPG key passphrase</source>
<translation>GPG Schlüssel Passwort</translation> <translation>GPG Schlüssel Passwort</translation>
</message> </message>
@ -10130,7 +10140,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../main.cpp" line="+85"/> <location filename="../main.cpp" line="+86"/>
<location line="+124"/> <location line="+124"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation>RetroShare</translation> <translation>RetroShare</translation>
@ -10249,7 +10259,14 @@ Lockdatei:
<translation type="obsolete">Der Empfänger der Nachricht ist unbekannt.</translation> <translation type="obsolete">Der Empfänger der Nachricht ist unbekannt.</translation>
</message> </message>
<message> <message>
<location filename="../gui/RetroShareLink.cpp" line="+688"/> <location filename="../gui/RetroShareLink.cpp" line="+514"/>
<source>Click to add this RetroShare cert to your GPG keyring
and open the Make Friend Wizard.
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+264"/>
<source>Add file</source> <source>Add file</source>
<translation>Datei hinzufügen</translation> <translation>Datei hinzufügen</translation>
</message> </message>
@ -10284,7 +10301,7 @@ Lockdatei:
<translation>Bestätigung</translation> <translation>Bestätigung</translation>
</message> </message>
<message> <message>
<location line="+291"/> <location line="+328"/>
<source>%1 of %2 RetroShare links processed.</source> <source>%1 of %2 RetroShare links processed.</source>
<translation>%1 von %2 RetroShare Links verarbeitet.</translation> <translation>%1 von %2 RetroShare Links verarbeitet.</translation>
</message> </message>
@ -10961,31 +10978,31 @@ p, li { white-space: pre-wrap; }
<translation type="unfinished">Freunde</translation> <translation type="unfinished">Freunde</translation>
</message> </message>
<message> <message>
<location line="+17"/> <location line="+20"/>
<location line="+40"/> <location line="+44"/>
<location line="+40"/> <location line="+44"/>
<source>x</source> <source>x</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="-73"/> <location line="-81"/>
<location line="+40"/> <location line="+44"/>
<location line="+40"/> <location line="+44"/>
<source>kB/s</source> <source>kB/s</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="-57"/> <location line="-65"/>
<source>Friends of Friends</source> <source>Friends of Friends</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+40"/> <location line="+44"/>
<source>General</source> <source>General</source>
<translation type="unfinished">Allgemein</translation> <translation type="unfinished">Allgemein</translation>
</message> </message>
<message> <message>
<location line="+57"/> <location line="+61"/>
<source>Total:</source> <source>Total:</source>
<translation type="unfinished">Gesamt:</translation> <translation type="unfinished">Gesamt:</translation>
</message> </message>
@ -12372,61 +12389,106 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>SoundPage</name> <name>SoundPage</name>
<message> <message>
<location filename="../gui/settings/SoundPage.ui" line="+500"/>
<source>Sound Events</source> <source>Sound Events</source>
<translation>Soundereignisse</translation> <translation type="obsolete">Soundereignisse</translation>
</message> </message>
<message> <message>
<location line="+15"/> <location filename="../gui/settings/SoundPage.cpp" line="+53"/>
<source>Event</source>
<translation>Ereignis</translation>
</message>
<message>
<location line="+1"/>
<source>Filename</source>
<translation>Dateiname</translation>
</message>
<message>
<location line="+62"/>
<source>go Online</source> <source>go Online</source>
<translation>Online</translation> <translation>Online</translation>
</message> </message>
<message> <message>
<location line="+57"/> <location line="+50"/>
<source>Open File</source>
<translation>Datei öffnen</translation>
</message>
<message>
<source>FileSend</source> <source>FileSend</source>
<translation>Dateitransfer</translation> <translation type="obsolete">Dateitransfer</translation>
</message> </message>
<message> <message>
<location line="+23"/>
<location line="+43"/>
<source>Finished</source> <source>Finished</source>
<translation>Beendet</translation> <translation type="obsolete">Beendet</translation>
</message> </message>
<message> <message>
<location line="-33"/>
<source>FileRecive</source> <source>FileRecive</source>
<translation>Dateitransfer ankommend</translation> <translation type="obsolete">Dateitransfer ankommend</translation>
</message> </message>
<message> <message>
<location line="+9"/>
<source>Incoming</source> <source>Incoming</source>
<translation>Eingehend</translation> <translation type="obsolete">Eingehend</translation>
</message> </message>
<message> <message>
<location line="-75"/> <location line="-48"/>
<source>Chatmessage</source> <source>Chatmessage</source>
<translation>Chatnachricht</translation> <translation>Chatnachricht</translation>
</message> </message>
<message> <message>
<location line="-33"/> <location line="-3"/>
<source>Friend</source> <source>Friend</source>
<translation>Freund</translation> <translation>Freund</translation>
</message> </message>
<message> <message>
<location line="+23"/> <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
<location line="+33"/> &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
<location line="+23"/> p, li { white-space: pre-wrap; }
<location line="+43"/> &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Search forums&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="obsolete">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Suche Foren&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="../gui/settings/SoundPage.ui" line="+549"/>
<source>Reset</source>
<translation>Zurücksetzen</translation>
</message>
<message>
<location line="+34"/>
<source>Event:</source>
<translation>Ereignis:</translation>
</message>
<message>
<location line="+7"/>
<source>Filename:</source>
<translation>Dateiname:</translation>
</message>
<message>
<location line="+24"/> <location line="+24"/>
<source>Browse</source> <source>Browse</source>
<translation>Durchsuchen</translation> <translation>Durchsuchen</translation>
</message> </message>
<message> <message>
<location line="-104"/> <location filename="../gui/settings/SoundPage.cpp" line="+4"/>
<source>New Msg</source> <source>New Msg</source>
<translation>Neue Nachricht</translation> <translation>Neue Nachricht</translation>
</message> </message>
</context> </context>
<context>
<name>SoundStatus</name>
<message>
<location filename="../gui/statusbar/SoundStatus.cpp" line="+58"/>
<source>Sound on</source>
<translation>Ton an</translation>
</message>
<message>
<location line="+0"/>
<source>Sound off</source>
<translation>Ton aus</translation>
</message>
</context>
<context> <context>
<name>SplashScreen</name> <name>SplashScreen</name>
<message> <message>
@ -12435,7 +12497,7 @@ p, li { white-space: pre-wrap; }
<translation>Lade Profil</translation> <translation>Lade Profil</translation>
</message> </message>
<message> <message>
<location line="+48"/> <location line="+50"/>
<source>Load configuration</source> <source>Load configuration</source>
<translation>Lade Konfiguration</translation> <translation>Lade Konfiguration</translation>
</message> </message>

View File

@ -44,6 +44,7 @@
#include "gui/common/Emoticons.h" #include "gui/common/Emoticons.h"
#include "util/EventReceiver.h" #include "util/EventReceiver.h"
#include "gui/RetroShareLink.h" #include "gui/RetroShareLink.h"
#include "gui/SoundManager.h"
/*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers. /*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers.
#include <gui/qskinobject/qskinobject.h> #include <gui/qskinobject/qskinobject.h>
@ -65,9 +66,9 @@ int main(int argc, char *argv[])
} }
#endif #endif
QStringList args = char_array_to_stringlist(argv+1, argc-1); QStringList args = char_array_to_stringlist(argv+1, argc-1);
Q_INIT_RESOURCE(images); Q_INIT_RESOURCE(images);
rsiface = NULL; rsiface = NULL;
@ -75,7 +76,7 @@ int main(int argc, char *argv[])
createRsIface(*notify); createRsIface(*notify);
createRsControl(*rsiface, *notify); createRsControl(*rsiface, *notify);
/* RetroShare Core Objects */ /* RetroShare Core Objects */
RsInit::InitRsConfig(); RsInit::InitRsConfig();
int initResult = RsInit::InitRetroShare(argc, argv); int initResult = RsInit::InitRetroShare(argc, argv);
@ -177,23 +178,23 @@ int main(int argc, char *argv[])
} }
// true: note auto-login is active // true: note auto-login is active
std::string lockFile; std::string lockFile;
int retVal = RsInit::LockAndLoadCertificates(true, lockFile); int retVal = RsInit::LockAndLoadCertificates(true, lockFile);
switch(retVal) switch(retVal)
{ {
case 0: break; case 0: break;
case 1: QMessageBox::warning( 0, case 1: QMessageBox::warning( 0,
QObject::tr("Multiple instances"), QObject::tr("Multiple instances"),
QObject::tr("Another RetroShare using the same profile is " QObject::tr("Another RetroShare using the same profile is "
"already running on your system. Please close " "already running on your system. Please close "
"that instance first\n Lock file:\n") + "that instance first\n Lock file:\n") +
QString::fromStdString(lockFile)); QString::fromStdString(lockFile));
return 1; return 1;
case 2: QMessageBox::critical( 0, case 2: QMessageBox::critical( 0,
QObject::tr("Multiple instances"), QObject::tr("Multiple instances"),
QObject::tr("An unexpected error occurred when Retroshare" QObject::tr("An unexpected error occurred when Retroshare"
"tried to acquire the single instance lock\n Lock file:\n") + "tried to acquire the single instance lock\n Lock file:\n") +
QString::fromStdString(lockFile)); QString::fromStdString(lockFile));
return 1; return 1;
case 3: QMessageBox::critical( 0, case 3: QMessageBox::critical( 0,
QObject::tr("Login Failure"), QObject::tr("Login Failure"),
@ -210,10 +211,12 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
/* recreate global settings object, now with correct path */ /* recreate global settings object, now with correct path */
RshareSettings::Create(true); RshareSettings::Create(true);
Rshare::resetLanguageAndStyle(); Rshare::resetLanguageAndStyle();
SoundManager::create();
splashScreen.showMessage(rshare.translate("SplashScreen", "Load configuration"), Qt::AlignHCenter | Qt::AlignBottom); splashScreen.showMessage(rshare.translate("SplashScreen", "Load configuration"), Qt::AlignHCenter | Qt::AlignBottom);
rsicontrol->StartupRetroShare(); rsicontrol->StartupRetroShare();
@ -323,8 +326,11 @@ int main(int argc, char *argv[])
rsicontrol->rsGlobalShutDown(); rsicontrol->rsGlobalShutDown();
delete(soundManager);
soundManager = NULL;
Settings->sync(); Settings->sync();
delete Settings; delete(Settings);
return ti ; return ti ;
} }