After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733411 - Follow the Gjs application conventions
Follow the Gjs application conventions
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-19 18:51 UTC by Damián Nohales
Modified: 2015-01-05 09:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Convert to the new Gjs "package.js" application conventions (34.59 KB, patch)
2014-07-21 09:01 UTC, Giovanni Campagna
none Details | Review
Convert to Gjs "package.js" application conventions (34.08 KB, patch)
2014-10-01 23:39 UTC, Damián Nohales
reviewed Details | Review
Convert to Gjs "package.js" application conventions (36.14 KB, patch)
2014-10-02 17:37 UTC, Damián Nohales
reviewed Details | Review
Convert to Gjs "package.js" application conventions (212.40 KB, patch)
2014-12-18 19:41 UTC, Damián Nohales
reviewed Details | Review
Convert to Gjs "package.js" application conventions (25.77 KB, patch)
2014-12-22 21:08 UTC, Damián Nohales
needs-work Details | Review
Unify resource namespace and move ui files to data/ui (17.11 KB, patch)
2014-12-22 21:08 UTC, Damián Nohales
needs-work Details | Review
settings: Load settings if the app is not installed (2.45 KB, patch)
2014-12-22 21:08 UTC, Damián Nohales
accepted-commit_now Details | Review
Use pkg.initGettext (5.65 KB, patch)
2014-12-22 21:08 UTC, Damián Nohales
accepted-commit_now Details | Review
Use pkg.initFormat (1001 bytes, patch)
2014-12-22 21:08 UTC, Damián Nohales
accepted-commit_now Details | Review
Convert to Gjs "package.js" application conventions (26.99 KB, patch)
2014-12-23 15:10 UTC, Damián Nohales
none Details | Review
Unify resource namespace and move ui files to data/ui (17.11 KB, patch)
2014-12-23 15:10 UTC, Damián Nohales
none Details | Review
settings: Load settings if the app is not installed (2.64 KB, patch)
2014-12-23 15:10 UTC, Damián Nohales
none Details | Review
Use pkg.initGettext (5.65 KB, patch)
2014-12-23 15:11 UTC, Damián Nohales
none Details | Review
Use pkg.initFormat (1.15 KB, patch)
2014-12-23 15:11 UTC, Damián Nohales
none Details | Review
Convert to Gjs "package.js" application conventions (27.02 KB, patch)
2015-01-05 09:16 UTC, Jonas Danielsson
committed Details | Review
Unify resource namespace and move ui files to data/ui (17.17 KB, patch)
2015-01-05 09:16 UTC, Jonas Danielsson
committed Details | Review
settings: Load settings if the app is not installed (2.64 KB, patch)
2015-01-05 09:16 UTC, Jonas Danielsson
committed Details | Review
Use pkg.initGettext (5.65 KB, patch)
2015-01-05 09:16 UTC, Jonas Danielsson
committed Details | Review
Use pkg.initFormat (1.15 KB, patch)
2015-01-05 09:16 UTC, Jonas Danielsson
committed Details | Review

Description Damián Nohales 2014-07-19 18:51:27 UTC
Recently [1], new conventions for Gjs apps were proposed [2]. It would be great to follow this conventions in Maps.

I propose to start this migration for 3.16 since some cooking patch-set coming from this GSoC doesn't follow the convetions, so starting the migration now can needlessly delay the upcoming features.

[1] https://mail.gnome.org/archives/desktop-devel-list/2014-July/msg00018.html
[2] https://wiki.gnome.org/Projects/Gjs/Package
Comment 1 Jonas Danielsson 2014-07-19 18:54:03 UTC
Sounds like a good idea and a good plan, Damián. Thanks for creating this bug.

If some one feels like hacking a patch for this it would be nice. I will mark it as gnome-love. And be willing to act as a mentor and answer question if someone want to try this out to get their feet wet in gnome development.
Comment 2 Giovanni Campagna 2014-07-20 16:52:12 UTC
If you want, I prepared a patch, just to see how difficult it is to take an existing app and turn into a package.js app. It's not huge, but there are subtleties here and there.

I can attach it, or not, if you want to use this bug to mentor newcomers.
Comment 3 Jonas Danielsson 2014-07-21 05:35:28 UTC
A patch against Maps? You could attach it, the task then will be to massage that patch to work against the post 3.14 tree.
Comment 4 Giovanni Campagna 2014-07-21 09:01:17 UTC
Created attachment 281284 [details] [review]
Convert to the new Gjs "package.js" application conventions

