[gnome-documents/wip/lokdocview-rebase: 4/19] Use the same hamburger menu definition for both EvView and LOKDocView
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/lokdocview-rebase: 4/19] Use the same hamburger menu definition for both EvView and LOKDocView
- Date: Mon, 4 Jan 2016 16:53:38 +0000 (UTC)
commit e3951a0782cffb0616d5178cd6b5a67713e42743
Author: Bastien Nocera <hadess hadess net>
Date: Fri Dec 4 17:52:53 2015 +0100
Use the same hamburger menu definition for both EvView and LOKDocView
... and remove the items which we are not supported yet (rotation,
print and edit). As a nice side-effect, we get a few extra items that
we didn't have before.
https://bugzilla.gnome.org/show_bug.cgi?id=753686
data/org.gnome.Documents.data.gresource.xml | 1 -
data/ui/lokview-menu.ui | 16 ----------------
src/application.js | 6 ++++--
src/lokview.js | 23 +++++++++++++++++++++--
4 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/data/org.gnome.Documents.data.gresource.xml b/data/org.gnome.Documents.data.gresource.xml
index 3a6be94..e374424 100644
--- a/data/org.gnome.Documents.data.gresource.xml
+++ b/data/org.gnome.Documents.data.gresource.xml
@@ -6,7 +6,6 @@
<file preprocess="xml-stripblanks">ui/organize-collection-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/preview-context-menu.ui</file>
<file preprocess="xml-stripblanks">ui/preview-menu.ui</file>
- <file preprocess="xml-stripblanks">ui/lokview-menu.ui</file>
<file preprocess="xml-stripblanks">ui/selection-menu.ui</file>
<file preprocess="xml-stripblanks">ui/selection-toolbar.ui</file>
<file preprocess="xml-stripblanks">ui/view-menu.ui</file>
diff --git a/src/application.js b/src/application.js
index 8a69823..78e435f 100644
--- a/src/application.js
+++ b/src/application.js
@@ -574,7 +574,8 @@ const Application = new Lang.Class({
WindowMode.WindowMode.SEARCH] },
{ name: 'open-current',
callback: this._onActionOpenCurrent,
- window_mode: WindowMode.WindowMode.PREVIEW },
+ window_modes: [WindowMode.WindowMode.PREVIEW,
+ WindowMode.WindowMode.PREVIEW_LOK] },
{ name: 'edit-current' },
{ name: 'view-current',
window_mode: WindowMode.WindowMode.EDIT },
@@ -613,7 +614,8 @@ const Application = new Lang.Class({
WindowMode.WindowMode.SEARCH] },
{ name: 'properties',
callback: this._onActionProperties,
- window_mode: WindowMode.WindowMode.PREVIEW },
+ window_modes: [WindowMode.WindowMode.PREVIEW,
+ WindowMode.WindowMode.PREVIEW_LOK] },
{ name: 'bookmark-page',
callback: this._onActionToggle,
state: GLib.Variant.new('b', false),
diff --git a/src/lokview.js b/src/lokview.js
index 0b86e5e..371e9f5 100644
--- a/src/lokview.js
+++ b/src/lokview.js
@@ -179,8 +179,27 @@ const LOKViewToolbar = new Lang.Class({
_getLOKViewMenu: function() {
let builder = new Gtk.Builder();
- builder.add_from_resource('/org/gnome/Documents/ui/lokview-menu.ui');
- let menu = builder.get_object('lokview-menu');
+ builder.add_from_resource('/org/gnome/Documents/ui/preview-menu.ui');
+ let menu = builder.get_object('preview-menu');
+ let section = builder.get_object('open-section');
+
+ let doc = Application.documentManager.getActiveItem();
+ if (doc && doc.defaultAppName) {
+ section.remove(0);
+ section.prepend(_("Open with %s").format(doc.defaultAppName), 'app.open-current');
+ }
+
+ // No edit support yet
+ section.remove(1);
+ // No print support yet
+ section.remove(1);
+ // No present support yet
+ section.remove(1);
+
+ // No rotate support
+ section = builder.get_object('rotate-section');
+ section.remove(0);
+ section.remove(0);
return menu;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]