1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-22 14:08:28 +02:00

Show fped's SVN revision in the title bar.

- Makefile: pass SVN version and commit status to CPP
- gui.c (gui_main): show SVN revision in the title bar, if available



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5845 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2010-02-18 14:03:14 +00:00
parent 3d6ef48930
commit 53a01182a3
2 changed files with 11 additions and 2 deletions

View File

@ -37,13 +37,18 @@ LIBS_GTK = `pkg-config --libs gtk+-2.0`
CFLAGS_WARN = -Wall -Wshadow -Wmissing-prototypes \
-Wmissing-declarations -Wno-format-zero-length
CFLAGS = -g -std=gnu99 $(CFLAGS_GTK) -DCPP='"cpp"' $(CFLAGS_WARN)
CFLAGS = -g -std=gnu99 $(CFLAGS_GTK) -DCPP='"cpp"' \
-DSVN_VERSION='"$(SVN_VERSION)$(SVN_STATUS)"' $(CFLAGS_WARN)
SLOPPY = -Wno-unused -Wno-implicit-function-declaration \
-Wno-missing-prototypes -Wno-missing-declarations
LDLIBS = -lm -lfl $(LIBS_GTK)
YACC = bison -y
YYFLAGS = -v
SVN_VERSION=$(shell svn info | sed '/Last Changed Rev: /s///p;d')
SVN_STATUS=$(shell [ -z "`svn status -q`" ] || echo +)
# ----- Verbosity control -----------------------------------------------------
CPP := $(CPP) # make sure changing CC won't affect CPP

6
gui.c
View File

@ -314,7 +314,11 @@ int gui_main(void)
root = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(root), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(root), 620, 460);
gtk_window_set_title(GTK_WINDOW(root), "fped");
if (*SVN_VERSION)
gtk_window_set_title(GTK_WINDOW(root),
"fped (rev " SVN_VERSION ")");
else
gtk_window_set_title(GTK_WINDOW(root), "fped");
/* get root->window */
gtk_widget_show_all(root);