Unify resource names and GSettings schemas as org.gnome.Maps.
Move all data files to data/, leaving only importable JS sources
in src/
Remove the C shim which is not needed.
Copy the Makefiles from gtk-js-app, and replace the names appropriately
Remove the config.js and path.js modules, as their functionality
is provided by package.js
Remove C compiler dependency.
Add helper to obtain the settings that works if the app is not
yet installed.
Comment 5 Damián Nohales 2014-10-01 23:39:12 UTC
Created attachment 287550 [details] [review]
Convert to Gjs "package.js" application conventions

Unify resource names and GSettings schemas as org.gnome.Maps.
Move all data files to data/, leaving only importable JS sources
in src/
Remove the C shim which is not needed.
Copy the Makefiles from gtk-js-app, and replace the names appropriately
Remove the config.js and path.js modules, as their functionality
is provided by package.js
Remove C compiler dependency.
Add helper to obtain the settings that works if the app is not
yet installed.

------

- Rebased on master.
- Fixed translation of gschemas.
- Removed Makefile-js.am.
- Fixed Makefile.am tab alignment.

Just to be sure, I am not seeing the correct app name and icon in
shell's topbar after these changes. This is because I am running
gnome-shell in a non-developer environment (different than Maps one)
and org.gnome.Maps.desktop in shell's environment, am I right?
Comment 6 Damián Nohales 2014-10-01 23:40:58 UTC
s/and org.gnome.Maps.desktop in shell's environment/and org.gnome.Maps.desktop is not present in shell's environment
Comment 7 Jonas Danielsson 2014-10-02 05:05:31 UTC
Review of attachment 287550 [details] [review]:

Thx for doing this.

I am bit confused by whether the const _ = imports.gettext.gettext is needed or not. Since it is removed in application.js but nowhere(?) else.

::: src/application.js
@@ -26,3 @@
 const Signals = imports.signals;
-const Gettext = imports.gettext;
-const _ = imports.gettext.gettext;

Oh so this is not needed anymore? :o

@@ +116,3 @@
             return;
 
+        Gtk.IconTheme.get_default().append_search_path(pkg.pkgdatadir + '/icons');

Should we use GLib.build_filanamev?

::: src/config.js.in
@@ -2,3 @@
-const PACKAGE_VERSION = '@PACKAGE_VERSION@';
-const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
-const USER_AGENT = [PACKAGE_NAME, PACKAGE_VERSION].join(' ');

