Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/Shell.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-07-06 21:34:23 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-06 21:34:23 (GMT)
commitba09278c6705461f2c79f1074af66ec448454e59 (patch)
treeee68cbd0bbb835ed0b0ece4a3076f2c5455adc68 /shell/Shell.py
parent270bb8aaf6cb1724958b6e22a05eab42de0b3368 (diff)
Split classes out of shell.py
Diffstat (limited to 'shell/Shell.py')
-rwxr-xr-xshell/Shell.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/shell/Shell.py b/shell/Shell.py
new file mode 100755
index 0000000..6cdbff9
--- /dev/null
+++ b/shell/Shell.py
@@ -0,0 +1,47 @@
+import dbus
+import gobject
+
+from sugar.LogWriter import LogWriter
+from WindowManager import WindowManager
+from ConsoleLogger import ConsoleLogger
+from ActivityContainer import ActivityContainer
+
+class Shell(gobject.GObject):
+ __gsignals__ = {
+ 'close': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([])),
+ }
+
+ def __init__(self):
+ gobject.GObject.__init__(self)
+
+ def start(self):
+ console = ConsoleLogger()
+
+ log_writer = LogWriter("Shell", False)
+ log_writer.start()
+
+ session_bus = dbus.SessionBus()
+ service = dbus.service.BusName("com.redhat.Sugar.Shell", bus=session_bus)
+
+ activity_container = ActivityContainer(service, session_bus)
+ activity_container.window.connect('destroy', self.__activity_container_destroy_cb)
+ activity_container.show()
+
+ wm = WindowManager(activity_container.window)
+ wm.set_width(640, WindowManager.ABSOLUTE)
+ wm.set_height(480, WindowManager.ABSOLUTE)
+ wm.set_position(WindowManager.CENTER)
+ wm.show()
+ wm.manage()
+
+ def __activity_container_destroy_cb(self, activity_container):
+ self.emit('close')
+
+if __name__ == "__main__":
+ shell = Shell()
+ shell.start()
+ try:
+ gtk.main()
+ except KeyboardInterrupt:
+ print 'Ctrl+c pressed, exiting...'