From 34481157443e97171e02a225a2f99543ea3b53b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
Date: Mon, 21 May 2012 12:37:27 -0300
Subject: [PATCH 1/2] Fix for displaying filename in untitled PDFs SL #3597
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
This patch moves the line that sets the title to the
filename of the PDF, so we display "Loading..." until we
know the title, and if title is None, we show the filename.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
---
pdfviewer.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pdfviewer.py b/pdfviewer.py
index ef6a6ea..cf435d6 100644
a
|
b
|
class PDFTabPage(Gtk.HBox): |
289 | 289 | # The title may be given from the Journal: |
290 | 290 | if title is not None: |
291 | 291 | self._browser.props.title = title |
292 | | else: |
293 | | self._browser.props.title = os.path.basename(requested_uri) |
294 | 292 | |
295 | 293 | self._browser.props.uri = requested_uri |
296 | 294 | self._browser.props.load_status = WebKit.LoadStatus.PROVISIONAL |
… |
… |
class PDFTabPage(Gtk.HBox): |
335 | 333 | pdf_title = self._evince_viewer.get_pdf_title() |
336 | 334 | if pdf_title is not None: |
337 | 335 | self._browser.props.title = pdf_title |
| 336 | else: |
| 337 | self._browser.props.title = os.path.basename(self._requested_uri) |
338 | 338 | |
339 | 339 | def _get_path_from_journal(self, journal_uri): |
340 | 340 | """Get the system tree URI of the file for the Journal object.""" |