From 13254e6c8e69bf5f45b1ad50d3d3483bb46f0179 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Mon, 12 Apr 2010 13:31:55 +0100
Subject: Use General menu on OS X (don't duplicate Swift).

Resolves: #307

diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 4ae2f6a..8ad20e7 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -117,6 +117,11 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {
 	QApplication::setQuitOnLastWindowClosed(false);
 	
 	swiftMenu_ = new QMenu(tr("Swift"), this);
+#ifdef SWIFTEN_PLATFORM_MACOSX
+	generalMenu_ = new QMenu(tr("General"), this);
+#else
+	generalMenu_ = swiftMenu_;
+#endif
 	
 	QAction* aboutAction = new QAction("About Swift", this);
 	connect(aboutAction, SIGNAL(activated()), SLOT(handleAbout()));
@@ -132,7 +137,7 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {
 	toggleSoundsAction_->setCheckable(true);
 	toggleSoundsAction_->setChecked(true);
 	connect(toggleSoundsAction_, SIGNAL(toggled(bool)), SLOT(handleToggleSounds(bool)));
-	swiftMenu_->addAction(toggleSoundsAction_);
+	generalMenu_->addAction(toggleSoundsAction_);
 
 	
 	QAction* quitAction = new QAction("Quit", this);
@@ -279,6 +284,9 @@ void QtLoginWindow::handleQuit() {
 void QtLoginWindow::setInitialMenus() {
 	menuBar_->clear();
 	menuBar_->addMenu(swiftMenu_);
+#ifdef SWIFTEN_PLATFORM_MACOSX
+	menuBar_->addMenu(generalMenu_);
+#endif
 	menuBar_->addMenu(toolsMenu_);
 }
 
diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h
index c2d06dd..654498d 100644
--- a/Swift/QtUI/QtLoginWindow.h
+++ b/Swift/QtUI/QtLoginWindow.h
@@ -71,6 +71,7 @@ namespace Swift {
 			QToolButton* certificateButton_;
 			QMenuBar* menuBar_;
 			QMenu* swiftMenu_;
+			QMenu* generalMenu_;
 			QMenu* toolsMenu_;
 			QAction* toggleSoundsAction_;
 			UIEventStream* uiEventStream_;
-- 
cgit v0.10.2-6-g49f6