From: Kaj-Michael Lang Date: Mon, 4 Jun 2007 06:49:48 +0000 (+0300) Subject: Fix POI db handling so it works. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e2d0bd593ec479499f76c8e6013ed1264fc5e61;p=mapper Fix POI db handling so it works. Use status bar for message in !hildon mode. Timeout messages in 5 seconds. Misc other changes. --- diff --git a/src/cb.c b/src/cb.c index 0c32875..8b617bd 100644 --- a/src/cb.c +++ b/src/cb.c @@ -702,8 +702,8 @@ gboolean menu_cb_about(GtkAction * action) #ifdef WITH_HILDON ossohelp_show(_osso, HELP_ID_ABOUT, OSSO_HELP_SHOW_DIALOG); #else - gtk_show_about_dialog(GTK_WINDOW(_window), "name", "OSM-Mapper", - "version", "0.1", NULL); + gtk_show_about_dialog(GTK_WINDOW(_window), "name", "Mapper", + "version", VERSION, NULL); #endif vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__); @@ -947,6 +947,8 @@ void cmenu_show_latlon(guint unitx, guint unity) gchar buffer[80], tmp1[16], tmp2[16]; printf("%s()\n", __PRETTY_FUNCTION__); + g_printf("S: %d %d\n", unitx, unity); + unit2latlon(unitx, unity, lat, lon); lat_format(lat, tmp1); lon_format(lon, tmp2); diff --git a/src/cb.h b/src/cb.h index 5070e1a..92c680d 100644 --- a/src/cb.h +++ b/src/cb.h @@ -20,12 +20,9 @@ gboolean heading_panel_expose(GtkWidget * widget, GdkEventExpose * event); gboolean sat_panel_expose(GtkWidget * widget, GdkEventExpose * event); gboolean sat_details_panel_expose(GtkWidget * widget, GdkEventExpose * event); -gboolean -channel_cb_error(GIOChannel * src, GIOCondition condition, gpointer data); -gboolean -channel_cb_connect(GIOChannel * src, GIOCondition condition, gpointer data); -gboolean -channel_cb_input(GIOChannel * src, GIOCondition condition, gpointer data); +gboolean channel_cb_error(GIOChannel * src, GIOCondition condition, gpointer data); +gboolean channel_cb_connect(GIOChannel * src, GIOCondition condition, gpointer data); +gboolean channel_cb_input(GIOChannel * src, GIOCondition condition, gpointer data); /* Callbacks for the "Route" submenu. */ gboolean menu_cb_route_download(GtkAction * action); diff --git a/src/config.c b/src/config.c index 209cf5f..d13ee6a 100644 --- a/src/config.c +++ b/src/config.c @@ -22,6 +22,7 @@ #include "mapper-types.h" #include "map.h" #include "route.h" +#include "db.h" #include "poi.h" #include "gps.h" #include "ui-common.h" @@ -744,7 +745,7 @@ void config_init() gnome_vfs_uri_make_full_from_relative(poi_base, "poi.db"); g_free(poi_base); } - db_connect(_db, _poi_db); + db_connect(&_db, _poi_db); _poi_zoom = gconf_client_get_int(gconf_client, GCONF_KEY_POI_ZOOM, NULL); diff --git a/src/db.c b/src/db.c index 2e4a78f..9fc62d1 100644 --- a/src/db.c +++ b/src/db.c @@ -1,3 +1,5 @@ +#include "config.h" + #include #include @@ -6,29 +8,55 @@ #include #include -static sqlite3_stmt *_stmt_select_poi = NULL; -static sqlite3_stmt *_stmt_select_nearest_poi = NULL; -static sqlite3_stmt *_stmt_insert_poi = NULL; -static sqlite3_stmt *_stmt_update_poi = NULL; -static sqlite3_stmt *_stmt_delete_poi = NULL; -static sqlite3_stmt *_stmt_delete_poi_by_catid = NULL; -static sqlite3_stmt *_stmt_nextlabel_poi = NULL; - -static sqlite3_stmt *_stmt_select_cat = NULL; -static sqlite3_stmt *_stmt_insert_cat = NULL; -static sqlite3_stmt *_stmt_update_cat = NULL; -static sqlite3_stmt *_stmt_delete_cat = NULL; -static sqlite3_stmt *_stmt_toggle_cat = NULL; -static sqlite3_stmt *_stmt_selall_cat = NULL; - -gboolean db_connect(sqlite3 * db, gchar * poi_db) +#include "utils.h" +#include "ui-common.h" +#include "poi.h" + +sqlite3_stmt *_stmt_select_poi = NULL; +sqlite3_stmt *_stmt_select_nearest_poi = NULL; +sqlite3_stmt *_stmt_insert_poi = NULL; +sqlite3_stmt *_stmt_update_poi = NULL; +sqlite3_stmt *_stmt_delete_poi = NULL; +sqlite3_stmt *_stmt_delete_poi_by_catid = NULL; +sqlite3_stmt *_stmt_nextlabel_poi = NULL; + +sqlite3_stmt *_stmt_select_cat = NULL; +sqlite3_stmt *_stmt_insert_cat = NULL; +sqlite3_stmt *_stmt_update_cat = NULL; +sqlite3_stmt *_stmt_delete_cat = NULL; +sqlite3_stmt *_stmt_toggle_cat = NULL; +sqlite3_stmt *_stmt_selall_cat = NULL; + +gboolean db_prepare(sqlite3 *db) +{ + +return TRUE; +} + +gboolean db_close(sqlite3 *db) +{ +if (db) { + sqlite3_close(db); + db=NULL; +} +return TRUE; +} + +gboolean db_connect(sqlite3 **ndb, const gchar *poi_db) { gchar buffer[100]; gchar *perror; gchar **pszResult; guint nRow, nColumn; + sqlite3 *db; + printf("%s()\n", __PRETTY_FUNCTION__); + if (ndb && *ndb) + db=*ndb; + else + db=NULL; + if (db) { sqlite3_close(db); db = NULL; @@ -45,10 +73,12 @@ gboolean db_connect(sqlite3 * db, gchar * poi_db) sqlite3_errmsg(db)); sqlite3_close(db); db = NULL; - /* popup_error(_window, buffer2); */ + popup_error(_window, buffer2); return FALSE; } + *ndb=db; + if (SQLITE_OK != sqlite3_get_table(db, "select label from poi limit 1", &pszResult, &nRow, &nColumn, NULL)) { gchar *create_sql; @@ -117,7 +147,7 @@ gboolean db_connect(sqlite3 * db, gchar * poi_db) sqlite3_errmsg(db)); sqlite3_close(db); db = NULL; - /*popup_error(_window, buffer); */ + popup_error(_window, buffer); return FALSE; } } else diff --git a/src/file.c b/src/file.c index 520e646..0db786b 100644 --- a/src/file.c +++ b/src/file.c @@ -11,6 +11,93 @@ #include "ui-common.h" #include "hildon-wrappers.h" +gboolean +file_open(gchar *dir, gchar *file, GnomeVFSHandle **vfs) +{ +GtkWidget *dialog; +gboolean success; + +#ifdef WITH_HILDON +dialog = hildon_file_chooser_dialog_new(GTK_WINDOW(_window), GTK_FILE_CHOOSER_ACTION_OPEN); +#else +dialog = gtk_file_chooser_dialog_new("Open...", GTK_WINDOW(_window), GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, + GTK_RESPONSE_ACCEPT, NULL); +#endif + +if (dir) + gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(dialog), dir); + +if (file) + gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(dialog), file); + +while (!success && gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { + gchar *file_uri_str; + GnomeVFSResult vfs_result; + + /* Get the selected filename. */ + file_uri_str = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); + + printf("file: %s\n", file_uri_str); + + g_free(file_uri_str); +} + +} + +gboolean +file_save(gchar *dir, gchar *file, GnomeVFSHandle **vfs) +{ +GtkWidget *dialog; +gboolean success; + +#ifdef WITH_HILDON +dialog = hildon_file_chooser_dialog_new(GTK_WINDOW(_window), GTK_FILE_CHOOSER_ACTION_SAVE); +#else +dialog = gtk_file_chooser_dialog_new("Save...", GTK_WINDOW(_window), GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, + GTK_RESPONSE_ACCEPT, NULL); +gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE); +#endif + +if (dir) + gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(dialog), dir); + +if (file) + gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(dialog), file); + +success=FALSE; +if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { + gchar *file_uri_str; + GnomeVFSResult vfs_result; + + file_uri_str = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); + vfs_result = gnome_vfs_create(vfs, file_uri_str, GNOME_VFS_OPEN_WRITE, FALSE, 0664); + g_free(file_uri_str); + + if (vfs_result!=GNOME_VFS_OK) { + success=FALSE; + } else { + if (dir) { + g_free(dir); + dir = gtk_file_chooser_get_current_folder_uri(GTK_FILE_CHOOSER(dialog)); + } + if (file) { + g_free(file); + file = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); + } + success=TRUE; + } +} + +gtk_widget_destroy(dialog); +return success; +} + /** * This is a multi-purpose function for allowing the user to select a file * for either reading or writing. If chooser_action is @@ -27,8 +114,7 @@ open_file(gchar ** bytes_out, GnomeVFSHandle ** handle_out, gint * size_out, gboolean success = FALSE; printf("%s()\n", __PRETTY_FUNCTION__); - dialog = - hildon_file_chooser_dialog_new(GTK_WINDOW(_window), chooser_action); + dialog = hildon_file_chooser_dialog_new(GTK_WINDOW(_window), chooser_action); if (dir && *dir) gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER diff --git a/src/hildon-wrappers.c b/src/hildon-wrappers.c index 7178874..a645642 100644 --- a/src/hildon-wrappers.c +++ b/src/hildon-wrappers.c @@ -32,45 +32,45 @@ GtkWidget *hildon_file_chooser_dialog_new(GtkWindow * parent, return dialog; } -void hildon_banner_show_information(void *w, void *t, gchar * text) +static gboolean +status_bar_clear(void) { - static guint cid = 0; - - if (cid != 0) - gtk_statusbar_pop(_status_bar, cid); + gtk_statusbar_pop(_status_bar, 0); + return FALSE; +} - cid = gtk_statusbar_get_context_id(_status_bar, text); - gtk_statusbar_push(_status_bar, cid, text); +void hildon_banner_show_information(GtkWidget *w, void *t, gchar *text) +{ + gtk_statusbar_pop(_status_bar, 0); + gtk_statusbar_push(_status_bar, 0, text); + g_timeout_add(5000, status_bar_clear, NULL); } GtkWidget *hildon_banner_show_progress(GtkWidget * widget, GtkProgressBar * bar, const gchar * text) { - hildon_banner_show_information(NULL, NULL, text); + hildon_banner_show_information(_status_bar, NULL, text); return NULL; } -GtkWidget *hildon_note_new_confirmation(GtkWidget * w, gchar * text) +GtkWidget *hildon_note_new_confirmation(GtkWidget *widget, const gchar *text) { - GtkWidget *dialog; - dialog = gtk_message_dialog_new(w, + return gtk_message_dialog_new(widget, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK_CANCEL, text); - - return dialog; } -void hildon_banner_set_fraction(GtkWidget * w, gfloat tmp) +void hildon_banner_set_fraction(GtkWidget * widget, gfloat tmp) { + } GtkWidget *hildon_banner_show_animation(GtkWidget * widget, const gchar * animation_name, const gchar * text) { - g_print(animation_name); - g_print(text); + hildon_banner_show_information(_status_bar, NULL, text); return NULL; } diff --git a/src/map.c b/src/map.c index a66beb8..c2c9188 100644 --- a/src/map.c +++ b/src/map.c @@ -1379,6 +1379,10 @@ gboolean map_cb_button_release(GtkWidget * widget, GdkEventButton * event) (_menu_ac_none_item), TRUE); + if (TRUE) { + map_draw_track(event->x, event->y); + } + map_center_unit(x2unit((gint) (event->x + 0.5)), y2unit((gint) (event->y + 0.5))); break; @@ -1396,7 +1400,6 @@ gboolean map_cb_button_release(GtkWidget * widget, GdkEventButton * event) before[1] = 0; break; case 3: - /* map_draw_track(event->x, event->y); */ break; } diff --git a/src/mapper.c b/src/mapper.c index 317501a..475ea74 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -138,8 +138,7 @@ void set_conn_state(ConnState new_conn_state) if (!_connect_banner) _connect_banner = hildon_banner_show_animation(_window, NULL, - _ - ("Searching for GPS receiver")); + _("Searching for GPS receiver")); break; case RCVR_UP: if (_connect_banner) { @@ -149,8 +148,7 @@ void set_conn_state(ConnState new_conn_state) if (!_fix_banner) _fix_banner = hildon_banner_show_progress(_window, NULL, - _ - ("Establishing GPS fix")); + _("Establishing GPS fix")); break; default:; /* to quell warning. */ } diff --git a/src/poi.h b/src/poi.h index 7932d6e..bd7d085 100644 --- a/src/poi.h +++ b/src/poi.h @@ -1,8 +1,54 @@ +/* + +POI table definitions: + +-- public POIs from different sources +-- (Fuel, pubs, museums, etc) +-- +create table poi ( + poi_id integer PRIMARY KEY, + cat_id integer, + source int, + source_id int, + type int, + lat real, + lon real, + elev real, + label text, + desc text, + wikipedia text, + url text, + phone varchar(64), + email varchar(64), +); + +-- type: +-- 0=POI +-- 1=Landmark + +-- Shared categories for POIs and landmarks +create table category ( + cat_id integer PRIMARY KEY, + priority int, + label text, + desc text, + color char(6), + icon varchar(32), + enabled integer +); + +*/ + #ifndef _MAPPER_POI_H #define _MAPPER_POI_H #include +typedef enum { + POI_TYPE_POINT=0, + POI_TYPE_LANDMARK=1, +} poi_types_e; + typedef struct _PoiDb PoiDb; struct _PoiDb { sqlite3 *db; diff --git a/src/route.c b/src/route.c index 1e29f52..48b7bd4 100644 --- a/src/route.c +++ b/src/route.c @@ -26,6 +26,7 @@ #include "settings.h" #include "mapper-types.h" #include "map.h" +#include "file.h" void route_find_nearest_point(); void cancel_autoroute(gboolean temporary); diff --git a/src/settings-gui.c b/src/settings-gui.c index 3d007ca..53a22fa 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -797,52 +797,39 @@ gboolean settings_dialog() rcvr_changed = TRUE; } - _center_ratio = - hildon_controlbar_get_value(HILDON_CONTROLBAR + _center_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR (num_center_ratio)); - _lead_ratio = - hildon_controlbar_get_value(HILDON_CONTROLBAR + _lead_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR (num_lead_ratio)); - _draw_width = - hildon_controlbar_get_value(HILDON_CONTROLBAR + _draw_width = hildon_controlbar_get_value(HILDON_CONTROLBAR (num_draw_width)); - _always_keep_on = - !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON + _always_keep_on = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (chk_always_keep_on)); _units = gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_units)); - _degformat = - gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_degformat)); + _degformat = gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_degformat)); - _speed_limit_on = - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON + _speed_limit_on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (chk_speed_limit_on)); - _speed_limit = - hildon_number_editor_get_value(HILDON_NUMBER_EDITOR + _speed_limit = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR (num_speed)); - _speed_location = - gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_speed_location)); + _speed_location = gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_speed_location)); - _info_font_size = - gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_info_font_size)); + _info_font_size = gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_info_font_size)); - _announce_notice_ratio = - hildon_controlbar_get_value(HILDON_CONTROLBAR + _announce_notice_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR (num_announce_notice)); - _voice_speed = - hildon_controlbar_get_value(HILDON_CONTROLBAR + _voice_speed = hildon_controlbar_get_value(HILDON_CONTROLBAR (num_voice_speed)) / 3.0; - _voice_pitch = - hildon_controlbar_get_value(HILDON_CONTROLBAR + _voice_pitch = hildon_controlbar_get_value(HILDON_CONTROLBAR (num_voice_pitch)); - _enable_voice = - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON + _enable_voice = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (chk_enable_voice)); if (_db) { @@ -851,9 +838,8 @@ gboolean settings_dialog() } g_free(_poi_db); if (strlen(gtk_entry_get_text(GTK_ENTRY(txt_poi_db)))) { - _poi_db = - g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_poi_db))); - db_connect(_db, _poi_db); + _poi_db = g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_poi_db))); + db_connect(&_db, _poi_db); } else _poi_db = NULL; @@ -863,9 +849,7 @@ gboolean settings_dialog() gtk_widget_set_sensitive(_cmenu_poi, _db != NULL); gtk_widget_set_sensitive(_menu_poi_item, _db != NULL); - _poi_zoom = - hildon_number_editor_get_value(HILDON_NUMBER_EDITOR - (num_poi_zoom)); + _poi_zoom = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_poi_zoom)); update_gcs(); diff --git a/src/track.c b/src/track.c index adb81aa..f5cdd66 100644 --- a/src/track.c +++ b/src/track.c @@ -7,6 +7,7 @@ #include "settings.h" #include "mapper-types.h" #include "ui-common.h" +#include "file.h" void path_resize(Path * path, guint size) { @@ -252,9 +253,7 @@ gboolean track_open(void) gint size; gboolean r = FALSE; - if (open_file - (&buffer, NULL, &size, NULL, &_track_file_uri, - GTK_FILE_CHOOSER_ACTION_OPEN)) { + if (open_file(&buffer, NULL, &size, NULL, &_track_file_uri, GTK_FILE_CHOOSER_ACTION_OPEN)) { if (parse_gpx(&_track, buffer, size, -1)) { map_force_redraw(); MACRO_BANNER_SHOW_INFO(_window, _("Track Opened")); @@ -272,8 +271,9 @@ 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 (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; @@ -357,12 +357,9 @@ gboolean track_insert_mark(void) if (*desc) { MACRO_PATH_INCREMENT_WTAIL(_track); _track.wtail->point = _track.tail; - _track.wtail->desc - = gtk_text_buffer_get_text(tbuf, &ti1, &ti2, TRUE); + _track.wtail->desc = gtk_text_buffer_get_text(tbuf, &ti1, &ti2, TRUE); } else { - popup_error(dialog, - _ - ("Please provide a description for the mark.")); + popup_error(dialog, _("Please provide a description for the mark.")); g_free(desc); continue; } @@ -372,5 +369,4 @@ gboolean track_insert_mark(void) break; } gtk_widget_destroy(dialog); - } diff --git a/src/ui-common.c b/src/ui-common.c index 5938999..13ea9d2 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -460,12 +460,9 @@ void menu_init() GtkWidget *_file_item; _file_item = gtk_menu_item_new_with_label("File"); - -/* gtk_widget_show_all(GTK_WIDGET(_menu_bar));*/ - #if 1 - gtk_menu_item_set_submenu(GTK_MENU_ITEM(_file_item), GTK_MENU(menu)); - gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), _file_item); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(_file_item), GTK_WIDGET(menu)); + gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(_file_item)); #else gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), menu); #endif @@ -623,24 +620,19 @@ void menu_init() = gtk_menu_item_new_with_label(_("Show Distance to"))); gtk_menu_append(submenu, _cmenu_way_route_to_item = - gtk_menu_item_new_with_label(_ - ("Download Route to..."))); + gtk_menu_item_new_with_label(_("Download Route to..."))); gtk_menu_append(submenu, _cmenu_way_delete_item = gtk_menu_item_new_with_label(_("Delete..."))); gtk_menu_append(submenu, gtk_separator_menu_item_new()); - gtk_menu_append(submenu, _cmenu_way_add_poi - = gtk_menu_item_new_with_label(_("Add POI..."))); + gtk_menu_append(submenu, _cmenu_way_add_poi = gtk_menu_item_new_with_label(_("Add POI..."))); gtk_widget_set_sensitive(_cmenu_way_add_poi, _db != NULL); gtk_menu_append(submenu, gtk_separator_menu_item_new()); - gtk_menu_append(submenu, _cmenu_way_goto_nextway - = gtk_menu_item_new_with_label(_("Go to Next"))); + gtk_menu_append(submenu, _cmenu_way_goto_nextway = gtk_menu_item_new_with_label(_("Go to Next"))); /* Setup the POI context menu. */ - gtk_menu_append(menu, _cmenu_poi - = gtk_menu_item_new_with_label(_("POI"))); + gtk_menu_append(menu, _cmenu_poi = gtk_menu_item_new_with_label(_("POI"))); gtk_widget_set_sensitive(_cmenu_poi, _db != NULL); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(_cmenu_poi), - submenu = gtk_menu_new()); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(_cmenu_poi), submenu = gtk_menu_new()); gtk_menu_append(submenu, _cmenu_poi_edit_poi = gtk_menu_item_new_with_label(_("View/Edit..."))); diff --git a/src/ui-common.h b/src/ui-common.h index 143dce7..776bad9 100644 --- a/src/ui-common.h +++ b/src/ui-common.h @@ -24,6 +24,8 @@ #include #include "mapper-types.h" +#include "ui-maemo.h" +#include "hildon-wrappers.h" /** The main GtkContainer of the application. */ GtkWidget *_window; @@ -186,13 +188,11 @@ GtkWidget *_status_bar; GtkMenu *_menu_map; -/** CONTEXT MENU ITEMS. */ +/** Context menu click location on map */ guint _cmenu_position_x; guint _cmenu_position_y; gboolean window_present(); - -#include "ui-maemo.h" -#include "hildon-wrappers.h" +void popup_error(GtkWidget * window, const gchar * error); #endif diff --git a/src/utils.h b/src/utils.h index 9592e68..f8a860b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -48,7 +48,7 @@ * BELOW: DEFINES *********************************************************** ****************************************************************************/ -#define DEBUG +/* #define DEBUG */ #ifndef DEBUG #define printf(...) @@ -324,7 +324,7 @@ if (_iap_http_proxy_host) { g_free(my_macro_buffer); \ } #else -#define MACRO_BANNER_SHOW_INFO(A, S) { g_print("INFO: %s\n", (S)); } +#define MACRO_BANNER_SHOW_INFO(A, S) { hildon_banner_show_information(A, NULL, S); } #endif #define GPS_READ_BUF_SIZE 256