Remove obsolete buttons for aqbanking/hbci setup that are

unneeded. Fix crash due to dangling points by deleting all pointers
after calling AB_Banking_Fini.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14502 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-07-15 11:27:48 +00:00
parent 37bfd1de1c
commit 97a282487e
3 changed files with 80 additions and 215 deletions

View File

@ -1,3 +1,10 @@
2006-07-15 Christian Stimming <stimming@tuhh.de>
* src/import-export/hbci/druid-hbci-initial.c: Remove obsolete
buttons for aqbanking/hbci setup that are unneeded. Fix crash due
to dangling points by deleting all pointers after calling
AB_Banking_Fini.
2006-07-14 Derek Atkins <derek@ihtfp.com> 2006-07-14 Derek Atkins <derek@ihtfp.com>
* configure.in: * configure.in:

View File

@ -51,13 +51,6 @@
/* #define DEFAULT_HBCI_VERSION 201 */ /* #define DEFAULT_HBCI_VERSION 201 */
typedef enum _infostate {
INI_UPDATE_ACCOUNTS,
INI_MATCH_ACCOUNTS,
UPDATE_ACCOUNTS,
MATCH_ACCOUNTS
} Infostate;
struct _hbciinitialinfo struct _hbciinitialinfo
{ {
GtkWidget *window; GtkWidget *window;
@ -79,9 +72,6 @@ struct _hbciinitialinfo
/* hbci_account (direct) -> gnucash_account -- DO NOT DELETE THE KEYS! */ /* hbci_account (direct) -> gnucash_account -- DO NOT DELETE THE KEYS! */
GHashTable *gnc_hash; GHashTable *gnc_hash;
/* Status of user's movement through the wizard */
Infostate state;
}; };
static gboolean static gboolean
@ -332,25 +322,6 @@ on_aqbutton_prepare (GnomeDruidPage *gnomedruidpage,
} }
static gboolean
on_accountlist_back (GnomeDruidPage *gnomedruidpage,
gpointer arg1,
gpointer user_data)
{
HBCIInitialInfo *info = user_data;
g_assert(info);
switch (info->state) {
case INI_MATCH_ACCOUNTS:
case MATCH_ACCOUNTS:
gnome_druid_set_page (GNOME_DRUID (info->druid),
GNOME_DRUID_PAGE (info->filepage));
return TRUE;
default:
return FALSE;
}
}
static void static void
on_accountlist_prepare (GnomeDruidPage *gnomedruidpage, on_accountlist_prepare (GnomeDruidPage *gnomedruidpage,
gpointer arg1, gpointer arg1,
@ -422,28 +393,6 @@ on_accountlist_select_row (GtkCList *clist, gint row,
static void
on_button_clicked (GtkButton *button,
gpointer user_data)
{
HBCIInitialInfo *info = user_data;
const char *name;
g_assert(info->druid);
name = gtk_widget_get_name (GTK_WIDGET (button));
if (strcmp (name, "aqhbci_button") == 0) {
/* info->state = ADD_BANK; */
/* gnome_druid_set_page (GNOME_DRUID (info->druid),
GNOME_DRUID_PAGE (info->bankpage)); */
} else if (strcmp (name, "updatelist_button") == 0) {
info->state = UPDATE_ACCOUNTS;
/* Nothing else to do. */
} else {
printf("on_button_clicked: Oops, unknown button: %s\n",
name);
}
}
#if (AQBANKING_VERSION_MAJOR > 1) || \ #if (AQBANKING_VERSION_MAJOR > 1) || \
((AQBANKING_VERSION_MAJOR == 1) && \ ((AQBANKING_VERSION_MAJOR == 1) && \
(AQBANKING_VERSION_MINOR == 9) && \ (AQBANKING_VERSION_MINOR == 9) && \
@ -593,8 +542,14 @@ on_aqhbci_button (GtkButton *button,
/* Call the qt wizard. See the note above about why this approach /* Call the qt wizard. See the note above about why this approach
is chosen. */ is chosen. */
/* In gtk2, this would be g_spawn_async or similar. */ /* Reset existing mapping tables */
AB_Banking_Fini (info->api); AB_Banking_Fini (info->api);
delete_hash (info->hbci_hash);
info->hbci_hash = NULL;
if (info->gnc_hash != NULL)
g_hash_table_destroy (info->gnc_hash);
info->gnc_hash = NULL;
/* In gtk2, this would be g_spawn_async or similar. */
{ {
pid_t pid; pid_t pid;
pid = fork(); pid = fork();
@ -705,16 +660,8 @@ void gnc_hbci_initial_druid (void)
info->accountlist = glade_xml_get_widget(xml, "account_page_list"); info->accountlist = glade_xml_get_widget(xml, "account_page_list");
g_signal_connect (info->accountlist, "select_row", g_signal_connect (info->accountlist, "select_row",
G_CALLBACK (on_accountlist_select_row), info); G_CALLBACK (on_accountlist_select_row), info);
g_signal_connect (glade_xml_get_widget (xml, "aqhbci_again_button"),
"clicked",
G_CALLBACK (on_aqhbci_button), info);
g_signal_connect (glade_xml_get_widget (xml, "updatelist_button"),
"clicked",
G_CALLBACK (on_button_clicked), info);
g_signal_connect (page, "prepare", g_signal_connect (page, "prepare",
G_CALLBACK (on_accountlist_prepare), info); G_CALLBACK (on_accountlist_prepare), info);
g_signal_connect (page, "back",
G_CALLBACK (on_accountlist_back), info);
} }

View File

@ -185,108 +185,74 @@ Press &quot;Cancel&quot; if you do not wish to setup any HBCI connection now.</p
<property name="spacing">0</property> <property name="spacing">0</property>
<child> <child>
<widget class="GtkHBox" id="hbox112"> <widget class="GtkVBox" id="vbox157">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<child> <child>
<widget class="GtkVBox" id="vbox157"> <widget class="GtkScrolledWindow" id="scrolledwindow25">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="spacing">0</property> <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow25"> <widget class="GtkCList" id="account_page_list">
<property name="visible">True</property> <property name="visible">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> <property name="can_focus">True</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> <property name="n_columns">3</property>
<property name="column_widths">281,242,53</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
<property name="show_titles">True</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child> <child>
<widget class="GtkCList" id="account_page_list"> <widget class="GtkLabel" id="label834">
<property name="visible">True</property> <property name="label" translatable="yes">HBCI account name</property>
<property name="can_focus">True</property> <property name="use_underline">False</property>
<property name="n_columns">3</property> <property name="use_markup">False</property>
<property name="column_widths">281,242,53</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property> <property name="wrap">False</property>
<property name="show_titles">True</property> <property name="selectable">False</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
<child> <child>
<widget class="GtkLabel" id="label834"> <widget class="GtkLabel" id="label835">
<property name="label" translatable="yes">HBCI account name</property> <property name="label" translatable="yes">GnuCash account name</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property> <property name="wrap">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label835"> <widget class="GtkLabel" id="label836">
<property name="label" translatable="yes">GnuCash account name</property> <property name="label" translatable="yes">New?</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property> <property name="wrap">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label836">
<property name="label" translatable="yes">New?</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label828">
<property name="visible">True</property>
<property name="label" translatable="yes">Click on the line of a HBCI account name if you want to match it to a GnuCash account. Click &quot;Forward&quot; when all desired accounts are matching.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
</widget> </widget>
<packing> <packing>
@ -297,78 +263,23 @@ Press &quot;Cancel&quot; if you do not wish to setup any HBCI connection now.</p
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame72"> <widget class="GtkLabel" id="label828">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label_xalign">0</property> <property name="label" translatable="yes">Click on the line of a HBCI account name if you want to match it to a GnuCash account. Click &quot;Forward&quot; when all desired accounts are matching.</property>
<property name="label_yalign">0.5</property> <property name="use_underline">False</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child> <property name="wrap">True</property>
<widget class="GtkVBox" id="vbox144"> <property name="selectable">False</property>
<property name="border_width">5</property> <property name="xalign">0.5</property>
<property name="visible">True</property> <property name="yalign">0.5</property>
<property name="homogeneous">False</property> <property name="xpad">0</property>
<property name="spacing">5</property> <property name="ypad">0</property>
<child>
<widget class="GtkButton" id="updatelist_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Update
account list</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="aqhbci_again_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">AqHBCI
Setup</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label8877442">
<property name="visible">True</property>
<property name="label" translatable="yes">HBCI Setup</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
</widget> </widget>
@ -1519,6 +1430,7 @@ Press &quot;Apply&quot; now.</property>
<property name="response_id">0</property> <property name="response_id">0</property>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="close_button"> <widget class="GtkButton" id="close_button">
<property name="visible">True</property> <property name="visible">True</property>
@ -1531,7 +1443,6 @@ Press &quot;Apply&quot; now.</property>
<property name="response_id">0</property> <property name="response_id">0</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -1888,6 +1799,7 @@ Press &quot;Apply&quot; now.</property>
<property name="response_id">2</property> <property name="response_id">2</property>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="ok_button"> <widget class="GtkButton" id="ok_button">
<property name="visible">True</property> <property name="visible">True</property>
@ -1900,7 +1812,6 @@ Press &quot;Apply&quot; now.</property>
<property name="response_id">1</property> <property name="response_id">1</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -2251,6 +2162,7 @@ Press &quot;Apply&quot; now.</property>
<property name="response_id">0</property> <property name="response_id">0</property>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button2"> <widget class="GtkButton" id="button2">
<property name="visible">True</property> <property name="visible">True</property>
@ -2263,7 +2175,6 @@ Press &quot;Apply&quot; now.</property>
<property name="response_id">0</property> <property name="response_id">0</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>