summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-04 23:14:37 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-04 23:14:37 (GMT)
commit326cd32e2c9e3ec9bac54f5bb952928680c93749 (patch)
tree6992a6810897fdcdc9cce9cc2c7e2b79bf0e6011 /Swift/QtUI
parenta9173b68bf4a44325ec55843017d65d04a7f0c75 (diff)
downloadswift-326cd32e2c9e3ec9bac54f5bb952928680c93749.zip
swift-326cd32e2c9e3ec9bac54f5bb952928680c93749.tar.bz2
Allow sounds to be toggled.
Doesn't persist option yet. Resolves: #192
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();