Use theme icons. Add comment about looking into animated icon.
authorRoy Marples <roy@marples.name>
Fri, 23 Jan 2009 11:03:58 +0000 (11:03 +0000)
committerRoy Marples <roy@marples.name>
Fri, 23 Jan 2009 11:03:58 +0000 (11:03 +0000)
main.c

diff --git a/main.c b/main.c
index 26bf03f7e68c35b23bf6b216f6d366c7d0b1b614..8fbecdb04f3ce1ca81cd3a8f16c89a5c5d57612d 100644 (file)
--- a/main.c
+++ b/main.c
  * SUCH DAMAGE.
  */
 
+/* TODO: Animate the icon from carrier -> address
+ * maybe use network-idle -> network-transmit ->
+ * network-receive -> network-transmit-receive */
+
 #include <arpa/inet.h>
 
 #include <stdlib.h>
@@ -289,8 +293,8 @@ update_online(char **buffer)
 
        if (online != ison) {
                online = ison;
-               icon = online ? GTK_STOCK_CONNECT : GTK_STOCK_DISCONNECT;
-               gtk_status_icon_set_from_stock(status_icon, icon);
+               icon = online ? "connect_established" : "connect_no";
+               gtk_status_icon_set_from_icon_name(status_icon, icon);
        }
        gtk_status_icon_set_tooltip(status_icon, msgs);
        if (buffer)
@@ -513,7 +517,10 @@ main(int argc, char *argv[])
        
        gtk_init(&argc, &argv);
        g_set_application_name("dhcpcd Monitor");
-       status_icon = gtk_status_icon_new_from_stock(GTK_STOCK_DISCONNECT);
+       status_icon = gtk_status_icon_new_from_icon_name("connect_no");
+       if (status_icon == NULL)
+               status_icon = gtk_status_icon_new_from_stock(GTK_STOCK_DISCONNECT);
+       
        gtk_status_icon_set_tooltip(status_icon, "Connecting to dhcpcd ...");
        gtk_status_icon_set_visible(status_icon, TRUE);