Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/model/ShellModel.py
diff options
context:
space:
mode:
Diffstat (limited to 'shell/model/ShellModel.py')
-rw-r--r--shell/model/ShellModel.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/shell/model/ShellModel.py b/shell/model/ShellModel.py
index de6020b..b1c21bc 100644
--- a/shell/model/ShellModel.py
+++ b/shell/model/ShellModel.py
@@ -16,6 +16,8 @@
import os
+import gobject
+
from sugar.presence import PresenceService
from sugar.activity.bundleregistry import BundleRegistry
from model.Friends import Friends
@@ -24,9 +26,22 @@ from model.homemodel import HomeModel
from model.Owner import ShellOwner
from sugar import env
-class ShellModel:
+class ShellModel(gobject.GObject):
+ STATE_STARTUP = 0
+ STATE_RUNNING = 1
+ STATE_SHUTDOWN = 2
+
+ __gproperties__ = {
+ 'state' : (int, None, None,
+ 0, 2, STATE_RUNNING,
+ gobject.PARAM_READWRITE)
+ }
+
def __init__(self):
+ gobject.GObject.__init__(self)
+
self._current_activity = None
+ self._state = self.STATE_RUNNING
self._bundle_registry = BundleRegistry()
@@ -47,6 +62,14 @@ class ShellModel:
bundles_path = os.path.join(path, 'activities')
self._bundle_registry.add_search_path(bundles_path)
+ def do_set_property(self, pspec, value):
+ if pspec.name == 'state':
+ self._state = value
+
+ def do_get_property(self, pspec):
+ if pspec.name == 'state':
+ return self._state
+
def get_bundle_registry(self):
return self._bundle_registry