Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2013-03-02 13:45:11 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-10 12:27:59 (GMT)
commitbadbe8e80f7d6d3e32da6ab10e1c949d3e5c84c4 (patch)
treeb6b4177b1756dba2d71015d090d4886a8510de82
parent96cd6370cc30255ad768aa1cc39568f796d344d3 (diff)
Add button to hide list
Signed-off-by: Daniel Francis <francis@sugarlabs.org> Reviewed-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r--logviewer.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/logviewer.py b/logviewer.py
index 79a9648..1faa64d 100644
--- a/logviewer.py
+++ b/logviewer.py
@@ -50,10 +50,11 @@ def _notify_response_cb(notify, response, activity):
activity.remove_alert(notify)
-class MultiLogView(Gtk.HPaned):
+class MultiLogView(Gtk.Paned):
def __init__(self, paths, extra_files):
GObject.GObject.__init__(self)
+ self.set_orientation(Gtk.Orientation.HORIZONTAL)
self.paths = paths
self.extra_files = extra_files
@@ -99,12 +100,12 @@ class MultiLogView(Gtk.HPaned):
if len(self.extra_files):
self.extra_iter = self._treemodel.append(None, [_('Other')])
- scroll = Gtk.ScrolledWindow()
- scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
- scroll.add(self._treeview)
- scroll.set_size_request(Gdk.Screen.width() * 30 / 100, -1)
+ self.list_scroll = Gtk.ScrolledWindow()
+ self.list_scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+ self.list_scroll.add(self._treeview)
+ self.list_scroll.set_size_request(Gdk.Screen.width() * 30 / 100, -1)
- self.add1(scroll)
+ self.add1(self.list_scroll)
def _build_textview(self):
self._textview = Gtk.TextView()
@@ -399,6 +400,13 @@ class LogActivity(activity.Activity):
toolbar_box.toolbar.insert(activity_button, -1)
+ show_list = ToggleToolButton('view-list')
+ show_list.set_active(True)
+ show_list.set_tooltip(_('Show list of files'))
+ show_list.connect('toggled', self._list_toggled_cb)
+ toolbar_box.toolbar.insert(show_list, -1)
+ show_list.show()
+
copy = CopyButton()
copy.connect('clicked', self.__copy_clicked_cb)
toolbar_box.toolbar.insert(copy, -1)
@@ -453,6 +461,12 @@ class LogActivity(activity.Activity):
toolbar_box.show_all()
self.set_toolbar_box(toolbar_box)
+ def _list_toggled_cb(self, widget):
+ if widget.get_active():
+ self.viewer.list_scroll.show()
+ else:
+ self.viewer.list_scroll.hide()
+
def __copy_clicked_cb(self, button):
if self.viewer.active_log:
self.viewer.active_log.copy_clipboard(self.clipboard)