[gnome-documents] Port to package.js



commit a2b86b54b9207e967bd477dd267571b15c35a2c1
Author: Alessandro Bono <shadow openaliasbox org>
Date:   Sun Aug 9 16:51:49 2015 +0200

    Port to package.js
    
    According to: https://wiki.gnome.org/Projects/Gjs/Package
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750861

 configure.ac                                       |    3 +-
 data/Makefile.am                                   |   28 ++++++++-
 src/resources/Adwaita.css => data/application.css  |    4 +-
 .../media}/collections-placeholder.png             |  Bin 686 -> 686 bytes
 {src/resources => data/media}/dnd-counter.svg      |    0
 {src/resources => data/media}/thumbnail-frame.png  |  Bin 832 -> 832 bytes
 data/org.gnome.Documents.data.gresource.xml        |   13 ++++
 {src/resources => data/ui}/app-menu.ui             |    0
 {src/resources => data/ui}/preview-context-menu.ui |    0
 {src/resources => data/ui}/preview-menu.ui         |    0
 {src/resources => data/ui}/selection-menu.ui       |    0
 po/POTFILES.in                                     |    8 +-
 src/Makefile-js.am                                 |   37 ----------
 src/Makefile.am                                    |   70 +++++++++++++++-----
 src/application.js                                 |   24 +------
 src/documents.js                                   |    3 +-
 src/gnome-books.in                                 |   20 ------
 src/gnome-documents.gresource.xml                  |   13 ----
 src/gnome-documents.in                             |   20 ------
 src/main.js                                        |   20 +++++-
 src/mainBooks.js                                   |   31 ---------
 src/mainToolbar.js                                 |    2 +-
 src/org.gnome.Books.in                             |    6 ++
 src/org.gnome.Books.src.gresource.xml              |   34 ++++++++++
 src/org.gnome.Documents.in                         |    6 ++
 src/org.gnome.Documents.src.gresource.xml          |   34 ++++++++++
 src/path.js.in                                     |    4 -
 src/preview.js                                     |    4 +-
 src/selections.js                                  |    2 +-
 src/shellSearchProvider.js                         |    1 -
 30 files changed, 204 insertions(+), 183 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ede904c..b3c8473 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,8 +104,7 @@ LIBGD_INIT([
   gir
 ])
 
-GJS_CONSOLE=`$PKG_CONFIG --variable=gjs_console gjs-1.0`
-AC_SUBST(GJS_CONSOLE)
+AC_PATH_PROG([GJS],[gjs])
 
 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
 AC_SUBST(GLIB_COMPILE_RESOURCES)
diff --git a/data/Makefile.am b/data/Makefile.am
index 1a628a1..06d66b9 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,5 +1,21 @@
 SUBDIRS = icons
 
+appdir = $(pkgdatadir)
+
+app_resource_files =                                                   \
+       $(shell $(GLIB_COMPILE_RESOURCES)                               \
+               --sourcedir=$(srcdir)                                   \
+               --generate-dependencies                                 \
+               $(srcdir)/org.gnome.Documents.data.gresource.xml        \
+       )
+org.gnome.Documents.data.gresource: org.gnome.Documents.data.gresource.xml $(app_resource_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES)                           \
+               --target=$@                                             \
+               --sourcedir=$(srcdir) $<
+
+resourcedir = $(pkgdatadir)
+resource_DATA = org.gnome.Documents.data.gresource
+
 appdatadir = $(datadir)/appdata
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 appdata_in_files = \
@@ -32,12 +48,22 @@ gsettings_SCHEMAS = org.gnome.documents.gschema.xml org.gnome.books.gschema.xml
 
 EXTRA_DIST= \
     $(appdata_in_files) \
+    $(app_resource_files) \
     $(desktop_in_files) \
     $(searchprovider_DATA) \
-    $(gsettings_SCHEMAS)
+    $(gsettings_SCHEMAS) \
+    org.gnome.Documents.data.gresource.xml
 
 CLEANFILES = \
+    org.gnome.Documents.data.gresource \
     $(appdata_DATA) \
     $(desktop_DATA)
 
+install-exec-hook:
+       -rm -f $(appdir)/org.gnome.Books.data.gresource
+       $(LN_S) $(appdir)/org.gnome.Documents.data.gresource 
$(DESTDIR)$(appdir)/org.gnome.Books.data.gresource
+uninstall-hook:
+       -rm -f $(appdir)/org.gnome.Books.data.gresource
+
+
 -include $(top_srcdir)/git.mk
