From 7e92df4c485e83eefe23a78c2d4046b660f1db8a Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Sun, 09 Dec 2012 13:59:38 +0000 Subject: Fix toolbar. --- diff --git a/ircactivity.py b/ircactivity.py index be8b9aa..eb22614 100644 --- a/ircactivity.py +++ b/ircactivity.py @@ -53,51 +53,30 @@ class IRCActivity(activity.Activity): self.set_canvas(widget) # TOOLBAR - OLD_TOOLBAR = False - - try: - from sugar3.graphics.toolbarbox import ToolbarBox, ToolbarButton - from sugar3.activity.widgets import ActivityToolbarButton, StopButton, \ - ShareButton, KeepButton, TitleEntry, ActivityButton - - except ImportError: - OLD_TOOLBAR = True - - if OLD_TOOLBAR: - from sugar3.activity import widgets - toolbar = widgets.ActivityToolbar(self) - - # Remove the Share button, since this activity isn't shareable - toolbar.remove(toolbar.share) - - self.set_toolbar_box(toolbar) - self.show_all() - else: - toolbar_box = ToolbarBox() - self.activity_button = ActivityButton(self) - toolbar_box.toolbar.insert(self.activity_button, 0) - self.activity_button.show() - - title_entry = TitleEntry(self) - toolbar_box.toolbar.insert(title_entry, -1) - title_entry.show() - - keep_button = KeepButton(self) - toolbar_box.toolbar.insert(keep_button, -1) - keep_button.show() - - separator = Gtk.SeparatorToolItem() - separator.props.draw = False - separator.set_expand(True) - toolbar_box.toolbar.insert(separator, -1) - separator.show() - - stop_button = StopButton(self) - toolbar_box.toolbar.insert(stop_button, -1) - stop_button.show() - - self.set_toolbar_box(toolbar_box) - toolbar_box.show() + from sugar3.graphics.toolbarbox import ToolbarBox, ToolbarButton + from sugar3.activity.widgets import ActivityToolbarButton, StopButton, ShareButton, TitleEntry, ActivityButton + + toolbar_box = ToolbarBox() + self.activity_button = ActivityButton(self) + toolbar_box.toolbar.insert(self.activity_button, 0) + self.activity_button.show() + + title_entry = TitleEntry(self) + toolbar_box.toolbar.insert(title_entry, -1) + title_entry.show() + + separator = Gtk.SeparatorToolItem() + separator.props.draw = False + separator.set_expand(True) + toolbar_box.toolbar.insert(separator, -1) + separator.show() + + stop_button = StopButton(self) + toolbar_box.toolbar.insert(stop_button, -1) + stop_button.show() + + self.set_toolbar_box(toolbar_box) + toolbar_box.show() def __visibility_notify_event_cb(self, window, event): self.is_visible = event.state != Gdk.VisibilityState.FULLY_OBSCURED -- cgit v0.9.1