Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-12-09 13:59:38 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-12-09 13:59:38 (GMT)
commit7e92df4c485e83eefe23a78c2d4046b660f1db8a (patch)
treec4ec32c65bf8770d963bfd63f1506d4163757c9c
parent36b9990c7547a0bcd96b9176f16af07c6569c1bb (diff)
Fix toolbar.
-rw-r--r--ircactivity.py69
1 files changed, 24 insertions, 45 deletions
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