diff --git a/src/resources/Adwaita.css b/data/application.css
similarity index 95%
rename from src/resources/Adwaita.css
rename to data/application.css
index 1811d81..edd68fe 100644
--- a/src/resources/Adwaita.css
+++ b/data/application.css
@@ -43,7 +43,7 @@ GdMainIconView.content-view.cell:active {
 }
 
 .documents-counter {
-    background-image: url("dnd-counter.svg");
+    background-image: url("ui/dnd-counter.svg");
     background-size: contain;
     background-color: transparent;
     color: @theme_base_color;
@@ -89,7 +89,7 @@ GdMainIconView.content-view.cell:active {
 .content-view.document-page {
     border-style: solid;
     border-width: 3px 3px 6px 4px;
-    border-image: url("thumbnail-frame.png") 3 3 6 4;
+    border-image: url("ui/thumbnail-frame.png") 3 3 6 4;
 }
 
 .osd .page-thumbnail {
diff --git a/src/resources/dnd-counter.svg b/data/media/dnd-counter.svg
similarity index 100%
rename from src/resources/dnd-counter.svg
rename to data/media/dnd-counter.svg
diff --git a/data/org.gnome.Documents.data.gresource.xml b/data/org.gnome.Documents.data.gresource.xml
new file mode 100644
index 0000000..cd0d41e
--- /dev/null
+++ b/data/org.gnome.Documents.data.gresource.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/Documents">
+    <file>application.css</file>
+    <file preprocess="xml-stripblanks">ui/app-menu.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/selection-menu.ui</file>
+    <file alias="ui/collections-placeholder.png" 
preprocess="to-pixdata">media/collections-placeholder.png</file>
+    <file alias="ui/dnd-counter.svg" preprocess="to-pixdata">media/dnd-counter.svg</file>
+    <file alias="ui/thumbnail-frame.png" preprocess="to-pixdata">media/thumbnail-frame.png</file>
+  </gresource>
+</gresources>
diff --git a/src/resources/app-menu.ui b/data/ui/app-menu.ui
similarity index 100%
rename from src/resources/app-menu.ui
rename to data/ui/app-menu.ui
diff --git a/src/resources/preview-context-menu.ui b/data/ui/preview-context-menu.ui
similarity index 100%
rename from src/resources/preview-context-menu.ui
rename to data/ui/preview-context-menu.ui
diff --git a/src/resources/preview-menu.ui b/data/ui/preview-menu.ui
similarity index 100%
rename from src/resources/preview-menu.ui
rename to data/ui/preview-menu.ui
diff --git a/src/resources/selection-menu.ui b/data/ui/selection-menu.ui
similarity index 100%
rename from src/resources/selection-menu.ui
rename to data/ui/selection-menu.ui
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fb4682a..e4e3a53 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -5,6 +5,10 @@ data/org.gnome.books.gschema.xml
 data/org.gnome.Documents.appdata.xml.in
 data/org.gnome.Documents.desktop.in
 data/org.gnome.documents.gschema.xml
+[type: gettext/glade]data/ui/app-menu.ui
+[type: gettext/glade]data/ui/preview-context-menu.ui
+[type: gettext/glade]data/ui/preview-menu.ui
+[type: gettext/glade]data/ui/selection-menu.ui
 src/application.js
 src/documents.js
 src/edit.js
@@ -22,10 +26,6 @@ src/places.js
 src/presentation.js
 src/preview.js
 src/properties.js
-[type: gettext/glade]src/resources/app-menu.ui
-[type: gettext/glade]src/resources/preview-context-menu.ui
-[type: gettext/glade]src/resources/preview-menu.ui
-[type: gettext/glade]src/resources/selection-menu.ui
 src/searchbar.js
 src/search.js
 src/selections.js
diff --git a/src/Makefile-js.am b/src/Makefile-js.am
index 7e1ef60..39276ee 100644
--- a/src/Makefile-js.am
+++ b/src/Makefile-js.am
@@ -1,36 +1,3 @@
-jsdir = $(pkgdatadir)/js/
-dist_js_DATA = \
-    application.js \
-    changeMonitor.js \
-    documents.js \
-    edit.js \
-    embed.js \
-    errorBox.js \
-    main.js \
-    mainBooks.js \
-    mainToolbar.js \
-    mainWindow.js \
-    manager.js \
-    miners.js \
-    notifications.js \
-    password.js \
-    places.js \
-    presentation.js \
-    preview.js \
-    properties.js\
-    query.js \
-    search.js \
-    searchbar.js \
-    selections.js \
-    sharing.js \
-    shellSearchProvider.js \
-    trackerController.js \
-    trackerUtils.js \
-    utils.js \
-    view.js \
-    windowMode.js \
-    path.js
-
 BUILT_SOURCES += \
     path.js \
     config.js
@@ -40,10 +7,6 @@ path.js: Makefile path.js.in
 config.js: Makefile config.js.in
        $(AM_V_GEN) $(do_subst) $(srcdir)/config.js.in > $@
 
-nodist_js_DATA = \
-    path.js \
-    config.js
-
 CLEANFILES += \
     $(BUILT_SOURCES)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index c11023f..974ac9b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,6 +11,9 @@ AM_CPPFLAGS = \
 girdir = $(pkgdatadir)/gir-1.0
 typelibdir = $(pkglibdir)/girepository-1.0
 
+appdir = $(pkgdatadir)
+nodist_app_SCRIPTS = org.gnome.Documents org.gnome.Books
+
 BUILT_SOURCES =
 EXTRA_DIST =
 CLEANFILES =
@@ -18,7 +21,6 @@ pkglib_LTLIBRARIES =
 INTROSPECTION_GIRS =
 gir_DATA =
 typelib_DATA =
-bin_SCRIPTS =
 libexec_PROGRAMS =
 libexec_SCRIPTS =
 
@@ -32,24 +34,48 @@ do_subst = sed -e 's|@abs_top_srcdir[ ]|$(abs_top_srcdir)|g' \
                -e 's|@libexecdir[ ]|$(libexecdir)|g' \
                -e 's|@pkglibdir[ ]|$(pkglibdir)|g' \
                -e 's|@pkgdatadir[ ]|$(pkgdatadir)|g' \
-               -e 's|@GJS_CONSOLE[ ]|$(GJS_CONSOLE)|g' \
+               -e 's|@GJS[ ]|$(GJS)|g' \
                -e 's|@PACKAGE_NAME[ ]|$(PACKAGE_NAME)|g' \
                -e 's|@PACKAGE_VERSION[ ]|$(PACKAGE_VERSION)|g' \
-               -e 's|@GETTEXT_PACKAGE[ ]|$(GETTEXT_PACKAGE)|g'
+               -e 's|@GETTEXT_PACKAGE[ ]|$(GETTEXT_PACKAGE)|g' \
+               -e 's|@prefix[ ]|$(prefix)|g'
 
 include $(INTROSPECTION_MAKEFILE)
 include Makefile-lib.am
-include Makefile-js.am
 
-resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/gnome-documents.gresource.xml)
-gnome-documents.gresource: gnome-documents.gresource.xml $(resource_files)
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<
-EXTRA_DIST += gnome-documents.gresource.xml $(resource_files)
+documents_app_resource_files =                                         \
+       $(shell $(GLIB_COMPILE_RESOURCES)                               \
+               --sourcedir=$(srcdir)                                   \
+               --generate-dependencies                                 \
+               $(srcdir)/org.gnome.Documents.src.gresource.xml         \
+       )
+
+org.gnome.Documents.src.gresource: org.gnome.Documents.src.gresource.xml $(documents_app_resource_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES)                           \
+               --target=$@                                             \
+               --sourcedir=$(srcdir) $<
+
+books_app_resource_files =                                             \
+       $(shell $(GLIB_COMPILE_RESOURCES)                               \
+               --sourcedir=$(srcdir)                                   \
+               --generate-dependencies                                 \
+               $(srcdir)/org.gnome.Books.src.gresource.xml             \
+       )
+
+org.gnome.Books.src.gresource: org.gnome.Books.src.gresource.xml $(books_app_resource_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES)                           \
+               --target=$@                                             \
+               --sourcedir=$(srcdir) $<
 
 resourcedir = $(pkgdatadir)
-resource_DATA = gnome-documents.gresource
+resource_DATA = org.gnome.Documents.src.gresource org.gnome.Books.src.gresource
 
-CLEANFILES += gnome-documents.gresource
+CLEANFILES += $(resource_DATA)
+EXTRA_DIST += \
+    $(documents_app_resource_files) \
+    $(books_app_resource_files) \
+    org.gnome.Documents.src.gresource.xml \
+    org.gnome.Books.src.gresource.xml
 
 gir_DATA += $(INTROSPECTION_GIRS)
 typelib_DATA += $(gir_DATA:.gir=.typelib)
@@ -69,20 +95,28 @@ org.gnome.Books.service: org.gnome.Books.service.in
 CLEANFILES += $(service_DATA)
 EXTRA_DIST += $(service_in_files)
 
-bin_SCRIPTS += gnome-documents
-gnome-documents: gnome-documents.in
+org.gnome.Documents: org.gnome.Documents.in
        $(AM_V_GEN) $(do_subst) $< > $@
        chmod +x $@
 
-CLEANFILES += gnome-documents
-EXTRA_DIST += gnome-documents.in
+CLEANFILES += org.gnome.Documents
+EXTRA_DIST += org.gnome.Documents.in
 
-bin_SCRIPTS += gnome-books
-gnome-books: gnome-books.in
+org.gnome.Books: org.gnome.Books.in
        $(AM_V_GEN) $(do_subst) $< > $@
        chmod +x $@
 
-CLEANFILES += gnome-books
-EXTRA_DIST += gnome-books.in
+CLEANFILES += org.gnome.Books
+EXTRA_DIST += org.gnome.Books.in
+
+install-exec-hook:
+       $(MKDIR_P) $(DESTDIR)$(bindir)
+       -rm -f $(DESTDIR)$(bindir)/gnome-documents
+       -rm -f $(DESTDIR)$(bindir)/gnome-books
+       $(LN_S) $(appdir)/org.gnome.Documents $(DESTDIR)$(bindir)/gnome-documents
+       $(LN_S) $(appdir)/org.gnome.Books $(DESTDIR)$(bindir)/gnome-books
+uninstall-hook:
+       -rm -f $(DESTDIR)$(bindir)/gnome-documents
+       -rm -f $(DESTDIR)$(bindir)/gnome-books
 
 -include $(top_srcdir)/git.mk
diff --git a/src/application.js b/src/application.js
index 943e49b..9a02527 100644
--- a/src/application.js
+++ b/src/application.js
@@ -22,18 +22,8 @@
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
-const Gettext = imports.gettext;
 const _ = imports.gettext.gettext;
 
-// Import versions go here
-imports.gi.versions.GdPrivate = '1.0';
-imports.gi.versions.Gd = '1.0';
-imports.gi.versions.Tracker = '1.0';
-imports.gi.versions.TrackerControl = '1.0';
-imports.gi.versions.EvinceDocument = '3.0';
-imports.gi.versions.Goa = '1.0';
-imports.gi.versions.WebKit2 = '4.0';
-
 const EvDoc = imports.gi.EvinceDocument;
 const GdPrivate = imports.gi.GdPrivate;
 const Gdk = imports.gi.Gdk;
@@ -53,7 +43,6 @@ const MainToolbar = imports.mainToolbar;
 const Manager = imports.manager;
 const Miners = imports.miners;
 const Notifications = imports.notifications;
-const Path = imports.path;
 const Properties = imports.properties;
 const Query = imports.query;
 const Search = imports.search;
@@ -120,15 +109,11 @@ const Application = new Lang.Class({
 
         this.isBooks = isBooks;
 
-        Gettext.bindtextdomain('gnome-documents', Path.LOCALE_DIR);
-        Gettext.textdomain('gnome-documents');
         let appid;
         if (!this.isBooks) {
-            GLib.set_prgname('gnome-documents');
             GLib.set_application_name(_("Documents"));
             appid = 'org.gnome.Documents';
         } else {
-            GLib.set_prgname('gnome-books');
             GLib.set_application_name(_("Books"));
             appid = 'org.gnome.Books';
         }
@@ -147,7 +132,7 @@ const Application = new Lang.Class({
         let languages = GLib.get_language_names();
         let files = languages.map(
             function(language) {
-                return Gio.File.new_for_path(Path.RESOURCE_DIR + '/getting-started/' + language +
+                return Gio.File.new_for_path(pkg.pkgdatadir + '/getting-started/' + language +
                     '/gnome-documents-getting-started.pdf');
             });
 
@@ -338,7 +323,7 @@ const Application = new Lang.Class({
 
     _initAppMenu: function() {
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/documents/app-menu.ui');
+        builder.add_from_resource('/org/gnome/Documents/ui/app-menu.ui');
 
         let menu = builder.get_object('app-menu');
         this.set_app_menu(menu);
@@ -473,7 +458,7 @@ const Application = new Lang.Class({
         if (gtkSettings.gtk_theme_name == 'Adwaita') {
             if (cssProvider == null) {
                 cssProvider = new Gtk.CssProvider();
-                let file = Gio.File.new_for_uri("resource:///org/gnome/documents/Adwaita.css");
+                let file = Gio.File.new_for_uri("resource:///org/gnome/Documents/application.css");
                 cssProvider.load_from_file(file);
             }
 
@@ -491,9 +476,6 @@ const Application = new Lang.Class({
 
         EvDoc.init();
 
-        let resource = Gio.Resource.load(Path.RESOURCE_DIR + '/gnome-documents.gresource');
-        resource._register();
-
         application = this;
         if (!application.isBooks)
             settings = new Gio.Settings({ schema_id: 'org.gnome.documents' });
diff --git a/src/documents.js b/src/documents.js
index 2c95d34..e5e34b7 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -39,7 +39,6 @@ const Application = imports.application;
 const ChangeMonitor = imports.changeMonitor;
 const Manager = imports.manager;
 const Notifications = imports.notifications;
-const Path = imports.path;
 const Query = imports.query;
 const Search = imports.search;
 const TrackerUtils = imports.trackerUtils;
@@ -563,7 +562,7 @@ const DocCommon = new Lang.Class({
         if (this._thumbPath) {
             let [ slice, border ] = Utils.getThumbnailFrameBorder();
             thumbnailedPixbuf = Gd.embed_image_in_frame(emblemedPixbuf,
-                'resource:///org/gnome/documents/thumbnail-frame.png',
+                'resource:///org/gnome/Documents/ui/thumbnail-frame.png',
                 slice, border);
         } else {
             thumbnailedPixbuf = emblemedPixbuf;
diff --git a/src/main.js b/src/main.js
index ec08fb3..1445217 100644
--- a/src/main.js
+++ b/src/main.js
@@ -19,13 +19,27 @@
  *
  */
 
+pkg.initGettext();
+pkg.initFormat();
+pkg.require({ 'EvinceDocument': '3.0',
+              'Gd': '1.0',
+              'GdPrivate': '1.0',
+              'Gio': '2.0',
+              'GLib': '2.0',
+              'Goa': '1.0',
+              'Gtk': '3.0',
+              'GObject': '2.0',
+              'Tracker': '1.0',
+              'TrackerControl': '1.0',
+              'WebKit2': '4.0' });
+
 const Application = imports.application;
 const GLib = imports.gi.GLib;
 const System = imports.system;
 
-function start() {
-    let application = new Application.Application(false);
+function main(args) {
+    let application = new Application.Application(pkg.name == 'org.gnome.Books');
     if (GLib.getenv('DOCUMENTS_PERSIST'))
         application.hold();
-    return application.run([System.programInvocationName].concat(ARGV));
+    return application.run(args);
 }
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 5b5b5de..2352471 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -116,7 +116,7 @@ const OverviewToolbar = new Lang.Class({
         this.parent();
 
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/documents/selection-menu.ui');
+        builder.add_from_resource('/org/gnome/Documents/ui/selection-menu.ui');
         let selectionMenu = builder.get_object('selection-menu');
         this._selectionMenu = new Gtk.MenuButton({ menu_model: selectionMenu });
         this._selectionMenu.get_style_context().add_class('selection-menu');
diff --git a/src/org.gnome.Books.in b/src/org.gnome.Books.in
new file mode 100644
index 0000000..675b983
--- /dev/null
+++ b/src/org.gnome.Books.in
@@ -0,0 +1,6 @@
+#! GJS@
+imports.package.init({ name: "gnome-documents",
+                       version: "@PACKAGE_VERSION@",
+                       prefix: "@prefix@",
+                       libdir: "@libdir@" });
+imports.package.run(imports.main);
diff --git a/src/org.gnome.Books.src.gresource.xml b/src/org.gnome.Books.src.gresource.xml
new file mode 100644
index 0000000..3e4c5e8
--- /dev/null
+++ b/src/org.gnome.Books.src.gresource.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/Books/js">
+    <file>application.js</file>
+    <file>changeMonitor.js</file>
+    <file>documents.js</file>
+    <file>edit.js</file>
+    <file>embed.js</file>
+    <file>errorBox.js</file>
+    <file>main.js</file>
+    <file>mainToolbar.js</file>
+    <file>mainWindow.js</file>
+    <file>manager.js</file>
+    <file>miners.js</file>
+    <file>notifications.js</file>
+    <file>password.js</file>
+    <file>places.js</file>
+    <file>presentation.js</file>
+    <file>preview.js</file>
+    <file>properties.js</file>
+    <file>query.js</file>
+    <file>searchbar.js</file>
+    <file>search.js</file>
+    <file>selections.js</file>
+    <file>sharing.js</file>
+    <file>shellSearchProvider.js</file>
+    <file>testentry.js</file>
+    <file>trackerController.js</file>
+    <file>trackerUtils.js</file>
+    <file>utils.js</file>
+    <file>view.js</file>
+    <file>windowMode.js</file>
+  </gresource>
+</gresources>
diff --git a/src/org.gnome.Documents.in b/src/org.gnome.Documents.in
new file mode 100644
index 0000000..675b983
--- /dev/null
+++ b/src/org.gnome.Documents.in
@@ -0,0 +1,6 @@
+#! GJS@
+imports.package.init({ name: "gnome-documents",
+                       version: "@PACKAGE_VERSION@",
+                       prefix: "@prefix@",
+                       libdir: "@libdir@" });
+imports.package.run(imports.main);
diff --git a/src/org.gnome.Documents.src.gresource.xml b/src/org.gnome.Documents.src.gresource.xml
new file mode 100644
index 0000000..a2baba3
--- /dev/null
+++ b/src/org.gnome.Documents.src.gresource.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/Documents/js">
+    <file>application.js</file>
+    <file>changeMonitor.js</file>
+    <file>documents.js</file>
+    <file>edit.js</file>
+    <file>embed.js</file>
+    <file>errorBox.js</file>
+    <file>main.js</file>
+    <file>mainToolbar.js</file>
+    <file>mainWindow.js</file>
+    <file>manager.js</file>
+    <file>miners.js</file>
+    <file>notifications.js</file>
+    <file>password.js</file>
+    <file>places.js</file>
+    <file>presentation.js</file>
+    <file>preview.js</file>
+    <file>properties.js</file>
+    <file>query.js</file>
+    <file>searchbar.js</file>
+    <file>search.js</file>
+    <file>selections.js</file>
+    <file>sharing.js</file>
+    <file>shellSearchProvider.js</file>
+    <file>testentry.js</file>
+    <file>trackerController.js</file>
+    <file>trackerUtils.js</file>
+    <file>utils.js</file>
+    <file>view.js</file>
+    <file>windowMode.js</file>
+  </gresource>
+</gresources>
diff --git a/src/preview.js b/src/preview.js
index 723034e..1e78b86 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -367,7 +367,7 @@ const PreviewView = new Lang.Class({
 
     _getPreviewContextMenu: function() {
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/documents/preview-context-menu.ui');
+        builder.add_from_resource('/org/gnome/Documents/ui/preview-context-menu.ui');
         return builder.get_object('preview-context-menu');
     },
 
@@ -890,7 +890,7 @@ const PreviewToolbar = new Lang.Class({
 
     _getPreviewMenu: function() {
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/documents/preview-menu.ui');
+        builder.add_from_resource('/org/gnome/Documents/ui/preview-menu.ui');
         let menu = builder.get_object('preview-menu');
 
         let doc = Application.documentManager.getActiveItem();
diff --git a/src/selections.js b/src/selections.js
index 507e5ba..004cee2 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -456,7 +456,7 @@ const OrganizeCollectionView = new Lang.Class({
                                        margin_top: 64 });
         this.add_overlay(this._msgGrid);
 
-        this._icon = new Gtk.Image({ resource: '/org/gnome/documents/collections-placeholder.png' });
+        this._icon = new Gtk.Image({ resource: '/org/gnome/Documents/ui/collections-placeholder.png' });
         this._msgGrid.add(this._icon);
 
         this._label = new Gtk.Label({
diff --git a/src/shellSearchProvider.js b/src/shellSearchProvider.js
index 6f77a24..d4062f0 100644
--- a/src/shellSearchProvider.js
+++ b/src/shellSearchProvider.js
@@ -32,7 +32,6 @@ const Tracker = imports.gi.Tracker;
 
 const Application = imports.application;
 const Format = imports.format;
-const Path = imports.path;
 const Query = imports.query;
 const Search = imports.search;
 const TrackerUtils = imports.trackerUtils;


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