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/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 \

View File

@ -29,7 +29,6 @@
#include <QFontDialog>
#include <QMenu>
#include <QScrollBar>
#include <QSound>
#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);

View File

@ -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;

View File

@ -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 <retroshare/rsstatus.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 */
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

View File

@ -1,7 +1,7 @@
/****************************************************************
* 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
* modify it under the terms of the GNU General Public License
@ -24,80 +24,108 @@
#include "SoundManager.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;
reInit();
switch (event) {
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;
}
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);
if (soundManager == NULL) {
soundManager = new SoundManager;
}
}
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");
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();
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);
}

View File

@ -1,7 +1,7 @@
/****************************************************************
* 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
* modify it under the terms of the GNU General Public License
@ -18,43 +18,46 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef SOUND_MANAGER_H
#define SOUND_MANAGER_H
#ifndef SOUNDMANAGER_H
#define SOUNDMANAGER_H
#include <QObject>
class SoundManager :public QObject
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();
public:
enum Events {
NEW_CHAT_MESSAGE,
USER_ONLINE
};
public slots:
void setMute(bool mute);
private:
bool isMute;
QString SoundFileUser_go_Online;
QString SoundFileUser_go_Offline;
QString SoundFileFileSend_Finished;
QString SoundFileFileRecive_Incoming;
QString SoundFileFileRecive_Finished;
QString SoundFileNewChatMessage;
signals:
void mute(bool isMute);
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;
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();
};
#endif
extern SoundManager *soundManager;
#endif //SOUNDMANAGER_H

View File

@ -29,6 +29,7 @@
#include "PopupChatWindow.h"
#include "gui/settings/rsharesettings.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/SoundManager.h"
#include <retroshare/rsiface.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)
{
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;
if (rsMsgs->getPrivateChatQueueIds(true, ids)) {
uint chatflags = Settings->getChatFlags();

View File

@ -27,7 +27,6 @@
#include <QColorDialog>
#include <QFontDialog>
#include <QMessageBox>
#include <QSound>
#include "ChatWidget.h"
#include "ui_ChatWidget.h"
@ -52,25 +51,6 @@
* #define CHAT_DEBUG 1
*****/
// play sound when recv a message
void playsound()
{
Settings->beginGroup("Sound");
Settings->beginGroup("SoundFilePath");
QString OnlineSound = Settings->value("NewChatMessage","").toString();
Settings->endGroup();
Settings->beginGroup("Enable");
bool flag = Settings->value("NewChatMessage",false).toBool();
Settings->endGroup();
Settings->endGroup();
if (!OnlineSound.isEmpty() && flag) {
if (QSound::isAvailable()) {
QSound::play(OnlineSound);
}
}
}
ChatWidget::ChatWidget(QWidget *parent) :
QWidget(parent), ui(new Ui::ChatWidget)
{
@ -330,8 +310,6 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
resetStatusBar();
if (incoming && chatType == TYPE_NORMAL) {
playsound();
emit newMessage(this);
if (!isVisible() || (window() && (!window()->isActiveWindow() || window()->isMinimized()))) {

View File

@ -18,6 +18,7 @@
<file>images/btn_27.png</file>
<file>images/btn_27_hover.png</file>
<file>images/connect_established.png</file>
<file>images/connect_established_low.png</file>
<file>images/connect_creating.png</file>
<file>images/connect_no.png</file>
<file>images/dht16.png</file>
@ -301,6 +302,8 @@
<file>images/message.png</file>
<file>images/messages_new.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/network16.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
#include "gui/settings/rsharesettings.h"
#include "SoundManager.h"
#include <iostream>
#include <sstream>
@ -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));

View File

@ -19,30 +19,44 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <rshare.h>
#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()));
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()));
ui.groupBox_13->hide();
ui.groupBox_14->hide();
ui.clearButton->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
#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);
}

View File

@ -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

View File

@ -490,190 +490,148 @@
<strikeout>false</strikeout>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_11">
<property name="title">
<string>Sound Events</string>
<widget class="QTreeWidget" name="eventTreeWidget">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_12">
<property name="title">
<string>Friend</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxSound">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>go Online</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txt_SoundFile">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="cmd_openFile">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</widget>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="eventGroup">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_1">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLineEdit" name="filenameEdit">
<property name="toolTip">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="minimumSize">
<size>
<width>16</width>
<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 row="1" column="0">
<widget class="QGroupBox" name="groupBox_15">
<property name="title">
<string>Chatmessage</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxSound_6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>New Msg</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txt_SoundFile6">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="cmd_openFile_6">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</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>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="browseButton">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="playButton">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/player_play.png</normaloff>:/images/player_play.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -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 "";
}

View File

@ -67,7 +67,8 @@ public:
LASTDIR_HISTORY,
LASTDIR_IMAGES,
LASTDIR_MESSAGES,
LASTDIR_BLOGS
LASTDIR_BLOGS,
LASTDIR_SOUNDS
};
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
*/
#include <QSound>
#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);
}

View File

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

View File

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

View File

@ -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 <gui/qskinobject/qskinobject.h>
@ -65,9 +66,9 @@ int main(int argc, char *argv[])
}
#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;
@ -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 ;
}