summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--.jshintrc2
-rw-r--r--configure.ac14
-rw-r--r--data/Makefile.am70
-rw-r--r--data/org.gnome.Maps.data.gresource.xml28
-rw-r--r--data/org.gnome.Maps.desktop.in (renamed from data/org.gnome.Maps.desktop.in.in)2
-rw-r--r--data/org.gnome.Maps.gschema.xml.in (renamed from data/org.gnome.maps.gschema.xml.in)2
-rw-r--r--data/org.gnome.Maps.service.in3
-rw-r--r--po/POTFILES.in4
-rw-r--r--src/Makefile-js.am42
-rw-r--r--src/Makefile.am113
-rw-r--r--src/application.js9
-rw-r--r--src/config.js.in4
-rw-r--r--src/gnome-maps.data.gresource.xml28
-rw-r--r--src/main.c69
-rw-r--r--src/main.js4
-rw-r--r--src/mainWindow.js3
-rw-r--r--src/org.gnome.Maps.in5
-rw-r--r--src/org.gnome.Maps.src.gresource.xml (renamed from src/gnome-maps.js.gresource.xml)22
-rw-r--r--src/path.js.in4
-rw-r--r--src/routeService.js3
21 files changed, 158 insertions, 282 deletions
diff --git a/.gitignore b/.gitignore
index fe33f27a..1b190549 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,9 +19,8 @@ missing
data/org.gnome.Maps.appdata.xml
data/org.gnome.Maps.desktop
-data/org.gnome.Maps.desktop.in
-data/org.gnome.maps.gschema.valid
-data/org.gnome.maps.gschema.xml
+data/org.gnome.Maps.gschema.valid
+data/org.gnome.Maps.gschema.xml
m4/*.m4
@@ -36,10 +35,6 @@ po/*.gmo
po/*.sin
po/*.header
-src/config.js
src/gnome-maps
src/*.gresource
-src/path.js
-src/gnome-maps-js.[ch]
-src/gnome-maps-data.[ch]
src/org.gnome.Maps.service
diff --git a/.jshintrc b/.jshintrc
index bb1cdff6..cee79413 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -78,5 +78,5 @@
"white" : false, // true: Check against strict whitespace and indentation rules
// Custom Globals
- "predef" : [ "log", "logError", "print", "printerr", "imports", "ARGV" ]
+ "predef" : [ "log", "logError", "print", "printerr", "imports", "ARGV", "pkg" ]
}
diff --git a/configure.ac b/configure.ac
index 691ef8df..6c9aa1ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,9 +5,10 @@ AC_INIT([gnome-maps],
[gnome-maps])
AC_CONFIG_HEADERS([config/config.h])
-AC_CONFIG_SRCDIR([src/main.c])
+AC_CONFIG_SRCDIR([src/main.js])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
+AC_PROG_LN_S
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -32,17 +33,9 @@ PKG_CHECK_MODULES(GNOME_MAPS, [
gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_MIN_VERSION
])
-
-# no stupid static libraries
-AM_DISABLE_STATIC
-# enable libtool
-AC_PROG_LIBTOOL
-# avoid libtool for LTCOMPILE, use it only to link
-
GLIB_GSETTINGS
-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)
@@ -51,7 +44,6 @@ AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
- data/org.gnome.Maps.desktop.in
data/icons/Makefile
po/Makefile.in
])
diff --git a/data/Makefile.am b/data/Makefile.am
index 6a7a41aa..0f9370c3 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,16 +1,27 @@
SUBDIRS = icons
-# The desktop files
-desktopdir = $(datadir)/applications
-desktop_DATA = \
- org.gnome.Maps.desktop
+app_resource_files =
+ $(shell $(GLIB_COMPILE_RESOURCES) \
+ --sourcedir=$(srcdir) \
+ --generate-dependencies \
+ $(srcdir)/org.gnome.Maps.data.gresource \
+ )
+org.gnome.Maps.data.gresource: org.gnome.Maps.data.gresource.xml $(app_resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
+ --target=$@ \
+ --sourcedir=$(srcdir) $<
+
+resourcedir = $(pkgdatadir)
+resource_DATA = org.gnome.Maps.data.gresource
+
+appsdir = $(datadir)/applications
+apps_DATA = org.gnome.Maps.desktop
+
@INTLTOOL_DESKTOP_RULE@
-gsettingsschema_in_files = org.gnome.maps.gschema.xml.in
-gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
-.PRECIOUS: $(gsettings_SCHEMAS)
+gsettings_SCHEMAS = org.gnome.Maps.gschema.xml
-@INTLTOOL_XML_NOMERGE_RULE@
+@INTLTOOL_XML_RULE@
@GSETTINGS_RULES@
appdatadir = $(datadir)/appdata
@@ -18,13 +29,38 @@ appdata_in_file = org.gnome.Maps.appdata.xml.in
appdata_DATA = $(appdata_in_file:.xml.in=.xml)
@INTLTOOL_XML_RULE@
-EXTRA_DIST= \
- $(desktop_DATA) \
- $(desktop_in_files) \
- $(appdata_in_file) \
- $(gsettingsschema_in_files)
+org.gnome.Maps.service: org.gnome.Maps.service.in
+ $(AM_V_GEN) sed \
+ -e "s|[@]pkgdatadir@|$(pkgdatadir)|g" \
+ -e "s|[@]pkglibdir@|$(pkglibdir)|g" \
+ $< > $@
+
+servicedir = $(datadir)/dbus-1/services
+service_DATA = org.gnome.Maps.service
+
+EXTRA_DIST = \
+ org.gnome.Maps.desktop.in \
+ org.gnome.Maps.service.in \
+ org.gnome.Maps.data.gresource.xml \
+ org.gnome.Maps.appdata.xml.in \
+ org.gnome.Maps.gschema.xml.in \
+ $(app_resource_files) \
+ $(NULL)
+
+CLEANFILES = \
+ org.gnome.Maps.service \
+ org.gnome.Maps.data.gresource \
+ org.gnome.Maps.appdata.xml \
+ org.gnome.Maps.appdata.valid \
+ $(apps_DATA) \
+ org.gnome.Maps.gschema.xml \
+ org.gnome.Maps.gschema.valid \
+ gschemas.compiled \
+ $(gsettings_SCHEMAS) \
+ $(NULL)
+
+# For uninstalled use
+all-local:
+ $(GLIB_COMPILE_SCHEMAS) $(builddir)
-CLEANFILES = \
- $(desktop_DATA) \
- $(appdata_DATA) \
- $(gsettings_SCHEMAS)
+-include $(top_srcdir)/git.mk
diff --git a/data/org.gnome.Maps.data.gresource.xml b/data/org.gnome.Maps.data.gresource.xml
new file mode 100644
index 00000000..6b68250f
--- /dev/null
+++ b/data/org.gnome.Maps.data.gresource.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/maps">
+ <file preprocess="xml-stripblanks" alias="account-row.ui">../src/account-row.ui</file>
+ <file preprocess="xml-stripblanks" alias="app-menu.ui">../src/app-menu.ui</file>
+ <file preprocess="xml-stripblanks" alias="check-in-dialog.ui">../src/check-in-dialog.ui</file>
+ <file preprocess="xml-stripblanks" alias="context-menu.ui">../src/context-menu.ui</file>
+ <file preprocess="xml-stripblanks" alias="favorites-popover.ui">../src/favorites-popover.ui</file>
+ <file preprocess="xml-stripblanks" alias="layers-popover.ui">../src/layers-popover.ui</file>
+ <file preprocess="xml-stripblanks" alias="main-window.ui">../src/main-window.ui</file>
+ <file preprocess="xml-stripblanks" alias="map-bubble.ui">../src/map-bubble.ui</file>
+ <file preprocess="xml-stripblanks" alias="notification.ui">../src/notification.ui</file>
+ <file preprocess="xml-stripblanks" alias="place-entry.ui">../src/place-entry.ui</file>
+ <file preprocess="xml-stripblanks" alias="place-list-row.ui">../src/place-list-row.ui</file>
+ <file preprocess="xml-stripblanks" alias="route-entry.ui">../src/route-entry.ui</file>
+ <file preprocess="xml-stripblanks" alias="search-popup.ui">../src/search-popup.ui</file>
+ <file preprocess="xml-stripblanks" alias="search-result-bubble.ui">../src/search-result-bubble.ui</file>
+ <file preprocess="xml-stripblanks" alias="share-dialog.ui">../src/share-dialog.ui</file>
+ <file preprocess="xml-stripblanks" alias="sidebar.ui">../src/sidebar.ui</file>
+ <file preprocess="xml-stripblanks" alias="social-place-more-results-row.ui">../src/social-place-more-results-row.ui</file>
+ <file preprocess="xml-stripblanks" alias="social-place-row.ui">../src/social-place-row.ui</file>
+ <file preprocess="xml-stripblanks" alias="user-location-bubble.ui">../src/user-location-bubble.ui</file>
+ <file preprocess="xml-stripblanks" alias="zoom-control.ui">../src/zoom-control.ui</file>
+ <file alias="application.css">gnome-maps.css</file>
+ <file alias="maptype-aerial.png">media/maptype-aerial.png</file>
+ <file alias="maptype-street.png">media/maptype-street.png</file>
+ </gresource>
+</gresources> \ No newline at end of file
diff --git a/data/org.gnome.Maps.desktop.in.in b/data/org.gnome.Maps.desktop.in
index 9ecf8595..f3f904de 100644
--- a/data/org.gnome.Maps.desktop.in.in
+++ b/data/org.gnome.Maps.desktop.in
@@ -2,7 +2,7 @@
Version=1.0
_Name=Maps
_Comment=A simple maps application
-Exec=gnome-maps
+Exec=gapplication launch org.gnome.Maps
Icon=gnome-maps
Terminal=false
Type=Application
diff --git a/data/org.gnome.maps.gschema.xml.in b/data/org.gnome.Maps.gschema.xml.in
index 96df8c4d..6492678a 100644
--- a/data/org.gnome.maps.gschema.xml.in
+++ b/data/org.gnome.Maps.gschema.xml.in
@@ -1,5 +1,5 @@
<schemalist gettext-domain="gnome-maps">
- <schema id="org.gnome.maps" path="/org/gnome/maps/">
+ <schema id="org.gnome.Maps" path="/org/gnome/maps/">
<key name="window-size" type="ai">
<default>[768, 600]</default>
<_summary>Window size</_summary>
diff --git a/data/org.gnome.Maps.service.in b/data/org.gnome.Maps.service.in
new file mode 100644
index 00000000..f8a854f6
--- /dev/null
+++ b/data/org.gnome.Maps.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Maps
+Exec=@pkgdatadir@/org.gnome.Maps --gapplication-service
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 69d26c1a..7cb79d86 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,7 @@
[encoding: UTF-8]
data/org.gnome.Maps.appdata.xml.in
-data/org.gnome.Maps.desktop.in.in
-data/org.gnome.maps.gschema.xml.in
+data/org.gnome.Maps.desktop.in
+data/org.gnome.Maps.gschema.xml.in
src/application.js
[type: gettext/glade]src/app-menu.ui
[type: gettext/glade]src/check-in-dialog.ui
diff --git a/src/Makefile-js.am b/src/Makefile-js.am
deleted file mode 100644
index 5764c341..00000000
--- a/src/Makefile-js.am
+++ /dev/null
@@ -1,42 +0,0 @@
-BUILT_SOURCES += \
- path.js \
- config.js
-
-path.js: Makefile path.js.in
- $(AM_V_GEN) $(do_subst) $(srcdir)/path.js.in > $(builddir)/path.js
-config.js: Makefile config.js.in
- $(AM_V_GEN) $(do_subst) $(srcdir)/config.js.in > $(builddir)/config.js
-
-.PHONY: generated-sources
-generated-sources: path.js config.js
-
-gnome-maps-js.h: gnome-maps.js.gresource.xml generated-sources
- $(AM_V_GEN) \
- $(GLIB_COMPILE_RESOURCES) \
- --target=$@ \
- --sourcedir=$(srcdir) \
- --sourcedir=$(builddir) \
- --generate \
- --c-name gnome_maps_js $<
-
-gnome-maps-js.c: gnome-maps.js.gresource.xml generated-sources
- $(AM_V_GEN) \
- $(GLIB_COMPILE_RESOURCES) \
- --target=$@ \
- --sourcedir=$(srcdir) \
- --sourcedir=$(builddir) \
- --generate \
- --c-name gnome_maps_js $<
-
-js_built_sources = gnome-maps-js.c gnome-maps-js.h
-
-BUILT_SOURCES += $(js_built_sources)
-
-CLEANFILES += \
- $(BUILT_SOURCES)
-
-EXTRA_DIST += \
- gnome-maps.js.gresource.xml \
- $(filter-out $(BUILT_SOURCES),$(subst ./,,$(wildcard *.js))) \
- path.js.in \
- config.js.in
diff --git a/src/Makefile.am b/src/Makefile.am
index 3d2f61d2..295f3991 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,80 +1,49 @@
-BUILT_SOURCES =
-EXTRA_DIST =
-CLEANFILES =
+NULL =
-# convenience command for doing Makefile variable substitutions in non-Makefile
-# files (scripts, service files, etc.)
-do_subst = sed -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
- -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
- -e 's|@localedir[@]|$(localedir)|g' \
- -e 's|@bindir[@]|$(bindir)|g' \
- -e 's|@libdir[@]|$(libdir)|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|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
- -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
- -e 's|@GETTEXT_PACKAGE[@]|$(GETTEXT_PACKAGE)|g'
+appdir = $(pkgdatadir)
+nodist_app_SCRIPTS = org.gnome.Maps
-include $(INTROSPECTION_MAKEFILE)
-include Makefile-js.am
-
-data_files = $(shell $(GLIB_COMPILE_RESOURCES) \
+app_resource_files =
+ $(shell $(GLIB_COMPILE_RESOURCES) \
--sourcedir=$(srcdir) \
- --generate-dependencies $(srcdir)/gnome-maps.data.gresource.xml)
-
-dbusservicedir = $(datadir)/dbus-1/services
-dbusservice_DATA = org.gnome.Maps.service
+ --generate-dependencies \
+ $(srcdir)/org.gnome.Maps.src.gresource.xml \
+ )
-org.gnome.Maps.service: Makefile
- $(AM_V_GEN) (echo '[D-BUS Service]'; \
- echo 'Name=org.gnome.Maps'; \
- echo 'Exec=${bindir}/gnome-maps --gapplication-service') > $@.tmp && \
- mv $@.tmp $@
-
-gnome-maps-data.h: gnome-maps.data.gresource.xml $(data_files)
- $(AM_V_GEN) \
- $(GLIB_COMPILE_RESOURCES) \
+org.gnome.Maps.src.gresource: org.gnome.Maps.src.gresource.xml $(app_resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
--target=$@ \
- --sourcedir=$(srcdir) \
- --sourcedir=$(builddir) \
- --generate \
- --c-name gnome_maps_data $<
-gnome-maps-data.c: gnome-maps.data.gresource.xml $(data_files)
- $(AM_V_GEN) \
- $(GLIB_COMPILE_RESOURCES) \
- --target=$@ \
- --sourcedir=$(srcdir) \
- --sourcedir=$(builddir) \
- --generate \
- --c-name gnome_maps_data $<
-
-EXTRA_DIST += gnome-maps.data.gresource.xml $(data_files)
-
-data_built_sources = gnome-maps-data.c gnome-maps-data.h
-
-BUILT_SOURCES += $(data_built_sources)
-
-bin_PROGRAMS = gnome-maps
-
-CLEANFILES += \
- gnome-maps \
- $(dbusservice_DATA) \
- $(data_built_sources)
-
-gnome_maps_SOURCES = main.c \
+ --sourcedir=$(srcdir) $<
+
+resourcedir = $(pkgdatadir)
+resource_DATA = org.gnome.Maps.src.gresource
+
+org.gnome.Maps: org.gnome.Maps.in
+ $(AM_V_GEN) sed \
+ -e "s|[@]GJS@|$(GJS)|g" \
+ -e "s|[@]PACKAGE_VERSION@|$(PACKAGE_VERSION)|g" \
+ -e "s|[@]prefix@|$(prefix)|g" \
+ -e "s|[@]libdir@|$(libdir)|g" \
+ -e "s|[@]pkgdatadir@|$(pkgdatadir)|g" \
+ $< > $@
+ @chmod +x $@
+
+EXTRA_DIST = \
+ org.gnome.Maps.in \
+ org.gnome.Maps.src.gresource.xml \
+ $(app_resource_files) \
+ $(service_resource_files) \
$(NULL)
-nodist_gnome_maps_SOURCES = \
- $(top_builddir)/src/gnome-maps-data.c \
- $(top_builddir)/src/gnome-maps-data.h \
- $(top_builddir)/src/gnome-maps-js.c \
- $(top_builddir)/src/gnome-maps-js.h \
+
+CLEANFILES = \
+ org.gnome.Maps \
+ org.gnome.Maps.src.gresource \
$(NULL)
-gnome_maps_CPPFLAGS = \
- $(GNOME_MAPS_CFLAGS) \
- -DLOCALEDIR=\"$(localedir)\" \
- -DGNOME_MAPS_PKGLIBDIR=\"$(pkglibdir)\"
-gnome_maps_LDADD = \
- $(GNOME_MAPS_LIBS)
+install-exec-hook:
+ $(MKDIR_P) $(DESTDIR)$(bindir)
+ $(LN_S) $(appdir)/org.gnome.Maps $(DESTDIR)$(bindir)/gnome-maps
+uninstall-hook:
+ -rm -f $(DESTDIR)$(bindir)/gnome-maps
+
+-include $(top_srcdir)/git.mk
diff --git a/src/application.js b/src/application.js
index 0cd15066..3068dd90 100644
--- a/src/application.js
+++ b/src/application.js
@@ -36,7 +36,6 @@ const Geoclue = imports.geoclue;
const GeocodeService = imports.geocodeService;
const MainWindow = imports.mainWindow;
const NotificationManager = imports.notificationManager;
-const Path = imports.path;
const PlaceStore = imports.placeStore;
const RouteService = imports.routeService;
const Settings = imports.settings;
@@ -74,9 +73,8 @@ const Application = new Lang.Class({
},
_init: function() {
- Gettext.bindtextdomain('gnome-maps', Path.LOCALE_DIR);
+ Gettext.bindtextdomain('gnome-maps', pkg.localedir);
Gettext.textdomain('gnome-maps');
- GLib.set_prgname('gnome-maps');
/* Translators: This is the program name. */
GLib.set_application_name(_("Maps"));
@@ -141,7 +139,7 @@ const Application = new Lang.Class({
},
_initServices: function() {
- settings = new Settings.Settings('org.gnome.maps');
+ settings = new Settings.Settings('org.gnome.Maps');
routeService = new RouteService.GraphHopper();
geoclue = new Geoclue.Geoclue();
geocodeService = new GeocodeService.GeocodeService();
@@ -155,7 +153,8 @@ const Application = new Lang.Class({
if (this._mainWindow)
return;
- Gtk.IconTheme.get_default().append_search_path(Path.ICONS_DIR);
+ Gtk.IconTheme.get_default().append_search_path(GLib.build_filenamev([pkg.pkgdatadir,
+ 'icons']));
let overlay = new Gtk.Overlay({ visible: true, can_focus: false });
notificationManager = new NotificationManager.NotificationManager(overlay);
this._mainWindow = new MainWindow.MainWindow(this, overlay);
diff --git a/src/config.js.in b/src/config.js.in
deleted file mode 100644
index 47967fdf..00000000
--- a/src/config.js.in
+++ /dev/null
@@ -1,4 +0,0 @@
-const PACKAGE_NAME = '@PACKAGE_NAME@';
-const PACKAGE_VERSION = '@PACKAGE_VERSION@';
-const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
-const USER_AGENT = [PACKAGE_NAME, PACKAGE_VERSION].join(' ');
diff --git a/src/gnome-maps.data.gresource.xml b/src/gnome-maps.data.gresource.xml
deleted file mode 100644
index 9638968d..00000000
--- a/src/gnome-maps.data.gresource.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gresources>
- <gresource prefix="/org/gnome/maps">
- <file preprocess="xml-stripblanks">app-menu.ui</file>
- <file preprocess="xml-stripblanks">favorites-popover.ui</file>
- <file preprocess="xml-stripblanks">place-entry.ui</file>
- <file preprocess="xml-stripblanks">main-window.ui</file>
- <file preprocess="xml-stripblanks">zoom-control.ui</file>
- <file preprocess="xml-stripblanks">search-popup.ui</file>
- <file preprocess="xml-stripblanks">place-list-row.ui</file>
- <file preprocess="xml-stripblanks">sidebar.ui</file>
- <file preprocess="xml-stripblanks">context-menu.ui</file>
- <file preprocess="xml-stripblanks">layers-popover.ui</file>
- <file preprocess="xml-stripblanks">notification.ui</file>
- <file preprocess="xml-stripblanks">route-entry.ui</file>
- <file preprocess="xml-stripblanks">map-bubble.ui</file>
- <file preprocess="xml-stripblanks">search-result-bubble.ui</file>
- <file preprocess="xml-stripblanks">share-dialog.ui</file>
- <file preprocess="xml-stripblanks">user-location-bubble.ui</file>
- <file preprocess="xml-stripblanks">check-in-dialog.ui</file>
- <file preprocess="xml-stripblanks">account-row.ui</file>
- <file preprocess="xml-stripblanks">social-place-row.ui</file>
- <file preprocess="xml-stripblanks">social-place-more-results-row.ui</file>
- <file alias="application.css">../data/gnome-maps.css</file>
- <file alias="maptype-aerial.png">../data/media/maptype-aerial.png</file>
- <file alias="maptype-street.png">../data/media/maptype-street.png</file>
- </gresource>
-</gresources>
diff --git a/src/main.c b/src/main.c
deleted file mode 100644
index 146e486a..00000000
--- a/src/main.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: nil; js2-basic-offset: 4 -*- */
-/* vim: set et ts=4 sw=4: */
-/*
- * GNOME Maps is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * GNOME Maps is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with GNOME Maps; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author: Florian Müllner <fmuellner@gnome.org>
- * Mattias Bengtsson <mattias.jc.bengtsson@gmail.com>
- */
-
-#include "config.h"
-
-#include <girepository.h>
-#include <gjs/gjs.h>
-#include <libintl.h>
-
-int
-main (int argc, char *argv[])
-{
- const char *search_path[] = { "resource:///org/gnome/maps", NULL };
- GError *error = NULL;
- GjsContext *context;
- int status;
-
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- g_irepository_prepend_search_path (GNOME_MAPS_PKGLIBDIR);
-
- context = gjs_context_new_with_search_path ((char**) search_path);
-
- if (!gjs_context_define_string_array(context, "ARGV",
- argc, (const char**)argv,
- &error))
- {
- g_critical ("Failed to define ARGV: %s", error->message);
- g_error_free (error);
-
- return 1;
- }
-
-
- if (!gjs_context_eval (context,
- "const Main = imports.main; Main.start();",
- -1,
- "<main>",
- &status,
- &error))
- {
- g_critical ("Failed to run: %s", error->message);
- g_error_free (error);
-
- return status;
- }
-
- return 0;
-}
diff --git a/src/main.js b/src/main.js
index be5ce27f..7f903a57 100644
--- a/src/main.js
+++ b/src/main.js
@@ -23,7 +23,7 @@
const Application = imports.application;
-function start() {
+function main(args) {
let application = new Application.Application();
- return application.run(ARGV);
+ return application.run(args);
}
diff --git a/src/mainWindow.js b/src/mainWindow.js
index d09ffe08..5688499c 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -29,7 +29,6 @@ const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Application = imports.application;
-const Config = imports.config;
const ContextMenu = imports.contextMenu;
const FavoritesPopover = imports.favoritesPopover;
const LayersPopover = imports.layersPopover;
@@ -329,7 +328,7 @@ const MainWindow = new Lang.Class({
'2013 Red Hat, Inc.',
license_type: Gtk.License.GPL_2_0,
logo_icon_name: 'gnome-maps',
- version: Config.PACKAGE_VERSION,
+ version: pkg.version,
website: 'https://live.gnome.org/Apps/Maps',
wrap_license: true,
diff --git a/src/org.gnome.Maps.in b/src/org.gnome.Maps.in
new file mode 100644
index 00000000..1cd74738
--- /dev/null
+++ b/src/org.gnome.Maps.in
@@ -0,0 +1,5 @@
+#!@GJS@
+imports.package.start({ name: "gnome-maps",
+ version: "@PACKAGE_VERSION@",
+ prefix: "@prefix@",
+ libdir: "@libdir@" });
diff --git a/src/gnome-maps.js.gresource.xml b/src/org.gnome.Maps.src.gresource.xml
index d6342f48..3bd9f701 100644
--- a/src/gnome-maps.js.gresource.xml
+++ b/src/org.gnome.Maps.src.gresource.xml
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
- <gresource prefix="/org/gnome/maps">
+ <gresource prefix="/org/gnome/Maps/js">
<file>accountListBox.js</file>
<file>application.js</file>
<file>checkIn.js</file>
<file>checkInDialog.js</file>
- <file>config.js</file>
<file>contextMenu.js</file>
<file>epaf.js</file>
+ <file>facebookBackend.js</file>
<file>favoritesPopover.js</file>
+ <file>foursquareBackend.js</file>
+ <file>foursquareGoaAuthorizer.js</file>
<file>geoclue.js</file>
<file>geocodeService.js</file>
<file>http.js</file>
@@ -22,7 +24,6 @@
<file>notification.js</file>
<file>notificationManager.js</file>
<file>overpass.js</file>
- <file>path.js</file>
<file>place.js</file>
<file>placeEntry.js</file>
<file>placeFormatter.js</file>
@@ -35,21 +36,18 @@
<file>searchPopup.js</file>
<file>searchResultBubble.js</file>
<file>searchResultMarker.js</file>
- <file>shareDialog.js</file>
- <file>turnPointBubble.js</file>
- <file>turnPointMarker.js</file>
+ <file>serviceBackend.js</file>
<file>settings.js</file>
+ <file>shareDialog.js</file>
<file>sidebar.js</file>
+ <file>socialPlace.js</file>
<file>socialPlaceListBox.js</file>
<file>socialPlaceMatcher.js</file>
<file>translations.js</file>
- <file>userLocationMarker.js</file>
+ <file>turnPointBubble.js</file>
+ <file>turnPointMarker.js</file>
<file>userLocationBubble.js</file>
- <file>facebookBackend.js</file>
- <file>foursquareBackend.js</file>
- <file>foursquareGoaAuthorizer.js</file>
- <file>serviceBackend.js</file>
- <file>socialPlace.js</file>
+ <file>userLocationMarker.js</file>
<file>utils.js</file>
<file>zoomControl.js</file>
</gresource>
diff --git a/src/path.js.in b/src/path.js.in
deleted file mode 100644
index 5b38c41e..00000000
--- a/src/path.js.in
+++ /dev/null
@@ -1,4 +0,0 @@
-let LOCALE_DIR = "@localedir@";
-let STYLE_DIR = "@pkgdatadir@/style/";
-let ICONS_DIR = "@pkgdatadir@/icons/";
-let RESOURCE_DIR = "@pkgdatadir@";
diff --git a/src/routeService.js b/src/routeService.js
index 92f6e20c..df0b2e3e 100644
--- a/src/routeService.js
+++ b/src/routeService.js
@@ -27,7 +27,6 @@ const Soup = imports.gi.Soup;
const _ = imports.gettext.gettext;
const Application = imports.application;
-const Config = imports.config;
const EPAF = imports.epaf;
const HTTP = imports.http;
const Route = imports.route;
@@ -46,7 +45,7 @@ const GraphHopper = new Lang.Class({
},
_init: function() {
- this._session = new Soup.Session({ user_agent : Config.USER_AGENT });
+ this._session = new Soup.Session({ user_agent : 'gnome-maps/' + pkg.version });
this._key = "VCIHrHj0pDKb8INLpT4s5hVadNmJ1Q3vi0J4nJYP";
this._baseURL = "https://graphhopper.com/api/1/route?";
this._locale = GLib.get_language_names()[0];