Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <erikos@localhost.localdomain>2009-06-10 07:29:25 (GMT)
committer Simon Schampijer <erikos@localhost.localdomain>2009-06-10 07:29:25 (GMT)
commitc7794ab39b37f88a52546ed3e39cbd3799e83751 (patch)
treeec5f9109840625c8375032101750a660bf7eae10
parent9f7f3a74444282310f35fc5b7288e3a98b42e744 (diff)
More meaningful screenshot titles (James Zaki) #650
"Screenshot of \"<activity name>\"" "Screenshot of \"<view>\""
-rw-r--r--extensions/globalkey/screenshot.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/extensions/globalkey/screenshot.py b/extensions/globalkey/screenshot.py
index b7538ef..5474b4c 100644
--- a/extensions/globalkey/screenshot.py
+++ b/extensions/globalkey/screenshot.py
@@ -1,5 +1,5 @@
# Copyright (C) 2008 One Laptop Per Child
-# Copyright (C) 2009 Simon Schampijer
+# Copyright (C) 2009 Simon Schampijer, James Zaki
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@ import dbus
from sugar.datastore import datastore
from sugar.graphics import style
+from jarabe.model import shell
BOUND_KEYS = ['<alt>1', 'Print']
@@ -46,9 +47,32 @@ def handle_key_press(key):
client = gconf.client_get_default()
color = client.get_string('/desktop/sugar/user/color')
+ content_title = None
+ shell_model = shell.get_model()
+ zoom_level = shell_model.zoom_level
+
+ # TRANS: Nouns of what a screenshot contains
+ if zoom_level == shell_model.ZOOM_MESH:
+ content_title = _('Mesh')
+ elif zoom_level == shell_model.ZOOM_GROUP:
+ content_title = _('Group')
+ elif zoom_level == shell_model.ZOOM_HOME:
+ content_title = _('Home')
+ elif zoom_level == shell_model.ZOOM_ACTIVITY:
+ activity = shell_model.get_active_activity()
+ if activity != None:
+ content_title = activity.get_title()
+ if content_title == None:
+ content_title = _('Activity')
+
+ if content_title is None:
+ title = _('Screenshot')
+ else:
+ title = _('Screenshot of \"%s\"') % content_title
+
jobject = datastore.create()
try:
- jobject.metadata['title'] = _('Screenshot')
+ jobject.metadata['title'] = title
jobject.metadata['keep'] = '0'
jobject.metadata['buddies'] = ''
jobject.metadata['preview'] = _get_preview_data(screenshot)