gchar *key = key_base + key_len;
#if MAEMO_VERSION >= 5
+ // Keyboard
strcpy(key, kGConfPlayerKeyboardEnable);
hildon_check_button_set_active(keys_chk,
gconf_client_get_bool(gcc, key_base, NULL));
+ // Touchscreen
strcpy(key, kGConfPlayerTouchscreenEnable);
hildon_check_button_set_active(touch_chk,
gconf_client_get_bool(gcc, key_base, NULL));
strcpy(key, kGConfPlayerTouchscreenShow);
hildon_check_button_set_active(touch_show_chk,
gconf_client_get_bool(gcc, key_base, NULL));
+
+ // Zeemote
+ strcpy(key, kGConfPlayerZeemoteEnable);
+ hildon_check_button_set_active(zeemote_chk,
+ gconf_client_get_bool(gcc, key_base, NULL));
#else
+ // Keyboard
strcpy(key, kGConfPlayerKeyboardEnable);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(keys_chk),
gconf_client_get_bool(gcc, key_base, NULL));
+ // Touchscreen
strcpy(key, kGConfPlayerTouchscreenEnable);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(touch_chk),
gconf_client_get_bool(gcc, key_base, NULL));
strcpy(key, kGConfPlayerTouchscreenShow);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(touch_show_chk),
gconf_client_get_bool(gcc, key_base, NULL));
+
+ // Zeemote
+ strcpy(key, kGConfPlayerZeemoteEnable);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(zeemote_chk),
+ gconf_client_get_bool(gcc, key_base, NULL));
#endif
}
gchar* controls_describe(int player)
{
- static gchar description[128];
+ static gchar description[256];
+ unsigned char count = 0;
gchar key_base[kGConfPlayerPathBufferLen];
const int key_len = sprintf(key_base, kGConfPlayerPath, player);
strcpy(key, kGConfPlayerKeyboardEnable);
if (gconf_client_get_bool(gcc, key_base, NULL)) {
strcpy(description, _("Keyboard"));
+ count++;
+ }
+
+ strcpy(key, kGConfPlayerTouchscreenEnable);
+ if (gconf_client_get_bool(gcc, key_base, NULL)) {
+ if (count > 0) strcat(description, ", ");
+ strcat(description, _("Touchscreen"));
+ count++;
}
- if (description[0] == '\0') {
+ strcpy(key, kGConfPlayerZeemoteEnable);
+ if (gconf_client_get_bool(gcc, key_base, NULL)) {
+ if (count > 0) strcat(description, ", ");
+ strcat(description, _("Zeemote"));
+ count++;
+ }
+
+ if (count == 0) {
+ /* Add some text if there are no enabled controls */
strcpy(description, _("Disabled"));
}
gtk_box_pack_start_defaults(keys_box, GTK_WIDGET(keys_btn));
GtkWidget* sep_1 = GTK_WIDGET(gtk_hseparator_new());
-
GtkBox* touch_box = GTK_BOX(gtk_vbox_new(FALSE, HILDON_MARGIN_HALF));
touch_chk = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(
touch_show_chk = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(
_("Show on-screen button grid")));
- GtkWidget* sep_2 = GTK_WIDGET(gtk_hseparator_new());
- touch_show_chk = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(
- _("Enable Zeemote joystick")));
-
gtk_box_pack_start_defaults(touch_box, GTK_WIDGET(touch_chk));
gtk_box_pack_start_defaults(touch_box, GTK_WIDGET(touch_show_chk));
+ GtkWidget* sep_2 = GTK_WIDGET(gtk_hseparator_new());
+ zeemote_chk = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(
+ _("Enable Zeemote joystick")));
+
gtk_box_pack_start_defaults(GTK_BOX(dialog->vbox), GTK_WIDGET(keys_box));
gtk_box_pack_start_defaults(GTK_BOX(dialog->vbox), sep_1);
gtk_box_pack_start_defaults(GTK_BOX(dialog->vbox), GTK_WIDGET(touch_box));
#if MAEMO_VERSION >= 5
gtk_window_resize(GTK_WINDOW(dialog), 800, 360);
#else
- gtk_window_resize(GTK_WINDOW(dialog), 400, 200);
+ gtk_window_resize(GTK_WINDOW(dialog), 450, 250);
#endif
g_signal_connect(G_OBJECT(dialog), "response",