]> err.no Git - mapper/commitdiff
Split settings to Generic, Gps and Map information
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 24 Jan 2008 12:58:48 +0000 (14:58 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 24 Jan 2008 12:58:48 +0000 (14:58 +0200)
src/cb.c
src/cb.h
src/help.h
src/settings-gui.c
src/settings-gui.h
src/ui-common.c

index 567933bae2311c1e05ae277327269fb762310d1e..49643ff8a93c9fa8f5235178808cff01cee116ab 100644 (file)
--- a/src/cb.c
+++ b/src/cb.c
@@ -472,7 +472,17 @@ return TRUE;
 gboolean 
 menu_cb_settings(GtkAction * action)
 {
-if (settings_dialog()) {
+settings_dialog();
+MACRO_RECALC_FOCUS_BASE();
+MACRO_RECALC_FOCUS_SIZE();
+map_force_redraw();
+return TRUE;
+}
+
+gboolean 
+menu_cb_settings_gps(GtkAction * action)
+{
+if (settings_dialog_gps()) {
        /* Settings have changed - reconnect to receiver. */
        if (_enable_gps) {
                gps_conn_set_state(_gps, RCVR_DOWN);
@@ -486,6 +496,13 @@ map_force_redraw();
 return TRUE;
 }
 
+gboolean 
+menu_cb_settings_osm(GtkAction * action)
+{
+settings_dialog_osm();
+return TRUE;
+}
+
 gboolean 
 menu_cb_help(GtkAction * action)
 {
index 07305af0d0737912d328387167e15f2a41d4b1f2..665d8bcd33a95ffe003ff97481efdd3566491f82 100644 (file)
--- a/src/cb.h
+++ b/src/cb.h
@@ -69,6 +69,8 @@ gboolean menu_cb_gps_reset(GtkAction * action);
 
 /* Callbacks for the other menu items. */
 gboolean menu_cb_settings(GtkAction * action);
+gboolean menu_cb_settings_gps(GtkAction * action);
+gboolean menu_cb_settings_osm(GtkAction * action);
 gboolean menu_cb_help(GtkAction * action);
 gboolean menu_cb_about(GtkAction * action);
 
index 8aeba7414db43e40fa966e293a546b8219211a8e..b30d2aada36a541815bcd70022c0ac78880785c6 100644 (file)
@@ -20,6 +20,8 @@
 #define HELP_ID_GETSTARTED HELP_ID_PREFIX"getstarted"
 #define HELP_ID_ABOUT HELP_ID_PREFIX"about"
 #define HELP_ID_SETTINGS HELP_ID_PREFIX"settings"
+#define HELP_ID_SETTINGS_GPS HELP_ID_PREFIX"settings_gps"
+#define HELP_ID_SETTINGS_OSM HELP_ID_PREFIX"settings_osm"
 #define HELP_ID_REPOMAN HELP_ID_PREFIX"repoman"
 #define HELP_ID_MAPMAN HELP_ID_PREFIX"mapman"
 #define HELP_ID_DOWNROUTE HELP_ID_PREFIX"downroute"
index 50ea67afa930cda839be99f92c598d52c4edb573..2597ff660d39e739297690b366a24d676a44333f 100644 (file)
 #include "db.h"
 #include "bluetooth-scan.h"
 #include "hildon-wrappers.h"
-
 #include "help.h"
+#include "osm-db.h"
+#include "settings-gui.h"
+
+typedef struct _KeysDialogInfo KeysDialogInfo;
+struct _KeysDialogInfo {
+       GtkWidget *cmb[CUSTOM_KEY_ENUM_COUNT];
+};
+
+#define UPDATE_GC(gc) gdk_gc_set_line_attributes(gc, _draw_width, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND);
 
-#define UPDATE_GC(gc) \
-    gdk_gc_set_line_attributes(gc, _draw_width, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND);
 void 
 update_gcs(void)
 {
-       gint i;
-
-       for (i = 0; i < COLORABLE_ENUM_COUNT; i++) {
-               gdk_color_alloc(gtk_widget_get_colormap(_map_widget),
-                               &_color[i]);
-               if (_gc[i])
-                       g_object_unref(_gc[i]);
-               _gc[i] = gdk_gc_new(_map_pixmap);
-               gdk_gc_set_foreground(_gc[i], &_color[i]);
-               gdk_gc_set_line_attributes(_gc[i],
-                                          _draw_width, GDK_LINE_SOLID,
-                                          GDK_CAP_ROUND, GDK_JOIN_ROUND);
-       }
+gint i;
+
+for (i = 0; i < COLORABLE_ENUM_COUNT; i++) {
+       gdk_color_alloc(gtk_widget_get_colormap(_map_widget),&_color[i]);
+       if (_gc[i])
+               g_object_unref(_gc[i]);
+       _gc[i] = gdk_gc_new(_map_pixmap);
+       gdk_gc_set_foreground(_gc[i], &_color[i]);
+       gdk_gc_set_line_attributes(_gc[i], _draw_width, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND);
+}
 
 }
 
 static gboolean
 settings_dialog_browse_forfile(GtkWidget * widget, BrowseInfo * browse_info)
 {
-       GtkWidget *dialog;
-       gint res;
+GtkWidget *dialog;
+gint res;
 
-       dialog = GTK_WIDGET(hildon_file_chooser_dialog_new(GTK_WINDOW(browse_info->dialog),
-                       GTK_FILE_CHOOSER_ACTION_OPEN));
+dialog = GTK_WIDGET(hildon_file_chooser_dialog_new(GTK_WINDOW(browse_info->dialog),GTK_FILE_CHOOSER_ACTION_OPEN));
 
-       gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE);
-       gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
-                                           gtk_entry_get_text(GTK_ENTRY(browse_info->txt)));
+gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE);
+gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), gtk_entry_get_text(GTK_ENTRY(browse_info->txt)));
 
-       res=gtk_dialog_run(GTK_DIALOG(dialog));
-       if (res==GTK_RESPONSE_OK || res==GTK_RESPONSE_ACCEPT) {
-               gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
-               gtk_entry_set_text(GTK_ENTRY(browse_info->txt), filename);
-               g_free(filename);
-       }
+res=gtk_dialog_run(GTK_DIALOG(dialog));
+if (res==GTK_RESPONSE_OK || res==GTK_RESPONSE_ACCEPT) {
+       gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+       gtk_entry_set_text(GTK_ENTRY(browse_info->txt), filename);
+       g_free(filename);
+}
 
-       gtk_widget_destroy(dialog);
+gtk_widget_destroy(dialog);
 
-       return TRUE;
+return TRUE;
 }
 
