[gnome-documents] preview: change the "Open" menu item description to include the app name



commit 9a337b78cf524ee5ca69317946005d898f1fb8d7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jul 19 15:19:24 2012 -0400

    preview: change the "Open" menu item description to include the app name
    
    See also https://bugzilla.gnome.org/show_bug.cgi?id=661598

 src/preview.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/preview.js b/src/preview.js
index bf07b3c..a6fccd4 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -316,7 +316,7 @@ const PreviewToolbar = new Lang.Class({
 
         // menu button, on the right of the toolbar
         let menuModel = new Gio.Menu();
-        menuModel.append_item(Gio.MenuItem.new(_("Open"), 'app.open-current'));
+        menuModel.append_item(Gio.MenuItem.new(this._getOpenItemLabel(), 'app.open-current'));
         menuModel.append_item(Gio.MenuItem.new(_("Print"), 'app.print-current'));
 
         let menuButton = this.widget.add_menu('emblem-system-symbolic', null, false);
@@ -326,6 +326,14 @@ const PreviewToolbar = new Lang.Class({
         this.widget.show_all();
     },
 
+    _getOpenItemLabel: function() {
+        let doc = Global.documentManager.getActiveItem();
+        if (!doc || (doc && !doc.defaultAppName))
+            return _("Open");
+
+        return _("Open with %s").format(doc.defaultAppName);
+    },
+
     createSearchbar: function() {
         this._searchbar = new PreviewSearchbar(this._previewView);
         this.layout.pack_start = false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]