<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Cambalache 1.0 -->
<interface>
  <!-- interface-name journal_panel.ui -->
  <!-- interface-description Unit journal panel -->
  <requires lib="gtk" version="4.18"/>
  <requires lib="libadwaita" version="1.7"/>
  <template class="JournalPanel" parent="GtkBox">
    <property name="orientation">vertical</property>
    <child>
      <object class="GtkBox">
        <property name="margin-bottom">5</property>
        <property name="margin-end">5</property>
        <property name="margin-start">5</property>
        <property name="spacing">5</property>
        <child>
          <object class="GtkToggleButton" id="find_text_button">
            <property name="icon-name">system-search-symbolic</property>
          </object>
        </child>
        <child>
          <object class="GtkButton" id="journal_refresh_button">
            <property name="child">
              <object class="AdwButtonContent">
                <property name="halign">baseline</property>
                <property name="icon-name">view-refresh</property>
                <property name="label" translatable="yes" context="journal" comments="button">Refresh</property>
                <property name="valign">baseline</property>
              </object>
            </property>
            <property name="halign">start</property>
            <property name="tooltip-text" translatable="yes" context="journal">Clear journal events and refetch them</property>
            <signal name="clicked" handler="refresh_journal_clicked" swapped="True"/>
          </object>
        </child>
        <child>
          <object class="GtkLabel">
            <property name="label">Follow</property>
          </object>
        </child>
        <child>
          <object class="GtkSwitch" id="continuous_switch">
            <property name="tooltip-text" translatable="yes" context="journal" comments="tooltip">Enable new entries continuous print as they are appended to the journal</property>
            <property name="valign">baseline-center</property>
            <signal name="state-set" handler="continuous_switch_state_set" swapped="True"/>
          </object>
        </child>
        <child>
          <object class="GtkButton" id="journal_toggle_sort_button">
            <property name="child">
              <object class="AdwButtonContent">
                <property name="halign">baseline-fill</property>
                <property name="icon-name">view-sort-ascending</property>
                <property name="label">Ascending</property>
              </object>
            </property>
            <property name="halign">start</property>
            <property name="hexpand">True</property>
            <property name="tooltip-text" translatable="yes" context="journal" comments="tooltip">Toggle events display order</property>
            <signal name="clicked" handler="toggle_sort_clicked" swapped="True"/>
          </object>
        </child>
        <child>
          <object class="GtkButton">
            <property name="tooltip-text" translatable="yes" context="journal" comments="tooltip">List the boots of the system</property>
            <signal name="clicked" handler="list_boots_clicked" swapped="True"/>
            <child>
              <object class="AdwButtonContent">
                <property name="icon-name">list-symbolic</property>
                <property name="label" translatable="yes" context="journal" comments="button">List Boots</property>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkMenuButton">
            <property name="label">Boot</property>
            <property name="popover">
              <object class="GtkPopover">
                <property name="width-request">300</property>
                <signal name="closed" handler="journal_menu_popover_closed" swapped="True"/>
                <signal name="activate-default" handler="journal_menu_popover_activate_default" swapped="True"/>
                <signal name="show" handler="journal_menu_popover_show" swapped="True"/>
                <child>
                  <object class="GtkBox">
                    <property name="orientation">vertical</property>
                    <property name="spacing">5</property>
                    <child>
                      <object class="GtkButton" id="journal_boot_current_button">
                        <property name="label" translatable="yes" context="journal" comments="button">Current boot</property>
                        <signal name="clicked" handler="journal_boot_current_button_clicked" swapped="True"/>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="journal_boot_all_button">
                        <property name="label" translatable="yes" context="journal" comments="button">All events</property>
                        <signal name="clicked" handler="journal_boot_all_button_clicked" swapped="True"/>
                      </object>
                    </child>
                    <child>
                      <object class="AdwEntryRow" id="journal_boot_id_entry">
                        <property name="css-classes">.monospace</property>
                        <property name="title" translatable="yes" context="journal" comments="title">Boot id</property>
                        <property name="use-underline">True</property>
                        <signal name="changed" handler="journal_boot_id_entry_change" swapped="True"/>
                        <signal name="entry-activated" handler="journal_boot_id_entry_activated" swapped="True"/>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </property>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="AdwViewStack" id="panel_stack">
        <child>
          <object class="AdwViewStackPage">
            <property name="child">
              <object class="GtkBox">
                <property name="orientation">vertical</property>
                <child>
                  <object class="GtkScrolledWindow" id="scrolled_window">
                    <property name="hscrollbar-policy">always</property>
                    <property name="overlay-scrolling">False</property>
                    <property name="vexpand">True</property>
                    <property name="vexpand-set">True</property>
                    <property name="vscrollbar-policy">always</property>
                    <signal name="edge-overshot" handler="scwin_edge_overshot" swapped="True"/>
                    <signal name="edge-reached" handler="scwin_edge_reached" swapped="True"/>
                  </object>
                </child>
                <child>
                  <object class="GtkSearchBar" id="text_search_bar">
                    <property name="show-close-button">True</property>
                  </object>
                </child>
              </object>
            </property>
            <property name="name">journal</property>
          </object>
        </child>
        <child>
          <object class="AdwViewStackPage">
            <property name="child">
              <object class="AdwStatusPage">
                <property name="child">
                  <object class="GtkLinkButton">
                    <property name="label" translatable="yes" context="journal" comments="wiki link">For more information</property>
                    <property name="uri">https://github.com/plrigaux/sysd-manager/wiki/Journal</property>
                  </object>
                </property>
                <property name="description" translatable="yes" context="journal" comments="description">Either there are no log events to display, or you don't have permission to access them.</property>
                <property name="icon-name">dialog-question-symbolic</property>
                <property name="title" translatable="yes" context="journal" comments="title">No journal events</property>
              </object>
            </property>
            <property name="name">empty</property>
          </object>
        </child>
        <child>
          <object class="AdwViewStackPage">
            <property name="child">
              <object class="AdwSpinner"/>
            </property>
            <property name="name">spinner</property>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>
