diff options
author | Ajay Garg <ajay@activitycentral.com> | 2012-08-08 07:59:40 (GMT) |
---|---|---|
committer | Ajay Garg <ajay@activitycentral.com> | 2012-08-08 07:59:40 (GMT) |
commit | f4ab20a311e5090aca2e1d757c6433eb19c5522a (patch) | |
tree | be6ddda93c3e0104c1fab22118f64e5e8b27ee73 | |
parent | 381e706de7e7309d27a44ed064794a44d50aad4a (diff) |
Multi-Select REVIEW (BUG): If the user pressed "Stop", during the confirmation-alert before the (batch) operation began, the operation proceeded nevertheless.
Thanks to Gary Martin, for catching the bug :)
-rw-r--r-- | rpms/sugar/0116-Multi-Select-REVIEW-BUG-If-the-user-pressed-Stop-dur.patch | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/rpms/sugar/0116-Multi-Select-REVIEW-BUG-If-the-user-pressed-Stop-dur.patch b/rpms/sugar/0116-Multi-Select-REVIEW-BUG-If-the-user-pressed-Stop-dur.patch new file mode 100644 index 0000000..4da621e --- /dev/null +++ b/rpms/sugar/0116-Multi-Select-REVIEW-BUG-If-the-user-pressed-Stop-dur.patch @@ -0,0 +1,89 @@ +From 54e48832c935079e7e6b5cde6443e9ebbf238609 Mon Sep 17 00:00:00 2001 +From: Ajay Garg <ajay@activitycentral.com> +Date: Wed, 8 Aug 2012 00:44:17 +0530 +Subject: [sugar PATCH] Multi-Select REVIEW (BUG): If the user pressed "Stop", + during the confirmation-alert before the (batch) operation + began, the operation proceeded nevertheless. +Organization: Sugar Labs Foundation +Signed-off-by: Ajay Garg <ajay@activitycentral.com> +--- + +Thanks to Gary Martin, for catching the bug :) + + src/jarabe/journal/palettes.py | 30 +++++++++++++++++++++++++----- + 1 files changed, 25 insertions(+), 5 deletions(-) + +diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py +index d148a76..ce569b7 100644 +--- a/src/jarabe/journal/palettes.py ++++ b/src/jarabe/journal/palettes.py +@@ -275,7 +275,6 @@ class ActionItem(gobject.GObject): + show_post_selected_confirmation + self._show_not_completed_ops_info = \ + show_not_completed_ops_info +- self._continue_operation = True + + actionable_signal = self._get_actionable_signal() + +@@ -285,7 +284,9 @@ class ActionItem(gobject.GObject): + if show_editing_alert: + self.connect(actionable_signal, self._show_editing_alert) + else: +- self.connect(actionable_signal, self._pre_operate_per_action) ++ self.connect(actionable_signal, ++ self._pre_operate_per_action, ++ gtk.RESPONSE_OK) + + def _get_actionable_signal(self): + """ +@@ -383,12 +384,21 @@ class ActionItem(gobject.GObject): + return (self._metadata_list is None) or \ + (len(self._metadata_list) == 0) + +- def _pre_operate_per_action(self, obj, ok_clicked=False): ++ def _pre_operate_per_action(self, obj, response_id): + """ + This is the stage, just before the FIRST metadata gets into its + processing cycle. + """ + ++ self._continue_operation = True ++ ++ # If the user chose to cancel the operation from the onset, ++ # simply proceeed to "self._post_operate_per_action". ++ if response_id == gtk.RESPONSE_CANCEL: ++ self._cancel_further_batch_operation_items() ++ self._post_operate_per_action() ++ return ++ + # Show waiting cursor (only for batch mode) + if self._batch_mode: + self.get_root_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +@@ -571,12 +581,22 @@ class ActionItem(gobject.GObject): + + def _process_error_skipping(self, metadata, response_id): + # This sets up the decision, as to whether continue operations +- # with the rest of the data. ++ # with the rest of the metadata. + if response_id == gtk.RESPONSE_CANCEL: +- self._continue_operation = False ++ self._cancel_further_batch_operation_items() + + self._post_operate_per_metadata_per_action(metadata) + ++ def _cancel_further_batch_operation_items(self): ++ self._continue_operation = False ++ ++ # Optimization: ++ # Clear the metadata-list as well. ++ # This would prevent the unnecessary traversing of the ++ # remaining checkboxes-corresponding-to-remaining-metadata (of ++ # course without doing any effective action). ++ self._metadata_list = [] ++ + def _file_path_valid(self, metadata): + from jarabe.journal.journalactivity import get_mount_point + current_mount_point = get_mount_point() +-- +1.7.4.4 + |