From a6f0b402e7239e1c2c48db09e42878bfebc7b264 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 11 Jun 2007 18:01:21 +0300 Subject: [PATCH] misc --- src/cb.c | 25 ++++++++++++------------- src/cb.h | 1 + src/mapper.c | 24 +++--------------------- src/poi.h | 28 ++++++++++++++++++++++++++-- src/ui-common.c | 34 ++++++++++++---------------------- 5 files changed, 54 insertions(+), 58 deletions(-) diff --git a/src/cb.c b/src/cb.c index f8bc6d1..1f3e5a7 100644 --- a/src/cb.c +++ b/src/cb.c @@ -594,12 +594,17 @@ gboolean cb_zoomout(GtkAction * action) return TRUE; } +gboolean cb_fullscreen_click(GtkAction * action) +{ + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item), !_fullscreen); + return TRUE; +} + gboolean cb_fullscreen(GtkAction * action) { printf("%s()\n", __PRETTY_FUNCTION__); - if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM - (_menu_fullscreen_item)))) + if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item)))) gtk_window_fullscreen(GTK_WINDOW(_window)); else gtk_window_unfullscreen(GTK_WINDOW(_window)); @@ -622,8 +627,7 @@ gboolean menu_cb_enable_gps(GtkAction * action) rcvr_connect_now(); } else { popup_error(_window, - _ - ("Cannot enable GPS until a GPS Receiver MAC " + _("Cannot enable GPS until a GPS Receiver MAC " "is set in the Settings dialog box.")); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM (_menu_enable_gps_item), @@ -638,8 +642,7 @@ gboolean menu_cb_enable_gps(GtkAction * action) } map_move_mark(); gps_show_info(); - gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item), - _enable_gps); + gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item), _enable_gps); gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_reset_item), _enable_gps); vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__); @@ -651,12 +654,10 @@ gboolean menu_cb_auto_download(GtkAction * action) printf("%s()\n", __PRETTY_FUNCTION__); if ((_auto_download = - gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM - (_menu_auto_download_item)))) { + gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_auto_download_item)))) { if (_curr_repo->url == REPOTYPE_NONE) popup_error(_window, - _ - ("NOTE: You must set a Map URI in the current repository in " + _("NOTE: You must set a Map URI in the current repository in " "order to download maps.")); map_force_redraw(); } @@ -826,9 +827,7 @@ gboolean window_cb_key_press(GtkWidget * widget, GdkEventKey * event) break; case CUSTOM_ACTION_TOGGLE_FULLSCREEN: - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_fullscreen_item), - !_fullscreen); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item), !_fullscreen); break; case CUSTOM_ACTION_TOGGLE_TRACKS: diff --git a/src/cb.h b/src/cb.h index 7c22e7f..8306265 100644 --- a/src/cb.h +++ b/src/cb.h @@ -55,6 +55,7 @@ gboolean cb_zoom_base(GtkAction * action); gboolean cb_zoomin(GtkAction * action); gboolean cb_zoomout(GtkAction * action); gboolean cb_fullscreen(GtkAction * action); +gboolean cb_fullscreen_click(GtkAction * action); gboolean menu_cb_show_scale(GtkAction * action); gboolean menu_cb_show_routes(GtkAction * action); gboolean menu_cb_show_tracks(GtkAction * action); diff --git a/src/mapper.c b/src/mapper.c index 3cab0bf..e605a4b 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -45,7 +44,6 @@ #include #include #include -#include #ifdef WITH_HILDON #include @@ -68,8 +66,6 @@ #include #include -#include - #include "utils.h" #include "poi.h" #include "route.h" @@ -79,15 +75,9 @@ #include "mapper-types.h" #include "bt.h" #include "ui-common.h" - -/* Callbacks */ #include "cb.h" -gfloat UNITS_CONVERT[] = { - 1.85200, - 1.15077945, - 1.f, -}; +gfloat UNITS_CONVERT[] = {1.85200,1.15077945,1.f,}; GdkColor COLORABLE_DEFAULT[COLORABLE_ENUM_COUNT] = { {0, 0x0000, 0x0000, 0xc000} @@ -239,7 +229,7 @@ void mapper_destroy(void) void set_var_defaults(void) { - _conn_state = RCVR_OFF; +_conn_state = RCVR_OFF; } gint mapper_osso_init(void) @@ -276,7 +266,6 @@ localtime_r(&time1, &time2); _gmtoffset = time2.tm_gmtoff; } - gint main(gint argc, gchar * argv[]) { printf("%s()\n", __PRETTY_FUNCTION__); @@ -289,15 +278,10 @@ gint main(gint argc, gchar * argv[]) g_thread_init(NULL); g_type_init(); - if (mapper_osso_init()!=0) return 1; - - set_var_defaults(); - -#ifdef WITH_GSTREAMER + set_var_defaults(); gst_init(&argc, &argv); -#endif gtk_init(&argc, &argv); gconf_init(argc, argv, NULL); gnome_vfs_init(); @@ -309,11 +293,9 @@ gint main(gint argc, gchar * argv[]) return 1; gtk_main(); mapper_destroy(); - #ifdef WITH_HILDON osso_deinitialize(_osso); #endif - vprintf("%s(): return\n", __PRETTY_FUNCTION__); return 0; } diff --git a/src/poi.h b/src/poi.h index dfa48b0..a38b2ad 100644 --- a/src/poi.h +++ b/src/poi.h @@ -29,14 +29,38 @@ create table poi ( -- Shared categories for POIs and landmarks create table category ( cat_id integer PRIMARY KEY, + pcat_id int, priority int, - label text, - desc text, + label text, + desc text, color char(6), icon varchar(32), enabled integer ); +Categories: +Fuel + - Esso, Teboil, BP, Nest, etc +Parking +Residence +Dining + - Restaurant +Fast food +Shopping/Services +Recreation +Transportation + - Bus + - Train + - Boat/Ferry + - Plane +Lodging + - Hotell + - Motell +School +Business +Landmark +Other + */ #ifndef _MAPPER_POI_H diff --git a/src/ui-common.c b/src/ui-common.c index edc46d0..858febc 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -177,7 +177,7 @@ void progress_update_info_free(ProgressUpdateInfo * pui) } /** - * Call gtk_window_present() on Maemo Mapper. This also checks the + * Call gtk_window_present() on Mapper. This also checks the * configuration and brings up the Settings dialog if the GPS Receiver is * not set up, the first time it is called. */ @@ -195,37 +195,29 @@ gboolean window_present() gtk_window_present(GTK_WINDOW(_window)); #ifdef WITH_HILDON - confirm = - hildon_note_new_confirmation(GTK_WINDOW(_window), - _ + confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), ("It looks like this is your first time running" - " Maemo Mapper. Press OK to view the the help pages." + " Mapper. Press OK to view the the help pages." " Otherwise, press Cancel to continue.")); - if (GTK_RESPONSE_OK == - gtk_dialog_run(GTK_DIALOG(confirm))) + if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) ossohelp_show(_osso, HELP_ID_INTRO, 0); gtk_widget_destroy(confirm); #endif if (settings_dialog()) { popup_error(_window, - _ - ("OpenStreetMap.org provides public, free-to-use maps. " + _("OpenStreetMap.org provides public, free-to-use maps. " "You can also download a sample set of repositories from " " the internet by using the \"Download...\" button.")); repoman_dialog(); if (_curr_repo->type != REPOTYPE_NONE) { - confirm = - hildon_note_new_confirmation + confirm = hildon_note_new_confirmation (GTK_WINDOW(_window), - _ - ("You will now see a blank screen. You can download" + _("You will now see a blank screen. You can download" " maps using the \"Manage Maps\" menu item in the" " \"Maps\" menu. Or, press OK to enable" " Auto-Download.")); - if (GTK_RESPONSE_OK == - gtk_dialog_run(GTK_DIALOG(confirm))) - { + if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (_menu_auto_download_item), @@ -745,7 +737,7 @@ gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); item = gtk_tool_button_new_from_stock (GTK_STOCK_FULLSCREEN); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); -g_signal_connect (item, "clicked", G_CALLBACK (cb_fullscreen), NULL); +g_signal_connect (item, "clicked", G_CALLBACK (cb_fullscreen_click), NULL); item = gtk_separator_tool_item_new(); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); @@ -919,7 +911,7 @@ void mapper_init(gint argc, gchar ** argv) gtk_box_pack_start(GTK_BOX(vbox_main), _toolbar, FALSE, FALSE, 0); hbox = gtk_hbox_new(FALSE, 0); - gtk_notebook_append_page(notebook, hbox, label); + gtk_notebook_append_page(GTK_WIDGET(notebook), hbox, label); gtk_box_pack_start(GTK_BOX(vbox_main), notebook, TRUE, TRUE, 0); _status_bar = gtk_statusbar_new(); @@ -1153,11 +1145,9 @@ void mapper_init(gint argc, gchar ** argv) popup_error(_window, buffer); } else { if (parse_gpx(&_route, buffer, size, 0)) { - MACRO_BANNER_SHOW_INFO(_window, - _("Route Opened")); + MACRO_BANNER_SHOW_INFO(_window, _("Route Opened")); } else - popup_error(_window, - _("Error parsing GPX file.")); + popup_error(_window, _("Error parsing GPX file.")); g_free(buffer); } g_free(file_uri); -- 2.39.5