elementary / default-settings

Default settings for elementary OS
GNU General Public License v3.0
39 stars 28 forks source link

Enable Housekeeping by default #182

Closed meisenzahl closed 4 years ago

meisenzahl commented 4 years ago

Closes #178

meisenzahl commented 4 years ago
...
construct {
        var settings = new GLib.Settings ("org.gnome.desktop.privacy");

        description = _("Old files can be automatically deleted after %u days to save space and help protect your privacy.").printf (settings.get_uint ("old-files-age"));

        var header_label = new Granite.HeaderLabel (_("Automatically Delete:"));

        var temp_switch = new Gtk.CheckButton.with_label (_("Temporary files"));
        temp_switch.margin_start = 12;

        var trash_switch = new Gtk.CheckButton.with_label (_("Trashed files"));
        trash_switch.margin_start = 12;

        custom_bin.attach (header_label, 0, 0);
        custom_bin.attach (temp_switch, 0, 1);
        custom_bin.attach (trash_switch, 0, 2);

        settings.bind ("remove-old-temp-files", temp_switch, "active", GLib.SettingsBindFlags.DEFAULT);
        settings.bind ("remove-old-trash-files", trash_switch, "active", GLib.SettingsBindFlags.DEFAULT);
    }
...

Reference: https://github.com/elementary/onboarding/blob/master/src/Views/HouseKeepingView.vala#L28