Commit 90efa0e1 authored by Christian Hergert's avatar Christian Hergert
Browse files

credits: include version in credits screen

parent 891dfe18
m4_define([project_name],[gnome-builder])
m4_define([project_major_version],[0])
m4_define([project_minor_version],[1])
m4_define([project_micro_version],[0])
m4_define([project_interface_age],[0])
m4_define([project_bugreport_url],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-builder])
AC_PREREQ(2.60)
m4_include([build/autotools/project_info.m4])
m4_define([project_name],[gnome-builder])
m4_define([project_major_version],[0])
m4_define([project_minor_version],[1])
m4_define([project_micro_version],[0])
m4_define([project_interface_age],[0])
m4_define([project_bugreport_url],
[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-builder])
# Initialize autoconf and things that go with it.
m4_include([build/autotools/autoconf.d/pre-ac.m4])
......@@ -30,9 +36,18 @@ m4_ifdef([GTK_DOC_CHECK],[
GTK_DOC_CHECK
])
MAJOR_VERSION=project_major_version
MINOR_VERSION=project_minor_version
MICRO_VERSION=project_micro_version
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
# Define our known config files.
AC_CONFIG_FILES([
Makefile
src/util/gb-version.h
data/icons/Makefile
data/org.gnome.builder.editor.gschema.xml
data/org.gnome.builder.editor.language.gschema.xml
......
......@@ -20,6 +20,7 @@
#include "gb-animation.h"
#include "gb-credits-widget.h"
#include "gb-version.h"
#include "gb-widget.h"
struct _GbCreditsWidgetPrivate
......@@ -27,6 +28,7 @@ struct _GbCreditsWidgetPrivate
GbAnimation *animation;
GtkGrid *grid;
GtkEventBox *event_box;
GtkLabel *title;
gdouble progress;
guint duration;
};
......@@ -283,18 +285,24 @@ gb_credits_widget_class_init (GbCreditsWidgetClass *klass)
g_object_class_install_property (object_class, PROP_PROGRESS,
gParamSpecs [PROP_PROGRESS]);
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/builder/ui/gb-credits-widget.ui");
gtk_widget_class_bind_template_child_private (widget_class, GbCreditsWidget, grid);
gtk_widget_class_bind_template_child_private (widget_class, GbCreditsWidget, event_box);
GB_WIDGET_CLASS_TEMPLATE (widget_class, "gb-credits-widget.ui");
GB_WIDGET_CLASS_BIND (widget_class, GbCreditsWidget, title);
GB_WIDGET_CLASS_BIND (widget_class, GbCreditsWidget, grid);
GB_WIDGET_CLASS_BIND (widget_class, GbCreditsWidget, event_box);
}
static void
gb_credits_widget_init (GbCreditsWidget *self)
{
gchar *label;
self->priv = gb_credits_widget_get_instance_private (self);
self->priv->duration = 1000 * 20;
gtk_widget_init_template (GTK_WIDGET (self));
label = g_strdup_printf (_("GNOME Builder - %s"), GB_VERSION_S);
gtk_label_set_label (self->priv->title, label);
g_free (label);
}
......@@ -233,7 +233,7 @@ and the Friends of GNOME</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label11">
<object class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">GNOME Builder</property>
......
/* gb-version.h.in
*
* Copyright (C) 2014 Christian Hergert <christian@hergert.me>
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GB_VERSION_H
#define GB_VERSION_H
#define GB_MAJOR_VERSION (@MAJOR_VERSION@)
#define GB_MINOR_VERSION (@MINOR_VERSION@)
#define GB_MICRO_VERSION (@MICRO_VERSION@)
#define GB_VERSION (@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@)
#define GB_VERSION_S "@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@"
#define GB_VERSION_HEX (GB_MAJOR_VERSION << 24 | \
GB_MINOR_VERSION << 16 | \
GB_MICRO_VERSION << 8)
#define GB_CHECK_VERSION(major,minor,micro) \
(GB_MAJOR_VERSION > (major) || \
(GB_MAJOR_VERSION == (major) && GB_MINOR_VERSION > (minor)) || \
(GB_MAJOR_VERSION == (major) && GB_MINOR_VERSION == (minor) && \
GB_MICRO_VERSION >= (micro)))
#endif /* GB_VERSION_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment