From 1510350c45a0f175eacaa370d02aafba92979c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Wed, 19 Mar 2008 17:19:22 +0100 Subject: Init dbus threads using a plugin --- plugins/dbus_init.xml | 15 +++++++++++++++ portato/gui/windows/main.py | 2 +- portato/plugins/dbus_init.py | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 plugins/dbus_init.xml create mode 100644 portato/plugins/dbus_init.py diff --git a/plugins/dbus_init.xml b/plugins/dbus_init.xml new file mode 100644 index 0000000..8b93718 --- /dev/null +++ b/plugins/dbus_init.xml @@ -0,0 +1,15 @@ + + + + René 'Necoro' Neumann + DBus Initializer + + portato.plugins.dbus_init + + + + + + + + diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 2dbecde..7ddd868 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -1655,7 +1655,7 @@ class MainWindow (Window): """ Main. """ - gobject.threads_init() + plugin.hook("thread_init")(gobject.threads_init)() # now subthreads can run normally, but are not allowed to touch the GUI. If threads should change sth there - use gobject.idle_add(). # for more informations on threading and gtk: http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq20.006.htp gtk.main() diff --git a/portato/plugins/dbus_init.py b/portato/plugins/dbus_init.py new file mode 100644 index 0000000..851562c --- /dev/null +++ b/portato/plugins/dbus_init.py @@ -0,0 +1,4 @@ +from dbus.mainloop.glib import threads_init + +def dbus_init (*args): + threads_init() -- cgit v1.2.3