[gssdp] sniffer: Add button to rescan the network



commit af0f43ed3a07d0b174091c7370f4799d907330ca
Author: Jens Georg <mail jensge org>
Date:   Mon Oct 29 15:54:33 2018 +0100

    sniffer: Add button to rescan the network

 tools/gssdp-device-sniffer.c  |   9 +++
 tools/gssdp-device-sniffer.ui | 177 +++++++++++++++++++++++-------------------
 2 files changed, 108 insertions(+), 78 deletions(-)
---
diff --git a/tools/gssdp-device-sniffer.c b/tools/gssdp-device-sniffer.c
index 1ffcbfa..7b71ec0 100644
--- a/tools/gssdp-device-sniffer.c
+++ b/tools/gssdp-device-sniffer.c
@@ -644,7 +644,16 @@ on_clear_packet_capture_activate (G_GNUC_UNUSED GtkMenuItem *menuitem,
         clear_packet_treeview ();
 }
 
+static void
+on_trigger_rescan (GSimpleAction *action,
+                   GVariant *parameter,
+                   gpointer user_data)
+{
+        gssdp_resource_browser_rescan (resource_browser);
+}
+
 static GActionEntry actions[] = {
+        { "trigger-rescan", on_trigger_rescan },
         { "set-address-filter", on_set_address_filter },
         { "show-packet-details", NULL, NULL, "true", on_details_activate },
         { "show-address-filter", on_show_address_filter },
diff --git a/tools/gssdp-device-sniffer.ui b/tools/gssdp-device-sniffer.ui
index 308c7ae..5a48cd5 100644
--- a/tools/gssdp-device-sniffer.ui
+++ b/tools/gssdp-device-sniffer.ui
@@ -1,176 +1,197 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.22.0 -->
 <interface>
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkWindow" id="main-window">
     <property name="can_focus">False</property>
     <signal name="delete-event" handler="on_delete_event" swapped="no"/>
-    <child type="titlebar">
-      <object class="GtkHeaderBar">
+    <child>
+      <object class="GtkStack" id="stack1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="show_close_button">True</property>
         <child>
-          <object class="GtkBox">
+          <object class="GtkBox" id="vbox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="border_width">6</property>
+            <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
-              <object class="GtkButton">
+              <object class="GtkScrolledWindow" id="packet-scrolledwindow">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="tooltip_text" translatable="yes">Clear packet capture</property>
-                <signal name="clicked" handler="on_clear_packet_capture_activate" swapped="no"/>
+                <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkImage">
+                  <object class="GtkTreeView" id="packet-treeview">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="icon_name">edit-clear-all-symbolic</property>
+                    <property name="can_focus">True</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection"/>
+                    </child>
                   </object>
                 </child>
               </object>
               <packing>
-                <property name="expand">False</property>
+                <property name="expand">True</property>
                 <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkToggleButton">
+              <object class="GtkScrolledWindow" id="packet-details-scrolledwindow">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="tooltip_text" translatable="yes">Toggle packet capture</property>
-                <property name="active">True</property>
-                <signal name="toggled" handler="on_enable_packet_capture_activate" object="capture-image" 
swapped="no"/>
+                <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkImage" id="capture-image">
+                  <object class="GtkTextView" id="packet-details-textview">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="icon_name">media-playback-stop-symbolic</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="monospace">True</property>
                   </object>
                 </child>
               </object>
               <packing>
-                <property name="expand">False</property>
+                <property name="expand">True</property>
                 <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="position">1</property>
+            <property name="name">page0</property>
+            <property name="title" translatable="yes">Packets</property>
           </packing>
         </child>
-        <child type="title">
-          <object class="GtkStackSwitcher">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="icon_size">0</property>
-            <property name="stack">stack1</property>
-          </object>
-        </child>
         <child>
-          <object class="GtkMenuButton" id="window-menu">
+          <object class="GtkScrolledWindow" id="device-details-scrolledwindow">
+            <property name="name">Bar</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
+            <property name="margin_top">6</property>
+            <property name="margin_bottom">6</property>
+            <property name="shadow_type">in</property>
             <child>
-              <object class="GtkImage">
+              <object class="GtkTreeView" id="device-details-treeview">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="icon_name">open-menu-symbolic</property>
+                <property name="can_focus">True</property>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection"/>
+                </child>
               </object>
             </child>
           </object>
           <packing>
-            <property name="pack_type">end</property>
+            <property name="name">page1</property>
+            <property name="title" translatable="yes">Device history</property>
             <property name="position">1</property>
           </packing>
         </child>
       </object>
     </child>
-    <child>
-      <object class="GtkStack" id="stack1">
+    <child type="titlebar">
+      <object class="GtkHeaderBar">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="show_close_button">True</property>
+        <child type="title">
+          <object class="GtkStackSwitcher">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">center</property>
+            <property name="icon_size">0</property>
+            <property name="stack">stack1</property>
+          </object>
+        </child>
         <child>
-          <object class="GtkBox" id="vbox">
+          <object class="GtkBox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="border_width">6</property>
-            <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
-              <object class="GtkScrolledWindow" id="packet-scrolledwindow">
+              <object class="GtkButton">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="shadow_type">in</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip_text" translatable="yes">Clear packet capture</property>
+                <signal name="clicked" handler="on_clear_packet_capture_activate" swapped="no"/>
                 <child>
-                  <object class="GtkTreeView" id="packet-treeview">
+                  <object class="GtkImage">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <child internal-child="selection">
-                      <object class="GtkTreeSelection"/>
-                    </child>
+                    <property name="can_focus">False</property>
+                    <property name="icon_name">edit-clear-all-symbolic</property>
                   </object>
                 </child>
               </object>
               <packing>
-                <property name="expand">True</property>
+                <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkScrolledWindow" id="packet-details-scrolledwindow">
+              <object class="GtkToggleButton">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="shadow_type">in</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip_text" translatable="yes">Toggle packet capture</property>
+                <property name="active">True</property>
+                <signal name="toggled" handler="on_enable_packet_capture_activate" object="capture-image" 
swapped="no"/>
                 <child>
-                  <object class="GtkTextView" id="packet-details-textview">
+                  <object class="GtkImage" id="capture-image">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="editable">False</property>
-                    <property name="monospace">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="icon_name">media-playback-stop-symbolic</property>
                   </object>
                 </child>
               </object>
               <packing>
-                <property name="expand">True</property>
+                <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkButton">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip_text" translatable="yes">Trigger a rescan of the network</property>
+                <property name="action_name">win.trigger-rescan</property>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="icon_name">view-refresh-symbolic</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
           </object>
           <packing>
-            <property name="name">page0</property>
-            <property name="title" translatable="yes">Packets</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow" id="device-details-scrolledwindow">
-            <property name="name">Bar</property>
+          <object class="GtkMenuButton" id="window-menu">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="margin_top">6</property>
-            <property name="margin_bottom">6</property>
-            <property name="shadow_type">in</property>
+            <property name="receives_default">True</property>
             <child>
-              <object class="GtkTreeView" id="device-details-treeview">
+              <object class="GtkImage">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <child internal-child="selection">
-                  <object class="GtkTreeSelection"/>
-                </child>
+                <property name="can_focus">False</property>
+                <property name="icon_name">open-menu-symbolic</property>
               </object>
             </child>
           </object>
           <packing>
-            <property name="name">page1</property>
-            <property name="title" translatable="yes">Device history</property>
+            <property name="pack_type">end</property>
             <property name="position">1</property>
           </packing>
         </child>
@@ -191,9 +212,6 @@ Inspired by Intel Tools for UPnP.</property>
     <property name="license_type">lgpl-2-1</property>
     <signal name="delete-event" handler="gtk_widget_hide" object="about-dialog" swapped="yes"/>
     <signal name="response" handler="gtk_widget_hide" object="about-dialog" swapped="yes"/>
-    <child>
-      <placeholder/>
-    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="aboutdialog-vbox1">
         <property name="can_focus">False</property>
@@ -211,6 +229,9 @@ Inspired by Intel Tools for UPnP.</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkDialog" id="address-filter-dialog">
     <property name="can_focus">False</property>
@@ -220,9 +241,6 @@ Inspired by Intel Tools for UPnP.</property>
     <property name="transient_for">main-window</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/>
     <signal name="response" handler="on_address_filter_dialog_response" swapped="no"/>
-    <child type="titlebar">
-      <placeholder/>
-    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="visible">True</property>
@@ -416,5 +434,8 @@ Inspired by Intel Tools for UPnP.</property>
     <action-widgets>
       <action-widget response="-5">closebutton1</action-widget>
     </action-widgets>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
 </interface>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]