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>2013-01-18 14:49:34 (GMT)
committer Walter Bender <walter.bender@gmail.com>2013-01-18 14:49:34 (GMT)
commit89a08d318c16b11fd93322f2cf0414134e88c0b5 (patch)
tree98c088db5929f6ebfa2682fbe4dded76f684b50a /TurtleArtActivity.py
parent253a0ecdaafc49a98bd0abb0a0981a51acbcc4f2 (diff)
use watch cursor while loading projects
Diffstat (limited to 'TurtleArtActivity.py')
-rw-r--r--TurtleArtActivity.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index d379822..b65dc87 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -303,7 +303,15 @@ class TurtleArtActivity(activity.Activity):
def do_samples_cb(self, button):
''' Sample-projects open dialog '''
+ if hasattr(self, 'get_window'):
+ _logger.debug('setting watch cursor')
+ if hasattr(self.get_window(), 'get_cursor'):
+ self._old_cursor = self.get_window().get_cursor()
+ self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
self.tw.load_file_from_chooser(True)
+ # Now that the file is loaded, restore the cursor
+ _logger.debug('restoring cursor')
+ self.restore_cursor()
def adjust_sw(self, dx, dy):
''' Adjust the scrolled window position. '''
@@ -1087,6 +1095,12 @@ in order to use the plugin.'))
def read_file(self, file_path, run_it=False, plugin=False):
''' Open a project or plugin and then run it. '''
if hasattr(self, 'tw') and self.tw is not None:
+ # While the file is loading, use the watch cursor
+ if hasattr(self, 'get_window'):
+ _logger.debug('setting watch cursor')
+ if hasattr(self.get_window(), 'get_cursor'):
+ self._old_cursor = self.get_window().get_cursor()
+ self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
_logger.debug('Read file: %s' % (file_path))
# Could be a plugin or deprecated gtar or tar file...
if plugin or file_path.endswith(('.gtar', '.tar', '.tar.gz')):
@@ -1138,6 +1152,10 @@ in order to use the plugin.'))
_logger.debug('Trying to open a .ta file:' + file_path)
self.tw.load_files(file_path, run_it)
+ # Now that the file is loaded, restore the cursor
+ _logger.debug('restoring cursor')
+ self.restore_cursor()
+
# Finally, run the project.
if run_it:
self.tw.run_button(0)