From 5b2f1c7914f5632362813a304659a3971e595d50 Mon Sep 17 00:00:00 2001 From: Riccardo Albertini Date: Tue, 20 Sep 2011 12:22:45 +0200 Subject: Added a comment about libusb dependency in Makefile. Due to libdivecomputer's dependency, can be necessary to add libusb to pkg-config in order to compile, so I exported the pkg-config line in the subsurface target to LIBS variable, and added a comment about libusb. Signed-off-by: Riccardo Albertini --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2f24eb7de..8f12d0a0a 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,15 @@ LIBDIVECOMPUTERDIR = /usr/local LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a +# Add libusb in case of libdivecomputer compiled with usb support. +LIBS = `pkg-config --libs gtk+-2.0 glib-2.0 gconf-2.0` + OBJS = main.o dive.o profile.o info.o equipment.o divelist.o \ parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o subsurface: $(OBJS) $(CC) $(LDFLAGS) -o subsurface $(OBJS) \ - `xml2-config --libs` \ - `pkg-config --libs gtk+-2.0 glib-2.0 gconf-2.0` \ + `xml2-config --libs` $(LIBS) \ $(LIBDIVECOMPUTERARCHIVE) -lpthread parse-xml.o: parse-xml.c dive.h -- cgit v1.2.3-70-g09d2 From e3176882490a012097ae2d158eb8ea0cfb2b5804 Mon Sep 17 00:00:00 2001 From: Riccardo Albertini Date: Tue, 20 Sep 2011 12:32:40 +0200 Subject: Provide an icon for subsurface. I designed a simple blue icon for subsurface with a diver in the middle. As suggested by Dirk Hohndel, I added the surface line above diver's head, so that now the icon reflects better the new application name. Signed-off-by: Riccardo Albertini --- icon.svg | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ main.c | 1 + 2 files changed, 146 insertions(+) create mode 100644 icon.svg diff --git a/icon.svg b/icon.svg new file mode 100644 index 000000000..29410c8ee --- /dev/null +++ b/icon.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/main.c b/main.c index cc90e4235..6e6bbd084 100644 --- a/main.c +++ b/main.c @@ -447,6 +447,7 @@ int main(int argc, char **argv) error_info_bar = NULL; win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_icon_from_file(GTK_WINDOW(win), "icon.svg", NULL); g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(on_destroy), NULL); main_window = win; -- cgit v1.2.3-70-g09d2 From 9a853c564c9bb47bc91e74d54d69443eeb4c3449 Mon Sep 17 00:00:00 2001 From: Riccardo Albertini Date: Tue, 20 Sep 2011 14:44:45 +0200 Subject: Fix Segmentation fault when trying to print an empty plot. When printing an empty plot, the function was missing nullability check for 'current_dive'. Now the print of an empty plot results with an empty blank page. A better solution could be making unsensitive the Print entry in the menu, until a plot is loaded. Signed-off-by: Riccardo Albertini --- print.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/print.c b/print.c index 0fe958a00..57cac8075 100644 --- a/print.c +++ b/print.c @@ -22,7 +22,8 @@ static void draw_page(GtkPrintOperation *operation, h = gtk_print_context_get_height(context); /* Do the profile on the top half of the page.. */ - plot(&gc, w, h/2, current_dive); + if (current_dive) + plot(&gc, w, h/2, current_dive); pango_cairo_show_layout(cr,layout); g_object_unref(layout); -- cgit v1.2.3-70-g09d2