app: Include commit hash in display shell message

This commit is contained in:
Mukund Sivaraman
2015-03-12 12:07:32 +05:30
parent 0fdde98f6d
commit 2c80affe4c

View File

@ -46,6 +46,8 @@
#include "gimpimagewindow.h" #include "gimpimagewindow.h"
#include "gimpnavigationeditor.h" #include "gimpnavigationeditor.h"
#include "git-version.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -515,18 +517,27 @@ gimp_display_shell_canvas_draw_drop_zone (GimpDisplayShell *shell,
#ifdef GIMP_UNSTABLE #ifdef GIMP_UNSTABLE
{ {
PangoLayout *layout; PangoLayout *layout;
const gchar *version;
gchar *short_hash;
gchar *msg;
GtkAllocation allocation; GtkAllocation allocation;
gint width; gint width;
gint height; gint height;
gdouble scale; gdouble scale;
layout = gtk_widget_create_pango_layout (shell->canvas, NULL); layout = gtk_widget_create_pango_layout (shell->canvas, NULL);
pango_layout_set_markup (layout,
_("<big>Unstable Development Version</big>\n\n" version = GIMP_GIT_VERSION;
"<small>Please build latest " short_hash = g_strdup (version + strlen (version) - 7);
"git master before\n" msg = g_strdup_printf (_("<big>Unstable Development Version</big>\n\n"
"reporting any bugs against " "<small>commit <tt>%s</tt></small>\n\n"
"this version</small>"), -1); "<small>Please build latest "
"git master before\n"
"reporting any bugs against "
"this version.</small>"), short_hash);
pango_layout_set_markup (layout, msg, -1);
g_free (msg);
g_free (short_hash);
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER); pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
pango_layout_get_pixel_size (layout, &width, &height); pango_layout_get_pixel_size (layout, &width, &height);