From b5de7ef33287bd75428645b2443d76d26a23a518 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Wed, 11 Jan 2012 19:52:11 +0100 Subject: [PATCH] Remove support for the old deprecated toolbar - removed deprecated imports from the activity module, use the widgets module instead - removed the ActivityToolbox class - removed the Stop button from the ActivityToolbar - removed set_toolbar/get_toolbar API from the window module Signed-off-by: Simon Schampijer Reviewed-by: Gonzalo Odiard Acked-by: Daniel Drake --- src/sugar3/activity/activity.py | 4 ---- src/sugar3/activity/widgets.py | 42 +-------------------------------- src/sugar3/graphics/window.py | 12 ---------- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py index fcff5be4..79c32ea6 100644 --- a/src/sugar3/activity/activity.py +++ b/src/sugar3/activity/activity.py @@ -86,10 +86,6 @@ from sugar3.datastore import datastore from sugar3.session import XSMPClient from sugar3 import wm -# support deprecated imports -from sugar3.activity.widgets import ActivityToolbar, EditToolbar -from sugar3.activity.widgets import ActivityToolbox - _ = lambda msg: gettext.dgettext('sugar-toolkit', msg) diff --git a/src/sugar3/activity/widgets.py b/src/sugar3/activity/widgets.py index 999a0801..3f673008 100644 --- a/src/sugar3/activity/widgets.py +++ b/src/sugar3/activity/widgets.py @@ -68,7 +68,6 @@ class ActivityToolbarButton(ToolbarButton): def __init__(self, activity, **kwargs): toolbar = ActivityToolbar(activity, orientation_left=True) - toolbar.stop.hide() ToolbarButton.__init__(self, page=toolbar, **kwargs) @@ -215,12 +214,7 @@ class TitleEntry(Gtk.ToolItem): class ActivityToolbar(Gtk.Toolbar): - """The Activity toolbar with the Journal entry title, sharing - and Stop buttons - - All activities should have this toolbar. It is easiest to add it to your - Activity by using the ActivityToolbox. - """ + """The Activity toolbar with the Journal entry title and sharing button""" def __init__(self, activity, orientation_left=False): Gtk.Toolbar.__init__(self) @@ -244,10 +238,6 @@ class ActivityToolbar(Gtk.Toolbar): self.share.show() self.insert(self.share, -1) - self.stop = StopButton(activity) - self.insert(self.stop, -1) - self.stop.show() - class EditToolbar(Gtk.Toolbar): """Provides the standard edit toolbar for Activities. @@ -306,33 +296,3 @@ class EditToolbar(Gtk.Toolbar): self.paste = PasteButton() self.insert(self.paste, -1) self.paste.show() - - -class ActivityToolbox(Toolbox): - """Creates the Toolbox for the Activity - - By default, the toolbox contains only the ActivityToolbar. After creating - the toolbox, you can add your activity specific toolbars, for example the - EditToolbar. - - To add the ActivityToolbox to your Activity in MyActivity.__init__() do: - - # Create the Toolbar with the ActivityToolbar: - toolbox = activity.ActivityToolbox(self) - ... your code, inserting all other toolbars you need, like EditToolbar - - # Add the toolbox to the activity frame: - self.set_toolbar_box(toolbox) - # And make it visible: - toolbox.show() - """ - - def __init__(self, activity): - Toolbox.__init__(self) - - self._activity_toolbar = ActivityToolbar(activity) - self.add_toolbar(_('Activity'), self._activity_toolbar) - self._activity_toolbar.show() - - def get_activity_toolbar(self): - return self._activity_toolbar diff --git a/src/sugar3/graphics/window.py b/src/sugar3/graphics/window.py index 965aecd7..d7753e0b 100644 --- a/src/sugar3/graphics/window.py +++ b/src/sugar3/graphics/window.py @@ -285,15 +285,3 @@ class Window(Gtk.Window): enable_fullscreen_mode = GObject.property(type=object, setter=set_enable_fullscreen_mode, getter=get_enable_fullscreen_mode) - - # DEPRECATED - - def set_toolbox(self, toolbar_box): - warnings.warn('use toolbar_box instead of toolbox', DeprecationWarning) - self.set_toolbar_box(toolbar_box) - - def get_toolbox(self): - warnings.warn('use toolbar_box instead of toolbox', DeprecationWarning) - return self._toolbar_box - - toolbox = property(get_toolbox, set_toolbox)