gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r7370 - in gnunet-gtk/src: common core include plugins/daem


From: gnunet
Subject: [GNUnet-SVN] r7370 - in gnunet-gtk/src: common core include plugins/daemon
Date: Mon, 30 Jun 2008 12:19:11 -0600 (MDT)

Author: moon
Date: 2008-06-30 12:19:09 -0600 (Mon, 30 Jun 2008)
New Revision: 7370

Modified:
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/core/eggtrayicon.c
   gnunet-gtk/src/include/gnunetgtk_common.h
   gnunet-gtk/src/plugins/daemon/daemon.c
Log:
new status when gnunetd is started -- fixes use case without the stats 
plugin being loaded



Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2008-06-30 01:08:31 UTC (rev 7369)
+++ gnunet-gtk/src/common/helper.c      2008-06-30 18:19:09 UTC (rev 7370)
@@ -545,6 +545,23 @@
 
       iconSet = gtk_icon_set_new ();
       iconPath =
+        g_strconcat (finalPath, "gnunet-gtk-status-connected.svg", NULL);
+      gtk_icon_source_set_filename (iconSource, iconPath);
+      g_free (iconPath);
+      gtk_icon_set_add_source (iconSet, iconSource);
+      iconPath = g_build_filename (instDir, "..", "gnunet-gtk",
+                                   "gnunet-gtk-status-connected.png", NULL);
+      gtk_icon_source_set_filename (iconSource, iconPath);
+      g_free (iconPath);
+      gtk_icon_source_set_size_wildcarded (iconSource, FALSE);
+      gtk_icon_set_add_source (iconSet, iconSource);
+      
+      gtk_icon_factory_add (GNUNET_GTK_get_iconFactory (),
+                            "gnunet-gtk-status-connected", iconSet);
+      gtk_icon_set_unref (iconSet);
+      
+      iconSet = gtk_icon_set_new ();
+      iconPath =
         g_strconcat (finalPath, "gnunet-gtk-status-unknown.svg", NULL);
       gtk_icon_source_set_filename (iconSource, iconPath);
       g_free (iconPath);
@@ -650,6 +667,18 @@
                                         "gnunet-gtk-status-disconnected");
 #endif
         break;
+        
+      case GNUNET_GTK_STATUS_DAEMONUP :
+        gtk_label_set_markup (GTK_LABEL (statusConnexionsLabel),
+                              _("Daemon running"));
+        gtk_image_set_from_stock (GTK_IMAGE (statusConnexionsPic),
+                                  GTK_STOCK_EXECUTE, 1);
+#if GTK_CHECK_VERSION (2,10,0)
+        gtk_status_icon_set_tooltip (trayIcon,
+                                     _("GNUnet - Daemon running"));
+        gtk_status_icon_set_from_icon_name (trayIcon, "gnunet-gtk");
+#endif
+        break;
 
       case GNUNET_GTK_STATUS_NODAEMON :
         gtk_label_set_markup (GTK_LABEL (statusConnexionsLabel),

Modified: gnunet-gtk/src/core/eggtrayicon.c
===================================================================
--- gnunet-gtk/src/core/eggtrayicon.c   2008-06-30 01:08:31 UTC (rev 7369)
+++ gnunet-gtk/src/core/eggtrayicon.c   2008-06-30 18:19:09 UTC (rev 7370)
@@ -666,14 +666,10 @@
 initTrayIcon ()
 {
 #if GTK_CHECK_VERSION (2,10,0)
-  char *instDir;
-  char *iconPath;
   GtkStatusIcon *trayIcon;
   GtkWidget *trayContextMenu;
   GladeXML *trayContextMenuXML;
   GtkWidget *tray_quit;
-  GtkIconSet *iconSet;
-  GtkIconSource *iconSource;
 
   trayContextMenuXML =
     glade_xml_new (GNUNET_GTK_get_glade_filename (), "trayContextMenu",
@@ -681,29 +677,7 @@
   trayContextMenu = glade_xml_get_widget (trayContextMenuXML,
                                           "trayContextMenu");
   trayIcon = GNUNET_GTK_get_trayIcon ();
-  instDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
-  iconSet = gtk_icon_set_new ();
-  iconSource = gtk_icon_source_new ();
-  iconPath =
-    g_build_filename (instDir, "..", "gnunet-gtk",
-                      "gnunet-gtk-status-connected.svg", NULL);
-  gtk_icon_source_set_filename (iconSource, iconPath);
-  g_free (iconPath);
-  gtk_icon_set_add_source (iconSet, iconSource);
-  iconPath =
-    g_build_filename (instDir, "..", "gnunet-gtk",
-                      "gnunet-gtk-status-connected.png", NULL);
-  gtk_icon_source_set_filename (iconSource, iconPath);
-  g_free (iconPath);
-  gtk_icon_source_set_size_wildcarded (iconSource, FALSE);
-  gtk_icon_set_add_source (iconSet, iconSource);
-
-  gtk_icon_factory_add (GNUNET_GTK_get_iconFactory (),
-                        "gnunet-gtk-status-connected", iconSet);
-  gtk_icon_set_unref (iconSet);
-  gtk_icon_source_free (iconSource);
-  GNUNET_free (instDir);
-  gtk_status_icon_set_from_stock (trayIcon, "gnunet-gtk-status-connected");
+  gtk_status_icon_set_from_icon_name (trayIcon, "gnunet-gtk");
   gtk_status_icon_set_tooltip (trayIcon, _("GNU's peer-to-peer network"));
   tray_quit = glade_xml_get_widget (trayContextMenuXML, "tray_quit");
   g_signal_connect_swapped (G_OBJECT (tray_quit), "activate",

Modified: gnunet-gtk/src/include/gnunetgtk_common.h
===================================================================
--- gnunet-gtk/src/include/gnunetgtk_common.h   2008-06-30 01:08:31 UTC (rev 
7369)
+++ gnunet-gtk/src/include/gnunetgtk_common.h   2008-06-30 18:19:09 UTC (rev 
7370)
@@ -101,6 +101,7 @@
 typedef enum
 {
   GNUNET_GTK_STATUS_NODAEMON,
+  GNUNET_GTK_STATUS_DAEMONUP,
   GNUNET_GTK_STATUS_DISCONNECTED,
   GNUNET_GTK_STATUS_CONNECTED,
   GNUNET_GTK_STATUS_UNKNOWN

Modified: gnunet-gtk/src/plugins/daemon/daemon.c
===================================================================
--- gnunet-gtk/src/plugins/daemon/daemon.c      2008-06-30 01:08:31 UTC (rev 
7369)
+++ gnunet-gtk/src/plugins/daemon/daemon.c      2008-06-30 18:19:09 UTC (rev 
7370)
@@ -254,7 +254,7 @@
       updateAppModel (NULL);
       last = ret;
       if (ret)
-        GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_DISCONNECTED, 0);
+        GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_DAEMONUP, 0);
       else
         GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_NODAEMON, 0);
     }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]