-typedef struct _KeysDialogInfo KeysDialogInfo;
-struct _KeysDialogInfo {
-       GtkWidget *cmb[CUSTOM_KEY_ENUM_COUNT];
-};
-
 static gboolean
 settings_dialog_hardkeys_reset(GtkWidget * widget, KeysDialogInfo * cdi)
 {
 GtkWidget *confirm;
 
-confirm = hildon_note_new_confirmation(GTK_WINDOW(_window),
-                                      _("Reset all hardware keys to their original defaults?"));
+confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), _("Reset all hardware keys to their original defaults?"));
 
 if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) {
        gint i;
@@ -107,88 +102,68 @@ return TRUE;
 static gboolean 
 settings_dialog_hardkeys(GtkWidget * widget, GtkWidget * parent)
 {
-       gint i;
-       GtkWidget *dialog;
-       GtkWidget *table;
-       GtkWidget *label;
-       KeysDialogInfo bdi;
-       GtkWidget *btn_defaults;
-
-       dialog = gtk_dialog_new_with_buttons(_("Hardware Keys"),
-                                            GTK_WINDOW(parent),
-                                            GTK_DIALOG_MODAL, GTK_STOCK_OK,
-                                            GTK_RESPONSE_ACCEPT, NULL);
-
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
-                         btn_defaults = gtk_button_new_with_label(_("Reset...")));
-       g_signal_connect(G_OBJECT(btn_defaults), "clicked",
-                        G_CALLBACK(settings_dialog_hardkeys_reset), &bdi);
-
-       gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
-
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
-                          table = gtk_table_new(2, 9, FALSE), TRUE, TRUE, 0);
-
-       for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++) {
-               gint j;
-               gtk_table_attach(GTK_TABLE(table),
-                                label = gtk_label_new(""),
-                                0, 1, i, i + 1, GTK_FILL, 0, 2, 1);
-               gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gint i;
+GtkWidget *dialog;
+GtkWidget *table;
+GtkWidget *label;
+KeysDialogInfo bdi;
+GtkWidget *btn_defaults;
+
+dialog = gtk_dialog_new_with_buttons(_("Hardware Keys"),
+                            GTK_WINDOW(parent),
+                            GTK_DIALOG_MODAL, GTK_STOCK_OK,
+                            GTK_RESPONSE_ACCEPT, NULL);
+
+gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_defaults = gtk_button_new_with_label(_("Reset...")));
+g_signal_connect(G_OBJECT(btn_defaults), "clicked",     G_CALLBACK(settings_dialog_hardkeys_reset), &bdi);
+
+gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table = gtk_table_new(2, 9, FALSE), TRUE, TRUE, 0);
+
+for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++) {
+       gint j;
+       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(""), 0, 1, i, i + 1, GTK_FILL, 0, 2, 1);
+       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
 #ifdef WITH_HILDON
-               gtk_label_set_markup(GTK_LABEL(label), CUSTOM_KEY_ICON[i]);
+       gtk_label_set_markup(GTK_LABEL(label), CUSTOM_KEY_ICON[i]);
 #endif
-               gtk_table_attach(GTK_TABLE(table),
-                                bdi.cmb[i] = gtk_combo_box_new_text(),
-                                1, 2, i, i + 1, GTK_FILL, 0, 2, 1);
+       gtk_table_attach(GTK_TABLE(table), bdi.cmb[i] = gtk_combo_box_new_text(), 1, 2, i, i + 1, GTK_FILL, 0, 2, 1);
                for (j = 0; j < CUSTOM_ACTION_ENUM_COUNT; j++)
-                       gtk_combo_box_append_text(GTK_COMBO_BOX(bdi.cmb[i]),
-                                                 CUSTOM_ACTION_TEXT[j]);
+                       gtk_combo_box_append_text(GTK_COMBO_BOX(bdi.cmb[i]), CUSTOM_ACTION_TEXT[j]);
                gtk_combo_box_set_active(GTK_COMBO_BOX(bdi.cmb[i]), _action[i]);
-       }
+}
 
-       gtk_widget_show_all(dialog);
-
-      OUTER_WHILE:
-       while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
-               /* Check for duplicates. */
-               for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++) {
-                       gint j;
-                       for (j = i + 1; j < CUSTOM_KEY_ENUM_COUNT; j++) {
-                               if (gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[i]))
-                                   == gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[j]))) {
-                                       GtkWidget *confirm;
-                                       gchar *buffer =
-                                           g_strdup_printf("%s:\n    %s\n%s",
-                                                           _("The following action is mapped to multiple keys"),
-                                                           CUSTOM_ACTION_TEXT
-                                                           [gtk_combo_box_get_active
-                                                            (GTK_COMBO_BOX
-                                                             (bdi.cmb[i]))],
-                                                           _("Continue?"));
-                                       confirm =
-                                           hildon_note_new_confirmation
-                                           (GTK_WINDOW(_window), buffer);
-
-                                       if (GTK_RESPONSE_OK !=
-                                           gtk_dialog_run(GTK_DIALOG(confirm)))
-                                       {
-                                               gtk_widget_destroy(confirm);
-                                               goto OUTER_WHILE;
-                                       }
+gtk_widget_show_all(dialog);
+
+OUTER_WHILE:
+while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+       /* Check for duplicates. */
+       for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++) {
+               gint j;
+               for (j = i + 1; j < CUSTOM_KEY_ENUM_COUNT; j++) {
+                       if (gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[i])) == gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[j]))) {
+                               GtkWidget *confirm;
+                               gchar *buffer = g_strdup_printf("%s:\n    %s\n%s", _("The following action is mapped to multiple keys"),
+                                                   CUSTOM_ACTION_TEXT[gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[i]))], _("Continue?"));
+                               confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), buffer);
+
+                               if (GTK_RESPONSE_OK != gtk_dialog_run(GTK_DIALOG(confirm)))
+                               {
                                        gtk_widget_destroy(confirm);
+                                       goto OUTER_WHILE;
                                }
+                               gtk_widget_destroy(confirm);
                        }
                }
-               for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++)
-                       _action[i] =
-                           gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[i]));
-               break;
        }
+       for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++)
+               _action[i] = gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[i]));
+       break;
+}
 
-       gtk_widget_destroy(dialog);
+gtk_widget_destroy(dialog);
 
-       return TRUE;
+return TRUE;
 }
 
 typedef struct _ColorsDialogInfo ColorsDialogInfo;
@@ -208,138 +183,226 @@ settings_dialog_colors_reset(GtkWidget * widget, ColorsDialogInfo * cdi)
                gint i;
                for (i = 0; i < COLORABLE_ENUM_COUNT; i++) {
                        gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                                     (cdi->col[i]),
-                                                     &COLORABLE_DEFAULT[i]);
-               }
+                             (cdi->col[i]), &COLORABLE_DEFAULT[i]);
        }
