static LinphoneCore *the_core=NULL;
static GtkWidget *the_ui=NULL;
-GtkWidget *the_wizard=NULL;
static void linphone_gtk_registration_state_changed(LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState rs, const char *msg);
static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid);
return the_ui;
}
+void linphone_gtk_destroy_main_window() {
+ linphone_gtk_destroy_window(the_ui);
+ the_ui = NULL;
+}
+
static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name){
static const char *icon_path=NULL;
static const char *hiddens=NULL;
return 0;
}
+void linphone_gtk_destroy_window(GtkWidget *widget) {
+ GtkBuilder* builder = g_object_get_data(G_OBJECT(widget), "builder");
+ gtk_widget_destroy(widget);
+ g_object_unref (G_OBJECT (builder));
+}
+
GtkWidget *linphone_gtk_create_window(const char *window_name){
GError* error = NULL;
GtkBuilder* builder = gtk_builder_new ();
g_error("Could not retrieve '%s' window from xml file",window_name);
return NULL;
}
- g_object_set_data(G_OBJECT(w),"builder",builder);
+ g_object_set_data(G_OBJECT(w), "builder",builder);
gtk_builder_connect_signals(builder,w);
linphone_gtk_configure_window(w,window_name);
return w;
}
}
-#ifdef BUILD_WIZARD
-// Display the account wizard
-void linphone_gtk_display_wizard() {
- if (the_wizard == NULL || !gtk_widget_get_visible(the_wizard)) { // Only one instance of the wizard at the same time
- the_wizard = linphone_gtk_create_assistant();
- }
-}
-#endif
-
static void linphone_gtk_quit(void){
static gboolean quit_done=FALSE;
if (!quit_done){
quit_done=TRUE;
linphone_gtk_unmonitor_usb();
g_source_remove_by_user_data(linphone_gtk_get_core());
+#ifdef BUILD_WIZARD
+ linphone_gtk_close_assistant();
+#endif
+ linphone_gtk_destroy_main_window();
linphone_gtk_uninit_instance();
linphone_gtk_destroy_log_window();
linphone_core_destroy(the_core);
#ifdef BUILD_WIZARD
// Veryfing if at least one sip account is configured. If not, show wizard
if (linphone_core_get_proxy_config_list(linphone_gtk_get_core()) == NULL) {
- linphone_gtk_display_wizard();
+ linphone_gtk_show_assistant();
}
#endif