summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-03-19 17:19:22 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-03-19 17:19:22 +0100
commit1510350c45a0f175eacaa370d02aafba92979c50 (patch)
treeaac86cc6ae40f618aeb3bd639ddfa73a8cc6b586
parent0e97cc678cb9ec813460ca2e60a23595e753c2f8 (diff)
downloadportato-1510350c45a0f175eacaa370d02aafba92979c50.tar.gz
portato-1510350c45a0f175eacaa370d02aafba92979c50.tar.bz2
portato-1510350c45a0f175eacaa370d02aafba92979c50.zip
Init dbus threads using a plugin
Diffstat (limited to '')
-rw-r--r--plugins/dbus_init.xml15
-rw-r--r--portato/gui/windows/main.py2
-rw-r--r--portato/plugins/dbus_init.py4
3 files changed, 20 insertions, 1 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<plugin xmlns="http://portato.sourceforge.net/plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://portato.sourceforge.net/plugin http://portato.sourceforge.net/plugin.xsd">
+
+ <author>René 'Necoro' Neumann</author>
+ <name>DBus Initializer</name>
+
+ <import>portato.plugins.dbus_init</import>
+
+ <hooks>
+ <hook type="thread_init" call="dbus_init">
+ <connect type="after" />
+ </hook>
+ </hooks>
+
+</plugin>
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()