Skip to content

Added initial settings schema.

Created a schema with the following settings:

Appearance
  • dark-theme (false)
    Enable or disable dark theme
Auto Refresh
  • auto-refresh (true)
    Whether to periodically refresh content
  • auto-refresh-time (1)
    How many periods of time to wait between automatic refreshes
  • auto-refresh-period ('hours')
    What period of time to wait between automatic refreshes
  • refresh-on-startup (true)
    Whether to refresh content after startup
Auto Cleanup
  • auto-cleanup (true)
    Whether to periodically refresh content
  • auto-cleanup-time (2)
    How many periods of time to wait between automatic cleanups
  • auto-cleanup-period ('days')
    What period of time to wait between automatic cleanups

Both of the time period based settings share an enum defined in the settings schema.

Reading and writing the settings is as simple as:

use gio::{Settings, SettingsExt};

let settings = Settings::new("org.gnome.Hammond")
let auto_refresh = settings.get_boolean("auto-refresh");

settings.set_boolean("auto-refresh", !auto_refresh);

I'm not sure if we want to have the settings persist as part of the App or if we should be accessing them explicitly in various locations.

Merge request reports