[pdfmod] Move and fix page tooltip logic
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pdfmod] Move and fix page tooltip logic
- Date: Sat, 8 May 2010 01:29:18 +0000 (UTC)
commit 7d1198b30cd4b73436a9dadd15c5bd9bac286b4d
Author: Gabriel Burt <gabriel burt gmail com>
Date: Fri May 7 18:06:34 2010 -0700
Move and fix page tooltip logic
The page # string was not properly marked for translation previously.
po/POTFILES.in | 1 +
src/PdfMod/Gui/PageListStore.cs | 9 +++------
src/PdfMod/Pdf/Page.cs | 10 ++++++++++
3 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 15fe676..07e3a0c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -5,6 +5,7 @@ data/pdfmod.desktop.in.in
src/PdfMod/Pdf/Actions/ExportImagesAction.cs
src/PdfMod/Pdf/Actions/MoveAction.cs
src/PdfMod/Pdf/Actions/RemoveAction.cs
+src/PdfMod/Pdf/Page.cs
src/PdfMod/Gui/Actions.cs
src/PdfMod/Gui/PageListStore.cs
src/PdfMod/Gui/Client.cs
diff --git a/src/PdfMod/Gui/PageListStore.cs b/src/PdfMod/Gui/PageListStore.cs
index b7ac848..354f435 100644
--- a/src/PdfMod/Gui/PageListStore.cs
+++ b/src/PdfMod/Gui/PageListStore.cs
@@ -19,7 +19,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using Mono.Unix;
using Gtk;
using PdfMod.Pdf;
@@ -63,14 +62,12 @@ namespace PdfMod.Gui
}
}
}
-
+
string GetPageTooltip (Page page)
{
- var label = page.Document.Labels[page];
- string page_no = Catalog.GetString (String.Format ("Page {0}", page.Index + 1));
- return ((null == label) ? page_no : String.Format ("{0} ({1})", label, page_no));
+ return page.Name;
}
-
+
public void UpdateForPage (TreeIter iter, Page page)
{
SetValue (iter, SortColumn, page.Index);
diff --git a/src/PdfMod/Pdf/Page.cs b/src/PdfMod/Pdf/Page.cs
index 83bfcea..7dbd814 100644
--- a/src/PdfMod/Pdf/Page.cs
+++ b/src/PdfMod/Pdf/Page.cs
@@ -16,6 +16,8 @@
using System;
+using Mono.Unix;
+
using PdfSharp.Pdf;
namespace PdfMod.Pdf
@@ -28,6 +30,14 @@ namespace PdfMod.Pdf
public int Index { get; internal set; }
public bool SurfaceDirty { get; internal set; }
+ public string Name {
+ get {
+ var label = Document.Labels[this];
+ string page_num = String.Format (Catalog.GetString ("Page {0}"), Index + 1);
+ return label == null ? page_num : String.Format ("{0} ({1})", label, page_num);
+ }
+ }
+
public Page (PdfPage pdf_page)
{
Pdf = pdf_page;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]