mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 796474 - Segmentation fault while setting up online banking
Allow only a single instance of the assistant.
This commit is contained in:
@@ -90,6 +90,8 @@ void aai_match_page_prepare (GtkAssistant *assistant, gpointer user_data);
|
|||||||
|
|
||||||
static gboolean banking_has_accounts(AB_BANKING *banking);
|
static gboolean banking_has_accounts(AB_BANKING *banking);
|
||||||
static void hash_from_kvp_acc_cb(Account *gnc_acc, gpointer user_data);
|
static void hash_from_kvp_acc_cb(Account *gnc_acc, gpointer user_data);
|
||||||
|
static ABInitialInfo *single_info = NULL;
|
||||||
|
|
||||||
#if AQBANKING_VERSION_INT <= 49908
|
#if AQBANKING_VERSION_INT <= 49908
|
||||||
static void child_exit_cb(GPid pid, gint status, gpointer data);
|
static void child_exit_cb(GPid pid, gint status, gpointer data);
|
||||||
#endif
|
#endif
|
||||||
@@ -178,6 +180,7 @@ void
|
|||||||
aai_destroy_cb(GtkWidget *object, gpointer user_data)
|
aai_destroy_cb(GtkWidget *object, gpointer user_data)
|
||||||
{
|
{
|
||||||
ABInitialInfo *info = user_data;
|
ABInitialInfo *info = user_data;
|
||||||
|
g_return_if_fail (single_info && info == single_info);
|
||||||
|
|
||||||
gnc_unregister_gui_component_by_data(ASSISTANT_AB_INITIAL_CM_CLASS, info);
|
gnc_unregister_gui_component_by_data(ASSISTANT_AB_INITIAL_CM_CLASS, info);
|
||||||
|
|
||||||
@@ -211,6 +214,7 @@ aai_destroy_cb(GtkWidget *object, gpointer user_data)
|
|||||||
info->window = NULL;
|
info->window = NULL;
|
||||||
|
|
||||||
g_free(info);
|
g_free(info);
|
||||||
|
single_info = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -845,16 +849,15 @@ void aai_on_prepare (GtkAssistant *assistant, GtkWidget *page,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static ABInitialInfo *
|
||||||
gnc_ab_initial_assistant(void)
|
gnc_ab_initial_assistant_new(void)
|
||||||
{
|
{
|
||||||
ABInitialInfo *info;
|
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
GtkTreeViewColumn *column;
|
GtkTreeViewColumn *column;
|
||||||
GtkTreeSelection *selection;
|
GtkTreeSelection *selection;
|
||||||
gint component_id;
|
gint component_id;
|
||||||
|
|
||||||
info = g_new0(ABInitialInfo, 1);
|
ABInitialInfo *info = g_new0(ABInitialInfo, 1);
|
||||||
builder = gtk_builder_new();
|
builder = gtk_builder_new();
|
||||||
gnc_builder_add_from_file (builder, "assistant-ab-initial.glade", "aqbanking_init_assistant");
|
gnc_builder_add_from_file (builder, "assistant-ab-initial.glade", "aqbanking_init_assistant");
|
||||||
|
|
||||||
@@ -910,6 +913,14 @@ gnc_ab_initial_assistant(void)
|
|||||||
NULL, aai_close_handler, info);
|
NULL, aai_close_handler, info);
|
||||||
|
|
||||||
gnc_gui_component_set_session(component_id, gnc_get_current_session());
|
gnc_gui_component_set_session(component_id, gnc_get_current_session());
|
||||||
|
return info;
|
||||||
gtk_widget_show(info->window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gnc_ab_initial_assistant(void)
|
||||||
|
{
|
||||||
|
if (!single_info)
|
||||||
|
single_info = gnc_ab_initial_assistant_new();
|
||||||
|
gtk_widget_show(single_info->window);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user