Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Pigout <florent.pigout@gmail.com>2011-09-22 08:58:16 (GMT)
committer Florent Pigout <florent.pigout@gmail.com>2011-09-22 08:58:16 (GMT)
commitecaae9887e03311f3b583bfb8e68efa2680260ff (patch)
treef6aaa01c31d35347fed4a526ccaea11e59c2761d
parentfc04adb07b07e030f6cbde04d053b76c73953f0a (diff)
load graphics screen when create a new story [REVIEW]
-rw-r--r--activity.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/activity.py b/activity.py
index 029b77f..0d3fdee 100644
--- a/activity.py
+++ b/activity.py
@@ -162,24 +162,24 @@ class AToiDeJouerActivity(activity.Activity):
# sequence dict and list
self.graphic_keys = StoryKeys('graphics', self)
self.sound_keys = StoryKeys('sounds', self)
- # current toolbar or screen index
- _cur_tuple = (2, 'graphics') if len(self.graphic_keys._names) == 0\
- else (1, 'story')
# show
self._toolbox.show()
# tmp var
_toolbar = None
+ self.__story_toolbar = None
# init toolbars
for _n in ['story', 'graphics', 'graphics_add',
'sounds', 'sounds_add', 'help']:
# init toolbar
_t = toolbar.Toolbar(self, name=_n)
# if default toolbar .. set default screen
- if _n == _cur_tuple[1]:
+ if _n == 'story':
+ self.__story_toolbar = _t
+ elif _n == 'graphics':
self._change_screen(_t)
_toolbar = _t
# set default tab
- self._toolbox.set_current_toolbar(_cur_tuple[0])
+ self._toolbox.set_current_toolbar(2)
# ..
self._toolbox.connect('current-toolbar-changed', _toolbar_changed, self)
# do anim
@@ -338,10 +338,9 @@ class AToiDeJouerActivity(activity.Activity):
self.update_number_of_keys()
# clear
self.graphic_keys.ask_clear()
- # refresh default
- self._previous = self._current
- _current = self.get_current_screen()
- _current.refresh()
+ # switch to edit mode if no key
+ self._toolbox.set_current_toolbar(1)
+ self._change_screen(toolbar=self.__story_toolbar)
def write_file(self, file_path):
"""Dummy overiding ...