(o/

::: src/geoclue.js
@@ -34,2 @@
 const Signals = imports.signals;
 const _ = imports.gettext.gettext;

Why was the _ import removed from application.js but not here?

::: src/mainWindow.js
@@ -42,3 @@
 const ZoomControl = imports.zoomControl;
 
 const _ = imports.gettext.gettext;

Same here...

::: src/path.js.in
@@ -2,3 @@
-let STYLE_DIR = "@pkgdatadir@/style/";
-let ICONS_DIR = "@pkgdatadir@/icons/";
-let RESOURCE_DIR = "@pkgdatadir@";

(o/

::: src/routeService.js
@@ +35,3 @@
 const Utils = imports.utils;
 
+const USER_AGENT = 'gnome-maps/' + pkg.version;

GLib.build_filenamev

::: src/userLocationMarker.js
@@ -33,3 @@
 const UserLocationBubble = imports.userLocationBubble;
 const Utils = imports.utils;
 const _ = imports.gettext.gettext;

And here.
Comment 8 Damián Nohales 2014-10-02 17:14:18 UTC
Review of attachment 287550 [details] [review]:

::: src/application.js
@@ -26,3 @@
 const Signals = imports.signals;
-const Gettext = imports.gettext;
-const _ = imports.gettext.gettext;

Ah... it looks like package.js declares _ as a global in initGettext function. Yes, then let's remove everywhere since is a package.js related stuff.

@@ +116,3 @@
             return;
 
+        Gtk.IconTheme.get_default().append_search_path(pkg.pkgdatadir + '/icons');

+1

::: src/config.js.in
@@ -2,3 @@
-const PACKAGE_VERSION = '@PACKAGE_VERSION@';
-const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
-const USER_AGENT = [PACKAGE_NAME, PACKAGE_VERSION].join(' ');

\o)

::: src/path.js.in
@@ -2,3 @@
-let STYLE_DIR = "@pkgdatadir@/style/";
-let ICONS_DIR = "@pkgdatadir@/icons/";
-let RESOURCE_DIR = "@pkgdatadir@";

\o/

::: src/routeService.js
@@ +35,3 @@
 const Utils = imports.utils;
 
+const USER_AGENT = 'gnome-maps/' + pkg.version;

+1
Comment 9 Damián Nohales 2014-10-02 17:31:11 UTC
Review of attachment 287550 [details] [review]:

::: src/routeService.js
@@ +35,3 @@
 const Utils = imports.utils;
 
+const USER_AGENT = 'gnome-maps/' + pkg.version;

I mean -1, it's a HTTP user agent, not a filename :)
Comment 10 Damián Nohales 2014-10-02 17:37:29 UTC
Created attachment 287614 [details] [review]
Convert to Gjs "package.js" application conventions

Unify resource names and GSettings schemas as org.gnome.Maps.
Move all data files to data/, leaving only importable JS sources
in src/
Remove the C shim which is not needed.
Copy the Makefiles from gtk-js-app, and replace the names appropriately
Remove the config.js and path.js modules, as their functionality
is provided by package.js
Remove C compiler dependency.
Add helper to obtain the settings that works if the app is not
yet installed.

----

- Remove all explicit imports of gettext's _ function.
- Use pkg.initFormat instead of manually initialize
String.prototype.format.
- Use GLib.build_filenamev when appropriated
Comment 11 Jonas Danielsson 2014-10-04 11:57:05 UTC
Review of attachment 287614 [details] [review]:

I had my gjs stuck on an old branch. So I got an error while running this. Maybe we should bump the gjs min version in configure.ac to 1.42 while doing this?
Other than that it seems swell. And distcheck passed.

But I have one concern. We made maps a binary for a reason, in https://bugzilla.gnome.org/show_bug.cgi?id=722338, Zeeshan wrote:
"Currently our executable '${bindir}/gnome-maps' is a shall script that launches
gjs-console with scripts etc passed to it. Trouble is that geoclue2 will need
to identify apps with /proc/${PID}/exe (as opposed to /proc/${PID}/cmdline,
which can be easily overwritten by apps themselves) and that points to the path
of gjs-console binary rather. So geoclue2 will have no means of differentiating
btwe gnome-weather and gnome-maps for example."

Zeeshan, is this still valid?
Comment 12 Jonas Danielsson 2014-10-04 12:48:55 UTC
Review of attachment 287614 [details] [review]:

Zeeshan says that is is not valid anymore, so seems like we are fine,
Comment 13 Damián Nohales 2014-10-04 15:08:23 UTC
(In reply to comment #11)
> Review of attachment 287614 [details] [review]:
> 
> I had my gjs stuck on an old branch. So I got an error while running this.
> Maybe we should bump the gjs min version in configure.ac to 1.42 while doing
> this?

Yes, I think that's fine.
Comment 14 Damián Nohales 2014-12-18 19:41:56 UTC
Created attachment 293002 [details] [review]
Convert to Gjs "package.js" application conventions

- Rebased on master
- Move .ui files to data/ui (I hope you like it, it looks more comfortable to me but I think is not the standard convention)
- Use imports.package.start instead of imports.package.run
Comment 15 Jonas Danielsson 2014-12-19 07:30:25 UTC
Review of attachment 293002 [details] [review]:

Oh boy, these are a lot of changes :)
Thanks for doing that work Damián.

So, ok. Could you tell me again exactly what we gain from this? I got a general idea but it would b nice. Maybe you could update the commit message to be more why than what?
Also: Maybe we could do the moving of the ui files in a separate commit? It is not strictly related to this and it would make it easier to get an overview and review this monster :)

I am fine with that move, makes our structure a bit more like other GNOME apps.

::: src/routeService.js
@@ +33,3 @@
 const Utils = imports.utils;
 
+const USER_AGENT = 'gnome-maps/' + pkg.version;

Will this be the same USER_AGENT as the one we hade in Config? And there is no way to make this pkg.user_agent?
Comment 16 Damián Nohales 2014-12-22 21:08:10 UTC
Created attachment 293203 [details] [review]
Convert to Gjs "package.js" application conventions

