Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-03-25 02:12:18 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-03-25 02:12:18 (GMT)
commit7aec473a52e43d2a72c06d00ff1f4cc4268ed478 (patch)
treeb9f9d2e6f7fab8786b67049851a552559cf1739e
parentc3c97e4844945fae15a55942af06af185fa1c5d6 (diff)
parent961400b5fe6efe00db767fb903c3f87483c88898 (diff)
Merge branch 'master' of git.sugarlabs.org:stopwatch/stopwatch
-rw-r--r--activity.py26
-rw-r--r--mybutton.py54
-rw-r--r--po/cpp.po37
-rw-r--r--po/it.po38
-rw-r--r--po/sw.po37
-rwxr-xr-xpo/templates.po37
6 files changed, 165 insertions, 64 deletions
diff --git a/activity.py b/activity.py
index c06db43..f28e976 100644
--- a/activity.py
+++ b/activity.py
@@ -40,17 +40,18 @@ class StopWatchActivity(Activity):
Activity.__init__(self, handle)
self._logger = logging.getLogger('stopwatch-activity')
+ # we do not have collaboration features
+ # make the share option insensitive
+ self.max_participants = 1
gobject.threads_init()
# top toolbar with share and close buttons:
-
OLD_TOOLBAR = False
try:
from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
from sugar.activity.widgets import ActivityToolbarButton, StopButton, \
- ShareButton, KeepButton
- from mybutton import MyActivityToolbarButton
+ ShareButton, KeepButton, TitleEntry, ActivityButton
except ImportError:
OLD_TOOLBAR = True
@@ -60,14 +61,13 @@ class StopWatchActivity(Activity):
toolbox.show()
else:
toolbar_box = ToolbarBox()
- self.activity_button = MyActivityToolbarButton(self)
+ self.activity_button = ActivityButton(self)
toolbar_box.toolbar.insert(self.activity_button, 0)
-
- separator = gtk.SeparatorToolItem()
- separator.props.draw = False
- separator.set_expand(True)
- toolbar_box.toolbar.insert(separator, -1)
- separator.show()
+ self.activity_button.show()
+
+ title_entry = TitleEntry(self)
+ toolbar_box.toolbar.insert(title_entry, -1)
+ title_entry.show()
share_button = ShareButton(self)
toolbar_box.toolbar.insert(share_button, -1)
@@ -77,6 +77,12 @@ class StopWatchActivity(Activity):
toolbar_box.toolbar.insert(keep_button, -1)
keep_button.show()
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = False
+ separator.set_expand(True)
+ toolbar_box.toolbar.insert(separator, -1)
+ separator.show()
+
stop_button = StopButton(self)
stop_button.props.accelerator = '<Ctrl><Shift>Q'
toolbar_box.toolbar.insert(stop_button, -1)
diff --git a/mybutton.py b/mybutton.py
deleted file mode 100644
index 1b38a75..0000000
--- a/mybutton.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# mybutton.py A version of ActivityToolbarButton that hides the "Keep"
-# button.
-
-# Copyright (C) 2010 James D. Simmons
-#
-# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US
-import gtk
-import gconf
-
-from sugar.graphics.toolbarbox import ToolbarButton
-from sugar.activity.widgets import ActivityToolbar
-from sugar.graphics.xocolor import XoColor
-from sugar.graphics.icon import Icon
-from sugar.bundle.activitybundle import ActivityBundle
-
-def _create_activity_icon(metadata):
- if metadata.get('icon-color', ''):
- color = XoColor(metadata['icon-color'])
- else:
- client = gconf.client_get_default()
- color = XoColor(client.get_string('/desktop/sugar/user/color'))
-
- from sugar.activity.activity import get_bundle_path
- bundle = ActivityBundle(get_bundle_path())
- icon = Icon(file=bundle.get_icon(), xo_color=color)
-
- return icon
-
-class MyActivityToolbarButton(ToolbarButton):
-
- def __init__(self, activity, **kwargs):
- toolbar = ActivityToolbar(activity, orientation_left=True)
- toolbar.share.hide()
- toolbar.stop.hide()
- toolbar.keep.hide()
- toolbar.title.unset_flags(gtk.CAN_FOCUS)
-
- ToolbarButton.__init__(self, page=toolbar, **kwargs)
-
- icon = _create_activity_icon(activity.metadata)
- self.set_icon_widget(icon)
- icon.show()
diff --git a/po/cpp.po b/po/cpp.po
new file mode 100644
index 0000000..d8f79f3
--- /dev/null
+++ b/po/cpp.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-06 00:41+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 1.7.0\n"
+
+#: activity/activity.info:2
+msgid "StopWatch"
+msgstr ""
+
+#: stopwatch.py:162
+msgid "Start/Stop"
+msgstr ""
+
+#: stopwatch.py:170
+msgid "Zero"
+msgstr ""
+
+#: stopwatch.py:177
+msgid "Mark"
+msgstr ""
+
+#: stopwatch.py:410
+msgid "Stopwatch"
+msgstr ""
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 0000000..1653a28
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-06 00:41+0000\n"
+"PO-Revision-Date: 2011-03-16 18:37+0200\n"
+"Last-Translator: Carlo Falciola <cfalciola@yahoo.it>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Pootle 2.0.1\n"
+
+#: activity/activity.info:2
+msgid "StopWatch"
+msgstr "Cronometro"
+
+#: stopwatch.py:162
+msgid "Start/Stop"
+msgstr "Start/Stop"
+
+#: stopwatch.py:170
+msgid "Zero"
+msgstr "Zero"
+
+#: stopwatch.py:177
+msgid "Mark"
+msgstr "Segna"
+
+#: stopwatch.py:410
+msgid "Stopwatch"
+msgstr "Cronometro"
diff --git a/po/sw.po b/po/sw.po
new file mode 100644
index 0000000..d8f79f3
--- /dev/null
+++ b/po/sw.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-06 00:41+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 1.7.0\n"
+
+#: activity/activity.info:2
+msgid "StopWatch"
+msgstr ""
+
+#: stopwatch.py:162
+msgid "Start/Stop"
+msgstr ""
+
+#: stopwatch.py:170
+msgid "Zero"
+msgstr ""
+
+#: stopwatch.py:177
+msgid "Mark"
+msgstr ""
+
+#: stopwatch.py:410
+msgid "Stopwatch"
+msgstr ""
diff --git a/po/templates.po b/po/templates.po
new file mode 100755
index 0000000..d8f79f3
--- /dev/null
+++ b/po/templates.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-12-06 00:41+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 1.7.0\n"
+
+#: activity/activity.info:2
+msgid "StopWatch"
+msgstr ""
+
+#: stopwatch.py:162
+msgid "Start/Stop"
+msgstr ""
+
+#: stopwatch.py:170
+msgid "Zero"
+msgstr ""
+
+#: stopwatch.py:177
+msgid "Mark"
+msgstr ""
+
+#: stopwatch.py:410
+msgid "Stopwatch"
+msgstr ""