[jhbuild: 56/60] [gui] keep at most 200 lines in textview log



commit 548621bbfc402fefd30c1e3fbdc422aeb47d1497
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat Jun 6 12:29:32 2009 +0200

    [gui] keep at most 200 lines in textview log
---
 jhbuild/frontends/gtkui.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/jhbuild/frontends/gtkui.py b/jhbuild/frontends/gtkui.py
index 93c378b..0768b38 100644
--- a/jhbuild/frontends/gtkui.py
+++ b/jhbuild/frontends/gtkui.py
@@ -511,6 +511,10 @@ class AppWindow(gtk.Window, buildscript.BuildScript):
                     textbuffer.insert_with_tags_by_name(
                             textbuffer.get_end_iter(), chunk, 'stderr')
 
+                if textbuffer.get_line_count() > 200:
+                    textbuffer.delete(0,
+                            textbuffer.get_iter_at_line_offset(200, 0).get_offset())
+
                 mark = textbuffer.get_mark('end')
                 if mark:
                     mark.move_mark(textbuffer.get_end_iter())



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]