[gcompris] Added a reset button for the locale in the configuration dialog .
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] Added a reset button for the locale in the configuration dialog .
- Date: Sun, 27 Feb 2011 09:00:27 +0000 (UTC)
commit e6bac87713c7ddde5c5aba14eba5b944ad2226cf
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Sun Feb 27 00:51:45 2011 +0100
Added a reset button for the locale in the configuration dialog .
It is sometimes hard to get back on the default locale, this button makes it easily.
src/gcompris/config.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/gcompris/config.c b/src/gcompris/config.c
index 79e7e37..3964631 100644
--- a/src/gcompris/config.c
+++ b/src/gcompris/config.c
@@ -219,6 +219,22 @@ gc_config_start ()
x_flag_start + 5,
y_start - pixmap_width/2);
+ /* A repeat icon to reset the selection */
+ item = goo_canvas_svg_new (rootitem,
+ gc_skin_rsvg_get(),
+ "svg-id", "#REPEAT",
+ NULL);
+ goo_canvas_item_get_bounds(item, &bounds);
+ double zoom = 0.65;
+ goo_canvas_item_scale(item, zoom, zoom);
+ goo_canvas_item_translate(item,
+ (-1 * bounds.x1 + x_flag_start - 340) * zoom,
+ (-1 * bounds.y1 + y_start - 120) * zoom);
+ g_signal_connect(item, "button_press_event",
+ (GtkSignalFunc) item_event_ok,
+ "locale_reset");
+ gc_item_focus_init(item, NULL);
+
/*
* The current locale is the one found in the config file
*/
@@ -727,6 +743,15 @@ item_event_ok(GooCanvasItem *item,
set_locale_flag(current_locale);
}
+ else if(!strcmp((char *)data, "locale_reset"))
+ {
+ current_locale = linguas[0];
+ g_object_set (G_OBJECT(item_locale_text),
+ "text", gc_locale_get_name(current_locale),
+ NULL);
+
+ set_locale_flag(current_locale);
+ }
else if(!strcmp((char *)data, "timer_previous"))
{
if(properties->timer>0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]