Use a standard icon here.
[dhcpcd-ui] / src / dhcpcd-gtk / prefs.c
index 2bbd16623a25016f765dca2a3843339ba5b3a73c..603521c89e029dff41327e4d1f5cace70aad39d8 100644 (file)
@@ -37,6 +37,7 @@ static GtkWidget *autoconf, *address, *router, *dns_servers, *dns_search;
 static DHCPCD_OPTION *config;
 static char *block, *name;
 static DHCPCD_IF *iface;
+static char **ifaces;
 
 static void
 config_err_dialog(DHCPCD_CONNECTION *con, bool writing, const char *txt)
@@ -210,12 +211,13 @@ static GSList *
 list_interfaces(DHCPCD_CONNECTION *con)
 {
        GSList *list;
-       DHCPCD_IF *i;
+       char **i;
 
        list = NULL;
-       for (i = dhcpcd_interfaces(con); i; i = i->next)
-               if (strcmp(i->type, "link") == 0)
-                       list = g_slist_append(list, UNCONST(i->ifname));
+       dhcpcd_freev(ifaces);
+       ifaces = dhcpcd_interface_names_sorted(con);
+       for (i = ifaces; i && *i; i++)
+               list = g_slist_append(list, *i);
        return list;
 }
 
@@ -306,7 +308,7 @@ blocks_on_change(GtkWidget *widget, gpointer data)
        }
        gtk_widget_set_sensitive(names, n);
        g_slist_free(new_names);
-       dhcpcd_config_blocks_free(list);
+       dhcpcd_freev(list);
 }
 
 static void
@@ -466,7 +468,10 @@ on_destroy(_unused GObject *o, gpointer data)
        }
        dhcpcd_config_free(config);
        config = NULL;
+       dhcpcd_freev(ifaces);
+       ifaces = NULL;
        dialog = NULL;
+
 }
 
 static void
@@ -626,19 +631,19 @@ prefs_show(DHCPCD_CONNECTION *con)
        gtk_box_pack_start(GTK_BOX(dialog_vbox), hbox, true, true, 3);
        clear = gtk_button_new_from_stock(GTK_STOCK_CLEAR);
        gtk_widget_set_sensitive(clear, false);
-       gtk_box_pack_start(GTK_BOX(hbox), clear, false, false, 0);
+       gtk_box_pack_start(GTK_BOX(hbox), clear, true, true, 0);
        g_signal_connect(G_OBJECT(clear), "clicked",
            G_CALLBACK(on_clear), con);
        rebind = gtk_button_new_with_mnemonic(_("_Rebind"));
        gtk_widget_set_sensitive(rebind, false);
-       w = gtk_image_new_from_stock(GTK_STOCK_EXECUTE,
+       w = gtk_image_new_from_icon_name("application-x-executable",
            GTK_ICON_SIZE_BUTTON);
        gtk_button_set_image(GTK_BUTTON(rebind), w);
-       gtk_box_pack_start(GTK_BOX(hbox), rebind, false, false, 0);
+       gtk_box_pack_start(GTK_BOX(hbox), rebind, true, true, 0);
        g_signal_connect(G_OBJECT(rebind), "clicked",
            G_CALLBACK(on_rebind), con);
        w = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
-       gtk_box_pack_end(GTK_BOX(hbox), w, false, false, 0);
+       gtk_box_pack_end(GTK_BOX(hbox), w, true, true, 0);
        g_signal_connect(G_OBJECT(w), "clicked",
            G_CALLBACK(prefs_close), NULL);