From c31e7b61765859116d3b96af445c7401faed6610 Mon Sep 17 00:00:00 2001 From: "ced@b2ck.com" Date: Thu, 27 Dec 2007 23:08:23 +0100 Subject: [PATCH] Add tooltips on startup and improve for missing tip file --- tryton/common/common.py | 4 +++- tryton/tryton.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index e82fd9299c..b38eae217e 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -91,8 +91,10 @@ def tipoftheday(parent=None): tip_file = False if lang: tip_file = os.path.join(DATA_DIR, 'tipoftheday.'+lang+'.txt') - if not tip_file: + if not os.path.isfile(tip_file): tip_file = os.path.join(DATA_DIR, 'tipoftheday.txt') + if not os.path.isfile(tip_file): + return tips = file(tip_file).read().split('---') tip = tips[self.number % len(tips)] del tips diff --git a/tryton/tryton.py b/tryton/tryton.py index e75b57cffc..6348dce2be 100644 --- a/tryton/tryton.py +++ b/tryton/tryton.py @@ -83,7 +83,7 @@ class TrytonClient(object): def run(self): main = Main() if CONFIG['tip.autostart']: - pass + main.sig_tips() else: main.sig_login() gtk.main()