-       gtk_widget_destroy(confirm);
+}
+gtk_widget_destroy(confirm);
 
-       return TRUE;
+return TRUE;
 }
 
 static gboolean 
 settings_dialog_colors(GtkWidget * widget, GtkWidget * parent)
 {
-       GtkWidget *dialog;
-       GtkWidget *table;
-       GtkWidget *label;
-       GtkWidget *btn_defaults;
-       ColorsDialogInfo cdi;
-
-       dialog = gtk_dialog_new_with_buttons(_("Colors"),
-                                            GTK_WINDOW(parent),
-                                            GTK_DIALOG_MODAL, GTK_STOCK_OK,
-                                            GTK_RESPONSE_ACCEPT, NULL);
-
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
-                         btn_defaults = gtk_button_new_with_label(_("Reset...")));
-       g_signal_connect(G_OBJECT(btn_defaults), "clicked",
-                        G_CALLBACK(settings_dialog_colors_reset), &cdi);
-
-       gtk_dialog_add_button(GTK_DIALOG(dialog),
-                             GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
-
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
-                          table = gtk_table_new(4, 3, TRUE), TRUE, TRUE, 0);
-
-       /* GPS. */
-       gtk_table_attach(GTK_TABLE(table),
-                        label = gtk_label_new(_("GPS")),
-                        0, 1, 0, 1, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table),
-                        cdi.col[COLORABLE_MARK] = gtk_color_button_new(),
-                        1, 2, 0, 1, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_MARK]),
-                                     &_color[COLORABLE_MARK]);
-       gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK_VELOCITY] =
-                        gtk_color_button_new(), 2, 3, 0, 1, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_MARK_VELOCITY]),
-                                     &_color[COLORABLE_MARK_VELOCITY]);
-       gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK_OLD] =
-                        gtk_color_button_new(), 3, 4, 0, 1, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_MARK_OLD]),
-                                     &_color[COLORABLE_MARK_OLD]);
-
-       /* Track. */
-       gtk_table_attach(GTK_TABLE(table),
-                        label = gtk_label_new(_("Track")),
-                        0, 1, 1, 2, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table),
-                        cdi.col[COLORABLE_TRACK] = gtk_color_button_new(),
-                        1, 2, 1, 2, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_TRACK]),
-                                     &_color[COLORABLE_TRACK]);
-       gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK_MARK] =
-                        gtk_color_button_new(), 2, 3, 1, 2, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_TRACK_MARK]),
-                                     &_color[COLORABLE_TRACK_MARK]);
-       gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK_BREAK] =
-                        gtk_color_button_new(), 3, 4, 1, 2, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_TRACK_BREAK]),
-                                     &_color[COLORABLE_TRACK_BREAK]);
-
-       /* Route. */
-       gtk_table_attach(GTK_TABLE(table),
-                        label = gtk_label_new(_("Route")),
-                        0, 1, 2, 3, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table),
-                        cdi.col[COLORABLE_ROUTE] = gtk_color_button_new(),
-                        1, 2, 2, 3, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_ROUTE]),
-                                     &_color[COLORABLE_ROUTE]);
-       gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE_WAY] =
-                        gtk_color_button_new(), 2, 3, 2, 3, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_ROUTE_WAY]),
-                                     &_color[COLORABLE_ROUTE_WAY]);
-       gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE_BREAK] =
-                        gtk_color_button_new(), 3, 4, 2, 3, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_ROUTE_BREAK]),
-                                     &_color[COLORABLE_ROUTE_BREAK]);
-
-       /* POI. */
-       gtk_table_attach(GTK_TABLE(table),
-                        label = gtk_label_new(_("POI")),
-                        0, 1, 3, 4, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table),
-                        cdi.col[COLORABLE_POI] = gtk_color_button_new(),
-                        1, 2, 3, 4, 0, 0, 2, 4);
-       gtk_color_button_set_color(GTK_COLOR_BUTTON
-                                     (cdi.col[COLORABLE_POI]),
-                                     &_color[COLORABLE_POI]);
-
-       gtk_widget_show_all(dialog);
-
-       if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]), &_color[COLORABLE_MARK]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]), &_color[COLORABLE_MARK_VELOCITY]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]), &_color[COLORABLE_MARK_OLD]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]), &_color[COLORABLE_TRACK]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]), &_color[COLORABLE_TRACK_MARK]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),&_color[COLORABLE_TRACK_BREAK]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),&_color[COLORABLE_ROUTE]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),&_color[COLORABLE_ROUTE_WAY]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),&_color[COLORABLE_ROUTE_BREAK]);
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),&_color[COLORABLE_POI]);
-
-               update_gcs();
+GtkWidget *dialog;
+GtkWidget *table;
+GtkWidget *label;
+GtkWidget *btn_defaults;
+ColorsDialogInfo cdi;
+
+dialog = gtk_dialog_new_with_buttons(_("Colors"), GTK_WINDOW(parent), GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+
+gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_defaults = gtk_button_new_with_label(_("Reset...")));
+g_signal_connect(G_OBJECT(btn_defaults), "clicked", G_CALLBACK(settings_dialog_colors_reset), &cdi);
+
+gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table = gtk_table_new(4, 3, TRUE), TRUE, TRUE, 0);
+
+/* GPS. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("GPS")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK] = gtk_color_button_new(), 1, 2, 0, 1, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]), &_color[COLORABLE_MARK]);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK_VELOCITY] = gtk_color_button_new(), 2, 3, 0, 1, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]), &_color[COLORABLE_MARK_VELOCITY]);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK_OLD] = gtk_color_button_new(), 3, 4, 0, 1, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]), &_color[COLORABLE_MARK_OLD]);
+
+/* Track. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Track")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK] = gtk_color_button_new(), 1, 2, 1, 2, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]), &_color[COLORABLE_TRACK]);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK_MARK] = gtk_color_button_new(), 2, 3, 1, 2, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]), &_color[COLORABLE_TRACK_MARK]);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK_BREAK] = gtk_color_button_new(), 3, 4, 1, 2, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]), &_color[COLORABLE_TRACK_BREAK]);
+
+/* Route. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Route")), 0, 1, 2, 3, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE] = gtk_color_button_new(), 1, 2, 2, 3, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]), &_color[COLORABLE_ROUTE]);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE_WAY] = gtk_color_button_new(), 2, 3, 2, 3, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]), &_color[COLORABLE_ROUTE_WAY]);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE_BREAK] = gtk_color_button_new(), 3, 4, 2, 3, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]), &_color[COLORABLE_ROUTE_BREAK]);
+
+/* POI. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("POI")), 0, 1, 3, 4, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_POI] = gtk_color_button_new(), 1, 2, 3, 4, 0, 0, 2, 4);
+gtk_color_button_set_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]), &_color[COLORABLE_POI]);
+
+gtk_widget_show_all(dialog);
+if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]), &_color[COLORABLE_MARK]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]), &_color[COLORABLE_MARK_VELOCITY]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]), &_color[COLORABLE_MARK_OLD]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]), &_color[COLORABLE_TRACK]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]), &_color[COLORABLE_TRACK_MARK]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),&_color[COLORABLE_TRACK_BREAK]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),&_color[COLORABLE_ROUTE]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),&_color[COLORABLE_ROUTE_WAY]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),&_color[COLORABLE_ROUTE_BREAK]);
+       gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),&_color[COLORABLE_POI]);
+       update_gcs();
+}
+
+gtk_widget_destroy(dialog);
+
+return TRUE;
+}
+
+gboolean
+settings_dialog_gps(void)
+{
+GtkWidget *dialog;
+GtkWidget *notebook;
+GtkWidget *table;
+GtkWidget *hbox;
+GtkWidget *label;
+GtkWidget *txt_rcvr_mac;
+GtkWidget *btn_scan;
+ScanInfo scan_info = { 0 };
+gboolean rcvr_changed=TRUE;
+
+dialog = gtk_dialog_new_with_buttons(_("GPS Settings"), GTK_WINDOW(_window), GTK_DIALOG_MODAL, 
+               GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
+help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS_GPS);
+
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), notebook = gtk_notebook_new(), TRUE, TRUE, 0);
+
+/* Receiver page. */
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("GPS")));
+
+/* Receiver MAC Address. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("MAC")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+gtk_box_pack_start(GTK_BOX(hbox), txt_rcvr_mac = gtk_entry_new(), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(hbox), btn_scan = gtk_button_new_with_label(_("Scan...")), FALSE, FALSE, 0);
+
+/* Note!. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Note: You can enter a device path\n""(e.g. \"/dev/rfcomm0\").")), 0, 2, 1, 2, GTK_FILL, 0, 2, 4);
+gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
+gtk_misc_set_alignment(GTK_MISC(label), 0.5f, 0.5f);
+
+/* Connect signals. */
+scan_info.settings_dialog = dialog;
+scan_info.txt_rcvr_mac = txt_rcvr_mac;
+g_signal_connect(G_OBJECT(btn_scan), "clicked", G_CALLBACK(scan_bluetooth), &scan_info);
+gtk_entry_set_text(GTK_ENTRY(txt_rcvr_mac), _gps->io.address ? _gps->io.address : "");
+
+gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 300);
+gtk_widget_show_all(dialog);
+
+if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+       /* Set _rcvr_mac if necessary. */
+       if (!*gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac))) {
+               /* User specified no rcvr mac - set _rcvr_mac to NULL. */
+               if (_gps->io.address) {
+                       g_free(_gps->io.address);
+                       _gps->io.address=NULL;
+                       rcvr_changed=TRUE;
+                       set_action_sensitive("gps_details", FALSE);
+               }
+               if (_enable_gps) {
+                       set_action_activate("gps_details", FALSE);
+                       popup_error(dialog, _("No GPS Receiver MAC provided.\nGPS will be disabled."));
+                       rcvr_changed=TRUE;
+                       set_action_sensitive("gps_details", FALSE);
+               }
+       } else if (!_gps->io.address || strcmp(_gps->io.address, gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac)))) {
+               /* User specified a new rcvr mac. */
+               g_free(_gps->io.address);
+               _gps->io.address=g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac)));
+               rcvr_changed=TRUE;
        }
 
