Added initial settings schema.

This commit is contained in:
Rowan Lewis 2018-03-16 20:38:37 +01:00
parent fdf3908494
commit 97e402b980
3 changed files with 63 additions and 1 deletions

View File

@ -2,3 +2,5 @@
install_data('org.gnome.Hammond.desktop', install_dir : datadir + '/applications')
install_data('org.gnome.Hammond.appdata.xml', install_dir : datadir + '/appdata')
install_data('org.gnome.Hammond.gschema.xml', install_dir: join_paths(datadir, 'glib-2.0', 'schemas'))
meson.add_install_script('../../scripts/compile-gschema.py')

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<enum id="org.gnome.Hammond.timePeriods">
<value nick="seconds" value="1"/>
<value nick="minutes" value="2"/>
<value nick="hours" value="3"/>
<value nick="days" value="4"/>
<value nick="weeks" value="5"/>
<value nick="months" value="6"/>
</enum>
<schema path="/org/gnome/hammond/" id="org.gnome.Hammond">
<key name="dark-theme" type="b">
<default>false</default>
<summary>Enable or disable dark theme</summary>
</key>
<key name="auto-refresh" type="b">
<default>true</default>
<summary>Wheather to periodically refresh content</summary>
</key>
<key name="auto-refresh-time" type="i">
<range min="1" max="100"/>
<default>1</default>
<summary>How many periods of time to wait between automatic refreshes</summary>
</key>
<key name="auto-refresh-period" enum="org.gnome.Hammond.timePeriods">
<default>'hours'</default>
<summary>What period of time to wait between automatic refreshes</summary>
</key>
<key name="refresh-on-startup" type="b">
<default>true</default>
<summary>Wheather to refresh content after startup</summary>
</key>
<key name="auto-cleanup" type="b">
<default>true</default>
<summary>Wheather to periodically cleanup content</summary>
</key>
<key name="auto-cleanup-time" type="i">
<range min="1" max="100"/>
<default>2</default>
<summary>How many periods of time to wait between automatic cleanups</summary>
</key>
<key name="auto-cleanup-period" enum="org.gnome.Hammond.timePeriods">
<default>'days'</default>
<summary>What period of time to wait between automatic cleanups</summary>
</key>
</schema>
</schemalist>

View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
import os
import subprocess
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])