1 /* This file is part of Beifahrer.
3 * Copyright (C) 2010 Philipp Zabel
5 * Beifahrer is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * Beifahrer is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Beifahrer. If not, see <http://www.gnu.org/licenses/>.
22 public class SettingsDialog : Gtk.Dialog {
23 public const string GCONF_KEY_USE_LOCATION = "/apps/beifahrer/use_location";
25 Hildon.CheckButton use_location;
28 public SettingsDialog (Gtk.Window window) {
29 set_title (_("Settings"));
30 set_transient_for (window);
32 var vbox = (VBox) get_content_area ();
33 use_location = new Hildon.CheckButton (SizeType.FINGER_HEIGHT);
34 use_location.set_label (_("Determine point of departure automatically"));
35 vbox.pack_start (use_location, true, true, 0);
38 add_button (_("Save"), ResponseType.APPLY);
40 gconf = GConf.Client.get_default ();
42 use_location.set_active (gconf.get_bool (GCONF_KEY_USE_LOCATION));
44 use_location.set_active (true);
47 response.connect (on_response);
50 void on_response (int response_id) {
51 if (response_id == ResponseType.APPLY) try {
52 gconf.set_bool (GCONF_KEY_USE_LOCATION, use_location.get_active ());