diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-09-21 21:24:59 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-09-21 22:02:13 +0100 |
commit | d792ccf10bca5d2ab8e7e3c423daff0c39f21f19 (patch) | |
tree | 64aeb16623a7980b9fb036fda8c1ada5d368818e /src | |
parent | be351769305e4186ac52533d6ae19e21bc5d1428 (diff) | |
download | gnome-dictionary-d792ccf10bca5d2ab8e7e3c423daff0c39f21f19.tar.gz |
Add a development profile
We begin the GNOME 40 development cycle by adding the ability to define
a development build of Dictionary, with its own application identifier.
We use the same application identifier across the binary, so that the
shell can match our desktop file with it; and we use a different label
in the About dialog, depending on whether we are using a development
build or not.
It's possible to enable the development build by using a build option;
otherwise, we're going to check if the current version is one of the
three development stages of a GNOME release.
Diffstat (limited to 'src')
-rw-r--r-- | src/gdict-about.c | 31 | ||||
-rw-r--r-- | src/gdict-app.c | 4 | ||||
-rw-r--r-- | src/gdict-common.c | 10 | ||||
-rw-r--r-- | src/gdict-common.h | 4 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/meson.build | 25 |
6 files changed, 50 insertions, 26 deletions
diff --git a/src/gdict-about.c b/src/gdict-about.c index 689ca7c..3125487 100644 --- a/src/gdict-about.c +++ b/src/gdict-about.c @@ -28,6 +28,7 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include "gdict-about.h" +#include "gdict-common.h" void gdict_show_about_dialog (GtkWidget *parent) @@ -49,21 +50,23 @@ gdict_show_about_dialog (GtkWidget *parent) }; const gchar *translator_credits = _("translator-credits"); - const gchar *copyright = "Copyright \xc2\xa9 2005-2006 Emmanuele Bassi"; + const gchar *copyright = "Copyright \xc2\xa9 2005 Emmanuele Bassi"; const gchar *comments = _("Look up words in dictionaries"); - g_return_if_fail (GTK_IS_WIDGET (parent)); + g_return_if_fail (GTK_IS_WINDOW (parent)); - gtk_show_about_dialog (GTK_IS_WINDOW (parent) ? GTK_WINDOW (parent) : NULL, - "program-name", _("Dictionary"), - "version", VERSION, - "copyright", copyright, - "comments", comments, - "authors", authors, - "documenters", documenters, - "translator-credits", translator_credits, - "logo-icon-name", "org.gnome.Dictionary", - "license-type", GTK_LICENSE_GPL_2_0, - "screen", gtk_widget_get_screen (parent), - NULL); + gtk_show_about_dialog (GTK_WINDOW (parent), + "program-name", + gdict_is_devel_build () + ? _("Dictionary (development build)") + : _("Dictionary"), + "version", VERSION, + "copyright", copyright, + "comments", comments, + "authors", authors, + "documenters", documenters, + "translator-credits", translator_credits, + "logo-icon-name", APPLICATION_ID, + "license-type", GTK_LICENSE_GPL_2_0, + NULL); } diff --git a/src/gdict-app.c b/src/gdict-app.c index 4189f88..12021f2 100644 --- a/src/gdict-app.c +++ b/src/gdict-app.c @@ -365,14 +365,14 @@ gdict_app_init (GdictApp *app) g_application_add_main_option_entries (G_APPLICATION (app), gdict_app_goptions); /* Set main application icon */ - gtk_window_set_default_icon_name ("org.gnome.Dictionary"); + gtk_window_set_default_icon_name (APPLICATION_ID); } GApplication * gdict_app_new (void) { return g_object_new (gdict_app_get_type (), - "application-id", "org.gnome.Dictionary", + "application-id", APPLICATION_ID, "resource-base-path", "/org/gnome/Dictionary", "flags", G_APPLICATION_HANDLES_COMMAND_LINE, NULL); diff --git a/src/gdict-common.c b/src/gdict-common.c index c9c788f..ad2e77a 100644 --- a/src/gdict-common.c +++ b/src/gdict-common.c @@ -241,3 +241,13 @@ gdict_show_gerror_dialog (GtkWindow *parent, g_error_free (error); error = NULL; } + +gboolean +gdict_is_devel_build (void) +{ +#ifdef DEVELOPMENT_BUILD + return TRUE; +#else + return FALSE; +#endif +} diff --git a/src/gdict-common.h b/src/gdict-common.h index 234ab1d..c9a646d 100644 --- a/src/gdict-common.h +++ b/src/gdict-common.h @@ -25,7 +25,7 @@ G_BEGIN_DECLS -gchar * gdict_get_data_dir (void) G_GNUC_MALLOC; +gchar * gdict_get_data_dir (void) G_GNUC_MALLOC; gchar * gdict_get_old_data_dir (void) G_GNUC_MALLOC; gchar * gdict_get_config_dir (void) G_GNUC_MALLOC; @@ -39,6 +39,8 @@ void gdict_show_gerror_dialog (GtkWindow *parent, const gchar *message, GError *error); +gboolean gdict_is_devel_build (void); + G_END_DECLS #endif /* __GDICT_COMMON_H__ */ @@ -34,7 +34,7 @@ main (int argc, char *argv[]) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - g_set_prgname ("gnome-dictionary"); + g_set_prgname (APPLICATION_ID); if (!gdict_create_config_dir ()) exit (1); diff --git a/src/meson.build b/src/meson.build index 8823968..915331a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -17,18 +17,27 @@ resources = gnome.compile_resources ('gdict-resources', c_name: 'gdict', ) +gdict_cflags = [ + '-DPREFIX="@0@"'.format(gdict_prefix), + '-DSYSCONFDIR="@0@"'.format(gdict_sysconfdir), + '-DLIBDIR="@0@"'.format(gdict_libdir), + '-DDATADIR="@0@"'.format(gdict_datadir), + '-DPKGDATADIR="@0@"'.format(join_paths(gdict_datadir, 'gnome-dictionary')), + '-DGNOMELOCALEDIR="@0@"'.format(join_paths(gdict_datadir, 'locale')), + '-DAPPLICATION_ID="@0@"'.format(application_id), +] + +if profile == 'devel' or gdict_minor_version in ['alpha', 'beta', 'rc'] + gdict_cflags += [ + '-DDEVELOPMENT_BUILD', + ] +endif + mathlib = cc.find_library('m', required: false) executable('gnome-dictionary', sources: app_sources + resources, - c_args: [ - '-DPREFIX="@0@"'.format(gdict_prefix), - '-DSYSCONFDIR="@0@"'.format(gdict_sysconfdir), - '-DLIBDIR="@0@"'.format(gdict_libdir), - '-DDATADIR="@0@"'.format(gdict_datadir), - '-DPKGDATADIR="@0@"'.format(join_paths(gdict_datadir, 'gnome-dictionary')), - '-DGNOMELOCALEDIR="@0@"'.format(join_paths(gdict_datadir, 'locale')), - ], + c_args: gdict_cflags, dependencies: [ libgdict_dep, mathlib ], include_directories: root_inc, install: true, |