<br><br><div class="gmail_quote">On Sat, May 21, 2011 at 10:24 AM, Sascha Silbe <span dir="ltr"><<a href="mailto:silbe@activitycentral.com">silbe@activitycentral.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
sugar.activity.activity.Activity.close() doesn't take a force parameter.<br>
Instead we need to make sure can_close() returns True the next time and call<br>
close() without parameters.<br>
<br>
The user-visible effect was that they needed to use Stop twice (once to stop<br>
the pending downloads and a second time to close Browse).<br>
<br>
Signed-off-by: Sascha Silbe <<a href="mailto:silbe@activitycentral.com">silbe@activitycentral.com</a>><br>
---<br>
webactivity.py | 9 +++++++--<br>
1 files changed, 7 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/webactivity.py b/webactivity.py<br>
index b444861..5f1ea5e 100644<br>
--- a/webactivity.py<br>
+++ b/webactivity.py<br>
@@ -184,6 +184,7 @@ class WebActivity(activity.Activity):<br>
<br>
_logger.debug('Starting the web activity')<br>
<br>
+ self._force_close = False<br>
self._tabbed_view = TabbedView()<br>
<br>
_set_accept_languages()<br>
@@ -601,7 +602,9 @@ class WebActivity(activity.Activity):<br>
return buf<br>
<br>
def can_close(self):<br>
- if downloadmanager.can_quit():<br>
+ if self._force_close:<br>
+ return True<br>
+ elif downloadmanager.can_quit():<br>
return True<br>
else:<br>
alert = Alert()<br>
@@ -616,6 +619,7 @@ class WebActivity(activity.Activity):<br>
alert.connect('response', self.__inprogress_response_cb)<br>
alert.show()<br>
self.present()<br>
+ return False<br>
<br>
def __inprogress_response_cb(self, alert, response_id):<br>
self.remove_alert(alert)<br>
@@ -623,8 +627,9 @@ class WebActivity(activity.Activity):<br>
logging.debug('Keep on')<br>
elif response_id == gtk.RESPONSE_OK:<br>
logging.debug('Stop downloads and quit')<br>
+ self._force_close = True<br>
downloadmanager.remove_all_downloads()<br>
- self.close(force=True)<br>
+ self.close()<br>
<br>
def get_document_path(self, async_cb, async_err_cb):<br>
browser = self._tabbed_view.props.current_browser<br>
<font color="#888888">--<br>
1.7.4.1<br></font></blockquote><div><br></div><div>Applied and tested, works as expected thanks. </div><div><br></div><div>Can you apply to mainline ?.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888">
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</font></blockquote></div><br>