[mousetweaks] Bind timer objects to GSettings
- From: Gerd Kohlberger <gerdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mousetweaks] Bind timer objects to GSettings
- Date: Mon, 11 Oct 2010 18:15:34 +0000 (UTC)
commit 20e86893cab49bdd530fc314633f177f4bf74c2f
Author: Gerd Kohlberger <gerdk src gnome org>
Date: Mon Oct 11 20:14:40 2010 +0200
Bind timer objects to GSettings
src/mt-main.c | 32 +++++++++-----------------------
src/mt-settings.c | 27 ---------------------------
src/mt-settings.h | 2 --
3 files changed, 9 insertions(+), 52 deletions(-)
---
diff --git a/src/mt-main.c b/src/mt-main.c
index 81322f0..c533865 100644
--- a/src/mt-main.c
+++ b/src/mt-main.c
@@ -528,29 +528,6 @@ mt_main_sig_handler (MtSigHandler *sigh,
signal_handler (signal_id);
}
-/*
- if (g_str_equal (key, OPT_SSC_T) && value->type == GCONF_VALUE_FLOAT)
- {
- mt_timer_set_target (mt->ssc_timer, gconf_value_get_float (value));
- }
- else if (g_str_equal (key, OPT_DWELL_T) && value->type == GCONF_VALUE_FLOAT)
- {
- mt_timer_set_target (mt->dwell_timer, gconf_value_get_float (value));
- }
- else if (g_str_equal (key, OPT_ANIMATE) && value->type == GCONF_VALUE_BOOL)
- {
- MtCursorManager *manager;
-
- manager = mt_cursor_manager_get_default ();
- mt->animate_cursor = gconf_value_get_bool (value);
-
- if (mt->animate_cursor)
- mt->cursor = mt_cursor_manager_current_cursor (manager);
- else
- mt_cursor_manager_restore_all (manager);
- }
-*/
-
static MtData *
mt_data_init (void)
{
@@ -702,6 +679,15 @@ mt_main (int argc, char **argv, MtCliArgs cli_args)
/* load settings */
ms = mt_settings_get_default ();
+ /* bind timers */
+ g_settings_bind (ms->settings, KEY_SSC_TIME,
+ mt->ssc_timer, "target-time",
+ G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
+
+ g_settings_bind (ms->settings, KEY_DWELL_TIME,
+ mt->dwell_timer, "target-time",
+ G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
+
/* override with CLI arguments */
if (cli_args.dwell_enabled)
ms->dwell_enabled = cli_args.dwell_enabled;
diff --git a/src/mt-settings.c b/src/mt-settings.c
index 9e5937e..823a0b7 100644
--- a/src/mt-settings.c
+++ b/src/mt-settings.c
@@ -29,7 +29,6 @@ enum
{
PROP_0,
PROP_DWELL_ENABLED,
- PROP_DWELL_TIME,
PROP_DWELL_THRESHOLD,
PROP_DWELL_MODE,
PROP_DWELL_GESTURE_SINGLE,
@@ -37,7 +36,6 @@ enum
PROP_DWELL_GESTURE_DRAG,
PROP_DWELL_GESTURE_SECONDARY,
PROP_SSC_ENABLED,
- PROP_SSC_TIME,
PROP_CTW_VISIBLE,
PROP_CTW_STYLE,
PROP_ANIMATE_CURSOR,
@@ -51,7 +49,6 @@ mt_settings_init (MtSettings *ms)
ms->settings = g_settings_new (MT_SCHEMA_ID);
BIND_PROP ("dwell-enabled", KEY_DWELL_ENABLED);
- BIND_PROP ("dwell-time", KEY_DWELL_TIME);
BIND_PROP ("dwell-threshold", KEY_DWELL_THRESHOLD);
BIND_PROP ("dwell-mode", KEY_DWELL_MODE);
BIND_PROP ("dwell-gesture-single", KEY_DWELL_GESTURE_SINGLE);
@@ -59,7 +56,6 @@ mt_settings_init (MtSettings *ms)
BIND_PROP ("dwell-gesture-drag", KEY_DWELL_GESTURE_DRAG);
BIND_PROP ("dwell-gesture-secondary", KEY_DWELL_GESTURE_SECONDARY);
BIND_PROP ("ssc-enabled", KEY_SSC_ENABLED);
- BIND_PROP ("ssc-time", KEY_SSC_TIME);
BIND_PROP ("ctw-visible", KEY_CTW_VISIBLE);
BIND_PROP ("ctw-style", KEY_CTW_STYLE);
BIND_PROP ("animate-cursor", KEY_ANIMATE_CURSOR);
@@ -92,9 +88,6 @@ mt_settings_set_property (GObject *object,
case PROP_DWELL_ENABLED:
ms->dwell_enabled = g_value_get_boolean (value);
break;
- case PROP_DWELL_TIME:
- ms->dwell_time = g_value_get_double (value);
- break;
case PROP_DWELL_THRESHOLD:
ms->dwell_threshold = g_value_get_int (value);
break;
@@ -116,9 +109,6 @@ mt_settings_set_property (GObject *object,
case PROP_SSC_ENABLED:
ms->ssc_enabled = g_value_get_boolean (value);
break;
- case PROP_SSC_TIME:
- ms->ssc_time = g_value_get_double (value);
- break;
case PROP_CTW_VISIBLE:
ms->ctw_visible = g_value_get_boolean (value);
break;
@@ -146,9 +136,6 @@ mt_settings_get_property (GObject *object,
case PROP_DWELL_ENABLED:
g_value_set_boolean (value, ms->dwell_enabled);
break;
- case PROP_DWELL_TIME:
- g_value_set_double (value, ms->dwell_time);
- break;
case PROP_DWELL_THRESHOLD:
g_value_set_int (value, ms->dwell_threshold);
break;
@@ -170,9 +157,6 @@ mt_settings_get_property (GObject *object,
case PROP_SSC_ENABLED:
g_value_set_boolean (value, ms->ssc_enabled);
break;
- case PROP_SSC_TIME:
- g_value_set_double (value, ms->ssc_time);
- break;
case PROP_CTW_VISIBLE:
g_value_set_boolean (value, ms->ctw_visible);
break;
@@ -204,12 +188,6 @@ mt_settings_class_init (MtSettingsClass *klass)
"Enable dwell clicks",
FALSE, PFLAGS));
g_object_class_install_property (object_class,
- PROP_DWELL_TIME,
- g_param_spec_double ("dwell-time",
- "Dwell time",
- "Dwell click time",
- 0.1, 3.0, 1.2, PFLAGS));
- g_object_class_install_property (object_class,
PROP_DWELL_THRESHOLD,
g_param_spec_int ("dwell-threshold",
"Dwell threshold",
@@ -252,11 +230,6 @@ mt_settings_class_init (MtSettingsClass *klass)
"Enable simulated secondary clicks",
FALSE, PFLAGS));
g_object_class_install_property (object_class,
- PROP_SSC_TIME,
- g_param_spec_double ("ssc-time", "SSC time",
- "Simulated secondary click time",
- 0.1, 3.0, 1.2, PFLAGS));
- g_object_class_install_property (object_class,
PROP_CTW_VISIBLE,
g_param_spec_boolean ("ctw-visible",
"CTW visible",
diff --git a/src/mt-settings.h b/src/mt-settings.h
index 328e800..3cf7378 100644
--- a/src/mt-settings.h
+++ b/src/mt-settings.h
@@ -37,8 +37,6 @@ struct _MtSettings
GSettings *settings;
- gdouble dwell_time;
- gdouble ssc_time;
gint dwell_threshold;
gint dwell_mode;
gint dwell_gesture_single;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]