1
# -*- coding: utf-8; -*-
3
Copyright (C) 2007 Gabriel Falcão <gabrielteratos@gmail.com>
4
Copyright (C) 2007 Lincoln de Sousa <lincoln@archlinux-br.org>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License as
8
published by the Free Software Foundation; either version 2 of the
9
License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
General Public License for more details.
16
You should have received a copy of the GNU General Public
17
License along with this program; if not, write to the
18
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
Boston, MA 02111-1307, USA.
26
dbus.glib.threads_init()
29
class DaemonDBus(dbus.service.Object):
30
def __init__(self, bus_name, guakeinstance):
31
self.guake = guakeinstance
32
object_path = '/DBusInterface'
33
super(DaemonDBus, self).__init__(bus_name, object_path)
35
@dbus.service.method('org.gnome.Guake.DBusInterface')
37
self.guake.show_hide()
39
@dbus.service.method('org.gnome.Guake.DBusInterface')
43
@dbus.service.method('org.gnome.Guake.DBusInterface')
45
self.guake.show_about()
47
@dbus.service.method('org.gnome.Guake.DBusInterface')
49
self.guake.show_prefs()
51
@dbus.service.method('org.gnome.Guake.DBusInterface')
56
def dbus_init(guakeinstance):
58
session_bus = dbus.SessionBus()
59
name = dbus.service.BusName('org.gnome.Guake.DBus', bus=session_bus)
60
return DaemonDBus(name, guakeinstance)
61
except dbus.DBusException:
63
sys.stderr.write(_('Could not connect to dbus session bus.'
64
' dbus will be unavailable.\n'))