Enable collaboration only when a file is loaded
Right now, Read activity can start without a file loaded,
showing the empty panel and a button to open the object chooser.
If the user try sharing the session before a book is opened,
the collaboration is broken, because no file is available to share.
This patch disable collaboration until a file is opened.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Gonzalo Odiard
10 years ago
145 | 145 | def __init__(self, handle): |
146 | 146 | activity.Activity.__init__(self, handle) |
147 | 147 | |
148 | self.max_participants = 1 | |
148 | 149 | self._document = None |
149 | 150 | self._fileserver = None |
150 | 151 | self._object_id = handle.object_id |
698 | 699 | 'tmp%i%s' % (time.time(), extension)) |
699 | 700 | os.link(file_path, tempfile) |
700 | 701 | self._tempfile = tempfile |
702 | # enable collaboration | |
703 | self.activity_button.page.share.props.sensitive = True | |
704 | ||
701 | 705 | self._load_document('file://' + self._tempfile) |
702 | 706 | |
703 | 707 | # FIXME: This should obviously be fixed properly |