[kupfer] browser: Unregister keybinding and dbus at quit
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] browser: Unregister keybinding and dbus at quit
- Date: Sun, 23 Aug 2009 11:27:15 +0000 (UTC)
commit e06b4ab3661cb76465e390411b698234c4ecb14a
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sat Aug 22 21:37:05 2009 +0200
browser: Unregister keybinding and dbus at quit
kupfer/browser.py | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index ca340ef..7b873cf 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -1294,18 +1294,18 @@ class WindowController (pretty.OutputMixin):
(keybinding callback, session logout callbacks etc)
"""
# register dbus callbacks
- from .listen import Service, AlreadyRunning, NoConnection
+ from . import listen
from .session import SessionClient
from kupfer import scheduler, settings
from kupfer import keybindings
try:
- s = Service()
- except AlreadyRunning:
+ s = listen.Service()
+ except listen.AlreadyRunning:
s = None
self.output_info("An instance is already running, exiting...")
self.quit_now()
- except NoConnection:
+ except listen.NoConnection:
pass
else:
s.connect("present", self.activate)
@@ -1356,3 +1356,10 @@ class WindowController (pretty.OutputMixin):
finally:
self.save_data()
+ # Now dismantle everything but keep hanging
+ listen.Unregister()
+ keybindings.bind_key("")
+ if gtk.events_pending():
+ self.output_info("Waiting for tasks to finish...")
+ while gtk.events_pending():
+ gtk.main_iteration()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]