<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <template class="ChattySettingsDialog" parent="GtkDialog">
    <property name="default-height">480</property>
    <property name="default-width">360</property>
    <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>

    <child type="titlebar">
      <object class="GtkHeaderBar">
        <property name="visible">1</property>
        <property name="show-close-button">0</property>
        <property name="title" translatable="yes">Preferences</property>

        <!-- Back button -->
        <child>
          <object class="GtkButton" id="back_button">
            <property name="visible">1</property>
            <signal name="clicked" handler="chatty_settings_back_clicked_cb" swapped="yes" />
            <child internal-child="accessible">
              <object class="AtkObject">
                <property name="accessible-name" translatable="yes">Back</property>
              </object>
            </child>
            <child>
              <object class="GtkImage">
                <property name="visible">1</property>
                <property name="icon-name">go-previous-symbolic</property>
              </object>
            </child>
          </object>
          <packing>
            <property name="pack-type">start</property>
          </packing>
        </child>

        <!-- Cancel button -->
        <child>
          <object class="GtkButton" id="cancel_button">
            <property name="visible">0</property>
            <property name="use-underline">1</property>
            <property name="label" translatable="yes">_Cancel</property>
            <signal name="clicked" handler="chatty_settings_cancel_clicked_cb" swapped="yes" />
          </object>
          <packing>
            <property name="pack-type">start</property>
          </packing>
        </child>

        <!-- Add button -->
        <child>
          <object class="GtkButton" id="add_button">
            <property name="visible">0</property>
            <property name="use-underline">1</property>
            <property name="label" translatable="yes">_Add</property>
            <signal name="clicked" handler="chatty_settings_add_clicked_cb" swapped="yes" />
            <style>
              <class name="default" />
            </style>
          </object>
          <packing>
            <property name="pack-type">end</property>
          </packing>
        </child>

        <!-- Save button -->
        <child>
          <object class="GtkButton" id="save_button">
            <property name="visible">0</property>
            <property name="use-underline">1</property>
            <property name="label" translatable="yes">_Save</property>
            <signal name="clicked" handler="chatty_settings_save_clicked_cb" swapped="yes" />
            <style>
              <class name="default" />
            </style>
          </object>
          <packing>
            <property name="pack-type">end</property>
          </packing>
        </child>

        <child>
          <object class="GtkSpinner" id="matrix_spinner">
            <property name="visible">1</property>
            <property name="halign">start</property>
          </object>
          <packing>
            <property name="pack-type">end</property>
          </packing>
        </child>

      </object>
    </child>

    <child internal-child="vbox">
      <object class="GtkBox">
        <property name="visible">1</property>
        <property name="border-width">0</property>
        <property name="spacing">18</property>
        <property name="width-request">340</property>
        <property name="height-request">360</property>

        <child>
          <object class="GtkStack" id="main_stack">
            <property name="visible">True</property>
            <property name="transition_type">slide-left-right</property>
            <child>
              <object class="HdyPreferencesPage">
                <property name="visible">True</property>

                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">True</property>
                    <child>
                      <object class="GtkListBox">
                        <property name="visible">True</property>
                        <style>
                         <class name="content"/>
                        </style>
                        <child>
                          <object class="HdyActionRow">
                            <property name="visible">True</property>
                            <property name="activatable">True</property>
                            <property name="selectable">False</property>
                            <property name="title" translatable="yes">Message Settings</property>
                            <property name="subtitle" translatable="yes">SMS/MMS Settings</property>
                            <signal name="activated" handler="sms_mms_settings_row_activated_cb" swapped="yes"/>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Account settings -->
                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">True</property>
                    <property name="title" translatable="yes">Accounts</property>
                    <child>
                      <object class="GtkListBox" id="accounts_list_box">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="expand">True</property>
                        <property name="selection-mode">none</property>
                        <signal name="row-activated" handler="account_list_row_activated_cb" swapped="yes"/>
                        <style>
                          <class name="content"/>
                        </style>
                        <child>
                          <object class="HdyActionRow" id="add_account_row">
                            <property name="visible">True</property>
                            <property name="title" translatable="yes">Add new account…</property>
                            <property name="activatable">True</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Privacy settings -->
                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">True</property>
                    <property name="title" translatable="yes">Privacy</property>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Message Receipts</property>
                        <property name="subtitle" translatable="yes">Confirm received messages</property>
                        <property name="activatable-widget">send_receipts_switch</property>
                        <child>
                          <object class="GtkSwitch" id="send_receipts_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Message Archive Management</property>
                        <property name="subtitle" translatable="yes">Sync conversations with chat server</property>
                        <property name="activatable-widget">message_archive_switch</property>
                        <child>
                          <object class="GtkSwitch" id="message_archive_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="HdyActionRow" id="message_carbons_row">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Message Carbon Copies</property>
                        <property name="subtitle" translatable="yes">Share chat history among devices</property>
                        <property name="activatable-widget">message_carbons_switch</property>
                        <child>
                          <object class="GtkSwitch" id="message_carbons_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Typing Notification</property>
                        <property name="subtitle" translatable="yes">Send typing messages</property>
                        <property name="activatable-widget">typing_notification_switch</property>
                        <child>
                          <object class="GtkSwitch" id="typing_notification_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Chat list settings -->
                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">True</property>
                    <property name="title" translatable="yes">Chats List</property>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Indicate Idle Contacts</property>
                        <property name="subtitle" translatable="yes">Blur avatars from idle contacts</property>
                        <property name="activatable-widget">indicate_idle_switch</property>
                        <child>
                          <object class="GtkSwitch" id="indicate_idle_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Indicate Unknown Contacts</property>
                        <property name="subtitle" translatable="yes">Color unknown contact ID red</property>
                        <property name="activatable-widget">indicate_unknown_switch</property>
                        <child>
                          <object class="GtkSwitch" id="indicate_unknown_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Editor settings -->
                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">True</property>
                    <property name="title" translatable="yes">Editor</property>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Graphical Emoticons</property>
                        <property name="subtitle" translatable="yes">Convert ASCII emoticons</property>
                        <property name="activatable-widget">convert_smileys_switch</property>
                        <child>
                          <object class="GtkSwitch" id="convert_smileys_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Return = Send Message</property>
                        <property name="subtitle" translatable="yes">Send message with return key</property>
                        <property name="activatable-widget">return_sends_switch</property>
                        <child>
                          <object class="GtkSwitch" id="return_sends_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
              <packing>
                <property name="name">main-settings</property>
              </packing>
            </child>

            <child>
              <object class="HdyPreferencesPage">
                <property name="visible">True</property>
                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">True</property>
                    <property name="title" translatable="yes">SMS Settings</property>
                    <child>
                      <object class="HdyActionRow">
                        <property name="visible">True</property>
                        <property name="selectable">False</property>
                        <property name="title" translatable="yes">Delivery Reports</property>
                        <property name="subtitle" translatable="yes">Request delivery reports for SMS messages</property>
                        <property name="activatable-widget">delivery_reports_switch</property>
                        <child>
                          <object class="GtkSwitch" id="delivery_reports_switch">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                          </object>
                        </child>
                      </object>
                    </child>

                  </object>
                </child>
              </object>
              <packing>
                <property name="name">message-settings-view</property>
              </packing>
            </child>

            <child>
              <object class="GtkStack" id="account_details_stack">
                <property name="visible">1</property>
                <child>
                  <object class="ChattyPpAccountDetails" id="pp_account_details">
                    <property name="visible">1</property>
                    <signal name="notify::modified" handler="settings_pp_details_changed_cb" swapped="yes"/>
                    <signal name="delete-clicked" handler="settings_pp_details_delete_cb" swapped="yes"/>
                  </object>
                </child>
                <child>
                  <object class="ChattyMaAccountDetails" id="ma_account_details">
                    <property name="visible">1</property>
                    <signal name="notify::modified" handler="settings_pp_details_changed_cb" swapped="yes"/>
                    <signal name="delete-clicked" handler="settings_pp_details_delete_cb" swapped="yes"/>
                  </object>
                </child>
              </object>
              <packing>
                <property name="name">edit-account-view</property>
              </packing>
            </child>

            <child>
              <object class="HdyPreferencesPage">
                <property name="visible">True</property>
                <child>
                  <object class="HdyPreferencesGroup" id="protocol_list_group">
                    <property name="visible">true</property>
                    <child>
                      <object class="GtkListBox" id="protocol_list">
                        <property name="visible">False</property>
                        <property name="can_focus">False</property>
                        <property name="selection-mode">none</property>
                        <property name="margin-bottom">24</property>
                        <style>
                          <class name="content"/>
                        </style>
                        <child>
                          <object class="HdyActionRow">
                            <property name="activatable_widget">xmpp_radio_button</property>
                            <property name="title" translatable="yes">XMPP</property>
                            <property name="visible">True</property>
                            <child type="prefix">
                              <object class="GtkRadioButton" id="xmpp_radio_button">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <signal name="toggled" handler="settings_protocol_changed_cb" swapped="yes"/>
                              </object>
                            </child>
                          </object>
                        </child>
                        <child>
                          <object class="HdyActionRow" id="matrix_row">
                            <property name="activatable_widget">matrix_radio_button</property>
                            <property name="title" translatable="yes">Matrix</property>
                            <property name="visible">False</property>
                            <child type="prefix">
                              <object class="GtkRadioButton" id="matrix_radio_button">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="group">xmpp_radio_button</property>
                                <signal name="toggled" handler="settings_protocol_changed_cb" swapped="yes"/>
                              </object>
                            </child>
                          </object>
                        </child>
                        <child>
                          <object class="HdyActionRow" id="telegram_row">
                            <property name="activatable_widget">telegram_radio_button</property>
                            <property name="title" translatable="yes">Telegram</property>
                            <property name="visible">False</property>
                            <child type="prefix">
                              <object class="GtkRadioButton" id="telegram_radio_button">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="group">xmpp_radio_button</property>
                                <signal name="toggled" handler="settings_protocol_changed_cb" swapped="yes"/>
                              </object>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="HdyPreferencesGroup">
                    <property name="visible">true</property>
                    <child>
                      <object class="GtkListBox" id="new_account_settings_list">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="expand">True</property>
                        <property name="selection-mode">none</property>
                        <property name="margin-bottom">24</property>
                        <style>
                          <class name="content"/>
                        </style>
                        <child>
                          <object class="HdyActionRow">
                            <property name="selectable">False</property>
                            <property name="activatable">False</property>
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <child type="prefix">
                              <object class="GtkLabel">
                                <property name="label" translatable="no">User ID</property>
                                <property name="xalign">1</property>
                                <property name="visible">True</property>
                                <property name="halign">start</property>
                              </object>
                            </child>
                            <child>
                              <object class="GtkEntry" id="new_account_id_entry">
                                <property name="activates_default">True</property>
                                <property name="hexpand">False</property>
                                <property name="visible">True</property>
                                <property name="halign">end</property>
                                <property name="valign">center</property>
                                <signal name="changed" handler="settings_new_detail_changed_cb" swapped="yes"/>
                              </object>
                            </child>
                          </object>
                        </child>
                        <child>
                          <object class="HdyActionRow">
                            <property name="selectable">False</property>
                            <property name="activatable">False</property>
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <child type="prefix">
                              <object class="GtkLabel">
                                <property name="label" translatable="yes">Password</property>
                                <property name="xalign">1</property>
                                <property name="visible">True</property>
                                <property name="halign">start</property>
                              </object>
                            </child>
                            <child>
                              <object class="GtkEntry" id="new_password_entry">
                                <property name="visible">True</property>
                                <property name="halign">end</property>
                                <property name="valign">center</property>
                                <property name="input_purpose">password</property>
                                <property name="activates_default">True</property>
                                <property name="hexpand">False</property>
                                <property name="visibility">False</property>
                                <property name="primary_icon_sensitive">False</property>
                                <property name="secondary_icon_activatable">True</property>
                                <property name="secondary_icon_name">eye-not-looking-symbolic</property>
                                <property name="secondary_icon_sensitive">True</property>
                                <signal name="icon-press" handler="settings_pw_entry_icon_clicked_cb" swapped="yes"/>
                                <signal name="changed" handler="settings_new_detail_changed_cb" swapped="yes"/>
                              </object>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
              <packing>
                <property name="name">add-account-view</property>
              </packing>
            </child>
          </object>
        </child>

      </object>
    </child>    <!-- ./internal-child -->

  </template>
  <object class="GtkDialog" id="matrix_homeserver_dialog">
    <property name="visible">False</property>
    <property name="modal">True</property>
    <property name="use-header-bar">1</property>
    <property name="default-height">24</property>
    <property name="title" translatable="yes">Matrix Home Server</property>
    <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>

    <child type="titlebar">
      <object class="GtkHeaderBar">
        <property name="visible">True</property>

        <!-- Cancel button -->
        <child>
          <object class="GtkButton" id="matrix_cancel_button">
            <property name="visible">True</property>
            <property name="use-underline">True</property>
            <property name="label" translatable="yes">_Cancel</property>
            <signal name="clicked" handler="settings_matrix_cancel_clicked_cb" swapped="yes"/>
          </object>
        </child>

        <!-- Spinner -->
        <child>
          <object class="GtkSpinner" id="matrix_homeserver_spinner">
            <property name="visible">True</property>
          </object>
          <packing>
            <property name="pack-type">end</property>
            <property name="position">1</property>
          </packing>
        </child>

        <!-- Accept button -->
        <child>
          <object class="GtkButton" id="matrix_accept_button">
            <property name="visible">True</property>
            <property name="sensitive">False</property>
            <property name="can-default">True</property>
            <property name="use-underline">True</property>
            <property name="label" translatable="yes">_Accept</property>
            <signal name="clicked" handler="settings_matrix_accept_clicked_cb" swapped="yes"/>
            <style>
              <class name="suggested-action"/>
            </style>
          </object>
          <packing>
            <property name="pack-type">end</property>
            <property name="position">0</property>
          </packing>
        </child>

      </object>
    </child>

    <child internal-child="vbox">
      <object class="GtkBox">
        <property name="border-width">0</property>
        <property name="margin-top">18</property>
        <property name="margin-start">12</property>
        <property name="margin-end">12</property>
        <property name="margin-bottom">18</property>
        <child>
          <object class="GtkLabel">
            <property name="visible">True</property>
            <property name="margin-bottom">18</property>
            <property name="wrap">True</property>
            <property name="max-width-chars">35</property>
            <property name="xalign">0.0</property>
            <property name="label" translatable="yes">Enter the matrix home server address.</property>
          </object>
        </child>
        <child>
          <object class="GtkEntry" id="matrix_homeserver_entry">
            <property name="visible">True</property>
            <signal name="changed" handler="settings_homeserver_entry_changed" swapped="yes"/>
          </object>
        </child>
        <child>
          <object class="GtkLabel" id="matrix_error_label">
            <property name="visible">True</property>
            <property name="wrap">True</property>
            <property name="max-width-chars">35</property>
            <property name="xalign">0.0</property>
            <style>
              <class name="error"/>
            </style>
          </object>
        </child>
      </object>
    </child>

  </object>

</interface>
