From 5b6b1ab64dd4edc894705baa15934380ca6c5f6c Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 19 Mar 2008 16:15:06 +0200 Subject: [PATCH] Add new notebook pages. Grey out voice settings if espeak is not enabled. --- src/settings-gui.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/settings-gui.c b/src/settings-gui.c index decf752..5414bdf 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -447,6 +447,7 @@ GtkWidget *hbox; GtkWidget *label; GtkWidget *txt_mapper_db; GtkWidget *btn_browsedb; +GtkWidget *num_sens; BrowseInfo browse_info={ 0, 0 }; dialog=gtk_dialog_new_with_buttons(_("OSM Settings"), GTK_WINDOW(_window), GTK_DIALOG_MODAL, @@ -465,6 +466,13 @@ gtk_table_attach(GTK_TABLE(table), hbox=gtk_hbox_new(FALSE, 4), 1, 2, 1, 2, GTK_ 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); +/* Advanced */ +gtk_table_attach(GTK_TABLE(table), label=gtk_label_new(_("Advanced")), 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_sens=hildon_controlbar_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4); +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 : ""); browse_info.dialog=dialog; @@ -568,6 +576,9 @@ 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); +/* Voice page */ +gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table=gtk_table_new(2, 3, FALSE), label=gtk_label_new(_("Announce"))); + /* 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); @@ -581,6 +592,12 @@ 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); +#ifndef WITH_ESPEAK +gtk_widget_set_sensitive(chk_enable_voice, FALSE); +gtk_widget_set_sensitive(num_voice_speed, FALSE); +gtk_widget_set_sensitive(num_voice_pitch, FALSE); +#endif + /* Display settings page. */ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table=gtk_table_new(2, 3, FALSE), label=gtk_label_new(_("Display"))); @@ -627,6 +644,7 @@ gtk_box_pack_start(GTK_BOX(hbox), label=gtk_alignment_new(0.f, 0.5f, 0.f, 0.f), 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); -- 2.39.5