Ok I solved it.
First I had to edit data/glib-2.0/schemas/net.launchpad.calorie-burner.gschema.xml:
Note that type="s" is for strings and type="i" is for integers
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="calorie-burner">
<schema id="net.launchpad.calorie-burner" path="/net/launchpad/calorie-burner/">
<key name="weight" type="i">
<range min="1" max="350"/>
<default>100</default>
<summary>User's Weight Kgs</summary>
</key>
<key name="units" type="s">
<choices>
<choice value='Metric'/>
<choice value='Imperial'/>
</choices>
<default>'Metric'</default>
</key>
<key name="energy" type="s">
<choices>
<choice value='KJs'/>
<choice value='Calories'/>
</choices>
<default>'KJs'</default>
</key>
</schema>
</schemalist>
Next I had to wire up my ui elements to my preferences:
In the preferences dialog I had to do the following:
# Bind each preference widget to gsettings
settings = Gio.Settings("net.launchpad.calorie-burner")
widget = self.builder.get_object('weight')
settings.bind("weight", widget, "value", Gio.SettingsBindFlags.DEFAULT)
widget = self.builder.get_object('cmbUnits-entry')
settings.bind("units", widget, "text", Gio.SettingsBindFlags.DEFAULT)
widget = self.builder.get_object('cmbEnergy-entry')
settings.bind("energy", widget, "text", Gio.SettingsBindFlags.DEFAULT)
Note that the first argument is the name of the setting, the second is the widget on the ui and the thrid is the property of the widget that contains the data I want to store in my preferences.
Also note for comboboxes I had to enable "Has Entry" to create a text box with the text property.
Lastly in my main dialog I had to do the following:
from gi.repository import Gtk, Gio # pylint: disable=E0611
self.settings = Gio.Settings("net.launchpad.calorie-burner")
To access the settings call either get_string or get_int with the name of the setting:
self.settings.get_string("energy")
self.settings.get_string("units")
self.settings.get_int("weight")