config: use "obey_silent_profile" pref instead of "ignore_silent"
authorAlex Badea <vamposdecampos@gmail.com>
Sun, 20 Jun 2010 18:32:16 +0000 (21:32 +0300)
committerAlex Badea <vamposdecampos@gmail.com>
Sun, 20 Jun 2010 18:32:16 +0000 (21:32 +0300)
This way it can default to "yes, ignore".

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)