aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk.c')
-rw-r--r--src/conversation/gnunet-conversation-gtk.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/src/conversation/gnunet-conversation-gtk.c b/src/conversation/gnunet-conversation-gtk.c
index aca58d30..be4f07db 100644
--- a/src/conversation/gnunet-conversation-gtk.c
+++ b/src/conversation/gnunet-conversation-gtk.c
@@ -45,11 +45,6 @@ static struct GNUNET_GTK_MainLoop *ml;
45static struct GNUNET_CONFIGURATION_Handle *cfg; 45static struct GNUNET_CONFIGURATION_Handle *cfg;
46 46
47/** 47/**
48 * Should gnunet-conversation-gtk start in tray mode?
49 */
50static int tray_only;
51
52/**
53 * Desired phone line. 48 * Desired phone line.
54 */ 49 */
55static unsigned int line; 50static unsigned int line;
@@ -74,36 +69,6 @@ GCG_get_main_window_object (const char *name)
74 69
75 70
76/** 71/**
77 * Updates the status icon to the image of the given name.
78 * TODO: support animations.
79 *
80 * available icons:
81 * gnunet-conversation-offline
82 * gnunet-conversation-call-active
83 * gnunet-conversation-call-on-hold
84 * gnunet-conversation-gtk-tray-available
85 * gnunet-conversation-gtk-tray-call-pending
86 * gnunet-conversation-gtk-tray-call-ringing
87 * gnunet-conversation-gtk-tray-call-incoming
88 *
89 * @param icon_name name of the icon to use
90 */
91void
92GCG_set_status_icon (const char *icon_name)
93{
94 GtkImage *status_icon;
95
96 status_icon = GTK_IMAGE (GCG_get_main_window_object
97 ("gnunet_conversation_gtk_status_icon"));
98 gtk_image_set_from_icon_name (status_icon,
99 icon_name,
100 GTK_ICON_SIZE_BUTTON);
101 GNUNET_GTK_tray_icon_change (icon_name,
102 NULL /* tooltip */);
103}
104
105
106/**
107 * Get our configuration. 72 * Get our configuration.
108 * 73 *
109 * @return configuration handle 74 * @return configuration handle
@@ -128,7 +93,6 @@ shutdown_task (void *cls)
128 GCG_PHONE_shutdown (); 93 GCG_PHONE_shutdown ();
129 GCG_CONTACTS_shutdown (); 94 GCG_CONTACTS_shutdown ();
130 GCG_IMPORT_shutdown (); 95 GCG_IMPORT_shutdown ();
131 GNUNET_GTK_tray_icon_destroy ();
132 GNUNET_GTK_main_loop_quit (ml); 96 GNUNET_GTK_main_loop_quit (ml);
133 ml = NULL; 97 ml = NULL;
134} 98}
@@ -176,17 +140,9 @@ run (void *cls)
176 main_window = GNUNET_GTK_plug_me ("GNUNET_CONVERSATION_GTK_PLUG", 140 main_window = GNUNET_GTK_plug_me ("GNUNET_CONVERSATION_GTK_PLUG",
177 main_window); 141 main_window);
178 gtk_window_maximize (GTK_WINDOW (main_window)); 142 gtk_window_maximize (GTK_WINDOW (main_window));
179 if (NULL == getenv ("GNUNET_CONVERSATION_GTK_PLUG"))
180 GNUNET_GTK_tray_icon_create (ml,
181 GTK_WINDOW (main_window),
182 "gnunet-gtk" /* FIXME: different icon? */,
183 "gnunet-conversation-gtk");
184 /* make GUI visible */ 143 /* make GUI visible */
185 if (! tray_only) 144 gtk_widget_show (main_window);
186 { 145 gtk_window_present (GTK_WINDOW (main_window));
187 gtk_widget_show (main_window);
188 gtk_window_present (GTK_WINDOW (main_window));
189 }
190 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, 146 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
191 NULL); 147 NULL);
192 if (NULL == ego_name) 148 if (NULL == ego_name)
@@ -222,9 +178,6 @@ main (int argc, char *const *argv)
222 {'e', "ego", "ego", 178 {'e', "ego", "ego",
223 gettext_noop ("select ego to use"), 1, 179 gettext_noop ("select ego to use"), 1,
224 &GNUNET_GETOPT_set_string, &ego_name}, 180 &GNUNET_GETOPT_set_string, &ego_name},
225 {'t', "tray", NULL,
226 gettext_noop ("start in tray mode"), 0,
227 &GNUNET_GETOPT_set_one, &tray_only},
228 GNUNET_GETOPT_OPTION_END 181 GNUNET_GETOPT_OPTION_END
229 }; 182 };
230 int ret; 183 int ret;