Use matchbox to activate home and people page
This commit is contained in:
parent
08a52809a6
commit
ae00121fbf
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
10
shell/sugar-people
Executable file
10
shell/sugar-people
Executable file
@ -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()
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import os
|
||||
|
||||
sugar_data_dir = os.path.dirname(os.path.dirname(__file__))
|
||||
sugar_activity_runner = os.path.join(sugar_data_dir, 'shell/sugar-activity')
|
||||
sugar_activities_dir = os.path.join(sugar_data_dir, 'activities')
|
||||
|
@ -36,6 +36,3 @@ def get_data_dir():
|
||||
|
||||
def get_activities_dir():
|
||||
return sugar_activities_dir
|
||||
|
||||
def get_activity_runner():
|
||||
return sugar_activity_runner
|
||||
|
@ -13,9 +13,5 @@ def setup_global_keys(window, shell = None):
|
||||
window.connect("key-press-event", __key_press_event_cb, shell)
|
||||
|
||||
def __key_press_event_cb(window, event, shell):
|
||||
if event.keyval == gtk.keysyms.F1:
|
||||
shell.toggle_home()
|
||||
if event.keyval == gtk.keysyms.F2:
|
||||
shell.toggle_people()
|
||||
if event.keyval == gtk.keysyms.F3:
|
||||
shell.toggle_console()
|
||||
|
Loading…
Reference in New Issue
Block a user