Unify resource names and GSettings schemas as org.gnome.Maps.
Remove the C shim which is not needed.
Copy the Makefiles from gtk-js-app, and replace the names appropriately
Remove the config.js and path.js modules, as their functionality
is provided by package.js
Remove C compiler dependency.
Comment 17 Damián Nohales 2014-12-22 21:08:16 UTC
Created attachment 293204 [details] [review]
Unify resource namespace and move ui files to data/ui
Comment 18 Damián Nohales 2014-12-22 21:08:23 UTC
Created attachment 293205 [details] [review]
settings: Load settings if the app is not installed
Comment 19 Damián Nohales 2014-12-22 21:08:30 UTC
Created attachment 293206 [details] [review]
Use pkg.initGettext

This initializes gettext for us and declares "_", "C_" and "N_"
functions implicitly.
Comment 20 Damián Nohales 2014-12-22 21:08:37 UTC
Created attachment 293207 [details] [review]
Use pkg.initFormat
Comment 21 Mattias Bengtsson 2014-12-23 12:14:59 UTC
Review of attachment 293203 [details] [review]:

I love you for diving into this!

Regarding review: mostly simple code style issues.

::: data/Makefile.am
@@ +1,3 @@
 SUBDIRS = icons
 
+app_resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/org.gnome.Maps.data.gresource.xml)

Split this up in multiple lines. One line per flag.

@@ +52,3 @@
+	$(gsettings_SCHEMAS)
+	$(NULL)
+

Align these '\' at column 72 (like in data/icons/Makefile.am and src/Makefile.am)

::: src/Makefile.am
@@ +4,3 @@
+nodist_app_SCRIPTS = org.gnome.Maps
+
+app_resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/org.gnome.Maps.src.gresource.xml)

Split this up in multiple lines. One flag per line.

@@ +25,3 @@
+	org.gnome.Maps.src.gresource.xml	\
+	$(app_resource_files)			\
+	$(service_resource_files)		\

Align at column 72

::: src/main.js
@@ +25,3 @@
 
