From 31dd0b882cddee12adb4a377716291405cd2c469 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 23 Jun 2009 22:00:34 +0200
Subject: [PATCH] ask if we really want to uit Gajim when systray is hidden

---
 src/roster_window.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/roster_window.py b/src/roster_window.py
index 3c98e90dbe..3b73c0cee8 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -2196,8 +2196,16 @@ class RosterWindow:
 		'quit_on_roster_x_button') and gajim.config.get('trayicon') != 'on_event':
 			self.tooltip.hide_tooltip()
 			self.window.hide()
-		else:
+		elif gajim.config.get('quit_on_roster_x_button'):
 			self.on_quit_request()
+		else:
+			def on_ok(checked):
+				if checked:
+					gajim.config.set('quit_on_roster_x_button', True)
+				self.on_quit_request()
+			dialogs.ConfirmationDialogiCheck(_('Really quit Gajim?'),
+				_('Are you sure you want to quit Gajim?'),
+				_('Do _not ask me again'), on_response_ok=on_ok)
 		return True # do NOT destroy the window
 
 	def prepare_quit(self):
-- 
GitLab