]> git.meshlink.io Git - catta/commitdiff
* improve avahi-discover GUI
authorLennart Poettering <lennart@poettering.net>
Fri, 3 Jun 2005 19:02:12 +0000 (19:02 +0000)
committerLennart Poettering <lennart@poettering.net>
Fri, 3 Jun 2005 19:02:12 +0000 (19:02 +0000)
* if a new interface becomes available, reissue all queries

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@94 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/browse.c
avahi-core/browse.h
avahi-core/iface.c
avahi-discover/avahi-discover.glade
avahi-discover/main.c

index c9598311a9cd2311ae25bde2ac5fe1dec25845ec..45e8bcef7fd6f7bad29a92aebd05e88a2daf4c8e 100644 (file)
@@ -41,7 +41,7 @@ struct AvahiRecordBrowser {
     AvahiRecordBrowserCallback callback;
     gpointer userdata;
 
-    AVAHI_LLIST_FIELDS(AvahiRecordBrowser, resolver);
+    AVAHI_LLIST_FIELDS(AvahiRecordBrowser, browser);
     AVAHI_LLIST_FIELDS(AvahiRecordBrowser, by_key);
 };
 
@@ -128,7 +128,7 @@ AvahiRecordBrowser *avahi_record_browser_new(AvahiServer *server, gint interface
     avahi_elapse_time(&tv, b->sec_delay*1000, 0);
     b->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, elapse, b);
 
-    AVAHI_LLIST_PREPEND(AvahiRecordBrowser, resolver, server->record_browsers, b);
+    AVAHI_LLIST_PREPEND(AvahiRecordBrowser, browser, server->record_browsers, b);
 
     /* Add the new entry to the record_browser hash table */
     t = g_hash_table_lookup(server->record_browser_hashtable, key);
@@ -159,7 +159,7 @@ void avahi_record_browser_destroy(AvahiRecordBrowser *b) {
     
     g_assert(b);
     
-    AVAHI_LLIST_REMOVE(AvahiRecordBrowser, resolver, b->server->record_browsers, b);
+    AVAHI_LLIST_REMOVE(AvahiRecordBrowser, browser, b->server->record_browsers, b);
 
     t = g_hash_table_lookup(b->server->record_browser_hashtable, b->key);
     AVAHI_LLIST_REMOVE(AvahiRecordBrowser, by_key, t, b);
@@ -182,7 +182,7 @@ void avahi_browser_cleanup(AvahiServer *server) {
     g_assert(server);
 
     for (b = server->record_browsers; b; b = n) {
-        n = b->resolver_next;
+        n = b->browser_next;
         
         if (b->dead)
             avahi_record_browser_destroy(b);
@@ -213,3 +213,14 @@ gboolean avahi_is_subscribed(AvahiServer *server, AvahiInterface *i, AvahiKey *k
 
     return FALSE;
 }
+
+void avahi_browser_new_interface(AvahiServer*s, AvahiInterface *i) {
+    AvahiRecordBrowser *b;
+    
+    g_assert(s);
+    g_assert(i);
+    
+    for (b = s->record_browsers; b; b = b->browser_next)
+        if (avahi_interface_match(i, b->interface, b->protocol))
+            avahi_interface_post_query(i, b->key, FALSE);
+}
index f993d3e70c93c87d5164cd093922d480036dc25a..ac33c5115209cf52e496a1fd2de094bc104707c2 100644 (file)
@@ -34,4 +34,6 @@ gboolean avahi_is_subscribed(AvahiServer *s, AvahiInterface *i, AvahiKey *k);
 
 void avahi_record_browser_destroy(AvahiRecordBrowser *b);
 
+void avahi_browser_new_interface(AvahiServer*s, AvahiInterface *i);
+
 #endif
index 8686fb551054f62328f18c94e3e9007304eef500..d890e221187110fea4b0ec422373190e935207ae 100644 (file)
@@ -244,6 +244,7 @@ static void check_interface_relevant(AvahiInterfaceMonitor *m, AvahiInterface *i
 
         i->announcing = TRUE;
         avahi_announce_interface(m->server, i);
+        avahi_browser_new_interface(m->server, i);
     } else if (!b && i->announcing) {
         g_message("Interface %s.%i no longer relevant", i->hardware->name, i->protocol);
 
index 9465036f8497e4c76b4960afbcddb452f4f56007..852f2eecf84b7422d394057b300c76df3af2e478 100644 (file)
@@ -41,7 +41,7 @@
              <property name="can_focus">True</property>
              <property name="headers_visible">True</property>
              <property name="rules_hint">False</property>
-             <property name="reorderable">True</property>
+             <property name="reorderable">False</property>
              <property name="enable_search">True</property>
            </widget>
          </child>
index 557806e26da6464cb9bae007bca2e6d4eaf7dc8f..de15a444e7b32953fea05bf983ab304c7d1ab988 100644 (file)
@@ -244,6 +244,7 @@ gboolean main_window_on_delete_event(GtkWidget *widget, GdkEvent *event, gpointe
 int main(int argc, char *argv[]) {
     GladeXML *xml;
     AvahiServerConfig config;
+    GtkTreeViewColumn *c;
 
     gtk_init(&argc, &argv);
     glade_init();
@@ -261,6 +262,10 @@ int main(int argc, char *argv[]) {
     gtk_tree_view_set_model(tree_view, GTK_TREE_MODEL(tree_store));
     gtk_tree_view_insert_column_with_attributes(tree_view, -1, "Name", gtk_cell_renderer_text_new(), "text", 0, NULL);
     gtk_tree_view_insert_column_with_attributes(tree_view, -1, "Interface", gtk_cell_renderer_text_new(), "text", 1, NULL);
+
+    gtk_tree_view_column_set_resizable(c = gtk_tree_view_get_column(tree_view, 0), TRUE);
+    gtk_tree_view_column_set_sizing(c, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
+    gtk_tree_view_column_set_expand(c, TRUE);
     
     service_type_hash_table = g_hash_table_new((GHashFunc) avahi_domain_hash, (GEqualFunc) avahi_domain_equal);