diff options
Diffstat (limited to 'src/lib/eventloop.c')
-rw-r--r-- | src/lib/eventloop.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index 60bd1faa..aef8d966 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c | |||
@@ -191,6 +191,30 @@ GNUNET_GTK_main_loop_quit (struct GNUNET_GTK_MainLoop *ml) | |||
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | /** | ||
195 | * Get the builder from the main window. | ||
196 | * | ||
197 | * @param ml handle to the main loop | ||
198 | * @return NULL on error, otherwise the builder | ||
199 | */ | ||
200 | GtkBuilder * | ||
201 | GNUNET_GTK_main_loop_get_builder (struct GNUNET_GTK_MainLoop *ml) | ||
202 | { | ||
203 | return ml->builder; | ||
204 | } | ||
205 | |||
206 | int | ||
207 | GNUNET_GTK_main_loop_build_window (struct GNUNET_GTK_MainLoop *ml, gpointer data) | ||
208 | { | ||
209 | ml->builder = GNUNET_GTK_get_new_builder (ml->main_window_file, data); | ||
210 | if (ml->builder == NULL) | ||
211 | { | ||
212 | GNUNET_GTK_main_loop_quit (ml); | ||
213 | return GNUNET_SYSERR; | ||
214 | } | ||
215 | return GNUNET_OK; | ||
216 | } | ||
217 | |||
194 | 218 | ||
195 | /** | 219 | /** |
196 | * Obtain the name of the configuration file that is being used. | 220 | * Obtain the name of the configuration file that is being used. |
@@ -841,10 +865,6 @@ run_main_loop (void *cls, char *const *args, const char *cfgfile, | |||
841 | argc++; | 865 | argc++; |
842 | gtk_init (&argc, (char ***) &args); | 866 | gtk_init (&argc, (char ***) &args); |
843 | 867 | ||
844 | /* setup main context */ | ||
845 | ml->builder = GNUNET_GTK_get_new_builder (ml->main_window_file, NULL); | ||
846 | if (ml->builder == NULL) | ||
847 | return; | ||
848 | ml->rs = GNUNET_NETWORK_fdset_create (); | 868 | ml->rs = GNUNET_NETWORK_fdset_create (); |
849 | ml->ws = GNUNET_NETWORK_fdset_create (); | 869 | ml->ws = GNUNET_NETWORK_fdset_create (); |
850 | ml->gml = g_main_loop_new (NULL, TRUE); | 870 | ml->gml = g_main_loop_new (NULL, TRUE); |