From ae00121fbffdb3434d79716a112bd5956b9e5e67 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 19 Jul 2006 11:38:24 +0000 Subject: Use matchbox to activate home and people page --- (limited to 'shell') diff --git a/shell/ActivityRegistry.py b/shell/ActivityRegistry.py index 70a502f..e9bd250 100644 --- a/shell/ActivityRegistry.py +++ b/shell/ActivityRegistry.py @@ -90,7 +90,7 @@ class ActivityRegistry: elif cp.has_option('Activity', 'python_module'): python_module = cp.get('Activity', 'python_module') python_module = cp.get('Activity', 'python_module') - activity_exec = '%s %s %s' % (env.get_activity_runner(), + activity_exec = '%s %s %s' % ('sugar-activity', activity_id, python_module) if default_type: activity_exec += ' ' + default_type diff --git a/shell/Emulator.py b/shell/Emulator.py index 3b60082..89a20fc 100644 --- a/shell/Emulator.py +++ b/shell/Emulator.py @@ -70,5 +70,6 @@ class Emulator: process = XnestProcess() process.start() except: - logging.error('Cannot run the emulator. You need to install Xephyr or Xnest.') + logging.error('Cannot run the emulator. You need to install \ + Xephyr or Xnest.') sys.exit(0) diff --git a/shell/HomeWindow.py b/shell/HomeWindow.py index a264fbc..1a849e7 100644 --- a/shell/HomeWindow.py +++ b/shell/HomeWindow.py @@ -154,8 +154,6 @@ class HomeWindow(gtk.Window): def create(self, activity_name): Activity.create(activity_name) - self.hide() def activate(self, activity_window): activity_window.activate(gtk.get_current_event_time()) - self.hide() diff --git a/shell/PeopleWindow.py b/shell/PeopleWindow.py index ee16352..76e0add 100644 --- a/shell/PeopleWindow.py +++ b/shell/PeopleWindow.py @@ -8,8 +8,6 @@ class PeopleWindow(gtk.Window): gtk.Window.__init__(self) self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) - self.set_skip_taskbar_hint(True) - self.set_decorated(False) self.set_default_size(620, 460) hbox = gtk.HBox(False, 12) diff --git a/shell/PresenceView.py b/shell/PresenceView.py index 8efc4fd..4120549 100644 --- a/shell/PresenceView.py +++ b/shell/PresenceView.py @@ -106,7 +106,7 @@ class PresenceView(gtk.VBox): button_box.show() def _share_button_clicked_cb(self, button): - self._shell.get_current_activity().publish() + self._activity.publish() def _on_buddyList_buddy_selected(self, view, *args): (model, aniter) = view.get_selection().get_selected() diff --git a/shell/Shell.py b/shell/Shell.py index 5998a95..b0e04d6 100755 --- a/shell/Shell.py +++ b/shell/Shell.py @@ -20,16 +20,12 @@ class ShellDbusService(dbus.service.Object): dbus.service.Object.__init__(self, bus_name, '/com/redhat/Sugar/Shell') self._shell = shell - def __toggle_people_idle(self): - self._shell.toggle_people() + def __show_people_idle(self): + self._shell.show_people() @dbus.service.method('com.redhat.Sugar.Shell') - def toggle_people(self): - gobject.idle_add(self.__toggle_people_idle) - - @dbus.service.method('com.redhat.Sugar.Shell') - def toggle_home(self): - self._shell.toggle_home() + def show_people(self): + gobject.idle_add(self.__show_people_idle) @dbus.service.method('com.redhat.Sugar.Shell') def toggle_console(self): @@ -68,9 +64,6 @@ class Shell: else: window.show() - def toggle_home(self): - self._toggle_window_visibility(self._home_window) - def get_activity_from_xid(self, xid): bus = dbus.SessionBus() service = Activity.ACTIVITY_SERVICE_NAME + "%s" % xid @@ -90,7 +83,7 @@ class Shell: else: return None - def toggle_people(self): + def show_people(self): activity = self.get_current_activity() if activity: diff --git a/shell/sugar b/shell/sugar index 756fe26..cff3c11 100755 --- a/shell/sugar +++ b/shell/sugar @@ -5,6 +5,13 @@ import os import pwd import random +def add_to_bin_path(path): + if os.environ.has_key('PATH'): + old_path = os.environ['PATH'] + os.environ['PATH'] = path + ':' + old_path + else: + os.environ['PATH'] = path + def add_to_python_path(path): sys.path.insert(0, path) if os.environ.has_key('PYTHONPATH'): @@ -34,6 +41,7 @@ basedir = os.path.dirname(curdir) if os.path.isfile(os.path.join(basedir, 'sugar/__uninstalled__.py')): print 'Running sugar from ' + basedir + ' ...' + add_to_bin_path(os.path.join(basedir, 'shell')) add_to_python_path(basedir) add_to_python_path(os.path.join(basedir, 'shell')) else: diff --git a/shell/sugar-people b/shell/sugar-people new file mode 100755 index 0000000..056dca0 --- /dev/null +++ b/shell/sugar-people @@ -0,0 +1,10 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SessionBus() +proxy_obj = bus.get_object('com.redhat.Sugar.Shell', '/com/redhat/Sugar/Shell') +shell = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Shell') +shell.show_people() + + -- cgit v0.9.1