From: Kaj-Michael Lang Date: Sat, 21 Jul 2007 17:54:57 +0000 (+0300) Subject: misc X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=287de2a192895d331c6f33c0a432bb4a9a64e073;p=mapper misc --- diff --git a/intltool-update b/intltool-update index 43a83d0..986e88e 100755 --- a/intltool-update +++ b/intltool-update @@ -565,7 +565,7 @@ sub Console_WriteError_InvalidOption sub GenerateHeaders { - my $EXTRACT = "/home/milang/devel/mapper/intltool-extract"; + my $EXTRACT = "/data/repos/mapper/intltool-extract"; chomp $EXTRACT; $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"}; diff --git a/src/config.h.in b/src/config.h.in index 48035ea..1a55248 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -24,6 +24,9 @@ /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES +/* Defined if you have libexpat */ +#undef HAVE_LIBEXPAT + /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H diff --git a/src/gps-panels.c b/src/gps-panels.c index 9d37568..f0bd846 100644 --- a/src/gps-panels.c +++ b/src/gps-panels.c @@ -737,146 +737,166 @@ gps_display_details(void) return TRUE; } +void gps_details_dialog(void) +{ +GtkWidget *dialog; + +dialog = gtk_dialog_new_with_buttons(_("GPS Details"), + GTK_WINDOW(_window), + GTK_DIALOG_MODAL, GTK_STOCK_OK, + GTK_RESPONSE_ACCEPT, NULL); + +gtk_window_set_default_size(GTK_WINDOW(dialog), 600, 300); + +gtk_widget_show_all(dialog); +_satdetails_on = TRUE; +gps_display_details(); +while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { + _satdetails_on = FALSE; + break; +} +gtk_widget_destroy(dialog); + +} + void gps_details(void) { - GtkWidget *dialog; - GtkWidget *table; - GtkWidget *label; - GtkWidget *notebook; - printf("%s()\n", __PRETTY_FUNCTION__); +GtkWidget *dialog; +GtkWidget *table; +GtkWidget *label; +GtkWidget *notebook; +printf("%s()\n", __PRETTY_FUNCTION__); - dialog = gtk_dialog_new_with_buttons(_("GPS Details"), - GTK_WINDOW(_window), - GTK_DIALOG_MODAL, GTK_STOCK_OK, - GTK_RESPONSE_ACCEPT, NULL); - - gtk_window_set_default_size(GTK_WINDOW(dialog), 600, 300); - - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), - notebook = gtk_notebook_new(), TRUE, TRUE, 0); - - /* textual info */ - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), - table = gtk_table_new(4, 6, FALSE), - label = gtk_label_new(_("GPS Information"))); - - _sat_details_panel = gtk_drawing_area_new(); - gtk_widget_set_size_request(_sat_details_panel, 300, 300); - /* sat details info */ - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), - _sat_details_panel, - label = - gtk_label_new(_("Satellites details"))); - g_signal_connect(G_OBJECT(_sat_details_panel), "expose_event", - G_CALLBACK(sat_details_panel_expose), NULL); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Latitude")), - 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_lat = gtk_label_new(" --- "), - 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_lat), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Longitude")), - 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_lon = gtk_label_new(" --- "), - 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_lon), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Speed")), - 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_spd = gtk_label_new(" --- "), - 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_spd), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Altitude")), - 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_alt = gtk_label_new(" --- "), - 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_alt), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Heading")), - 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_hea = gtk_label_new(" --- "), - 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_hea), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Local time")), - 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_tim = gtk_label_new(" --:--:-- "), - 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_tim), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Sat in view")), - 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_vie = gtk_label_new("0"), - 3, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_vie), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Sat in use")), - 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_use = gtk_label_new("0"), - 3, 4, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_use), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Fix")), - 2, 3, 2, 3, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_fix = gtk_label_new(_("nofix")), - 3, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_fix), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Fix Quality")), - 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_fqu = gtk_label_new(_("none")), - 3, 4, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_fqu), 0.f, 0.5f); - - gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("Max speed")), - 2, 3, 5, 6, GTK_EXPAND | GTK_FILL, 0, 20, 4); - gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); - gtk_table_attach(GTK_TABLE(table), - _sdi_msp = gtk_label_new(" --- "), - 3, 4, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 4); - gtk_misc_set_alignment(GTK_MISC(_sdi_msp), 0.f, 0.5f); - - gtk_widget_show_all(dialog); - _satdetails_on = TRUE; - gps_display_details(); - while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { - _satdetails_on = FALSE; - break; - } - gtk_widget_destroy(dialog); +dialog = gtk_dialog_new_with_buttons(_("GPS Details"), + GTK_WINDOW(_window), + GTK_DIALOG_MODAL, GTK_STOCK_OK, + GTK_RESPONSE_ACCEPT, NULL); + +gtk_window_set_default_size(GTK_WINDOW(dialog), 600, 300); +gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), + notebook = gtk_notebook_new(), TRUE, TRUE, 0); + +/* textual info */ +gtk_notebook_append_page(GTK_NOTEBOOK(notebook), + table = gtk_table_new(4, 6, FALSE), + label = gtk_label_new(_("GPS Information"))); + +_sat_details_panel = gtk_drawing_area_new(); +gtk_widget_set_size_request(_sat_details_panel, 300, 300); +/* sat details info */ +gtk_notebook_append_page(GTK_NOTEBOOK(notebook), + _sat_details_panel, + label = gtk_label_new(_("Satellites details"))); +g_signal_connect(G_OBJECT(_sat_details_panel), "expose_event", + G_CALLBACK(sat_details_panel_expose), NULL); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Latitude")), + 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_lat = gtk_label_new(" --- "), + 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_lat), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Longitude")), + 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_lon = gtk_label_new(" --- "), + 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_lon), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Speed")), + 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_spd = gtk_label_new(" --- "), + 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_spd), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Altitude")), + 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_alt = gtk_label_new(" --- "), + 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_alt), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Heading")), + 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_hea = gtk_label_new(" --- "), + 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_hea), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Local time")), + 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_tim = gtk_label_new(" --:--:-- "), + 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_tim), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Sat in view")), + 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_vie = gtk_label_new("0"), + 3, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_vie), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Sat in use")), + 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_use = gtk_label_new("0"), + 3, 4, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_use), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Fix")), + 2, 3, 2, 3, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_fix = gtk_label_new(_("nofix")), + 3, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_fix), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Fix Quality")), + 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_fqu = gtk_label_new(_("none")), + 3, 4, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_fqu), 0.f, 0.5f); + +gtk_table_attach(GTK_TABLE(table), + label = gtk_label_new(_("Max speed")), + 2, 3, 5, 6, GTK_EXPAND | GTK_FILL, 0, 20, 4); +gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); +gtk_table_attach(GTK_TABLE(table), + _sdi_msp = gtk_label_new(" --- "), + 3, 4, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 4); +gtk_misc_set_alignment(GTK_MISC(_sdi_msp), 0.f, 0.5f); + +gtk_widget_show_all(dialog); +_satdetails_on = TRUE; +gps_display_details(); +while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { + _satdetails_on = FALSE; + break; +} +gtk_widget_destroy(dialog); - vprintf("%s(): return\n", __PRETTY_FUNCTION__); +vprintf("%s(): return\n", __PRETTY_FUNCTION__); } diff --git a/src/route.c b/src/route.c index 55e406d..6d4a136 100644 --- a/src/route.c +++ b/src/route.c @@ -55,10 +55,14 @@ if (open_file(&buffer, NULL, &size, &_route_dir_uri, NULL, GTK_FILE_CHOOSER_ACTI map_force_redraw(); MACRO_BANNER_SHOW_INFO(_window, _("Route Opened")); - } else + return TRUE; + } else { popup_error(_window, _("Error parsing GPX file.")); - g_free(buffer); + g_free(buffer); + return FALSE; + } } +return FALSE; } gboolean diff --git a/src/track.c b/src/track.c index ad9b12e..14055aa 100644 --- a/src/track.c +++ b/src/track.c @@ -254,9 +254,9 @@ gboolean track_open(void) map_force_redraw(); MACRO_BANNER_SHOW_INFO(_window, _("Track Opened")); r = TRUE; - } else + } else { popup_error(_window, _("Error parsing GPX file.")); - + } g_free(buffer); } return r; @@ -267,14 +267,13 @@ gboolean track_save(void) GnomeVFSHandle *handle; gboolean r = FALSE; -/* if (open_file(NULL, &handle, NULL, NULL, &_track_file_uri, GTK_FILE_CHOOSER_ACTION_SAVE)) { */ - if (file_save(_track_file_uri, _track_file_uri, &handle)) { if (write_gpx(&_track, handle)) { MACRO_BANNER_SHOW_INFO(_window, _("Track Saved")); r = TRUE; - } else + } else { popup_error(_window, _("Error writing GPX file.")); + } gnome_vfs_close(handle); } return r;