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 769564 - autotools-templates: Add i18n to GNOME application template
autotools-templates: Add i18n to GNOME application template
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-05 19:39 UTC by Matthew Leeds
Modified: 2016-11-16 07:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
autotools-templates: Add a GNOME application template (23.08 KB, patch)
2016-08-05 19:39 UTC, Matthew Leeds
none Details | Review
autotools-templates: Add a GNOME application template (23.18 KB, patch)
2016-08-06 04:51 UTC, Matthew Leeds
committed Details | Review

Description Matthew Leeds 2016-08-05 19:39:12 UTC
See the commit message.
Comment 1 Matthew Leeds 2016-08-05 19:39:17 UTC
Created attachment 332813 [details] [review]
autotools-templates: Add a GNOME application template

This commit adds a template for GNOME applications. It's similar to the
Empty Project template but it comes with a main function that creates an
empty window, and it includes a flatpak manifest. Hopefully it will help
newcomers get started on their first project.

In the future we should probably add internationalization, gtk-doc, and
GSettings code to the template, possibly as optional components.

The flatpak manifest works when used with flatpak-builder but building
the template in a flatpak runtime from within Builder doesn't seem to
work yet.
Comment 2 Christian Hergert 2016-08-05 20:58:23 UTC
Review of attachment 332813 [details] [review]:

Excellent! Just a few small nits.

::: plugins/autotools-templates/autotools_templates/resources/ManifestTemplate.flatpak.json
@@ +29,3 @@
+                    {
+                        "type": "git",
+                        "url": "file://{{project_path}}"

Not really ideal, but I can't think of a better solution right now either.

::: plugins/autotools-templates/autotools_templates/resources/src/main.c
@@ +1,1 @@
+#include <gtk/gtk.h>

Add {{include "license.c"}} at the top here to get the standard header for C. (Sorry it's not very obvious).

@@ +18,3 @@
+}
+
+int main(int argc, char *argv[])

int
main (int   argc,
      char *argv[])

@@ +20,3 @@
+int main(int argc, char *argv[])
+{
+    GtkApplication *app;

Let's use g_autoptr(GtkApplication) app = NULL and drop the unref. I very much want to get people in the habit of using autoptr since MSVC portability is not really much of a concern to us.

::: plugins/autotools-templates/autotools_templates/resources/src/main.cpp
@@ +1,1 @@
+#include <gtkmm.h>

{{include "license.cpp"}}

::: plugins/autotools-templates/autotools_templates/resources/src/main.vala
@@ +1,1 @@
+using Gtk;

{{include "license.vala"}}
Comment 3 Matthew Leeds 2016-08-06 04:51:28 UTC
Created attachment 332816 [details] [review]
autotools-templates: Add a GNOME application template

This commit adds a template for GNOME applications. It's similar to the
Empty Project template but it comes with a main function that creates an
empty window, and it includes a flatpak manifest. Hopefully it will help
newcomers get started on their first project.

In the future we should probably add internationalization, gtk-doc, and
GSettings code to the template, possibly as optional components.

The flatpak manifest works when used with flatpak-builder but building
the template in a flatpak runtime from within Builder doesn't seem to
work yet.
Comment 4 Matthew Leeds 2016-08-06 17:12:12 UTC
Pushed as commit 82c47cda95fc48c4b15037db9600048939ecd335, but perhaps we should leave this issue open until we add internationalization, etc.
Comment 5 Christian Hergert 2016-08-06 18:06:27 UTC
(In reply to Matthew Leeds from comment #4)
> Pushed as commit 82c47cda95fc48c4b15037db9600048939ecd335, but perhaps we
> should leave this issue open until we add internationalization, etc.

Makes sense. Thanks again!