Fix a few bugs
This commit is contained in:
parent
790129cb52
commit
e00fea9480
@ -51,7 +51,6 @@ class LogView(gtk.ScrolledWindow):
|
|||||||
|
|
||||||
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||||
|
|
||||||
log_file = os.path.join(env.get_profile_path(), 'sugar.log')
|
|
||||||
textview = gtk.TextView(model)
|
textview = gtk.TextView(model)
|
||||||
textview.set_wrap_mode(gtk.WRAP_WORD)
|
textview.set_wrap_mode(gtk.WRAP_WORD)
|
||||||
textview.set_editable(False)
|
textview.set_editable(False)
|
||||||
@ -67,6 +66,7 @@ class MultiLogView(gtk.Notebook):
|
|||||||
self._pages = {}
|
self._pages = {}
|
||||||
|
|
||||||
self._update()
|
self._update()
|
||||||
|
|
||||||
gobject.timeout_add(1000, self._update)
|
gobject.timeout_add(1000, self._update)
|
||||||
|
|
||||||
def _add_page(self, logfile):
|
def _add_page(self, logfile):
|
||||||
@ -80,12 +80,17 @@ class MultiLogView(gtk.Notebook):
|
|||||||
self._pages[logfile] = model
|
self._pages[logfile] = model
|
||||||
|
|
||||||
def _update(self):
|
def _update(self):
|
||||||
|
if not os.path.isdir(self._logs_path):
|
||||||
|
return True
|
||||||
|
|
||||||
for logfile in os.listdir(self._logs_path):
|
for logfile in os.listdir(self._logs_path):
|
||||||
if self._pages.has_key(logfile):
|
if self._pages.has_key(logfile):
|
||||||
self._pages[logfile].update()
|
self._pages[logfile].update()
|
||||||
else:
|
else:
|
||||||
self._add_page(logfile)
|
self._add_page(logfile)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
window = gtk.Window()
|
window = gtk.Window()
|
||||||
window.set_default_size(gtk.gdk.screen_width() * 3 / 4,
|
window.set_default_size(gtk.gdk.screen_width() * 3 / 4,
|
||||||
gtk.gdk.screen_height() * 3 / 4)
|
gtk.gdk.screen_height() * 3 / 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user