<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <menu id="primary_menu">
    <section>
      <item>
        <attribute name="label" translatable="yes">New _Window</attribute>
        <attribute name="action">app.new-window</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Open</attribute>
        <attribute name="action">win.open-log</attribute>
        <attribute name="hidden-when">action-disabled</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">Open Pair of Logs</attribute>
        <attribute name="action">win.open-pair-logs</attribute>
        <attribute name="hidden-when">action-disabled</attribute>
      </item>
    </section>
    <section>
      <submenu>
        <attribute name="label" translatable="yes">Save As…</attribute>
        <section>
          <item>
            <attribute name="label" translatable="yes">PCAP</attribute>
            <attribute name="action">win.save</attribute>
          </item>
          <item>
            <attribute name="label" translatable="yes">DOT Graph</attribute>
            <attribute name="action">win.save-dot</attribute>
          </item>
        </section>
      </submenu>
      <item>
        <attribute name="label" translatable="yes">_Statistics</attribute>
        <attribute name="action">win.statistics</attribute>
        <attribute name="hidden-when">action-disabled</attribute>
      </item>
    </section>
    <section>
      <item>
        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
        <attribute name="action">app.shortcuts</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes" context="Translators: Do not translate Bustle, its the app's name">_About Bustle</attribute>
        <attribute name="action">win.about</attribute>
      </item>
    </section>
  </menu>
  <menu id="record_menu">
    <section>
      <item>
        <attribute name="label" translatable="yes" comments="Bus as in D-Bus">Record Session Bus</attribute>
        <attribute name="action">win.record-session-bus</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes" comments="Bus as in D-Bus">Record System Bus</attribute>
        <attribute name="action">win.record-system-bus</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes" comments="Bus as in D-Bus">Record Address…</attribute>
        <attribute name="action">win.record-address</attribute>
      </item>
    </section>
  </menu>
  <template class="BustleWindow" parent="AdwApplicationWindow">
    <property name="title">Bustle</property>
    <property name="height-request">240</property>
    <child>
      <object class="AdwBreakpoint">
        <condition>max-width: 720sp</condition>
        <setter object="split_view_sub_page" property="collapsed">True</setter>
        <setter object="details_view_split_view" property="collapsed">True</setter>
        <setter object="diagram_title" property="visible">False</setter>
      </object>
    </child>
    <property name="content">
      <object class="AdwToastOverlay" id="toast_overlay">
        <property name="child">
          <object class="GtkStack" id="main_stack">
            <property name="transition-type">crossfade</property>
            <child>
              <object class="AdwToolbarView" id="empty_page">
                <child type="top">
                  <object class="AdwHeaderBar">
                    <property name="show-title">False</property>
                    <child>
                      <object class="GtkMenuButton">
                        <property name="label" translatable="yes" comments="This is a verb">_Record</property>
                        <property name="always-show-arrow">True</property>
                        <property name="use-underline">True</property>
                        <property name="menu-model">record_menu</property>
                        <style>
                          <class name="suggested-action"/>
                        </style>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton">
                        <property name="icon-name">folder-symbolic</property>
                        <property name="action-name">win.open-log</property>
                        <property name="tooltip-text" translatable="yes">Open Log File</property>
                      </object>
                    </child>
                    <child type="end">
                      <object class="GtkMenuButton">
                        <property name="icon-name">open-menu-symbolic</property>
                        <property name="menu-model">primary_menu</property>
                        <property name="primary">True</property>
                        <property name="tooltip-text" translatable="yes">Main Menu</property>
                      </object>
                    </child>
                  </object>
                </child>
                <property name="content">
                  <object class="AdwStatusPage" id="empty_status_page">
                    <property name="title" translatable="yes" context="Translators: Do not translate Bustle, its the app's name">Welcome to Bustle</property>
                    <property name="description" translatable="yes" comments="Translators: Do not localize D-Bus. It is a proper name">Start recording D-Bus activity, you can also run the command</property>
                    <property name="vexpand">True</property>
                    <style>
                      <class name="icon-dropshadow"/>
                    </style>
                    <child>
                      <object class="AdwClamp">
                        <property name="maximum-size">400</property>
                        <child>
                          <object class="AdwPreferencesGroup">
                            <child>
                              <object class="AdwActionRow">
                                <property name="title">dbus-monitor --pcap</property>
                                <style>
                                  <class name="monospace"/>
                                </style>
                                <child>
                                  <object class="GtkButton">
                                    <property name="valign">center</property>
                                    <property name="icon-name">edit-copy-symbolic</property>
                                    <property name="tooltip-text" translatable="yes">Copy</property>
                                    <signal name="clicked" handler="copy_command_clicked" swapped="yes"/>
                                    <style>
                                      <class name="flat"/>
                                    </style>
                                  </object>
                                </child>
                              </object>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </property>
              </object>
            </child>
            <child>
              <object class="AdwToolbarView" id="loading_page">
                <child type="top">
                  <object class="AdwHeaderBar">
                    <property name="show-title">False</property>
                    <child type="end">
                      <object class="GtkMenuButton">
                        <property name="icon-name">open-menu-symbolic</property>
                        <property name="menu-model">primary_menu</property>
                        <property name="primary">True</property>
                        <property name="tooltip-text" translatable="yes">Main Menu</property>
                      </object>
                    </child>
                  </object>
                </child>
                <property name="content">
                  <object class="AdwStatusPage" id="status_page">
                    <property name="title" translatable="yes">Loading</property>
                    <property name="paintable">
                      <object class="AdwSpinnerPaintable">
                        <property name="widget">status_page</property>
                      </object>
                    </property>
                  </object>
                </property>
              </object>
            </child>
            <child>
              <object class="AdwToolbarView" id="diagram_page">
                <property name="top-bar-style">raised</property>
                <child type="top">
                  <object class="AdwHeaderBar">
                    <property name="title-widget">
                      <object class="AdwWindowTitle" id="diagram_title"/>
                    </property>
                    <child>
                      <object class="GtkStack" id="record_button_stack">
                        <child>
                          <object class="GtkStackPage">
                            <property name="name">record</property>
                            <property name="child">
                              <object class="GtkMenuButton">
                                <property name="label" translatable="yes" comments="This is a verb">_Record</property>
                                <property name="always-show-arrow">True</property>
                                <property name="use-underline">True</property>
                                <property name="menu-model">record_menu</property>
                                <style>
                                  <class name="suggested-action"/>
                                </style>
                              </object>
                            </property>
                          </object>
                        </child>
                        <child>
                          <object class="GtkStackPage">
                            <property name="name">stop</property>
                            <property name="child">
                              <object class="GtkButton">
                                <property name="label" translatable="yes" comments="This is a verb">_Stop</property>
                                <property name="action-name">win.stop-recording</property>
                                <property name="use-underline">True</property>
                                <property name="can-shrink">True</property>
                                <style>
                                  <class name="destructive-action"/>
                                </style>
                              </object>
                            </property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton">
                        <property name="icon-name">folder-symbolic</property>
                        <property name="action-name">win.open-log</property>
                        <property name="tooltip-text" translatable="yes">Open Log File</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkToggleButton">
                        <property name="icon-name">funnel-symbolic</property>
                        <property name="tooltip-text" translatable="yes">Filter Services</property>
                        <property name="action-name">win.filter-services</property>
                        <property name="active" bind-source="split_view_sub_page" bind-property="show-sidebar" bind-flags="sync-create | bidirectional"/>
                      </object>
                    </child>
                    <child type="end">
                      <object class="GtkMenuButton">
                        <property name="icon-name">open-menu-symbolic</property>
                        <property name="menu-model">primary_menu</property>
                        <property name="primary">True</property>
                        <property name="tooltip-text" translatable="yes">Main Menu</property>
                      </object>
                    </child>
                    <child type="end">
                      <object class="GtkToggleButton" id="sidebar_button">
                        <property name="icon-name">dock-right-symbolic</property>
                        <property name="tooltip-text" translatable="yes">Details View</property>
                        <property name="active" bind-source="details_view_split_view" bind-property="show-sidebar" bind-flags="sync-create | bidirectional"/>
                        <property name="sensitive">False</property>
                      </object>
                    </child>
                  </object>
                </child>
                <property name="content">
                  <object class="GtkStack" id="diagram_page_stack">
                    <child>
                      <object class="AdwStatusPage" id="waiting_sub_page">
                        <property name="title" translatable="yes">Please Hold</property>
                        <property name="description" translatable="yes">Waiting for D-Bus Traffic…</property>
                      </object>
                    </child>
                    <child>
                      <object class="AdwOverlaySplitView" id="split_view_sub_page">
                        <property name="min-sidebar-width">60</property>
                        <property name="max-sidebar-width">240</property>
                        <property name="pin-sidebar">True</property>
                        <property name="show-sidebar">False</property>
                        <property name="sidebar">
                          <object class="BustleFilterPane" id="filter_pane">
                            <property name="hexpand">True</property>
                            <property name="model">filtered_message_model</property>
                          </object>
                        </property>
                        <property name="content">
                          <object class="AdwOverlaySplitView" id="details_view_split_view">
                            <property name="sidebar-position">end</property>
                            <property name="min-sidebar-width">275</property>
                            <property name="max-sidebar-width">360</property>
                            <property name="pin-sidebar">True</property>
                            <property name="content">
                              <object class="BustleDiagram" id="diagram">
                                <property name="model">
                                  <object class="BustleFilteredMessageModel" id="filtered_message_model">
                                    <signal name="items-changed" handler="filtered_message_model_items_changed" swapped="yes"/>
                                  </object>
                                </property>
                                <signal name="notify::selected-message" handler="diagram_selected_message_notify" swapped="yes"/>
                              </object>
                            </property>
                            <property name="sidebar">
                              <object class="BustleDetailsView" id="details_view">
                                <signal name="show-message-request" handler="details_view_show_message_request" swapped="yes"/>
                              </object>
                            </property>
                          </object>
                        </property>
                      </object>
                    </child>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </property>
      </object>
    </property>
  </template>
</interface>
