diff options
author | Ajay Garg <ajay@activitycentral.com> | 2013-02-18 11:54:09 (GMT) |
---|---|---|
committer | Ajay Garg <ajay@activitycentral.com> | 2013-02-18 11:54:09 (GMT) |
commit | e7b692dce140eeb90115f5712400fa1cc5e76539 (patch) | |
tree | 7bb7cee0ca8da731fd9462f393eade130a24b40e | |
parent | 158d8181bb1d6bb9d4f6d6425c8fc0d1d2ded448 (diff) |
sdxo#2954: Display "Not used yet" for activities, that have not been launched even once since the image-installation.
-rw-r--r-- | src/sugar3/util.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/sugar3/util.py b/src/sugar3/util.py index baec3b1..ed459b5 100644 --- a/src/sugar3/util.py +++ b/src/sugar3/util.py @@ -30,6 +30,16 @@ import tempfile import logging import atexit +from gi.repository import GConf +from gettext import gettext as _ + +gconf_client = GConf.Client.get_default() +DISPLAY_USER_FRIENDLY_MESSAGE_FOR_NEVER_USED_ACTIVITIES = \ + gconf_client.get_bool('/desktop/sugar/display_user_friendly_message_for_never_used_activities') +if DISPLAY_USER_FRIENDLY_MESSAGE_FOR_NEVER_USED_ACTIVITIES is True: + NEVER_USED_ACTIVITIES_TIME = \ + gconf_client.get_string('/desktop/sugar/never_used_activities_time') + _ = lambda msg: gettext.dgettext('sugar-toolkit', msg) @@ -295,7 +305,12 @@ def timestamp_to_elapsed_string(timestamp, max_levels=2): if levels == 0: return NOW - return ELAPSED % time_period + return_string = ELAPSED % time_period + if DISPLAY_USER_FRIENDLY_MESSAGE_FOR_NEVER_USED_ACTIVITIES is True: + if return_string == NEVER_USED_ACTIVITIES_TIME: + return_string = _('Not used yet') + + return return_string _tracked_paths = {} |