From 38c5e5847bf22f0845cdd9ce3ba9ea2d588c7967 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 27 Apr 2006 18:58:10 +0000 Subject: Add some tab icons, still missing web site icons --- diff --git a/Makefile.am b/Makefile.am index 027fc63..64267ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,7 @@ SUBDIRS = chat browser shell +bin_SCRIPTS = sugar + sugardir = $(pythondir)/sugar sugar_PYTHON = \ __init__.py \ diff --git a/README b/README index 425eae3..aaeeea3 100644 --- a/README +++ b/README @@ -11,28 +11,28 @@ Building You will need gnome-common. -./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var +./autogen.sh make -make install # make require root privileges +make install Running ======= -To run the python sources from your source tree run +sugar - $ ./setup-run-from-source.sh -in the top-level directory. Icons and other resources are still loaded -from the installed location though. +Debug +===== -To run the shell +To run the shell: - $ cd shell/src - $ ./shell.py +sugar shell -You can run activities like this +To run the chat activity: - $ cd browser - $ ./browser.py +sugar chat + +To run the web activity: + +sugar browser -(Just remember to have the shell running) diff --git a/browser/browser.py b/browser/browser.py index 8df2695..1027c99 100755 --- a/browser/browser.py +++ b/browser/browser.py @@ -151,6 +151,8 @@ class BrowserActivity(activity.Activity): self.activity_set_ellipsize_tab(True) self.activity_set_can_close(True) self.activity_set_tab_text("Web Page") + self.activity_set_tab_icon_name("web-browser") + self.activity_show_icon(True) vbox = gtk.VBox() @@ -186,6 +188,8 @@ class WebActivity(activity.Activity): def activity_on_connected_to_shell(self): self.activity_set_tab_text("Web Browser") + self.activity_set_tab_icon_name("web-browser") + self.activity_show_icon(True) vbox = gtk.VBox() @@ -264,6 +268,3 @@ def main(): gtk.main() except KeyboardInterrupt: pass - -if __name__=="__main__": - main() diff --git a/chat/chat.py b/chat/chat.py index 55ce757..0df3a11 100755 --- a/chat/chat.py +++ b/chat/chat.py @@ -175,6 +175,8 @@ class BuddyChat(Chat): def activity_on_connected_to_shell(self): Chat.activity_on_connected_to_shell(self) self.activity_set_can_close(True) + self.activity_set_tab_icon_name("im") + self.activity_show_icon(True) def recv_message(self, msg): Chat.recv_message(self, self._buddy, msg) @@ -303,6 +305,10 @@ class GroupChat(Chat): def activity_on_connected_to_shell(self): Chat.activity_on_connected_to_shell(self) + + self.activity_set_tab_icon_name("stock_help-chat") + self.activity_show_icon(True) + aniter = self._buddy_list_model.append(None) self._buddy_list_model.set(aniter, self._MODEL_COL_NICK, "Group", self._MODEL_COL_ICON, self._pixbuf_active_chat, self._MODEL_COL_BUDDY, None) diff --git a/setup-run-from-source.sh b/setup-run-from-source.sh deleted file mode 100755 index 69a6847..0000000 --- a/setup-run-from-source.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# for activity.py -export PYTHONPATH=`pwd`/shell/src/ - -# for sugar_globals.py -export PYTHONPATH=$PYTHONPATH:`pwd`/ diff --git a/shell/src/activity.py b/shell/src/activity.py index 6c66a37..6f1f3fc 100644 --- a/shell/src/activity.py +++ b/shell/src/activity.py @@ -105,6 +105,14 @@ class Activity(dbus.service.Object): @dbus.service.method("com.redhat.Sugar.Activity", \ in_signature="", \ out_signature="") + + def activity_set_tab_icon_name(self, icon_name): + icon_theme = gtk.icon_theme_get_default() + icon_info = icon_theme.lookup_icon(icon_name, gtk.ICON_SIZE_MENU, 0) + pixbuf = icon_info.load_icon() + scaled_pixbuf = pixbuf.scale_simple(16, 16, gtk.gdk.INTERP_BILINEAR) + self.activity_set_icon(scaled_pixbuf) + def lost_focus(self): self.activity_on_lost_focus() diff --git a/shell/src/shell.py b/shell/src/shell.py index 880c9c8..5ce526e 100755 --- a/shell/src/shell.py +++ b/shell/src/shell.py @@ -300,6 +300,3 @@ def main(): gtk.main() except KeyboardInterrupt: pass - -if __name__=="__main__": - main() diff --git a/sugar b/sugar new file mode 100755 index 0000000..2c4f105 --- /dev/null +++ b/sugar @@ -0,0 +1,28 @@ +#!/usr/bin/python + +import sys +import os + +if len(sys.argv) == 1: + # 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 + sugar.shell.main() +elif sys.argv[1] == 'chat': + import sugar.chat + sugar.chat.main() +elif sys.argv[1] == 'browser': + import sugar.browser + sugar.browser.main() +else: + print "Unkown activity" -- cgit v0.9.1