Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArtActivity.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-06-30 18:00:41 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-06-30 18:00:41 (GMT)
commit031d8f5adafaade8b4d6cdcfa98c99fbad19ca82 (patch)
treedb3409c7835252883818ad6319529a71641b02dd /TurtleArtActivity.py
parentc792d86e92f6c5e38e752e45ef5a350d7f636188 (diff)
use same mechanism for sharing stacks as in copying stacks
Diffstat (limited to 'TurtleArtActivity.py')
-rw-r--r--TurtleArtActivity.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index 86991da..9bab7f9 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -871,6 +871,7 @@ class TurtleArtActivity(activity.Activity):
if self.has_toolbarbox:
self._old_cursor = self.get_window().get_cursor()
self.copying = False
+ self.sharing_blocks = False
def _setup_sharing(self):
''' Setup the Collabora stack. '''
@@ -1101,8 +1102,9 @@ in order to use the plugin.'))
self._jobject.destroy()
def restore_cursor(self):
- ''' No longer copying, so restore standard cursor. '''
+ ''' No longer copying or sharing, so restore standard cursor. '''
self.copying = False
+ self.sharing_blocks = False
if self.has_toolbarbox:
self.get_window().set_cursor(self._old_cursor)
@@ -1147,9 +1149,20 @@ in order to use the plugin.'))
def _share_cb(self, button):
''' Share a stack of blocks. '''
+ if self.sharing_blocks:
+ self.restore_cursor()
+ else:
+ self.sharing_blocks = True
+ if self.has_toolbarbox:
+ self._old_cursor = self.get_window().get_cursor()
+ self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.HAND1))
+
+ def share_blocks(self):
+ ''' Share selected stack. '''
if not self.tw.sharing():
return
_logger.debug('Serialize a stack and send as event.')
+ self.restore_cursor()
data = self.tw.assemble_data_to_save(False, False)
if data is not []:
text = data_to_string(data)