[Sugar-devel] [PATCH 3/3] better wording #1508 + pep8 fixes

Rafael Ortiz rafael at activitycentral.com
Fri May 20 16:36:09 EDT 2011


This patch proposes a better wording for cancel/stop buttons while exiting browse activity 
plus pep8 fixes for downloadmanager.py
---
 downloadmanager.py |    7 ++++---
 webactivity.py     |    4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/downloadmanager.py b/downloadmanager.py
index 27ed311..ba2b0a5 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -238,6 +238,7 @@ class Download:
                             gtk.gdk.INTERP_BILINEAR)
 
         preview_data = []
+
         def save_func(buf, data):
             data.append(buf)
 
@@ -297,7 +298,7 @@ class Download:
     def onProgressChange64(self, web_progress, request, cur_self_progress,
                            max_self_progress, cur_total_progress,
                            max_total_progress):
-        percent = (cur_self_progress  * 100) / max_self_progress
+        percent = (cur_self_progress * 100) / max_self_progress
 
         if (time.time() - self._last_update_time) < _MIN_TIME_UPDATE and \
            (percent - self._last_update_percent) < _MIN_PERCENT_UPDATE:
@@ -354,7 +355,7 @@ class Download:
         if self in _active_downloads:
             # TODO: Use NS_BINDING_ABORTED instead of NS_ERROR_FAILURE.
             self._delete_partial_download()
-            self.cancelable.cancel(NS_ERROR_FAILURE) #NS_BINDING_ABORTED)
+            self.cancelable.cancel(NS_ERROR_FAILURE)  # NS_BINDING_ABORTED)
             _active_downloads.remove(self)
 
 
@@ -453,4 +454,4 @@ class _SaveLinkProgressListener(object):
 
     def onDataAvailable(self, request, context, inputStream, offset, count):
         self._external_listener.onDataAvailable(request, context, inputStream,
-                                                offset, count);
+                                                offset, count)
diff --git a/webactivity.py b/webactivity.py
index d744ab1..2e1509d 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -598,9 +598,9 @@ class WebActivity(activity.Activity):
             alert.props.title = _('Download in progress')
             alert.props.msg = _('Stopping now will cancel your download')
             cancel_icon = Icon(icon_name='dialog-cancel')
-            alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel'), cancel_icon)
+            alert.add_button(gtk.RESPONSE_CANCEL, _('Continue Download'), cancel_icon)
             stop_icon = Icon(icon_name='dialog-ok')
-            alert.add_button(gtk.RESPONSE_OK, _('Stop'), stop_icon)
+            alert.add_button(gtk.RESPONSE_OK, _('Cancel Download'), stop_icon)
             stop_icon.show()
             self.add_alert(alert)
             alert.connect('response', self.__inprogress_response_cb)
-- 
1.7.4.1



More information about the Sugar-devel mailing list