diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-03-01 22:51:59 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-03-02 14:45:13 (GMT) |
commit | a6baeb40f195c17e3adba72e90a0a69694453e1c (patch) | |
tree | 30066cad7f2d46f3efdf2c62d4c23e48e7f2c066 /activity.py | |
parent | a8636de076deafa686770a9cb4393138e2ff1a11 (diff) |
Load/Save jobject
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/activity.py b/activity.py index c6b8655..9f3f2d5 100644 --- a/activity.py +++ b/activity.py @@ -39,20 +39,10 @@ class InfoslicerActivity(SharedActivity): self.connect('init', self._init_cb) self.connect('tube', self._tube_cb) - def read_file(self, filepath): - pass - - def write_file(self, filepath): - # XXX this method will be invoked on every props.status changing - # thus ignore it and use can_close() instead to save data on exit - pass - - def can_close(self): - book.teardown() - return True - def _init_cb(self, sender): - book.init() + book.wiki = book.WikiBook() + if not book.custom: + book.custom = book.CustomBook() self.edit_page = 1 self.edit = edit.View() @@ -76,6 +66,13 @@ class InfoslicerActivity(SharedActivity): toolbox.set_current_toolbar(1) self.show_all() + def read_file(self, filepath): + book.custom = book.CustomBook(filepath) + + def write_file(self, filepath): + book.wiki.sync() + book.custom.sync(filepath) + def set_edit_sensitive(self, enable): self.edit_bar.props.sensitive = enable self.edit_page = (enable and 1 or 2) |