config: use "obey_silent_profile" pref instead of "ignore_silent"
[espeaktime] / src / config.c
index 19f89e0..8a82c8d 100644 (file)
@@ -14,7 +14,7 @@ void cfg_read(GConfClient *client, struct espeaktime_settings *cfg)
        cfg->amplitude = gconf_client_get_int(client, GCONF_KEY "/amplitude", NULL);
        cfg->pitch = gconf_client_get_int(client, GCONF_KEY "/pitch", NULL);
        cfg->speed = gconf_client_get_int(client, GCONF_KEY "/speed", NULL);
-       cfg->ignore_silent = gconf_client_get_bool(client, GCONF_KEY "/ignore_silent", NULL);
+       cfg->ignore_silent = !gconf_client_get_bool(client, GCONF_KEY "/obey_silent_profile", NULL);
        if (!cfg->voice)
                cfg->voice = g_strdup("en-us");
        if (!cfg->effect)
@@ -27,7 +27,6 @@ void cfg_read(GConfClient *client, struct espeaktime_settings *cfg)
                cfg->pitch = 50;
        if (!cfg->speed)
                cfg->speed = 170;
-       /* TODO: default ignore_silent to TRUE */
 }
 
 void cfg_write(GConfClient *client, struct espeaktime_settings *cfg)
@@ -39,7 +38,7 @@ void cfg_write(GConfClient *client, struct espeaktime_settings *cfg)
        gconf_client_set_int(client, GCONF_KEY "/amplitude", cfg->amplitude, NULL);
        gconf_client_set_int(client, GCONF_KEY "/pitch", cfg->pitch, NULL);
        gconf_client_set_int(client, GCONF_KEY "/speed", cfg->speed, NULL);
-       gconf_client_set_bool(client, GCONF_KEY "/ignore_silent", cfg->ignore_silent, NULL);
+       gconf_client_set_bool(client, GCONF_KEY "/obey_silent_profile", !cfg->ignore_silent, NULL);
 }
 
 void cfg_free(struct espeaktime_settings *cfg)