summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp13
-rw-r--r--Swift/QtUI/QtLoginWindow.h1
2 files changed, 14 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();
}
diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h
index 38852ce..40ea4ec 100644
--- a/Swift/QtUI/QtLoginWindow.h
+++ b/Swift/QtUI/QtLoginWindow.h
@@ -39,6 +39,7 @@ namespace Swift {
void handleCertficateChecked(bool);
void handleQuit();
void handleShowXMLConsole();
+ void handleToggleSounds(bool enabled);
void handleAbout();
void bringToFront();
void handleUsernameTextChanged();