~smspillaz/compiz-compizconfig-gconf/compiz-compizconfig-gconf.adapt-to-new-interfaces

« back to all changes in this revision

Viewing changes to src/gconf.c

  • Committer: Sam Spilsbury
  • Date: 2011-06-27 07:21:50 UTC
  • mto: This revision was merged to the branch mainline in revision 155.
  • Revision ID: git-v1:c68304abd9e44cd3c35341931f8fdb605172d84e
Add support for bell options

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    OptionInt,
99
99
    OptionBool,
100
100
    OptionKey,
 
101
    OptionBell,
101
102
    OptionString,
102
103
    OptionSpecial,
103
104
} SpecialOptionType;
167
168
     METACITY "/general/resize_with_right_button", OptionSpecial},
168
169
 
169
170
    {"visual_bell", "fade", TRUE,
170
 
     METACITY "/general/visual_bell", OptionBool},
 
171
     METACITY "/general/visual_bell", OptionBell},
171
172
    {"fullscreen_visual_bell", "fade", TRUE,
172
173
     METACITY "/general/visual_bell_type", OptionSpecial},
173
174
 
1001
1002
            ret = TRUE;
1002
1003
        }
1003
1004
        break;
 
1005
    case OptionBell:
 
1006
        if (gconfValue->type == GCONF_VALUE_BOOL)
 
1007
        {
 
1008
            gboolean value;
 
1009
 
 
1010
            value = gconf_value_get_bool (gconfValue);
 
1011
            ccsSetBell (setting, value ? TRUE : FALSE);
 
1012
            ret = TRUE;
 
1013
        }
 
1014
        break;
1004
1015
    case OptionString:
1005
1016
        if (gconfValue->type == GCONF_VALUE_STRING)
1006
1017
        {
1518
1529
                                       newValue, NULL);
1519
1530
        }
1520
1531
        break;
 
1532
    case OptionBell:
 
1533
        {
 
1534
            Bool     newValue;
 
1535
            gboolean currentValue;
 
1536
            if (!ccsGetBell (setting, &newValue))
 
1537
                break;
 
1538
            currentValue = gconf_client_get_bool (client, optionName, &err);
 
1539
 
 
1540
            if (!err && ((currentValue && !newValue) ||
 
1541
                         (!currentValue && newValue)))
 
1542
                gconf_client_set_bool (client, specialOptions[index].gnomeName,
 
1543
                                       newValue, NULL);
 
1544
        }
 
1545
        break;
1521
1546
    case OptionString:
1522
1547
        {
1523
1548
            char  *newValue;