[Sugar-devel] [PATCH Browse 2/2] Display the filename for untitled PDFs stored in the Journal SL #3622

Manuel Quiñones manuq at laptop.org
Wed May 23 16:29:49 EDT 2012


It was set in the setup method of the pdf viewer, but
was overwritten by the show_pdf method.

This requires the patch attached in SL #3620

Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 pdfviewer.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pdfviewer.py b/pdfviewer.py
index cf435d6..5f607bf 100644
--- a/pdfviewer.py
+++ b/pdfviewer.py
@@ -329,7 +329,12 @@ class PDFTabPage(Gtk.HBox):
         self._evince_viewer.show()
         self.pack_start(self._evince_viewer, True, True, 0)
 
-        # if the PDF has a title, show it instead of the URI:
+        # If the PDF has a title, set it as the browse page title,
+        # otherwise use the last part of the URI.  Only when the title
+        # was not set already from the Journal.
+        if from_journal:
+            self._browser.props.title = self._browser.props.title
+            return
         pdf_title = self._evince_viewer.get_pdf_title()
         if pdf_title is not None:
             self._browser.props.title = pdf_title
-- 
1.7.10.1



More information about the Sugar-devel mailing list