-       gtk_widget_destroy(dialog);
+       /* 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);
 
-       return TRUE;
+       config_save();
+}
+gtk_widget_destroy(dialog);    
+return rcvr_changed;
+}
+
+gboolean 
+settings_dialog_osm(void)
+{
+GtkWidget *dialog;
+GtkWidget *notebook;
+GtkWidget *table;
+GtkWidget *hbox;
+GtkWidget *label;
+GtkWidget *txt_mapper_db;
+GtkWidget *btn_browsedb;
+BrowseInfo browse_info = { 0, 0 };
+
+dialog = gtk_dialog_new_with_buttons(_("OSM Settings"), GTK_WINDOW(_window), GTK_DIALOG_MODAL, 
+               GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
+help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS_OSM);
+
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), notebook = gtk_notebook_new(), TRUE, TRUE, 0);
+
+/* Database page */
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Database")));
+
+/* Database. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Database")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+gtk_box_pack_start(GTK_BOX(hbox), txt_mapper_db = gtk_entry_new(), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(hbox), btn_browsedb = gtk_button_new_with_label(_("Browse...")), FALSE, FALSE, 0);
+
+gtk_entry_set_text(GTK_ENTRY(txt_mapper_db), _mapper_db ? _mapper_db : "");
+
+browse_info.dialog = dialog;
+browse_info.txt = txt_mapper_db;
+g_signal_connect(G_OBJECT(btn_browsedb), "clicked", G_CALLBACK(settings_dialog_browse_forfile), &browse_info);
+
+gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 300);
+gtk_widget_show_all(dialog);
+
+if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+       if (_db) {
+               poi_deinit(_db);
+               osm_deinit();
+               db_close(&_db);
+               _db=NULL;
+       }
+       g_free(_mapper_db);
+       if (strlen(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)))>0) {
+               _mapper_db=g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_mapper_db)));
+               db_connect(&_db, _mapper_db);
+               poi_init(&_db);
+               osm_init(&_db);
+       } else {
+               _mapper_db=NULL;
+       }
+       /* 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);
+
+       config_save();
+}
+gtk_widget_destroy(dialog);    
+return TRUE;
 }
 
 /**
@@ -349,316 +412,185 @@ settings_dialog_colors(GtkWidget * widget, GtkWidget * parent)
 gboolean 
 settings_dialog(void)
 {
-       GtkWidget *dialog;
-       GtkWidget *notebook;
-       GtkWidget *table;
-       GtkWidget *hbox;
-       GtkWidget *hbox2;
-       GtkWidget *label;
-       GtkWidget *txt_rcvr_mac;
-       GtkWidget *num_center_ratio;
-       GtkWidget *num_lead_ratio;
-       GtkWidget *num_announce_notice;
-       GtkWidget *chk_enable_voice;
-       GtkWidget *num_voice_speed;
-       GtkWidget *num_voice_pitch;
-       GtkWidget *lbl_voice_speed;
-       GtkWidget *lbl_voice_pitch;
-       GtkWidget *num_draw_width;
-       GtkWidget *chk_always_keep_on;
-       GtkWidget *cmb_units;
-       GtkWidget *cmb_degformat;
-       GtkWidget *btn_scan;
-       GtkWidget *btn_buttons;
-       GtkWidget *btn_colors;
-
-       GtkWidget *txt_mapper_db;
-       GtkWidget *btn_browsedb;
-       GtkWidget *num_poi_zoom;
-       GtkWidget *chk_speed_on;
-       GtkWidget *num_speed;
-       GtkWidget *cmb_info_font_size;
-
-       BrowseInfo browse_info = { 0, 0 };
-       ScanInfo scan_info = { 0 };
-       gboolean rcvr_changed = FALSE;
-       guint i;
-
-       dialog = gtk_dialog_new_with_buttons(_("Settings"),
-                                            GTK_WINDOW(_window),
-                                            GTK_DIALOG_MODAL, GTK_STOCK_OK,
-                                            GTK_RESPONSE_ACCEPT, NULL);
-
-       help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS);
+GtkWidget *dialog;
+GtkWidget *notebook;
+GtkWidget *table;
+GtkWidget *hbox;
+GtkWidget *hbox2;
+GtkWidget *label;
+GtkWidget *num_center_ratio;
+GtkWidget *num_lead_ratio;
+GtkWidget *num_announce_notice;
+GtkWidget *chk_enable_voice;
+GtkWidget *num_voice_speed;
+GtkWidget *num_voice_pitch;
+GtkWidget *lbl_voice_speed;
+GtkWidget *lbl_voice_pitch;
+GtkWidget *num_draw_width;
+GtkWidget *chk_always_keep_on;
+GtkWidget *cmb_units;
+GtkWidget *cmb_degformat;
+GtkWidget *btn_buttons;
+GtkWidget *btn_colors;
+GtkWidget *num_poi_zoom;
+GtkWidget *chk_speed_on;
+GtkWidget *num_speed;
+GtkWidget *cmb_info_font_size;
+guint i;
+
+dialog = gtk_dialog_new_with_buttons(_("Settings"), GTK_WINDOW(_window), GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS);
 
 #ifdef WITH_DEVICE_770
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
-                         btn_buttons = gtk_button_new_with_label(_("Hardware Keys...")));
-       g_signal_connect(G_OBJECT(btn_buttons), "clicked", G_CALLBACK(settings_dialog_hardkeys), dialog);
+gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_buttons = gtk_button_new_with_label(_("Hardware Keys...")));
+g_signal_connect(G_OBJECT(btn_buttons), "clicked", G_CALLBACK(settings_dialog_hardkeys), dialog);
 #endif
 
-       gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
-                         btn_colors = gtk_button_new_with_label(_("Colors...")));
-
-       gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
-
-       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
-                          notebook = gtk_notebook_new(), TRUE, TRUE, 0);
-
-       /* Receiver page. */
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-                                table = gtk_table_new(2, 3, FALSE),
-                                label = gtk_label_new(_("GPS")));
-
-       /* Receiver MAC Address. */
-       gtk_table_attach(GTK_TABLE(table),
-                        label = gtk_label_new(_("MAC")),
-                        0, 1, 0, 1, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table),
-                        hbox = gtk_hbox_new(FALSE, 4),
-                        1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       gtk_box_pack_start(GTK_BOX(hbox),
-                          txt_rcvr_mac = gtk_entry_new(), TRUE, TRUE, 0);
-       gtk_box_pack_start(GTK_BOX(hbox),
-                          btn_scan = gtk_button_new_with_label(_("Scan...")),
-                          FALSE, FALSE, 0);
-
-       /* Note!. */
-       gtk_table_attach(GTK_TABLE(table),
-                        label = gtk_label_new(_
-                                      ("Note: You can enter a device path\n"
-                                       "(e.g. \"/dev/rfcomm0\").")), 0, 2, 1,
-                        2, GTK_FILL, 0, 2, 4);
-       gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-       gtk_misc_set_alignment(GTK_MISC(label), 0.5f, 0.5f);
-
-
-       /* Auto-Center page. */
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-                                table = gtk_table_new(2, 2, FALSE),
-                                label = gtk_label_new(_("Auto-Center")));
-
-       /* Auto-Center Sensitivity. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Sensitivity")),
-                        0, 1, 0, 1, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), num_center_ratio = hildon_controlbar_new(),
-                        1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       hildon_controlbar_set_range(HILDON_CONTROLBAR(num_center_ratio), 1, 10);
-       force_min_visible_bars(HILDON_CONTROLBAR(num_center_ratio), 1);
-
-       /* Lead Amount. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Lead Amount")),
-                        0, 1, 1, 2, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-
-       gtk_table_attach(GTK_TABLE(table), num_lead_ratio = hildon_controlbar_new(),
-                        1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       hildon_controlbar_set_range(HILDON_CONTROLBAR(num_lead_ratio), 1, 10);
-       force_min_visible_bars(HILDON_CONTROLBAR(num_lead_ratio), 1);
-
-       /* Announcement page */
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-                                table = gtk_table_new(2, 3, FALSE),
-                                label = gtk_label_new(_("Announce")));
-
-       /* Announcement Advance Notice. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Advance Notice")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), num_announce_notice = hildon_controlbar_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       hildon_controlbar_set_range(HILDON_CONTROLBAR(num_announce_notice), 1, 20);
-       force_min_visible_bars(HILDON_CONTROLBAR(num_announce_notice), 1);
-
-       /* Enable Voice. */
-       gtk_table_attach(GTK_TABLE(table),
-                        chk_enable_voice = gtk_check_button_new_with_label(_("Enable Voice Synthesis")),
-                        0, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_enable_voice), _enable_voice);
-
-       /* Voice Speed and Pitch. */
-       gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 12), 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 6);
-       gtk_box_pack_start(GTK_BOX(hbox), hbox2 = gtk_hbox_new(FALSE, 4), TRUE, TRUE, 4);
-       gtk_box_pack_start(GTK_BOX(hbox2), lbl_voice_speed = gtk_label_new(_("Speed (words/minute)")), TRUE, TRUE, 0);
-       gtk_box_pack_start(GTK_BOX(hbox2), num_voice_speed = hildon_number_editor_new(80, 370), TRUE, TRUE, 0);
-
-       gtk_box_pack_start(GTK_BOX(hbox), hbox2 = gtk_hbox_new(FALSE, 4), TRUE, TRUE, 4);
-       gtk_box_pack_start(GTK_BOX(hbox2), lbl_voice_pitch = gtk_label_new(_("Pitch")), TRUE, TRUE, 0);
-       gtk_box_pack_start(GTK_BOX(hbox2), num_voice_pitch = hildon_number_editor_new(1, 99), TRUE, TRUE, 0);
-
-       /* Display settings page. */
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Display")));
-
-       /* Line Width. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Line Width")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), num_draw_width = hildon_controlbar_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       hildon_controlbar_set_range(HILDON_CONTROLBAR(num_draw_width), 1, 20);
-       force_min_visible_bars(HILDON_CONTROLBAR(num_draw_width), 1);
-
-       /* Keep Display On Only When Fullscreen. */
-       gtk_table_attach(GTK_TABLE(table),
-                        chk_always_keep_on = gtk_check_button_new_with_label(_("Keep Display On Only in Fullscreen Mode")),
-                        0, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-
-       /* Information Font Size. */
-       gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 0, 2, 2, 3, GTK_FILL, 0, 2, 4);
-       gtk_box_pack_start(GTK_BOX(hbox), label = gtk_label_new(_("Information Font Size")), FALSE, FALSE, 0);
-       gtk_box_pack_start(GTK_BOX(hbox), cmb_info_font_size = gtk_combo_box_new_text(), FALSE, FALSE, 0);
-       for (i = 0; i < INFO_FONT_ENUM_COUNT; i++)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_info_font_size), INFO_FONT_TEXT[i]);
-
-       /* Units page. */
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Units")));
-
-       /* Units. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Units")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), cmb_units = gtk_combo_box_new_text(), 1, 2, 0, 1, GTK_FILL, 0, 2, 4);
-       for (i = 0; i < UNITS_ENUM_COUNT; i++)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_units), UNITS_TEXT[i]);
-
-       /* Degrees format */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Degrees Format")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), label = gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), 1, 2, 1, 2, GTK_FILL, 0, 2, 4);
-       gtk_container_add(GTK_CONTAINER(label), cmb_degformat = gtk_combo_box_new_text());
-       for (i = 0; i < DEG_FORMAT_ENUM_COUNT; i++)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_degformat), DEG_FORMAT_TEXT[i]);
-
-       gtk_table_attach(GTK_TABLE(table), gtk_label_new(""), 2, 3, 0, 2, GTK_FILL | GTK_EXPAND, 0, 2, 4);
-
-       /* Speed warner. */
-       gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 0, 3, 2, 3, GTK_FILL, 0, 2, 4);
-
-       gtk_box_pack_start(GTK_BOX(hbox), chk_speed_on = gtk_check_button_new_with_label(_("Display Speed")), FALSE, FALSE, 0);
-
-       gtk_box_pack_start(GTK_BOX(hbox), label = gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), FALSE, FALSE, 0);
-       gtk_container_add(GTK_CONTAINER(label), num_speed = hildon_number_editor_new(0, 999));
-
-       /* Database page */
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Database")));
-
-       /* Database. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Database")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       gtk_box_pack_start(GTK_BOX(hbox), txt_mapper_db = gtk_entry_new(), TRUE, TRUE, 0);
-       gtk_box_pack_start(GTK_BOX(hbox), btn_browsedb = gtk_button_new_with_label(_("Browse...")), FALSE, FALSE, 0);
-
-       /* Show POI below zoom. */
-       gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Show POI below zoom")), 0, 1, 2, 3, GTK_FILL, 0, 2, 4);
-       gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
-       gtk_table_attach(GTK_TABLE(table), label = gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 4);
-       gtk_container_add(GTK_CONTAINER(label), num_poi_zoom = hildon_number_editor_new(0, MAX_ZOOM));
-
-       /* Connect signals. */
-       scan_info.settings_dialog = dialog;
-       scan_info.txt_rcvr_mac = txt_rcvr_mac;
-       g_signal_connect(G_OBJECT(btn_scan), "clicked", G_CALLBACK(scan_bluetooth), &scan_info);
-       g_signal_connect(G_OBJECT(btn_colors), "clicked", G_CALLBACK(settings_dialog_colors), dialog);
-
-       browse_info.dialog = dialog;
-       browse_info.txt = txt_mapper_db;
-       g_signal_connect(G_OBJECT(btn_browsedb), "clicked", G_CALLBACK(settings_dialog_browse_forfile), &browse_info);
-
-       /* Initialize fields. */
-       gtk_entry_set_text(GTK_ENTRY(txt_rcvr_mac), _gps->io.address ? _gps->io.address : "");
-       gtk_entry_set_text(GTK_ENTRY(txt_mapper_db), _mapper_db ? _mapper_db : "");
-
-       hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_poi_zoom), _poi_zoom);
-       hildon_controlbar_set_value(HILDON_CONTROLBAR(num_center_ratio), _center_ratio);
-       hildon_controlbar_set_value(HILDON_CONTROLBAR(num_lead_ratio), _lead_ratio);
-       hildon_controlbar_set_value(HILDON_CONTROLBAR(num_announce_notice), _announce_notice_ratio);
-       hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_voice_speed), _voice_speed);
-       hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_voice_pitch), _voice_pitch);
-       hildon_controlbar_set_value(HILDON_CONTROLBAR(num_draw_width), _draw_width);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_always_keep_on), !_always_keep_on);
-       gtk_combo_box_set_active(GTK_COMBO_BOX(cmb_units), _units);
-       gtk_combo_box_set_active(GTK_COMBO_BOX(cmb_degformat), _degformat);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_speed_on), _speed_on);
-       hildon_number_editor_set_range(HILDON_NUMBER_EDITOR(num_speed), 1, 300);
-       hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_speed), _speed_limit);
-       gtk_combo_box_set_active(GTK_COMBO_BOX(cmb_info_font_size), _info_font_size);
-
-       gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 300);
-       gtk_widget_show_all(dialog);
-
-       if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
-               /* Set _rcvr_mac if necessary. */
-               if (!*gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac))) {
-                       /* User specified no rcvr mac - set _rcvr_mac to NULL. */
-                       if (_gps->io.address) {
-                               g_free(_gps->io.address);
-                               _gps->io.address = NULL;
-                               rcvr_changed = TRUE;
-                               set_action_sensitive("gps_details", FALSE);
-                       }
-                       if (_enable_gps) {
-                               set_action_activate("gps_details", FALSE);
-                               popup_error(dialog, _("No GPS Receiver MAC provided.\nGPS will be disabled."));
-                               rcvr_changed = TRUE;
-                               set_action_sensitive("gps_details", FALSE);
-                       }
-               } else if (!_gps->io.address || strcmp(_gps->io.address, gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac)))) {
-                       /* User specified a new rcvr mac. */
-                       g_free(_gps->io.address);
-                       _gps->io.address = g_strdup(gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac)));
-                       rcvr_changed = TRUE;
-               }
-
-               _center_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_center_ratio));
-               _lead_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_lead_ratio));
-               _draw_width = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_draw_width));
-               _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));
-               _speed_on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chk_speed_on));
-               _speed_limit = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_speed));
-               _info_font_size = gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_info_font_size));
-
-               _announce_notice_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_announce_notice));
-
-               _voice_speed = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_voice_speed));
-               _voice_pitch = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_voice_pitch));
-               _enable_voice = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chk_enable_voice));
-
-               speak_set_parameters(_voice_speed, _voice_pitch);
-
-               if (_db) {
-                       poi_deinit(_db);
-                       osm_deinit(_db);
-                       db_close(&_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)));
-                       db_connect(&_db, _mapper_db);
-                       poi_init(&_db);
-                       osm_init(&_db);
-               } else {
-                       _mapper_db=NULL;
-               }
-
-               /* 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);
-
-               _poi_zoom = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_poi_zoom));
-
-               update_gcs();
-
-               config_save();
-       }
+gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_colors = gtk_button_new_with_label(_("Colors...")));
+gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), notebook = gtk_notebook_new(), TRUE, TRUE, 0);
+
+/* Auto-Center page. */
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 2, FALSE), label = gtk_label_new(_("Auto-Center")));
+
+/* Auto-Center Sensitivity. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Sensitivity")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), num_center_ratio = hildon_controlbar_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+hildon_controlbar_set_range(HILDON_CONTROLBAR(num_center_ratio), 1, 10);
+force_min_visible_bars(HILDON_CONTROLBAR(num_center_ratio), 1);
+
+/* Lead Amount. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Lead Amount")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+
+gtk_table_attach(GTK_TABLE(table), num_lead_ratio = hildon_controlbar_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+hildon_controlbar_set_range(HILDON_CONTROLBAR(num_lead_ratio), 1, 10);
+force_min_visible_bars(HILDON_CONTROLBAR(num_lead_ratio), 1);
+
+/* Announcement page */
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Announce")));
+
+/* Announcement Advance Notice. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Advance Notice")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), num_announce_notice = hildon_controlbar_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+hildon_controlbar_set_range(HILDON_CONTROLBAR(num_announce_notice), 1, 20);
+force_min_visible_bars(HILDON_CONTROLBAR(num_announce_notice), 1);
+
+/* Enable Voice. */
+gtk_table_attach(GTK_TABLE(table), chk_enable_voice = gtk_check_button_new_with_label(_("Enable Voice Synthesis")), 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_enable_voice), _enable_voice);
+
+/* Voice Speed and Pitch. */
+gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 12), 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 6);
+gtk_box_pack_start(GTK_BOX(hbox), hbox2 = gtk_hbox_new(FALSE, 4), TRUE, TRUE, 4);
+gtk_box_pack_start(GTK_BOX(hbox2), lbl_voice_speed = gtk_label_new(_("Speed (words/minute)")), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(hbox2), num_voice_speed = hildon_number_editor_new(80, 370), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(hbox), hbox2 = gtk_hbox_new(FALSE, 4), TRUE, TRUE, 4);
+gtk_box_pack_start(GTK_BOX(hbox2), lbl_voice_pitch = gtk_label_new(_("Pitch")), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(hbox2), num_voice_pitch = hildon_number_editor_new(1, 99), TRUE, TRUE, 0);
+
+/* Display settings page. */
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Display")));
+
+/* Line Width. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Line Width")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), num_draw_width = hildon_controlbar_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+hildon_controlbar_set_range(HILDON_CONTROLBAR(num_draw_width), 1, 20);
+force_min_visible_bars(HILDON_CONTROLBAR(num_draw_width), 1);
+
+/* Keep Display On Only When Fullscreen. */
+gtk_table_attach(GTK_TABLE(table), chk_always_keep_on = gtk_check_button_new_with_label(_("Keep Display On Only in Fullscreen Mode")), 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+
+/* Information Font Size. */
+gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 0, 2, 2, 3, GTK_FILL, 0, 2, 4);
+gtk_box_pack_start(GTK_BOX(hbox), label = gtk_label_new(_("Information Font Size")), FALSE, FALSE, 0);
+gtk_box_pack_start(GTK_BOX(hbox), cmb_info_font_size = gtk_combo_box_new_text(), FALSE, FALSE, 0);
+for (i = 0; i < INFO_FONT_ENUM_COUNT; i++)
+       gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_info_font_size), INFO_FONT_TEXT[i]);
+
+/* Units page. */
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("Units")));
+
+/* Units. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Units")), 0, 1, 0, 1, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), cmb_units = gtk_combo_box_new_text(), 1, 2, 0, 1, GTK_FILL, 0, 2, 4);
+for (i = 0; i < UNITS_ENUM_COUNT; i++)
+       gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_units), UNITS_TEXT[i]);
+
+/* Degrees format */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Degrees Format")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), label = gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), 1, 2, 1, 2, GTK_FILL, 0, 2, 4);
+gtk_container_add(GTK_CONTAINER(label), cmb_degformat = gtk_combo_box_new_text());
+for (i = 0; i < DEG_FORMAT_ENUM_COUNT; i++)
+       gtk_combo_box_append_text(GTK_COMBO_BOX(cmb_degformat), DEG_FORMAT_TEXT[i]);
+gtk_table_attach(GTK_TABLE(table), gtk_label_new(""), 2, 3, 0, 2, GTK_FILL | GTK_EXPAND, 0, 2, 4);
+
+/* Speed warner. */
+gtk_table_attach(GTK_TABLE(table), hbox = gtk_hbox_new(FALSE, 4), 0, 3, 2, 3, GTK_FILL, 0, 2, 4);
+gtk_box_pack_start(GTK_BOX(hbox), chk_speed_on = gtk_check_button_new_with_label(_("Display Speed")), FALSE, FALSE, 0);
+gtk_box_pack_start(GTK_BOX(hbox), label = gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), FALSE, FALSE, 0);
+gtk_container_add(GTK_CONTAINER(label), num_speed = hildon_number_editor_new(0, 999));
+
+gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), label = gtk_label_new(_("POIs")));
+/* Show POI below zoom. */
+gtk_table_attach(GTK_TABLE(table), label = gtk_label_new(_("Show POI below zoom")), 0, 1, 2, 3, GTK_FILL, 0, 2, 4);
+gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f);
+gtk_table_attach(GTK_TABLE(table), label = gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+gtk_container_add(GTK_CONTAINER(label), num_poi_zoom = hildon_number_editor_new(0, MAX_ZOOM));
+
+g_signal_connect(G_OBJECT(btn_colors), "clicked", G_CALLBACK(settings_dialog_colors), dialog);
+
+/* Initialize fields. */
+hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_poi_zoom), _poi_zoom);
+hildon_controlbar_set_value(HILDON_CONTROLBAR(num_center_ratio), _center_ratio);
+hildon_controlbar_set_value(HILDON_CONTROLBAR(num_lead_ratio), _lead_ratio);
+hildon_controlbar_set_value(HILDON_CONTROLBAR(num_announce_notice), _announce_notice_ratio);
+hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_voice_speed), _voice_speed);
+hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_voice_pitch), _voice_pitch);
+hildon_controlbar_set_value(HILDON_CONTROLBAR(num_draw_width), _draw_width);
+gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_always_keep_on), !_always_keep_on);
+gtk_combo_box_set_active(GTK_COMBO_BOX(cmb_units), _units);
+gtk_combo_box_set_active(GTK_COMBO_BOX(cmb_degformat), _degformat);
+gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_speed_on), _speed_on);
+hildon_number_editor_set_range(HILDON_NUMBER_EDITOR(num_speed), 1, 300);
+hildon_number_editor_set_value(HILDON_NUMBER_EDITOR(num_speed), _speed_limit);
+gtk_combo_box_set_active(GTK_COMBO_BOX(cmb_info_font_size), _info_font_size);
+
+gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 300);
+gtk_widget_show_all(dialog);
+
+if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+       _center_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_center_ratio));
+       _lead_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_lead_ratio));
+       _draw_width = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_draw_width));
+       _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));
+       _speed_on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chk_speed_on));
+       _speed_limit = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_speed));
+       _info_font_size = gtk_combo_box_get_active(GTK_COMBO_BOX(cmb_info_font_size));
+       _announce_notice_ratio = hildon_controlbar_get_value(HILDON_CONTROLBAR(num_announce_notice));
+       _voice_speed = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_voice_speed));
+       _voice_pitch = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_voice_pitch));
+       _enable_voice = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(chk_enable_voice));
+       _poi_zoom = hildon_number_editor_get_value(HILDON_NUMBER_EDITOR(num_poi_zoom));
+
+       speak_set_parameters(_voice_speed, _voice_pitch);
+       update_gcs();
+       config_save();
+}
 
 #ifndef WITH_HILDON
