From c47d084c27bb92ad861a75538f9eafa8a232b88c Mon Sep 17 00:00:00 2001
From: Mateusz Piekos <mateuszpiekos@gmail.com>
Date: Tue, 24 Apr 2012 21:59:55 +0200
Subject: Inserting elements do generalMenu_ before quitAction

Resolves: #1081

License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.

diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 7612720..e7cabf2 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -222,7 +222,8 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream, SettingsProvider* set
 
 void QtLoginWindow::setShowNotificationToggle(bool toggle) {
 	if (toggle) {
-		generalMenu_->addAction(toggleNotificationsAction_);
+		QList< QAction* > generalMenuActions = generalMenu_->actions();
+		generalMenu_->insertAction(generalMenuActions.at(generalMenuActions.count()-2), toggleNotificationsAction_);
 	}
 	else {
 		generalMenu_->removeAction(toggleNotificationsAction_);
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index ea888d5..05c78b3 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -126,7 +126,9 @@ QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStr
 	toggleRequestDeliveryReceipts_->setCheckable(true);
 	toggleRequestDeliveryReceipts_->setChecked(settings_->getSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS));
 	connect(toggleRequestDeliveryReceipts_, SIGNAL(toggled(bool)), SLOT(handleToggleRequestDeliveryReceipts(bool)));
-	loginMenus_.generalMenu->addAction(toggleRequestDeliveryReceipts_);
+
+	QList< QAction* > generalMenuActions = loginMenus_.generalMenu->actions();
+	loginMenus_.generalMenu->insertAction(generalMenuActions.at(generalMenuActions.count()-2),toggleRequestDeliveryReceipts_);
 
 	treeWidget_->onSomethingSelectedChanged.connect(boost::bind(&QAction::setEnabled, editUserAction_, _1));
 
-- 
cgit v0.10.2-6-g49f6