Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/readactivity.py
diff options
context:
space:
mode:
authorManuel Kaufmann <humitos@gmail.com>2012-11-05 14:48:27 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-10 13:20:19 (GMT)
commitd63a824535a346a67ab67e423f91581df64c428e (patch)
treef32829357b96e9afe3752a0fd388bf25a83d5903 /readactivity.py
parente11267a9cde41b444dbbbb47a175ff0836fa2109 (diff)
Show 'No book' message when Read starts from scratch
When the user starts a new instance of Read the 'No book' message is shown with a button to 'Choose something to read' that opens the Object Chooser. Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Diffstat (limited to 'readactivity.py')
-rw-r--r--readactivity.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/readactivity.py b/readactivity.py
index c7a81aa..701d3aa 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -25,6 +25,7 @@ import re
import md5
import StringIO
import cairo
+import emptypanel
import dbus
from gi.repository import GObject
@@ -336,7 +337,9 @@ class ReadActivity(activity.Activity):
self.connect("joined", self._joined_cb)
elif self._object_id is None:
# Not joining, not resuming
- self._show_journal_object_picker()
+ emptypanel.show(self, 'activity-read',
+ _('No book'), _('Choose something to read'),
+ self._show_journal_object_picker_cb)
def _create_back_button(self):
back = ToolButton('go-previous-paired')
@@ -627,7 +630,7 @@ class ReadActivity(activity.Activity):
else:
logging.debug('link "%s" not found in the toc model', current_link)
- def _show_journal_object_picker(self):
+ def _show_journal_object_picker_cb(self, button):
"""Show the journal object picker to load a document.
This is for if Read is launched without a document.
@@ -643,6 +646,7 @@ class ReadActivity(activity.Activity):
jobject = chooser.get_selected_object()
if jobject and jobject.file_path:
self.read_file(jobject.file_path)
+ self.set_canvas(self._vbox)
finally:
chooser.destroy()
del chooser