[gnome-documents] preview: Rename to EvinceView
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] preview: Rename to EvinceView
- Date: Mon, 6 Jun 2016 18:29:04 +0000 (UTC)
commit 29c4a9f7266d952fbd2774580b33d1514747a3b2
Author: Bastien Nocera <hadess hadess net>
Date: Sun Jun 5 19:19:28 2016 +0200
preview: Rename to EvinceView
This makes it clearer that this view is type-specific, similarly to the
LOKView for LibreOffice.
https://bugzilla.gnome.org/show_bug.cgi?id=767270
po/POTFILES.in | 2 +-
src/embed.js | 12 ++++----
src/{preview.js => evinceview.js} | 40 ++++++++++++++--------------
src/mainWindow.js | 2 +-
src/org.gnome.Books.src.gresource.xml | 2 +-
src/org.gnome.Documents.src.gresource.xml | 2 +-
6 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c62f820..bab1f86 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -29,7 +29,7 @@ src/notifications.js
src/password.js
src/places.js
src/presentation.js
-src/preview.js
+src/evinceview.js
src/properties.js
src/searchbar.js
src/search.js
diff --git a/src/embed.js b/src/embed.js
index 549fdad..b83368f 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -25,7 +25,6 @@ const Mainloop = imports.mainloop;
const Application = imports.application;
const MainToolbar = imports.mainToolbar;
const Password = imports.password;
-const Preview = imports.preview;
const Edit = imports.edit;
const Search = imports.search;
const Selections = imports.selections;
@@ -34,6 +33,7 @@ const WindowMode = imports.windowMode;
const Documents = imports.documents;
const EvView = imports.gi.EvinceView;
+const EvinceView = imports.evinceview;
const LOKView = imports.lokview;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
@@ -83,7 +83,7 @@ const Embed = new Lang.Class({
this._search = new View.ViewContainer(WindowMode.WindowMode.SEARCH);
this._stack.add_named(this._search, 'search');
- this._previewEv = new Preview.PreviewView(this._stackOverlay);
+ this._previewEv = new EvinceView.EvinceView(this._stackOverlay);
this._stack.add_named(this._previewEv, 'preview-ev');
this._previewLok = new LOKView.LOKView(this._stackOverlay);
@@ -273,7 +273,7 @@ const Embed = new Lang.Class({
case WindowMode.WindowMode.PREVIEW:
if (oldMode == WindowMode.WindowMode.EDIT)
Application.documentManager.reloadActiveItem();
- this._prepareForPreview();
+ this._prepareForEvinceView();
break;
case WindowMode.WindowMode.PREVIEW_LOK:
if (oldMode == WindowMode.WindowMode.EDIT)
@@ -441,14 +441,14 @@ const Embed = new Lang.Class({
this._stack.set_visible_child_name(visibleChildName);
},
- _prepareForPreview: function() {
+ _prepareForEvinceView: function() {
if (this._edit)
this._edit.setUri(null);
if (this._toolbar)
this._toolbar.destroy();
// pack the toolbar
- this._toolbar = new Preview.PreviewToolbar(this._previewEv);
+ this._toolbar = new EvinceView.EvinceViewToolbar(this._previewEv);
this._titlebar.add(this._toolbar);
this._stack.set_visible_child_name('preview-ev');
@@ -492,7 +492,7 @@ const Embed = new Lang.Class({
return this._toolbar;
},
- getPreview: function() {
+ getEvinceView: function() {
//FIXME When we can pass clicks and key presses
//to the view, we'll need to grab the real current view
return this._previewEv;
diff --git a/src/preview.js b/src/evinceview.js
similarity index 97%
rename from src/preview.js
rename to src/evinceview.js
index cb0c5b9..ad4d7fd 100644
--- a/src/preview.js
+++ b/src/evinceview.js
@@ -44,8 +44,8 @@ const Documents = imports.documents;
const _FULLSCREEN_TOOLBAR_TIMEOUT = 2; // seconds
-const PreviewView = new Lang.Class({
- Name: 'PreviewView',
+const EvinceView = new Lang.Class({
+ Name: 'EvinceView',
Extends: Gtk.Stack,
_init: function(overlay) {
@@ -83,7 +83,7 @@ const PreviewView = new Lang.Class({
this._createView();
// create context menu
- let model = this._getPreviewContextMenu();
+ let model = this._getEvinceViewContextMenu();
this._previewContextMenu = Gtk.Menu.new_from_model(model);
this._previewContextMenu.attach_to_widget(this._sw, null);
@@ -370,11 +370,11 @@ const PreviewView = new Lang.Class({
this.view.connect('external-link', Lang.bind(this,
this._handleExternalLink));
- this._navControls = new PreviewNavControls(this, this._overlay);
+ this._navControls = new EvinceViewNavControls(this, this._overlay);
this.set_visible_child_full('view', Gtk.StackTransitionType.NONE);
},
- _getPreviewContextMenu: function() {
+ _getEvinceViewContextMenu: function() {
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/Documents/ui/preview-context-menu.ui');
return builder.get_object('preview-context-menu');
@@ -404,7 +404,7 @@ const PreviewView = new Lang.Class({
if (fullscreen) {
// create fullscreen toolbar (hidden by default)
- this._fsToolbar = new PreviewFullscreenToolbar(this);
+ this._fsToolbar = new EvinceViewFullscreenToolbar(this);
this._fsToolbar.setModel(this._model);
this._overlay.add_overlay(this._fsToolbar);
@@ -607,13 +607,13 @@ const PreviewView = new Lang.Class({
return this._lastSearch;
}
});
-Utils.addJSSignalMethods(PreviewView.prototype);
+Utils.addJSSignalMethods(EvinceView.prototype);
const _PREVIEW_NAVBAR_MARGIN = 30;
const _AUTO_HIDE_TIMEOUT = 2;
-const PreviewNavControls = new Lang.Class({
- Name: 'PreviewNavControls',
+const EvinceViewNavControls = new Lang.Class({
+ Name: 'EvinceViewNavControls',
_init: function(previewView, overlay) {
this._previewView = previewView;
@@ -837,8 +837,8 @@ const PreviewNavControls = new Lang.Class({
}
});
-const PreviewToolbar = new Lang.Class({
- Name: 'PreviewToolbar',
+const EvinceViewToolbar = new Lang.Class({
+ Name: 'EvinceViewToolbar',
Extends: MainToolbar.MainToolbar,
_init: function(previewView) {
@@ -866,7 +866,7 @@ const PreviewToolbar = new Lang.Class({
}));
// menu button, on the right of the toolbar
- let previewMenu = this._getPreviewMenu();
+ let previewMenu = this._getEvinceViewMenu();
let menuButton = new Gtk.MenuButton({ image: new Gtk.Image ({ icon_name: 'open-menu-symbolic' }),
menu_model: previewMenu,
action_name: 'app.gear-menu' });
@@ -910,7 +910,7 @@ const PreviewToolbar = new Lang.Class({
this._searchAction.enabled = (hasPages && isFind);
},
- _getPreviewMenu: function() {
+ _getEvinceViewMenu: function() {
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/Documents/ui/preview-menu.ui');
let menu = builder.get_object('preview-menu');
@@ -926,7 +926,7 @@ const PreviewToolbar = new Lang.Class({
},
createSearchbar: function() {
- return new PreviewSearchbar(this._previewView);
+ return new EvinceViewSearchbar(this._previewView);
},
_setToolbarTitle: function() {
@@ -950,8 +950,8 @@ const PreviewToolbar = new Lang.Class({
}
});
-const PreviewSearchbar = new Lang.Class({
- Name: 'PreviewSearchbar',
+const EvinceViewSearchbar = new Lang.Class({
+ Name: 'EvinceViewSearchbar',
Extends: Searchbar.Searchbar,
_init: function(previewView) {
@@ -1021,14 +1021,14 @@ const PreviewSearchbar = new Lang.Class({
}
});
-const PreviewFullscreenToolbar = new Lang.Class({
- Name: 'PreviewFullscreenToolbar',
+const EvinceViewFullscreenToolbar = new Lang.Class({
+ Name: 'EvinceViewFullscreenToolbar',
Extends: Gtk.Revealer,
_init: function(previewView) {
this.parent({ valign: Gtk.Align.START });
- this._toolbar = new PreviewToolbar(previewView);
+ this._toolbar = new EvinceViewToolbar(previewView);
this.add(this._toolbar);
this.show();
@@ -1076,4 +1076,4 @@ const PreviewFullscreenToolbar = new Lang.Class({
Application.application.change_action_state('search', GLib.Variant.new('b', false));
}
});
-Utils.addJSSignalMethods(PreviewFullscreenToolbar.prototype);
+Utils.addJSSignalMethods(EvinceViewFullscreenToolbar.prototype);
diff --git a/src/mainWindow.js b/src/mainWindow.js
index a298bd6..442b661 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -235,7 +235,7 @@ const MainWindow = new Lang.Class({
let keyval = event.get_keyval()[1];
let fullscreen = Application.modeController.getFullscreen();
let def_mod_mask = Gtk.accelerator_get_default_mod_mask();
- let preview = this._embed.getPreview();
+ let preview = this._embed.getEvinceView();
let state = event.get_state()[1];
if (keyval == Gdk.KEY_Escape) {
diff --git a/src/org.gnome.Books.src.gresource.xml b/src/org.gnome.Books.src.gresource.xml
index 61407f7..1448541 100644
--- a/src/org.gnome.Books.src.gresource.xml
+++ b/src/org.gnome.Books.src.gresource.xml
@@ -17,7 +17,7 @@
<file>password.js</file>
<file>places.js</file>
<file>presentation.js</file>
- <file>preview.js</file>
+ <file>evinceview.js</file>
<file>properties.js</file>
<file>query.js</file>
<file>searchbar.js</file>
diff --git a/src/org.gnome.Documents.src.gresource.xml b/src/org.gnome.Documents.src.gresource.xml
index a3b26db..3ad150b 100644
--- a/src/org.gnome.Documents.src.gresource.xml
+++ b/src/org.gnome.Documents.src.gresource.xml
@@ -17,7 +17,7 @@
<file>password.js</file>
<file>places.js</file>
<file>presentation.js</file>
- <file>preview.js</file>
+ <file>evinceview.js</file>
<file>properties.js</file>
<file>query.js</file>
<file>searchbar.js</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]