[gnome-documents] windowMode: Rename PREVIEW window mode to PREVIEW_EV



commit e7b9159c45bf1da406c38114f7f4568492029014
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Jun 5 19:42:29 2016 +0200

    windowMode: Rename PREVIEW window mode to PREVIEW_EV
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767270

 src/application.js   |   30 +++++++++++++++---------------
 src/embed.js         |   14 +++++++-------
 src/evinceview.js    |    2 +-
 src/mainWindow.js    |    4 ++--
 src/notifications.js |    2 +-
 src/windowMode.js    |    6 +++---
 6 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 4f583ee..2d5e364 100644
--- a/src/application.js
+++ b/src/application.js
@@ -537,7 +537,7 @@ const Application = new Lang.Class({
               state: GLib.Variant.new('b', false),
               create_hook: this._fullscreenCreateHook,
               accels: ['F11'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'night-mode',
               callback: this._onActionNightMode,
               create_hook: this._nightModeCreateHook,
@@ -564,7 +564,7 @@ const Application = new Lang.Class({
                              WindowMode.WindowMode.SEARCH] },
             { name: 'open-current',
               callback: this._onActionOpenCurrent,
-              window_modes: [WindowMode.WindowMode.PREVIEW,
+              window_modes: [WindowMode.WindowMode.PREVIEW_EV,
                              WindowMode.WindowMode.PREVIEW_LOK] },
             { name: 'edit-current' },
             { name: 'view-current',
@@ -576,19 +576,19 @@ const Application = new Lang.Class({
               state: GLib.Variant.new('b', false),
               accels: ['<Primary>f'] },
             { name: 'find-next', accels: ['<Primary>g'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'find-prev', accels: ['<Shift><Primary>g'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'zoom-in', accels: ['<Primary>plus', '<Primary>equal'],
-              window_modes: [WindowMode.WindowMode.PREVIEW,
+              window_modes: [WindowMode.WindowMode.PREVIEW_EV,
                              WindowMode.WindowMode.PREVIEW_LOK] },
             { name: 'zoom-out', accels: ['<Primary>minus'],
-              window_modes: [WindowMode.WindowMode.PREVIEW,
+              window_modes: [WindowMode.WindowMode.PREVIEW_EV,
                              WindowMode.WindowMode.PREVIEW_LOK] },
             { name: 'rotate-left', accels: ['<Primary>Left'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'rotate-right', accels: ['<Primary>Right'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'select-all', accels: ['<Primary>a'],
               window_modes: [WindowMode.WindowMode.COLLECTIONS,
                              WindowMode.WindowMode.DOCUMENTS,
@@ -599,19 +599,19 @@ const Application = new Lang.Class({
                              WindowMode.WindowMode.SEARCH] },
             { name: 'properties',
               callback: this._onActionProperties,
-              window_modes: [WindowMode.WindowMode.PREVIEW,
+              window_modes: [WindowMode.WindowMode.PREVIEW_EV,
                              WindowMode.WindowMode.PREVIEW_LOK] },
             { name: 'bookmark-page',
               callback: this._onActionToggle,
               state: GLib.Variant.new('b', false),
               accels: ['<Primary>d'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'places',
               accels: ['<Primary>b'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'copy',
               accels: ['<Primary>c'],
-              window_mode: WindowMode.WindowMode.PREVIEW },
+              window_mode: WindowMode.WindowMode.PREVIEW_EV },
             { name: 'search-source',
               parameter_type: 's',
               state: GLib.Variant.new('s', Search.SearchSourceStock.ALL),
@@ -635,7 +635,7 @@ const Application = new Lang.Class({
         if (!this.isBooks) {
             this._actionEntries.push (
             { name: 'present-current',
-              window_mode: WindowMode.WindowMode.PREVIEW,
+              window_mode: WindowMode.WindowMode.PREVIEW_EV,
               callback: this._onActionToggle,
               state: GLib.Variant.new('b', false),
               accels: ['F5'] });
@@ -726,7 +726,7 @@ const Application = new Lang.Class({
 
     _onActivateResult: function(provider, urn, terms, timestamp) {
         this._createWindow();
-        modeController.setWindowMode(WindowMode.WindowMode.PREVIEW);
+        modeController.setWindowMode(WindowMode.WindowMode.PREVIEW_EV);
 
         let doc = documentManager.getItemById(urn);
         if (doc) {
@@ -752,7 +752,7 @@ const Application = new Lang.Class({
             let modeChangeId = modeController.connect('window-mode-changed', Lang.bind(this,
                 function(object, newMode) {
                     if (newMode == WindowMode.WindowMode.EDIT
-                        || newMode == WindowMode.WindowMode.PREVIEW)
+                        || newMode == WindowMode.WindowMode.PREVIEW_EV)
                         return;
 
                     modeController.disconnect(modeChangeId);
diff --git a/src/embed.js b/src/embed.js
index b83368f..cc7cdc6 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -146,7 +146,7 @@ const Embed = new Lang.Class({
         case WindowMode.WindowMode.DOCUMENTS:
             view = this._documents;
             break;
-        case WindowMode.WindowMode.PREVIEW:
+        case WindowMode.WindowMode.PREVIEW_EV:
             view = this._previewEv;
             break;
         case WindowMode.WindowMode.PREVIEW_LOK:
@@ -183,7 +183,7 @@ const Embed = new Lang.Class({
         case WindowMode.WindowMode.DOCUMENTS:
             page = 'documents';
             break;
-        case WindowMode.WindowMode.PREVIEW:
+        case WindowMode.WindowMode.PREVIEW_EV:
             page = 'preview-ev';
             break;
         case WindowMode.WindowMode.SEARCH:
@@ -232,7 +232,7 @@ const Embed = new Lang.Class({
         let windowMode = Application.modeController.getWindowMode();
         if (windowMode == WindowMode.WindowMode.SEARCH && doc)
             return;
-        if (windowMode == WindowMode.WindowMode.PREVIEW)
+        if (windowMode == WindowMode.WindowMode.PREVIEW_EV)
             return;
 
         let searchType = Application.searchTypeManager.getActiveItem();
@@ -270,7 +270,7 @@ const Embed = new Lang.Class({
         case WindowMode.WindowMode.SEARCH:
             this._prepareForOverview(newMode, oldMode);
             break;
-        case WindowMode.WindowMode.PREVIEW:
+        case WindowMode.WindowMode.PREVIEW_EV:
             if (oldMode == WindowMode.WindowMode.EDIT)
                 Application.documentManager.reloadActiveItem();
             this._prepareForEvinceView();
@@ -319,7 +319,7 @@ const Embed = new Lang.Class({
 
     _onActiveItemChanged: function(manager, doc) {
         let windowMode = Application.modeController.getWindowMode();
-        let showSearch = (windowMode == WindowMode.WindowMode.PREVIEW && !doc
+        let showSearch = (windowMode == WindowMode.WindowMode.PREVIEW_EV && !doc
                           || windowMode == WindowMode.WindowMode.SEARCH && !doc);
         if (showSearch)
             this._restoreSearch();
@@ -340,7 +340,7 @@ const Embed = new Lang.Class({
         if (LOKView.isOpenDocumentFormat(doc.mimeType))
             Application.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW_LOK);
         else
-            Application.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW);
+            Application.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW_EV);
 
         this._clearLoadTimer();
         this._loadShowId = Mainloop.timeout_add(_PDF_LOADER_TIMEOUT, Lang.bind(this,
@@ -486,7 +486,7 @@ const Embed = new Lang.Class({
         let windowMode = Application.modeController.getWindowMode();
         let fullscreen = Application.modeController.getFullscreen();
 
-        if (fullscreen && (windowMode == WindowMode.WindowMode.PREVIEW))
+        if (fullscreen && (windowMode == WindowMode.WindowMode.PREVIEW_EV))
             return this._previewEv.getFullscreenToolbar();
         else
             return this._toolbar;
diff --git a/src/evinceview.js b/src/evinceview.js
index ad4d7fd..07b4de8 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -392,7 +392,7 @@ const EvinceView = new Lang.Class({
 
     _onWindowModeChanged: function() {
         let windowMode = Application.modeController.getWindowMode();
-        if (windowMode != WindowMode.WindowMode.PREVIEW) {
+        if (windowMode != WindowMode.WindowMode.PREVIEW_EV) {
             this.controlsVisible = false;
             this._hidePresentation();
             this._navControls.hide();
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 442b661..a1b53d5 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -151,7 +151,7 @@ const MainWindow = new Lang.Class({
             handled = false;
             break;
         case WindowMode.WindowMode.EDIT:
-        case WindowMode.WindowMode.PREVIEW:
+        case WindowMode.WindowMode.PREVIEW_EV:
             Application.documentManager.setActiveItem(null);
             Application.modeController.goBack();
             break;
@@ -193,7 +193,7 @@ const MainWindow = new Lang.Class({
         switch (Application.modeController.getWindowMode()) {
         case WindowMode.WindowMode.NONE:
             return false;
-        case WindowMode.WindowMode.PREVIEW:
+        case WindowMode.WindowMode.PREVIEW_EV:
             return this._handleKeyPreview(event);
         case WindowMode.WindowMode.COLLECTIONS:
         case WindowMode.WindowMode.DOCUMENTS:
diff --git a/src/notifications.js b/src/notifications.js
index c059501..834d079 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -191,7 +191,7 @@ const IndexingNotification = new Lang.Class({
     },
 
     _checkNotification: function() {
-        if (Application.modeController.getWindowMode() == WindowMode.WindowMode.PREVIEW) {
+        if (Application.modeController.getWindowMode() == WindowMode.WindowMode.PREVIEW_EV) {
             this._destroy(false);
             return;
         }
diff --git a/src/windowMode.js b/src/windowMode.js
index b70afc5..fd2daa2 100644
--- a/src/windowMode.js
+++ b/src/windowMode.js
@@ -25,7 +25,7 @@ const Signals = imports.signals;
 const WindowMode = {
     NONE: 0,
     DOCUMENTS: 1,
-    PREVIEW: 2,
+    PREVIEW_EV: 2,
     PREVIEW_LOK: 3,
     EDIT: 4,
     COLLECTIONS: 5,
@@ -56,7 +56,7 @@ const ModeController = new Lang.Class({
          * provider. It is easier to special case it here instead of all
          * over the code.
          */
-        if (this._mode == WindowMode.PREVIEW && oldMode == WindowMode.NONE && steps == 1)
+        if (this._mode == WindowMode.PREVIEW_EV && oldMode == WindowMode.NONE && steps == 1)
           oldMode = WindowMode.DOCUMENTS;
 
         if (oldMode == WindowMode.NONE)
@@ -108,7 +108,7 @@ const ModeController = new Lang.Class({
     },
 
     getCanFullscreen: function() {
-        return (this._mode == WindowMode.PREVIEW || this._mode == WindowMode.EDIT);
+        return (this._mode == WindowMode.PREVIEW_EV || this._mode == WindowMode.EDIT);
     }
 });
 Signals.addSignalMethods(ModeController.prototype);


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