changeset 553:a2648295b7cf

Only stop test if we were just testing (otherwise the level gets cleared).
author Simon Cross <hodgestar@gmail.com>
date Fri, 23 Sep 2011 21:54:02 +0200
parents b2e0f1267282
children b308ebaa96f3
files mamba/habitats/editor.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mamba/habitats/editor.py	Wed Sep 21 14:19:45 2011 +0200
+++ b/mamba/habitats/editor.py	Fri Sep 23 21:54:02 2011 +0200
@@ -402,6 +402,7 @@
         return True
 
     def change_toolbar(self, ev, widget, new_mode):
+        old_mode = self.mode
         if new_mode == 'Test':
             try:
                 self.level.validate_level()
@@ -416,7 +417,7 @@
         self.setup_toolbar()
         if self.mode == 'Test':
             self.edit_widget.start_test()
-        else:
+        elif old_mode == 'Test':
             self.edit_widget.stop_test()
         return True