Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Podcasts Podcasts
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 105
    • Issues 105
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • World
  • PodcastsPodcasts
  • Merge requests
  • !22

Added initial settings schema.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Anarchist Mae requested to merge anarchistmae/Hammond:feature/gsettings-schema into master Mar 16, 2018
  • Overview 1
  • Commits 2
  • Pipelines 1
  • Changes 3

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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/gsettings-schema