-       /* Destroying causes a crash (!?!?!??!)  huh? in hildon (770?) only, plain gtk is ok...*/
-       gtk_widget_destroy(dialog);     
+/* Destroying causes a crash (!?!?!??!)  huh? in hildon (770?) only, plain gtk is ok...*/
+gtk_widget_destroy(dialog);    
 #else
-       gtk_widget_hide(dialog);
+gtk_widget_hide(dialog);
 #endif
 
-       return rcvr_changed;
+return FALSE;
 }
index c20705a3c674a1882809ae43cd09968c70a363f6..ab94a9c4c292c511eb50ebbbf65cac59c9c394b9 100644 (file)
@@ -2,6 +2,8 @@
 #define _SETTINGS_GUI_H
 
 gboolean settings_dialog(void);
+gboolean settings_dialog_gps(void);
+gboolean settings_dialog_osm(void);
 void update_gcs(void);
 
 #endif
index f3a667de9bd3056f6290eb16f599639f4798a741..4dcb107fe811b33806922a9610d6ca7c55ae210e 100644 (file)
@@ -71,7 +71,11 @@ static const gchar *mapper_ui =
 "<ui>"
 "  <menubar name='MenuBar'>"
 "    <menu action='file'>"
-"      <menuitem action='file_settings'/>"
+"      <menu action='file_settings'>"
+"       <menuitem action='file_settings_generic'/>"
+"       <menuitem action='file_settings_gps'/>"
+"       <menuitem action='file_settings_osm'/>"
+"         </menu>"
 "      <separator/>"
 "      <menuitem action='file_quit'/>"
 "    </menu>"
