summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtLoginWindow.cpp')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index da23ea0..4f6b423 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -2,6 +2,7 @@
#include "Swift/Controllers/UIEvents/UIEventStream.h"
#include "Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h"
+#include "Swift/Controllers/UIEvents/ToggleSoundsUIEvent.h"
#include "Swiften/Base/Platform.h"
#include "QtAboutWidget.h"
@@ -115,6 +116,13 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {
QAction* xmlConsoleAction = new QAction(tr("Show Debug Console"), this);
connect(xmlConsoleAction, SIGNAL(activated()), SLOT(handleShowXMLConsole()));
toolsMenu_->addAction(xmlConsoleAction);
+
+ QAction* toggleSoundsAction = new QAction(tr("Toggle Sounds"), this);
+ toggleSoundsAction->setCheckable(true);
+ toggleSoundsAction->setChecked(true);
+ connect(toggleSoundsAction, SIGNAL(toggled(bool)), SLOT(handleToggleSounds(bool)));
+ swiftMenu_->addAction(toggleSoundsAction);
+
QAction* quitAction = new QAction("Quit", this);
connect(quitAction, SIGNAL(activated()), SLOT(handleQuit()));
@@ -234,6 +242,11 @@ void QtLoginWindow::handleShowXMLConsole() {
uiEventStream_->send(boost::shared_ptr<RequestXMLConsoleUIEvent>(new RequestXMLConsoleUIEvent()));
}
+void QtLoginWindow::handleToggleSounds(bool enabled) {
+ uiEventStream_->send(boost::shared_ptr<ToggleSoundsUIEvent>(new ToggleSoundsUIEvent(enabled)));
+}
+
+
void QtLoginWindow::handleQuit() {
QApplication::quit();
}