Install service files so that services are automatically

This commit is contained in:
Marco Pesenti Gritti 2006-04-26 02:25:58 -04:00
parent 070088a6a5
commit 200c3d077a
4 changed files with 52 additions and 6 deletions

View File

@ -5,3 +5,19 @@ icondir = $(pkgdatadir)
icon_DATA = \ icon_DATA = \
fold.png \ fold.png \
unfold.png unfold.png
# Dbus service file
servicedir = $(datadir)/dbus-1/services
service_in_files = com.redhat.Sugar.Browser.service.in
service_DATA = $(service_in_files:.service.in=.service)
# Rule to make the service file with bindir expanded
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@bindir\@|$(bindir)|" $< > $@
EXTRA_DIST = \
$(service_in_files) \
$(service_DATA)
DISTCLEANFILES = \
$(service_DATA)

View File

@ -2,3 +2,19 @@ sugardir = $(pythondir)/sugar
sugar_PYTHON = \ sugar_PYTHON = \
activity.py \ activity.py \
shell.py shell.py
# Dbus service file
servicedir = $(datadir)/dbus-1/services
service_in_files = com.redhat.Sugar.Shell.service.in
service_DATA = $(service_in_files:.service.in=.service)
# Rule to make the service file with bindir expanded
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@bindir\@|$(bindir)|" $< > $@
EXTRA_DIST = \
$(service_in_files) \
$(service_DATA)
DISTCLEANFILES = \
$(service_DATA)

View File

@ -191,10 +191,12 @@ class ActivityContainer(dbus.service.Object):
self.window.resize(640, 480) self.window.resize(640, 480)
self.window.set_geometry_hints(min_width = 640, max_width = 640, min_height = 480, max_height = 480) self.window.set_geometry_hints(min_width = 640, max_width = 640, min_height = 480, max_height = 480)
self.notebook = gtk.Notebook() self.notebook = gtk.Notebook()
tab_label = gtk.Label("My Laptop")
empty_label = gtk.Label("This activity could launch other activities / be a help page") #tab_label = gtk.Label("My Laptop")
empty_label.show() #empty_label = gtk.Label("This activity could launch other activities / be a help page")
self.notebook.append_page(empty_label, tab_label) #empty_label.show()
#self.notebook.append_page(empty_label, tab_label)
self.notebook.show() self.notebook.show()
self.notebook.connect("switch-page", self.notebook_tab_changed) self.notebook.connect("switch-page", self.notebook_tab_changed)
self.window.add(self.notebook) self.window.add(self.notebook)

16
sugar
View File

@ -1,9 +1,21 @@
#!/usr/bin/python #!/usr/bin/python
import sys import sys
import os
# FIXME Without args we should startup the session thing if len(sys.argv) == 1:
if len(sys.argv) == 1 or sys.argv[1] == 'shell': # FIXME Start a session
# We are lucky and this
# currently behave as we want.
# The chat depends on the
# web browser, so both activities
# are spanned. But obviously we
# need something better.
import sugar.chat
sugar.chat.main()
elif sys.argv[1] == 'shell':
import sugar.shell import sugar.shell
sugar.shell.main() sugar.shell.main()
elif sys.argv[1] == 'chat': elif sys.argv[1] == 'chat':