+function main(args) {
+    pkg.useragent = 'gnome-maps/' + pkg.version;

Hm, in general I don't feel comfortable adding properties to objects owned by other code. I think we can just skip this line, and later in routeService.js...

::: src/routeService.js
@@ +47,2 @@
     _init: function() {
+        this._session = new Soup.Session({ user_agent : pkg.useragent });

...just use 'gnome-maps/' + pkg.version here.
Comment 22 Jonas Danielsson 2014-12-23 12:18:30 UTC
Review of attachment 293203 [details] [review]:

::: src/main.js
@@ +25,3 @@
 
+function main(args) {
+    pkg.useragent = 'gnome-maps/' + pkg.version;

Just to chirp in a bit, I was the one who asked if there was any possibility of getting pkg.useragent.

I am fine with going the route Mattias spells out here if there is no "native" pkg.useragent.
Comment 23 Jonas Danielsson 2014-12-23 12:20:29 UTC
Review of attachment 293204 [details] [review]:

Other than comment it looks good.

::: data/org.gnome.Maps.data.gresource.xml
@@ +24,1 @@
     <file alias="application.css">gnome-maps.css</file>

Shouldn't the css file  be part of "ui" ?
Comment 24 Jonas Danielsson 2014-12-23 12:23:42 UTC
Review of attachment 293206 [details] [review]:

Looks fine!
Comment 25 Jonas Danielsson 2014-12-23 12:24:41 UTC
Review of attachment 293207 [details] [review]:

Ok, so this gives us String.format? Maybe the commit message body can say so?

Other than that: thanks!
Comment 26 Mattias Bengtsson 2014-12-23 12:26:46 UTC
Review of attachment 293204 [details] [review]:

I think you might have forgotten to move the ui-files here no?

Otherwise looks great!

::: data/org.gnome.Maps.data.gresource.xml
@@ +2,3 @@
 <gresources>
+  <gresource prefix="/org/gnome/Maps">
+    <file preprocess="xml-stripblanks">ui/app-menu.ui</file>

If you change these paths here, don't you need to also move the ui-files as well?

The patches doesn't apply on master for me so I can't test.
Comment 27 Jonas Danielsson 2014-12-23 12:27:17 UTC
Review of attachment 293203 [details] [review]:

Thanks!

::: data/org.gnome.Maps.data.gresource.xml
@@ +26,3 @@
+    <file alias="maptype-street.png">media/maptype-street.png</file>
+  </gresource>
+</gresources>
 No newline at end of file

Maybe we can alphabetize this list when we are recreating it?

::: data/org.gnome.maps.gschema.xml.in
@@ +1,2 @@
 <schemalist gettext-domain="gnome-maps">
+  <schema id="org.gnome.Maps" path="/org/gnome/maps/">

Does this fix anything?
Comment 28 Jonas Danielsson 2014-12-23 12:28:37 UTC
Review of attachment 293205 [details] [review]:

So I need this to be more explained.

Both for me, here and now and in the commit message.
Why is this needed? Why was it not needed before? Or was it?
What does this fix?

::: src/settings.js
@@ +69,3 @@
+    }
+
+    if (path === undefined)

What is path? We do not supply any path atm, when do we need to?
Comment 29 Mattias Bengtsson 2014-12-23 12:28:46 UTC
Review of attachment 293205 [details] [review]:

ACK
Comment 30 Mattias Bengtsson 2014-12-23 13:02:20 UTC
Review of attachment 293203 [details] [review]:

::: data/org.gnome.Maps.data.gresource.xml
@@ +26,3 @@
+    <file alias="maptype-street.png">media/maptype-street.png</file>
+  </gresource>
+</gresources>
 No newline at end of file

No newline at end of file

Oh yes please! :)

::: data/org.gnome.maps.gschema.xml.in
@@ +1,2 @@
 <schemalist gettext-domain="gnome-maps">
+  <schema id="org.gnome.Maps" path="/org/gnome/maps/">

From the gsettings docs:

» The convention for schema ids is to use a dotted name, similar in style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular, if the settings are for a specific service that owns a D-Bus bus name, the D-Bus bus name and schema id should match. «

Not sure if it gives us anything but lets be consistent.
Comment 31 Damián Nohales 2014-12-23 13:17:20 UTC
Review of attachment 293204 [details] [review]:

::: data/org.gnome.Maps.data.gresource.xml
@@ +2,3 @@
 <gresources>
+  <gresource prefix="/org/gnome/Maps">
+    <file preprocess="xml-stripblanks">ui/app-menu.ui</file>

WTF, I can see the renames in my log, let me see what happened.

@@ +24,1 @@
     <file alias="application.css">gnome-maps.css</file>

Hmmm... why? you mean moving it to ui directory?
Comment 32 Jonas Danielsson 2014-12-23 13:24:07 UTC
(In reply to comment #31)
> Review of attachment 293204 [details] [review]:
> 
> ::: data/org.gnome.Maps.data.gresource.xml
> @@ +2,3 @@
>  <gresources>
> +  <gresource prefix="/org/gnome/Maps">
> +    <file preprocess="xml-stripblanks">ui/app-menu.ui</file>
> 
> WTF, I can see the renames in my log, let me see what happened.
> 
> @@ +24,1 @@
>      <file alias="application.css">gnome-maps.css</file>
> 
> Hmmm... why? you mean moving it to ui directory?

Yes, Ive seen other apps have the css filé in ui/
Comment 33 Mattias Bengtsson 2014-12-23 13:24:37 UTC
Review of attachment 293204 [details] [review]:

::: data/org.gnome.Maps.data.gresource.xml
@@ +2,3 @@
 <gresources>
+  <gresource prefix="/org/gnome/Maps">
+    <file preprocess="xml-stripblanks">ui/app-menu.ui</file>

:)

@@ +24,1 @@
     <file alias="application.css">gnome-maps.css</file>

Nah I agree with you here Damián. Let ui/ be just ui-files.
Comment 34 Damián Nohales 2014-12-23 13:48:05 UTC
Review of attachment 293205 [details] [review]:

Let me be honest, I fully trusted in Giovanni for that part of the code :P (it comes from gnome-weather and gtk-js-app I think)

Maybe this is really not necessary and we could skip it since executing the app without installing it is not part of our workflow (maybe because jhbuild always do make install). Originally, I think Giovanni made it in that way because package.js always take into account that the app can be executed directly from source (I mean, be able to execute the app from source seems to be part of the convention) and this is needed to load the GSettings from source.

We could skip it, personally, I would never use this.
Comment 35 Damián Nohales 2014-12-23 14:16:11 UTC
Review of attachment 293204 [details] [review]:

::: data/org.gnome.Maps.data.gresource.xml
@@ +2,3 @@
 <gresources>
+  <gresource prefix="/org/gnome/Maps">
+    <file preprocess="xml-stripblanks">ui/app-menu.ui</file>

So, the patch is submitted right (see the raw version of it), it seems that splinter doesn't manage renames well.

Also, I checked out master and reapplied the patchset from bz, and it applies right. Maybe you need to pull master?
Comment 36 Mattias Bengtsson 2014-12-23 14:52:55 UTC
Review of attachment 293205 [details] [review]:

Being able to run without an install step is actually something I'd really like. It would potentially speed up development a little bit more.
Comment 37 Mattias Bengtsson 2014-12-23 14:54:36 UTC
Review of attachment 293204 [details] [review]:

::: data/org.gnome.Maps.data.gresource.xml
@@ +2,3 @@
 <gresources>
+  <gresource prefix="/org/gnome/Maps">
+    <file preprocess="xml-stripblanks">ui/app-menu.ui</file>

Ah great!

I'll try to apply the patches once more! :)
Comment 38 Damián Nohales 2014-12-23 15:10:46 UTC
Created attachment 293263 [details] [review]
Convert to Gjs "package.js" application conventions

Unify resource names and GSettings schemas as org.gnome.Maps.
Remove the C shim which is not needed.
Copy the Makefiles from gtk-js-app, and replace the names appropriately
Remove the config.js and path.js modules, as their functionality
is provided by package.js
Remove C compiler dependency.
Comment 39 Damián Nohales 2014-12-23 15:10:52 UTC
Created attachment 293264 [details] [review]
Unify resource namespace and move ui files to data/ui
Comment 40 Damián Nohales 2014-12-23 15:10:58 UTC
Created attachment 293265 [details] [review]
settings: Load settings if the app is not installed
Comment 41 Damián Nohales 2014-12-23 15:11:05 UTC
Created attachment 293266 [details] [review]
Use pkg.initGettext

This initializes gettext for us and declares "_", "C_" and "N_"
functions implicitly.
Comment 42 Damián Nohales 2014-12-23 15:11:11 UTC
Created attachment 293267 [details] [review]
Use pkg.initFormat

pkg.initFormat is a gjs's helper that declares the
String.format method, let's use this helper instead
of declare the method manually.
Comment 43 Jonas Danielsson 2015-01-05 09:16:01 UTC
Created attachment 293745 [details] [review]
Convert to Gjs "package.js" application conventions

Unify resource names and GSettings schemas as org.gnome.Maps.
Remove the C shim which is not needed.
Copy the Makefiles from gtk-js-app, and replace the names appropriately
Remove the config.js and path.js modules, as their functionality
is provided by package.js
Remove C compiler dependency.
Comment 44 Jonas Danielsson 2015-01-05 09:16:07 UTC
Created attachment 293746 [details] [review]
Unify resource namespace and move ui files to data/ui
Comment 45 Jonas Danielsson 2015-01-05 09:16:12 UTC
Created attachment 293747 [details] [review]
settings: Load settings if the app is not installed
Comment 46 Jonas Danielsson 2015-01-05 09:16:18 UTC
Created attachment 293748 [details] [review]
Use pkg.initGettext

This initializes gettext for us and declares "_", "C_" and "N_"
functions implicitly.
Comment 47 Jonas Danielsson 2015-01-05 09:16:23 UTC
Created attachment 293749 [details] [review]
Use pkg.initFormat

pkg.initFormat is a gjs's helper that declares the
String.format method, let's use this helper instead
of declare the method manually.
Comment 48 Jonas Danielsson 2015-01-05 09:17:25 UTC
Review of attachment 293745 [details] [review]:

Thanks!
Comment 49 Jonas Danielsson 2015-01-05 09:19:22 UTC
Review of attachment 293746 [details] [review]:

Great!
Comment 50 Jonas Danielsson 2015-01-05 09:21:46 UTC
Review of attachment 293747 [details] [review]:

Still unsure of this, but if you guys want it, sure.

::: src/settings.js
@@ +51,3 @@
 });
+
+function getSettings(schemaId, path) {

path is never used? Why include it?

@@ +67,3 @@
+    if (!schemaObj) {
+        log('Missing GSettings schema ' + schemaId);
+        System.exit(1);

Can't we return NULL instead? And let the application deal with what to do?
Comment 51 Jonas Danielsson 2015-01-05 09:22:02 UTC
Review of attachment 293748 [details] [review]:

Thanks!
Comment 52 Jonas Danielsson 2015-01-05 09:22:27 UTC
Review of attachment 293749 [details] [review]:

Thanks!