[pdfmod] Add Open in Viewer action
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pdfmod] Add Open in Viewer action
- Date: Mon, 10 Aug 2009 17:10:40 +0000 (UTC)
commit 0457ba0ae3f023d1685dda195db8ed6e983437db
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date: Mon Aug 10 10:06:09 2009 -0700
Add Open in Viewer action
src/PdfMod/PdfMod/GlobalActions.cs | 11 +++++++++--
src/PdfMod/Resources/UIManager.xml | 4 ++++
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/PdfMod/PdfMod/GlobalActions.cs b/src/PdfMod/PdfMod/GlobalActions.cs
index 9bbab40..52f49c6 100644
--- a/src/PdfMod/PdfMod/GlobalActions.cs
+++ b/src/PdfMod/PdfMod/GlobalActions.cs
@@ -24,7 +24,7 @@ namespace PdfMod
private const string WIKI_URL = "http://live.gnome.org/PdfMod";
private static string [] require_doc_actions = new string[] {
- "SaveAction", "SaveAsAction", "PropertiesAction", "UndoAction", "RedoAction", "ZoomFitAction",
+ "SaveAction", "SaveAsAction", "PropertiesAction", "UndoAction", "RedoAction", "ZoomFitAction", "OpenInViewerAction",
"SelectAllAction", "SelectEvensAction", "SelectOddsAction", "SelectMatchingAction", "InsertFromAction", "ExportImagesAction"
};
@@ -72,7 +72,9 @@ namespace PdfMod
new ActionEntry ("HelpAction", Stock.Help, Catalog.GetString ("_Contents"), "F1", null, OnHelp),
new ActionEntry ("AboutAction", Stock.About, null, null, null, OnAbout),
- new ActionEntry ("PageContextMenuAction", null, "", null, null, OnPageContextMenu)
+ new ActionEntry ("PageContextMenuAction", null, "", null, null, OnPageContextMenu),
+
+ new ActionEntry ("OpenInViewerAction", null, Catalog.GetString ("Open in Viewer"), "F5", Catalog.GetString ("Open in viewer"), OnOpenInViewer)
);
AddImportant (
@@ -197,6 +199,11 @@ namespace PdfMod
}
}
+ private void OnOpenInViewer (object o, EventArgs args)
+ {
+ System.Diagnostics.Process.Start (app.Document.CurrentStateUri);
+ }
+
private void OnInsertFrom (object o, EventArgs args)
{
var chooser = new Gtk.FileChooserDialog (Catalog.GetString ("Select PDF"), app.Window, FileChooserAction.Open);
diff --git a/src/PdfMod/Resources/UIManager.xml b/src/PdfMod/Resources/UIManager.xml
index bd92105..94c4972 100644
--- a/src/PdfMod/Resources/UIManager.xml
+++ b/src/PdfMod/Resources/UIManager.xml
@@ -35,6 +35,8 @@
<menuitem action="ZoomOutAction"/>
<menuitem action="ZoomFitAction"/>
<separator/>
+ <menuitem action="OpenInViewerAction"/>
+ <separator/>
<menuitem action="ViewToolbar"/>
</menu>
<menu name="HelpMenu" action="HelpMenuAction">
@@ -55,6 +57,8 @@
<toolitem action="RemoveAction"/>
<toolitem action="RotateLeftAction"/>
<toolitem action="RotateRightAction"/>
+ <separator/>
+ <!-- Commented out until we have a good icon <toolitem action="OpenInViewerAction"/>-->
</toolbar>
<popup name="PageContextMenu" action="PageContextMenuAction">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]