diff options
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/activity.py b/activity.py index 42e28c1..2f43550 100644 --- a/activity.py +++ b/activity.py @@ -1,9 +1,7 @@ # python import -import json, logging, os, threading, time -# ... +import logging, os, threading, time from functools import partial -# .. from gettext import gettext as _ # gtk import @@ -252,6 +250,8 @@ class AToiDeJouerActivity(activity.Activity): self._update_slider(toolbar) def read_file(self, file_path): + if not file_path or not os.path.exists(file_path): + return # close db story.DB().close() # save content @@ -266,8 +266,14 @@ class AToiDeJouerActivity(activity.Activity): story.DB(force=True) # update max time self.update_max_time() + # clear screens + if 'story' in self._screens: + self._screens['story'].set_clear(True) + if 'edit' in self._screens: + self._screens['edit'].scene.set_clear(True) def write_file(self, file_path): + self.metadata['mime_type'] = 'atoidejouer/db' # close db story.DB().close() # save content |