AUDIT: r16567 - gnucash/trunk/src/import-export/qif-import - #487317: Fix qif import druid when stepping back without a file selection.
Andreas Köhler
andi5 at cvs.gnucash.org
Tue Oct 16 18:18:29 EDT 2007
Author: andi5
Date: 2007-10-16 18:18:27 -0400 (Tue, 16 Oct 2007)
New Revision: 16567
Trac: http://svn.gnucash.org/trac/changeset/16567
Modified:
gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
gnucash/trunk/src/import-export/qif-import/qif.glade
Log:
#487317: Fix qif import druid when stepping back without a file selection.
Also gray out "unload selected file" and "back" buttons when there is no
file selected.
BP
Modified: gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.c 2007-10-15 20:14:37 UTC (rev 16566)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.c 2007-10-16 22:18:27 UTC (rev 16567)
@@ -701,7 +701,9 @@
GtkTreeModel *model;
GtkTreeIter iter;
gint row;
+ GtkWidget *button;
+ button = gnc_glade_lookup_widget(wind->window, "unload_file_button");
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
if(SCM_LISTP(wind->imported_files) &&
@@ -710,11 +712,17 @@
wind->selected_file = scm_list_ref(wind->imported_files,
scm_int2num(row));
scm_gc_protect_object(wind->selected_file);
+ g_object_set(button, "sensitive", TRUE, (gchar*)NULL);
+ gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+ TRUE, TRUE, TRUE, TRUE);
}
} else {
scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = SCM_BOOL_F;
scm_gc_protect_object(wind->selected_file);
+ g_object_set(button, "sensitive", FALSE, (gchar*)NULL);
+ gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+ FALSE, TRUE, TRUE, TRUE);
}
}
@@ -731,9 +739,9 @@
{
QIFImportWindow * wind = user_data;
+ gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+ FALSE, TRUE, TRUE, TRUE);
update_file_page(wind);
- gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
- FALSE, TRUE, TRUE, TRUE);
}
@@ -860,6 +868,7 @@
SCM fix_default = scm_c_eval_string("qif-import:fix-from-acct");
SCM scm_name;
+ g_return_val_if_fail(wind->selected_file != SCM_BOOL_F, FALSE);
if(!acct_name || acct_name[0] == 0) {
gnc_warning_dialog(wind->window, _("You must enter an account name."));
return TRUE;
Modified: gnucash/trunk/src/import-export/qif-import/qif.glade
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif.glade 2007-10-15 20:14:37 UTC (rev 16566)
+++ gnucash/trunk/src/import-export/qif-import/qif.glade 2007-10-16 22:18:27 UTC (rev 16567)
@@ -514,7 +514,7 @@
<property name="visible">True</property>
<property name="title" translatable="yes">QIF files you have loaded</property>
<property name="title_foreground">#f5f5f5f5f5f5</property>
- <signal name="prepare" handler="gnc_ui_qif_import_loaded_files_prepare_cb"/>
+ <signal name="prepare" handler="gnc_ui_qif_import_loaded_files_prepare_cb" after="yes"/>
<signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
<signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
@@ -589,7 +589,7 @@
<property name="spacing">0</property>
<child>
- <widget class="GtkButton" id="button70">
+ <widget class="GtkButton" id="unload_file_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Unload selected file</property>
More information about the gnucash-changes
mailing list