<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <template class="NotificationsPage" parent="AdwPreferencesPage">
    <property name="icon-name">notifications-symbolic</property>
    <property name="title" translatable="yes">Notifications</property>
    <property name="name">notifications</property>
    <child>
      <object class="AdwPreferencesGroup">
        <child>
          <object class="AdwActionRow">
            <property name="title" translatable="yes">Enable for this account</property>
            <property name="activatable-widget">account_switch</property>
            <child type="suffix">
              <object class="GtkBox">
                <property name="valign">center</property>
                <property name="spacing">6</property>
                <child>
                  <object class="Spinner">
                    <property name="visible" bind-source="NotificationsPage" bind-property="account-loading" bind-flags="sync-create"/>
                  </object>
                </child>
                <child>
                  <object class="GtkSwitch" id="account_switch">
                    <signal name="notify::active" handler="account_switched" swapped="true"/>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwSwitchRow" id="session_row">
            <property name="title" translatable="yes">Enable for this session</property>
            <signal name="notify::active" handler="session_switched" swapped="true"/>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="AdwPreferencesGroup" id="global">
        <property name="title" translatable="yes">Global</property>
        <property name="description" translatable="yes">Which messages trigger notifications in rooms that do not have more specific rules.</property>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">global_all_radio</property>
            <property name="title" translatable="yes">All messages in all rooms</property>
            <child type="prefix">
              <object class="LoadingBin" id="global_all_bin">
                <property name="child">
                  <object class="GtkCheckButton" id="global_all_radio">
                    <property name="valign">center</property>
                    <property name="action-name">notifications.set-global-default</property>
                    <property name="action-target">'all'</property>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">global_direct_radio</property>
            <property name="title" translatable="yes">All messages in direct chats, and mentions and keywords in all rooms</property>
            <child type="prefix">
              <object class="LoadingBin" id="global_direct_bin">
                <property name="child">
                  <object class="GtkCheckButton" id="global_direct_radio">
                    <property name="valign">center</property>
                    <property name="action-name">notifications.set-global-default</property>
                    <property name="action-target">'direct-and-mentions'</property>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="AdwActionRow">
            <property name="activatable-widget">global_mentions_radio</property>
            <property name="title" translatable="yes">Only mentions and keywords in all rooms</property>
            <child type="prefix">
              <object class="LoadingBin" id="global_mentions_bin">
                <property name="child">
                  <object class="GtkCheckButton" id="global_mentions_radio">
                    <property name="valign">center</property>
                    <property name="action-name">notifications.set-global-default</property>
                    <property name="action-target">'mentions-only'</property>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="AdwPreferencesGroup">
        <property name="title" translatable="yes">Keywords</property>
        <property name="description" translatable="yes">Messages that contain one of these keywords trigger notifications. Matching on these keywords is case-insensitive.</property>
        <child>
          <object class="GtkListBox" id="keywords">
            <style>
              <class name="boxed-list"/>
            </style>
          </object>
        </child>
      </object>
    </child>
  </template>
  <object class="AdwEntryRow" id="keywords_add_entry">
    <property name="title" translatable="yes">Add Keyword…</property>
    <signal name="entry-activated" handler="add_keyword" swapped="yes"/>
    <child>
      <object class="LoadingBin" id="keywords_add_bin">
        <property name="child">
          <object class="GtkButton">
            <property name="icon-name">add-symbolic</property>
            <property name="valign">center</property>
            <property name="halign">center</property>
            <property name="tooltip-text" translatable="yes">Add Keyword</property>
            <signal name="clicked" handler="add_keyword" swapped="true"/>
            <style>
              <class name="flat"/>
            </style>
          </object>
        </property>
      </object>
    </child>
  </object>
</interface>
