Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/atoidejouer/ui/panel.py
diff options
context:
space:
mode:
Diffstat (limited to 'atoidejouer/ui/panel.py')
-rw-r--r--atoidejouer/ui/panel.py39
1 files changed, 14 insertions, 25 deletions
diff --git a/atoidejouer/ui/panel.py b/atoidejouer/ui/panel.py
index 13f723c..d939eb3 100644
--- a/atoidejouer/ui/panel.py
+++ b/atoidejouer/ui/panel.py
@@ -18,14 +18,6 @@ from atoidejouer.tools import config, image, storage, ui
logger = logging.getLogger('atoidejouer')
-def _get_sequence_items(sequence_path):
- _f = open(sequence_path)
- _items = _f.readlines()
- _f.close()
- # ..
- return [_n.strip() for _n in _items]
-
-
def _get_filename(panel):
# get model
_model = panel.combo_box.get_model()
@@ -185,10 +177,8 @@ def _on_time_clicked(widget, panel, value):
panel.story_keys.refresh(panel._sequence_name)
# refresh timeline
panel.screen.timeline.refresh_sequence()
- # get new max
- _max = panel.story_keys.get_max_frame()
# set activity new number of keys
- _activity.set_number_of_keys(_max + 1)
+ _activity.update_number_of_keys()
# update thread time
_activity._thread.set_time(time_=_new_frame)
# restore current
@@ -338,11 +328,7 @@ def _on_key_press(widget, event, panel):
_keyval = event.keyval
_name = gtk.gdk.keyval_name(_keyval)
_mod = gtk.accelerator_get_label(_keyval, event.state)
- # DEBUG
- logger.debug('[panel] _on_key_press - _keyval: %s' % _keyval)
- logger.debug('[panel] _on_key_press - _name: %s' % _name)
- logger.debug('[panel] _on_key_press - _mod: %s' % _mod)
- # DEBUG
+ # ..
if panel.screen != panel.screen.toolbar.activity.get_current_screen():
return
# key factory
@@ -542,7 +528,7 @@ class Panel(gtk.Frame):
_current, _f_type, _k_type = self.story_keys.get_current(
self._sequence_name, _activity._thread._time)
# get sound names
- _items = _get_sequence_items(_seq_path)
+ _items = storage.get_sequence_items(_seq_path)
# get combo box active
if _current in _items:
_active = _items.index(_current) + 1
@@ -716,7 +702,7 @@ class PanelGraphics(Panel):
# little check
if os.path.exists(_seq_path):
# get graphic names
- _items = _get_sequence_items(_seq_path)
+ _items = storage.get_sequence_items(_seq_path)
# add dummy row
_dummy_pix, _path = self._get_pixbuf('blank', dir_='data')
self._store.append([_dummy_pix, '', None])
@@ -906,7 +892,7 @@ class PanelSounds(Panel):
# little check
if os.path.exists(_seq_path):
# get graphic names
- _items = _get_sequence_items(_seq_path)
+ _items = storage.get_sequence_items(_seq_path)
# add dummy row
_dummy_pix, _path = self._get_pixbuf('blank', dir_='data')
self._store.append([_dummy_pix, '', None])
@@ -1012,7 +998,7 @@ class PanelSounds(Panel):
self._init_sequence_box()
_in_vbox.pack_start(self.combo_box, expand=False, fill=True)
# add duration box
- # _in_vbox.pack_start(self._get_duration_box(), expand=False, fill=True)
+ _in_vbox.pack_start(self._get_duration_box(), expand=False, fill=True)
# add loop button
self._init_loop_box()
_in_vbox.pack_start(self.toggle_loop, expand=False, fill=True)
@@ -1025,11 +1011,14 @@ class PanelSounds(Panel):
if os.path.exists(_seq_path):
# shortcut
_activity = self.screen.toolbar.activity
- # get current x and y
- _d = self.story_keys.get_duration(self._sequence_name,
- _activity._thread._time, _current)
- # update panel x y
- self.entry_duration.set_text('%1d:%02d' % divmod(_d, 60))
+ if self.entry_duration is None:
+ pass
+ else:
+ # get current x and y
+ _d = self.story_keys.get_duration(self._sequence_name,
+ _activity._thread._time, _current)
+ # update panel x y
+ self.entry_duration.set_text('%1d:%02d' % divmod(_d, 60))
# ...
_l = self.story_keys.get_loop(self._sequence_name,
_activity._thread._time, _current)