}
}
- /* Save POI database. */
+ /* Save Mapper database. */
if (_mapper_db)
- gconf_client_set_string(gconf_client, GCONF_KEY_POI_DB, _mapper_db, NULL);
+ gconf_client_set_string(gconf_client, GCONF_KEY_MAPPER_DB, _mapper_db, NULL);
else
- gconf_client_unset(gconf_client, GCONF_KEY_POI_DB, NULL);
+ gconf_client_unset(gconf_client, GCONF_KEY_MAPPER_DB, NULL);
/* Save Show POI below zoom. */
gconf_client_set_int(gconf_client, GCONF_KEY_POI_ZOOM, _poi_zoom, NULL);
}
}
- /* Get POI Database. Default is in REPO_DEFAULT_CACHE_BASE */
- _mapper_db = gconf_client_get_string(gconf_client, GCONF_KEY_POI_DB, NULL);
+ /* Get Mapper Database. Default is in REPO_DEFAULT_CACHE_BASE */
+ _mapper_db = gconf_client_get_string(gconf_client, GCONF_KEY_MAPPER_DB, NULL);
if (_mapper_db == NULL) {
- gchar *poi_base =
- gnome_vfs_expand_initial_tilde(REPO_DEFAULT_CACHE_BASE);
- _mapper_db =
- gnome_vfs_uri_make_full_from_relative(poi_base, "poi.db");
+ gchar *poi_base = gnome_vfs_expand_initial_tilde(REPO_DEFAULT_CACHE_BASE);
+ _mapper_db = gnome_vfs_uri_make_full_from_relative(poi_base, "poi.db");
g_free(poi_base);
}
- poi_db_connect(&_db, _mapper_db);
+ mapper_db_connect(&_db, _mapper_db);
_poi_zoom = gconf_client_get_int(gconf_client,
GCONF_KEY_POI_ZOOM, NULL);
}
gboolean
-poi_db_disconnect(sqlite3 **db)
+mapper_db_disconnect(sqlite3 **db)
{
if (db && *db) {
- /* XXX: Handle prepared statements */
+ /* XXX: Handle the prepared statements */
+#if 0
+ poi_db_unprepare(*db);
+ osm_db_unprepare(*db);
+#endif
sqlite3_close(*db);
return TRUE;
}
}
gboolean
-poi_db_connect(sqlite3 **db, const gchar *poi_db)
+mapper_db_connect(sqlite3 **db, const gchar *data_db)
{
-if (db_connect(db, poi_db)) {
+if (db_connect(db, data_db)) {
poi_db_create(*db);
if (poi_db_prepare(*db)==FALSE)
g_printerr("Failed to prepare POI SQL statements");
GtkWidget *num_angle;
GtkWidget *num_hdop_ratio;
GtkWidget *num_vdop_ratio;
+ GtkWidget *num_osm_dist;
BrowseInfo browse_info = { 0, 0 };
ScanInfo scan_info = { 0 };
gtk_misc_set_alignment(GTK_MISC(label), 0.5f, 0.5f);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
- table = gtk_table_new(2, 4, FALSE),
+ table = gtk_table_new(2, 5, FALSE),
label = gtk_label_new(_("Filter")));
gtk_table_attach(GTK_TABLE(table),
hildon_controlbar_set_range(HILDON_CONTROLBAR(num_angle), 0, 45);
force_min_visible_bars(HILDON_CONTROLBAR(num_angle), 1);
+ /* Distance to OSM data */
+ gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("OSM Data")),
+ 0, 1, 4, 5, GTK_FILL, 0, 2, 4);
+ gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+ gtk_table_attach(GTK_TABLE(table), num_osm_dist = hildon_controlbar_new(),
+ 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+ hildon_controlbar_set_range(HILDON_CONTROLBAR(num_osm_dist), 0, 5000);
+ force_min_visible_bars(HILDON_CONTROLBAR(num_osm_dist), 1);
+
/* Auto-Center page. */
gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
table = gtk_table_new(2, 2, FALSE),
gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_speed_location),
SPEED_LOCATION_TEXT[i]);
- /* POI page */
+ /* Database page */
gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
table = gtk_table_new(2, 3, FALSE),
label = gtk_label_new(_("Database")));
_gps_filter = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chk_gps_filter));
if (_db) {
- poi_db_disconnect(&_db);
+ mapper_db_disconnect(&_db);
_db = NULL;
}
g_free(_mapper_db);
if (strlen(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)))) {
_mapper_db = g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)));
- poi_db_connect(&_db, _mapper_db);
+ mapper_db_connect(&_db, _mapper_db);
} else {
_mapper_db = NULL;
}
- /* Sensitize menus based on whether we have a POI database conn. */
+ /* Sensitize menus based on whether we have a database conn. */
gtk_widget_set_sensitive(_cmenu_loc_add_poi, _db != NULL);
gtk_widget_set_sensitive(_cmenu_way_add_poi, _db != NULL);
gtk_widget_set_sensitive(_cmenu_poi, _db != NULL);