@@ -185,7 +189,10 @@ static const gchar *mapper_ui =
 
 static GtkActionEntry ui_entries[] = {
        {"file", NULL, N_("_File"), NULL, NULL, NULL },
-       {"file_settings", GTK_STOCK_PREFERENCES, N_("_Settings..."), NULL, NULL, G_CALLBACK(menu_cb_settings) },
+       {"file_settings", GTK_STOCK_PREFERENCES, N_("_Settings..."), NULL, NULL, NULL },
+       {"file_settings_generic", GTK_STOCK_PREFERENCES, N_("Generic..."), NULL, NULL, G_CALLBACK(menu_cb_settings) },
+       {"file_settings_gps", GTK_STOCK_PREFERENCES, N_("_Gps..."), NULL, NULL, G_CALLBACK(menu_cb_settings_gps) },
+       {"file_settings_osm", GTK_STOCK_PREFERENCES, N_("_Map info..."), NULL, NULL, G_CALLBACK(menu_cb_settings_osm) },
        {"file_quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q", NULL, G_CALLBACK(gtk_main_quit) },
 
        {"help", NULL, N_("_Help"), NULL, NULL, NULL },
@@ -220,8 +227,8 @@ static GtkActionEntry ui_entries[] = {
        {"poi_export", GTK_STOCK_SAVE, N_("_Export..."), NULL, NULL, NULL },
 
        {"search", NULL, N_("_Search"), NULL, NULL, NULL },
-       {"poi_search", GTK_STOCK_FIND, N_("_Search..."), NULL, NULL, G_CALLBACK(cb_poi_search) },
-       {"search_address", GTK_STOCK_FIND, N_("Address..."), NULL, NULL, G_CALLBACK(menu_cb_search_address) },
+       {"poi_search", GTK_STOCK_FIND, N_("_Search..."), "<control>P", NULL, G_CALLBACK(cb_poi_search) },
+       {"search_address", GTK_STOCK_FIND, N_("Address..."), "<control>F", NULL, G_CALLBACK(menu_cb_search_address) },
 
        {"map", NULL, N_("_Map"), NULL, NULL, NULL },
        {"map_maps", NULL, N_("_Maps"), NULL, NULL, NULL },
@@ -268,9 +275,9 @@ static GtkToggleActionEntry ui_toggle_entries[] = {
 static guint n_ui_toggle_entries = G_N_ELEMENTS (ui_toggle_entries);
 
 static GtkRadioActionEntry ui_autocenter_entries[] = {
-  { "autocenter_latlon", NULL, "Lat/Lon", "<control>1", NULL, CENTER_LATLON },
-  { "autocenter_lead", NULL, "Lead", "<control>2", NULL, CENTER_LEAD },
-  { "autocenter_none", NULL, "None", "<control>3", NULL, CENTER_MANUAL },
+  { "autocenter_latlon", NULL, "Lat/Lon", "<control>L", NULL, CENTER_LATLON },
+  { "autocenter_lead", NULL, "Lead", "<control>E", NULL, CENTER_LEAD },
+  { "autocenter_none", NULL, "None", "<control>N", NULL, CENTER_MANUAL },
 };
 static guint n_ui_autocenter_entries = G_N_ELEMENTS (ui_autocenter_entries);