diff options
author | Moon <moon@140774ce-b5e7-0310-ab8b-a85725594a96> | 2008-06-30 18:19:09 +0000 |
---|---|---|
committer | Moon <moon@140774ce-b5e7-0310-ab8b-a85725594a96> | 2008-06-30 18:19:09 +0000 |
commit | b2c61ac68e7bb31b1464d63c2b81eeb52146fa77 (patch) | |
tree | 413c559cfc7fba36231bd9b82f1a10a4d18353d9 | |
parent | 0875c535495b0948f58a2b6c14388492fcd6053f (diff) | |
download | gnunet-gtk-b2c61ac68e7bb31b1464d63c2b81eeb52146fa77.tar.gz gnunet-gtk-b2c61ac68e7bb31b1464d63c2b81eeb52146fa77.zip |
new status when gnunetd is started -- fixes use case without the stats
plugin being loaded
-rw-r--r-- | src/common/helper.c | 29 | ||||
-rw-r--r-- | src/core/eggtrayicon.c | 28 | ||||
-rw-r--r-- | src/include/gnunetgtk_common.h | 1 | ||||
-rw-r--r-- | src/plugins/daemon/daemon.c | 2 |
4 files changed, 32 insertions, 28 deletions
diff --git a/src/common/helper.c b/src/common/helper.c index d8722bc5..2a06bf26 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -545,6 +545,23 @@ GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS status, | |||
545 | 545 | ||
546 | iconSet = gtk_icon_set_new (); | 546 | iconSet = gtk_icon_set_new (); |
547 | iconPath = | 547 | iconPath = |
548 | g_strconcat (finalPath, "gnunet-gtk-status-connected.svg", NULL); | ||
549 | gtk_icon_source_set_filename (iconSource, iconPath); | ||
550 | g_free (iconPath); | ||
551 | gtk_icon_set_add_source (iconSet, iconSource); | ||
552 | iconPath = g_build_filename (instDir, "..", "gnunet-gtk", | ||
553 | "gnunet-gtk-status-connected.png", NULL); | ||
554 | gtk_icon_source_set_filename (iconSource, iconPath); | ||
555 | g_free (iconPath); | ||
556 | gtk_icon_source_set_size_wildcarded (iconSource, FALSE); | ||
557 | gtk_icon_set_add_source (iconSet, iconSource); | ||
558 | |||
559 | gtk_icon_factory_add (GNUNET_GTK_get_iconFactory (), | ||
560 | "gnunet-gtk-status-connected", iconSet); | ||
561 | gtk_icon_set_unref (iconSet); | ||
562 | |||
563 | iconSet = gtk_icon_set_new (); | ||
564 | iconPath = | ||
548 | g_strconcat (finalPath, "gnunet-gtk-status-unknown.svg", NULL); | 565 | g_strconcat (finalPath, "gnunet-gtk-status-unknown.svg", NULL); |
549 | gtk_icon_source_set_filename (iconSource, iconPath); | 566 | gtk_icon_source_set_filename (iconSource, iconPath); |
550 | g_free (iconPath); | 567 | g_free (iconPath); |
@@ -650,6 +667,18 @@ GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS status, | |||
650 | "gnunet-gtk-status-disconnected"); | 667 | "gnunet-gtk-status-disconnected"); |
651 | #endif | 668 | #endif |
652 | break; | 669 | break; |
670 | |||
671 | case GNUNET_GTK_STATUS_DAEMONUP : | ||
672 | gtk_label_set_markup (GTK_LABEL (statusConnexionsLabel), | ||
673 | _("Daemon running")); | ||
674 | gtk_image_set_from_stock (GTK_IMAGE (statusConnexionsPic), | ||
675 | GTK_STOCK_EXECUTE, 1); | ||
676 | #if GTK_CHECK_VERSION (2,10,0) | ||
677 | gtk_status_icon_set_tooltip (trayIcon, | ||
678 | _("GNUnet - Daemon running")); | ||
679 | gtk_status_icon_set_from_icon_name (trayIcon, "gnunet-gtk"); | ||
680 | #endif | ||
681 | break; | ||
653 | 682 | ||
654 | case GNUNET_GTK_STATUS_NODAEMON : | 683 | case GNUNET_GTK_STATUS_NODAEMON : |
655 | gtk_label_set_markup (GTK_LABEL (statusConnexionsLabel), | 684 | gtk_label_set_markup (GTK_LABEL (statusConnexionsLabel), |
diff --git a/src/core/eggtrayicon.c b/src/core/eggtrayicon.c index 93e69063..e8ecc01f 100644 --- a/src/core/eggtrayicon.c +++ b/src/core/eggtrayicon.c | |||
@@ -666,14 +666,10 @@ void | |||
666 | initTrayIcon () | 666 | initTrayIcon () |
667 | { | 667 | { |
668 | #if GTK_CHECK_VERSION (2,10,0) | 668 | #if GTK_CHECK_VERSION (2,10,0) |
669 | char *instDir; | ||
670 | char *iconPath; | ||
671 | GtkStatusIcon *trayIcon; | 669 | GtkStatusIcon *trayIcon; |
672 | GtkWidget *trayContextMenu; | 670 | GtkWidget *trayContextMenu; |
673 | GladeXML *trayContextMenuXML; | 671 | GladeXML *trayContextMenuXML; |
674 | GtkWidget *tray_quit; | 672 | GtkWidget *tray_quit; |
675 | GtkIconSet *iconSet; | ||
676 | GtkIconSource *iconSource; | ||
677 | 673 | ||
678 | trayContextMenuXML = | 674 | trayContextMenuXML = |
679 | glade_xml_new (GNUNET_GTK_get_glade_filename (), "trayContextMenu", | 675 | glade_xml_new (GNUNET_GTK_get_glade_filename (), "trayContextMenu", |
@@ -681,29 +677,7 @@ initTrayIcon () | |||
681 | trayContextMenu = glade_xml_get_widget (trayContextMenuXML, | 677 | trayContextMenu = glade_xml_get_widget (trayContextMenuXML, |
682 | "trayContextMenu"); | 678 | "trayContextMenu"); |
683 | trayIcon = GNUNET_GTK_get_trayIcon (); | 679 | trayIcon = GNUNET_GTK_get_trayIcon (); |
684 | instDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR); | 680 | gtk_status_icon_set_from_icon_name (trayIcon, "gnunet-gtk"); |
685 | iconSet = gtk_icon_set_new (); | ||
686 | iconSource = gtk_icon_source_new (); | ||
687 | iconPath = | ||
688 | g_build_filename (instDir, "..", "gnunet-gtk", | ||
689 | "gnunet-gtk-status-connected.svg", NULL); | ||
690 | gtk_icon_source_set_filename (iconSource, iconPath); | ||
691 | g_free (iconPath); | ||
692 | gtk_icon_set_add_source (iconSet, iconSource); | ||
693 | iconPath = | ||
694 | g_build_filename (instDir, "..", "gnunet-gtk", | ||
695 | "gnunet-gtk-status-connected.png", NULL); | ||
696 | gtk_icon_source_set_filename (iconSource, iconPath); | ||
697 | g_free (iconPath); | ||
698 | gtk_icon_source_set_size_wildcarded (iconSource, FALSE); | ||
699 | gtk_icon_set_add_source (iconSet, iconSource); | ||
700 | |||
701 | gtk_icon_factory_add (GNUNET_GTK_get_iconFactory (), | ||
702 | "gnunet-gtk-status-connected", iconSet); | ||
703 | gtk_icon_set_unref (iconSet); | ||
704 | gtk_icon_source_free (iconSource); | ||
705 | GNUNET_free (instDir); | ||
706 | gtk_status_icon_set_from_stock (trayIcon, "gnunet-gtk-status-connected"); | ||
707 | gtk_status_icon_set_tooltip (trayIcon, _("GNU's peer-to-peer network")); | 681 | gtk_status_icon_set_tooltip (trayIcon, _("GNU's peer-to-peer network")); |
708 | tray_quit = glade_xml_get_widget (trayContextMenuXML, "tray_quit"); | 682 | tray_quit = glade_xml_get_widget (trayContextMenuXML, "tray_quit"); |
709 | g_signal_connect_swapped (G_OBJECT (tray_quit), "activate", | 683 | g_signal_connect_swapped (G_OBJECT (tray_quit), "activate", |
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h index 4125550e..08ade149 100644 --- a/src/include/gnunetgtk_common.h +++ b/src/include/gnunetgtk_common.h | |||
@@ -101,6 +101,7 @@ GNUNET_GTK_shutdown_logger(); | |||
101 | typedef enum | 101 | typedef enum |
102 | { | 102 | { |
103 | GNUNET_GTK_STATUS_NODAEMON, | 103 | GNUNET_GTK_STATUS_NODAEMON, |
104 | GNUNET_GTK_STATUS_DAEMONUP, | ||
104 | GNUNET_GTK_STATUS_DISCONNECTED, | 105 | GNUNET_GTK_STATUS_DISCONNECTED, |
105 | GNUNET_GTK_STATUS_CONNECTED, | 106 | GNUNET_GTK_STATUS_CONNECTED, |
106 | GNUNET_GTK_STATUS_UNKNOWN | 107 | GNUNET_GTK_STATUS_UNKNOWN |
diff --git a/src/plugins/daemon/daemon.c b/src/plugins/daemon/daemon.c index 6d1e1e8c..886de80d 100644 --- a/src/plugins/daemon/daemon.c +++ b/src/plugins/daemon/daemon.c | |||
@@ -254,7 +254,7 @@ cronCheckDaemon (void *dummy) | |||
254 | updateAppModel (NULL); | 254 | updateAppModel (NULL); |
255 | last = ret; | 255 | last = ret; |
256 | if (ret) | 256 | if (ret) |
257 | GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_DISCONNECTED, 0); | 257 | GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_DAEMONUP, 0); |
258 | else | 258 | else |
259 | GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_NODAEMON, 0); | 259 | GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS_NODAEMON, 0); |
260 | } | 260 | } |