diff options
Diffstat (limited to 'src/ui/new_account.c')
-rw-r--r-- | src/ui/new_account.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/ui/new_account.c b/src/ui/new_account.c index 854b2bd..f51eb4d 100644 --- a/src/ui/new_account.c +++ b/src/ui/new_account.c | |||
@@ -26,6 +26,15 @@ | |||
26 | 26 | ||
27 | #include "../application.h" | 27 | #include "../application.h" |
28 | 28 | ||
29 | static gboolean | ||
30 | _show_messenger_main_window(gpointer user_data) | ||
31 | { | ||
32 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | ||
33 | |||
34 | gtk_widget_show(GTK_WIDGET(app->ui.messenger.main_window)); | ||
35 | return FALSE; | ||
36 | } | ||
37 | |||
29 | static void | 38 | static void |
30 | _open_new_account(GtkEntry *entry, MESSENGER_Application *app) | 39 | _open_new_account(GtkEntry *entry, MESSENGER_Application *app) |
31 | { | 40 | { |
@@ -40,6 +49,11 @@ _open_new_account(GtkEntry *entry, MESSENGER_Application *app) | |||
40 | GNUNET_free(app->chat.identity); | 49 | GNUNET_free(app->chat.identity); |
41 | 50 | ||
42 | app->chat.identity = GNUNET_strdup(name); | 51 | app->chat.identity = GNUNET_strdup(name); |
52 | |||
53 | if (!gtk_widget_is_visible(GTK_WIDGET(app->ui.messenger.main_window))) | ||
54 | app->ui.new_account.show_queued = g_idle_add( | ||
55 | G_SOURCE_FUNC(_show_messenger_main_window), app | ||
56 | ); | ||
43 | } | 57 | } |
44 | 58 | ||
45 | static void | 59 | static void |
@@ -86,13 +100,21 @@ static void | |||
86 | handle_dialog_destroy(UNUSED GtkWidget *window, | 100 | handle_dialog_destroy(UNUSED GtkWidget *window, |
87 | gpointer user_data) | 101 | gpointer user_data) |
88 | { | 102 | { |
89 | ui_new_account_dialog_cleanup((UI_NEW_ACCOUNT_Handle*) user_data); | 103 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
104 | |||
105 | ui_new_account_dialog_cleanup(&(app->ui.new_account)); | ||
106 | |||
107 | if ((!(app->ui.new_account.show_queued)) && | ||
108 | (!gtk_widget_is_visible(GTK_WIDGET(app->ui.messenger.main_window)))) | ||
109 | gtk_widget_destroy(GTK_WIDGET(app->ui.messenger.main_window)); | ||
90 | } | 110 | } |
91 | 111 | ||
92 | void | 112 | void |
93 | ui_new_account_dialog_init(MESSENGER_Application *app, | 113 | ui_new_account_dialog_init(MESSENGER_Application *app, |
94 | UI_NEW_ACCOUNT_Handle *handle) | 114 | UI_NEW_ACCOUNT_Handle *handle) |
95 | { | 115 | { |
116 | handle->show_queued = 0; | ||
117 | |||
96 | handle->builder = gtk_builder_new_from_resource( | 118 | handle->builder = gtk_builder_new_from_resource( |
97 | application_get_resource_path(app, "ui/new_account.ui") | 119 | application_get_resource_path(app, "ui/new_account.ui") |
98 | ); | 120 | ); |
@@ -163,7 +185,7 @@ ui_new_account_dialog_init(MESSENGER_Application *app, | |||
163 | handle->dialog, | 185 | handle->dialog, |
164 | "destroy", | 186 | "destroy", |
165 | G_CALLBACK(handle_dialog_destroy), | 187 | G_CALLBACK(handle_dialog_destroy), |
166 | handle | 188 | app |
167 | ); | 189 | ); |
168 | } | 190 | } |
169 | 191 | ||