Version bump (2.5-2)
[ukeyboard.git] / cpanel / onscreen.c
blobf2047ef6c1a316a5122bb6103f3cda13bd74a24c
1 /*
2 * Copyright (c) 2008 Jiri Benc <jbenc@upir.cz>
3 * Copyright (c) 2009 Roman Moravcik <roman.moravcik@gmail.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include <stdio.h>
20 #include <string.h>
21 #include <glib.h>
22 #include <gtk/gtk.h>
23 #include <hildon/hildon-caption.h>
24 #include <hildon/hildon-controlbar.h>
25 #include <hildon/hildon.h>
26 #include <device_symbols.h>
27 #include <libosso.h>
28 #include <gconf/gconf.h>
29 #include <gconf/gconf-client.h>
30 #include "prefs.h"
31 #include "onscreen.h"
33 #define GETTEXT_PACKAGE "ukeyboard"
34 #include <glib/gi18n-lib.h>
36 struct data {
37 HildonCheckButton *use_finger;
40 static GtkWidget *start(GConfClient *client, GtkWidget *win, void **data)
42 struct data *d;
43 GtkWidget *vbox;
45 (void)win;
46 d = g_new0(struct data, 1);
48 vbox = gtk_vbox_new(FALSE, 0);
50 d->use_finger = HILDON_CHECK_BUTTON(hildon_check_button_new(HILDON_SIZE_FINGER_HEIGHT));
51 hildon_check_button_set_active(d->use_finger, get_bool(client, "use_finger_kb"));
52 gtk_button_set_label (GTK_BUTTON (d->use_finger), _TI("tein_fi_use_virtual_keyboard"));
53 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(d->use_finger), TRUE, TRUE, 0);
55 *data = d;
57 gtk_widget_show_all(vbox);
59 return vbox;
62 static void action(GConfClient *client, void *data)
64 struct data *d = data;
66 set_bool(client, "use_finger_kb", hildon_check_button_get_active(d->use_finger));
69 void prefs_onscreen_init(struct prefs *prefs)
71 prefs->start = start;
72 prefs->action = action;
73 prefs->stop = NULL;
74 prefs->name = internal_kbd ? "On-screen" : "General";