<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2026, Jiri Eischmann <jiri@eischmann.cz> and the meshy contributors -->
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="libadwaita" version="1.0"/>

  <!-- Backup & Restore -->
  <object class="AdwPreferencesGroup" id="backup_group">
    <property name="margin-start">12</property>
    <property name="margin-end">12</property>
    <property name="margin-top">8</property>
    <child>
      <object class="AdwExpanderRow" id="backup_expander">
        <property name="title" translatable="yes">Backup</property>
        <child type="prefix">
          <object class="GtkImage">
            <property name="icon-name">document-save-symbolic</property>
          </object>
        </child>
        <child>
          <object class="AdwActionRow" id="manual_backup_row">
            <property name="title" translatable="yes">Manual</property>
            <property name="subtitle" translatable="yes">Choose what to back up and save to a file</property>
            <property name="activatable-widget">manual_backup_btn</property>
            <child type="suffix">
              <object class="GtkButton" id="manual_backup_btn">
                <property name="icon-name">document-save-symbolic</property>
                <property name="valign">center</property>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow" id="auto_backup_row">
            <property name="title" translatable="yes">Automatic</property>
            <property name="subtitle" translatable="yes">Daily backups, kept for 7 days</property>
            <property name="activatable-widget">auto_backup_btn</property>
            <child type="suffix">
              <object class="GtkButton" id="auto_backup_btn">
                <property name="icon-name">snapshots-alt-symbolic</property>
                <property name="valign">center</property>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="AdwExpanderRow" id="restore_expander">
        <property name="title" translatable="yes">Restore</property>
        <child type="prefix">
          <object class="GtkImage">
            <property name="icon-name">document-open-symbolic</property>
          </object>
        </child>
        <child>
          <object class="AdwActionRow" id="restore_file_row">
            <property name="title" translatable="yes">From File</property>
            <property name="subtitle" translatable="yes">Restore from a manually saved backup</property>
            <property name="activatable-widget">restore_file_btn</property>
            <child type="suffix">
              <object class="GtkButton" id="restore_file_btn">
                <property name="icon-name">document-open-symbolic</property>
                <property name="valign">center</property>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow" id="restore_auto_row">
            <property name="title" translatable="yes">From Auto Backup</property>
            <property name="subtitle" translatable="yes">Restore from an automatic snapshot</property>
            <property name="activatable-widget">restore_auto_btn</property>
            <child type="suffix">
              <object class="GtkButton" id="restore_auto_btn">
                <property name="icon-name">history-undo-symbolic</property>
                <property name="valign">center</property>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </object>

  <!-- Spacer to push Factory Reset to the bottom -->
  <object class="GtkBox" id="spacer">
    <property name="vexpand">true</property>
  </object>

  <!-- Factory Reset -->
  <object class="AdwPreferencesGroup" id="reset_group">
    <property name="margin-start">12</property>
    <property name="margin-end">12</property>
    <property name="margin-bottom">12</property>
    <child>
      <object class="AdwActionRow" id="factory_reset_row">
        <property name="title" translatable="yes">Factory Reset</property>
        <property name="subtitle" translatable="yes">Erase all data on the companion</property>
        <property name="activatable-widget">factory_reset_btn</property>
        <child type="suffix">
          <object class="GtkButton" id="factory_reset_btn">
            <property name="icon-name">edit-clear-all-symbolic</property>
            <property name="valign">center</property>
            <style>
              <class name="destructive-action"/>
            </style>
          </object>
        </child>
      </object>
    </child>
  </object>
</interface>
