[Dextrose] [sugar PATCH] sl#3343: If the journal is in editing mode (batch-operations mode), de-sensitize any newly mounted drive button in the bottom-panelframe.

Ajay Garg ajay at activitycentral.com
Sun Mar 4 10:37:11 EST 2012


Note that, this patch needs to be applied, after applying the patch at ::

(Commit Link)
http://git.sugarlabs.org/dextrose/mainline/commit/22ee61af567acba7ee5fee1f656804a19e561684

(Patchwork Link)
http://patchwork.sugarlabs.org/patch/1205/


 src/jarabe/journal/journalactivity.py |    3 +++
 src/jarabe/journal/volumestoolbar.py  |    7 +++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index 2e044fc..fa308cd 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -482,6 +482,9 @@ class JournalActivity(JournalWindow):
 
         return metadata_list
 
+    def is_editing_mode_present(self):
+        return self._editing_mode
+
 
 def get_journal():
     global _journal
diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
index c591cc4..94914e6 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -254,6 +254,13 @@ class VolumesToolbar(gtk.Toolbar):
         button.connect('volume-error', self.__volume_error_cb)
         position = self.get_item_index(self._volume_buttons[-1]) + 1
         self.insert(button, position)
+
+        # If the journal-view is in editing mode, ensure that the newly
+        # mounted-drive-button is de-sensitized.
+        from jarabe.journal.journalactivity import get_journal
+        if get_journal().is_editing_mode_present():
+            button.set_sensitive(False)
+
         button.show()
 
         self._volume_buttons.append(button)
-- 
1.7.4.4



More information about the Dextrose mailing list