Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-08-01 15:12:46 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-08-05 14:19:28 (GMT)
commit9daed3dbbacceaa710cc2f9b95fa65ce4eaad7d6 (patch)
tree023398a3b770b0ca5540a7d25bda1d76693698ce
parent0cbe3f88716e1a01a43dc0c6e6cb7469af776569 (diff)
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>
-rw-r--r--readactivity.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/readactivity.py b/readactivity.py
index e39956e..236030b 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -146,6 +146,7 @@ class ReadActivity(activity.Activity):
def __init__(self, handle):
activity.Activity.__init__(self, handle)
+ self.max_participants = 1
self._document = None
self._fileserver = None
self._object_id = handle.object_id
@@ -699,6 +700,9 @@ class ReadActivity(activity.Activity):
'tmp%i%s' % (time.time(), extension))
os.link(file_path, tempfile)
self._tempfile = tempfile
+ # enable collaboration
+ self.activity_button.page.share.props.sensitive = True
+
self._load_document('file://' + self._tempfile)
# FIXME: This should obviously be fixed properly