]> err.no Git - mapper/commitdiff
Add announcement flags. Remove some warnings.
authorKaj-Michael Lang <milang@tal.org>
Fri, 21 Mar 2008 12:46:09 +0000 (14:46 +0200)
committerKaj-Michael Lang <milang@tal.org>
Fri, 21 Mar 2008 12:46:09 +0000 (14:46 +0200)
src/settings-gui.c
src/settings.h

index 8ce981c98184f6a1241c1f9fab72f1ce0c4821e3..1f10018c3ef2b2ebdbe72033aea2e6972238bc7c 100644 (file)
 #include "settings.h"
 #include "db.h"
 #include "bluetooth-scan.h"
-#include "hildon-wrappers.h"
-#include "help.h"
 #include "osm-db.h"
 #include "settings-gui.h"
+#include "config-gconf.h"
+#include "hildon-wrappers.h"
+#include "help.h"
 #include "dialogs.h"
 
 typedef struct _KeysDialogInfo KeysDialogInfo;
@@ -286,7 +287,7 @@ gboolean scan, port, address;
 GpsIOSourceType type;
 guint dport;
 
-if (gtk_combo_box_get_active_iter(gdi->cmb_gps_type, &gdi->iter)==FALSE)
+if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(gdi->cmb_gps_type), &gdi->iter)==FALSE)
        return TRUE;
 
 gtk_tree_model_get(GTK_TREE_MODEL(gdi->store), &gdi->iter, 0, &type, 2, &scan, 3, &address, 4, &port, 5, &dport, -1);
@@ -295,8 +296,8 @@ g_debug("GPS: %d", type);
 gtk_widget_hideshow(gdi->btn_scan, scan);
 gtk_widget_hideshow(gdi->txt_rcvr_mac, address);
 gtk_widget_hideshow(gdi->spn_rcvr_port, port);
-if (port && dport!=0 && (guint)gtk_spin_button_get_value(gdi->spn_rcvr_port)==0)
-       gtk_spin_button_set_value(gdi->spn_rcvr_port, (guint)dport);
+if (port && dport!=0 && (guint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(gdi->spn_rcvr_port))==0)
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(gdi->spn_rcvr_port), (guint)dport);
 
 return TRUE;
 }
@@ -388,7 +389,7 @@ g_signal_connect(G_OBJECT(gdi.btn_scan), "clicked", G_CALLBACK(scan_bluetooth),
 g_signal_connect(G_OBJECT(gdi.cmb_gps_type), "changed", G_CALLBACK(gps_type_changed_cb), &gdi);
 
 gtk_entry_set_text(GTK_ENTRY(gdi.txt_rcvr_mac), gps->io.address ? gps->io.address : "");
-gtk_spin_button_set_value(gdi.spn_rcvr_port, gps->io.port);
+gtk_spin_button_set_value(GTK_SPIN_BUTTON(gdi.spn_rcvr_port), gps->io.port);
 
 gtk_window_set_default_size(GTK_WINDOW(dialog), 500, -1);
 gtk_widget_show_all(dialog);
@@ -426,7 +427,7 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
                /* User specified a new rcvr mac. */
                g_free(gps->io.address);
                gps->io.address=g_strdup(gtk_entry_get_text(GTK_ENTRY(gdi.txt_rcvr_mac)));
-               gps->io.port=(guint)gtk_spin_button_get_value(gdi.spn_rcvr_port);
+               gps->io.port=(guint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(gdi.spn_rcvr_port));
                rcvr_changed=TRUE;
        }
 
@@ -476,6 +477,7 @@ hildon_controlbar_set_range(HILDON_CONTROLBAR(num_sens), 1, 10);
 force_min_visible_bars(HILDON_CONTROLBAR(num_sens), 1);
 
 gtk_entry_set_text(GTK_ENTRY(txt_mapper_db), _mapper_db ? _mapper_db : "");
+hildon_controlbar_set_value(HILDON_CONTROLBAR(num_sens), _map_location_sens);
 
 browse_info.dialog=dialog;
 browse_info.txt=txt_mapper_db;
@@ -501,6 +503,7 @@ if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
                _mapper_db=NULL;
        }
 
+       _map_location_sens=hildon_controlbar_get_value(HILDON_CONTROLBAR(num_sens));
        config_save();
 }
 gtk_widget_destroy(dialog);    
@@ -523,6 +526,7 @@ GtkWidget *dialog;
 GtkWidget *notebook;
 GtkWidget *table;
 GtkWidget *hbox;
+GtkWidget *vbox;
 GtkWidget *hbox2;
 GtkWidget *label;
 GtkWidget *num_center_ratio;
@@ -542,6 +546,10 @@ GtkWidget *num_poi_zoom;
 GtkWidget *chk_speed_on;
 GtkWidget *num_speed;
 GtkWidget *cmb_info_font_size;
+
+GtkWidget *announce_destination;
+GtkWidget *announce_overspeed;
+GtkWidget *announce_waypoints;
 guint i;
 
 dialog=gtk_dialog_new_with_buttons(_("Settings"), GTK_WINDOW(_window), GTK_DIALOG_MODAL, 
@@ -578,7 +586,10 @@ gtk_table_attach(GTK_TABLE(table), num_announce_notice=hildon_controlbar_new(),
 hildon_controlbar_set_range(HILDON_CONTROLBAR(num_announce_notice), 1, 20);
 force_min_visible_bars(HILDON_CONTROLBAR(num_announce_notice), 1);
 
-gtk_table_attach(GTK_TABLE(table), announce_speed=gtk_check_button_new_with_label(_("Enable speed announcements")), 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
+gtk_table_attach(GTK_TABLE(table), vbox=gtk_vbox_new(FALSE, 4), 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 6);
+gtk_box_pack_start(GTK_BOX(vbox), announce_waypoints=gtk_check_button_new_with_label(_("Enable waypoint announcements")), TRUE, TRUE, 4);
+gtk_box_pack_start(GTK_BOX(vbox), announce_destination=gtk_check_button_new_with_label(_("Enable destination announcements")), TRUE, TRUE, 4);
+gtk_box_pack_start(GTK_BOX(vbox), announce_overspeed=gtk_check_button_new_with_label(_("Enable overspeed announcements")), TRUE, TRUE, 4);
 
 /* Voice page */
 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table=gtk_table_new(2, 3, FALSE), label=gtk_label_new(_("Voice")));
@@ -588,7 +599,7 @@ gtk_table_attach(GTK_TABLE(table), chk_enable_voice=gtk_check_button_new_with_la
 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_table_attach(GTK_TABLE(table), hbox=gtk_hbox_new(FALSE, 4), 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);
index 46ca45d289c3dc47a2fc301fd2820cee427cf4e8..0f7b94a78f54ec8ae57b9dea5970efacb7ac523e 100644 (file)
@@ -32,10 +32,16 @@ guint _announce_notice_ratio;
 guint _voice_speed;
 guint _voice_pitch;
 
+gboolean _announce_waypoints;
+gboolean _announce_overspeed;
+gboolean _announce_destination;
+
 gboolean _speed_on;
 gboolean _speed_excess;
 guint _speed_limit;
 
+guint _map_location_sens;
+
 gchar *_http_proxy_host;
 gint _http_proxy_port;