Skip to content

Commit

Permalink
Bug 728873 - In Qif importer use the enter on account entry
Browse files Browse the repository at this point in the history
Focus is already on the account entry so enable the use of the enter
key to proceed to the next page when you are finished changing the
account name for a qif file.
  • Loading branch information
Bob-IT committed May 12, 2019
1 parent 1dc99f1 commit 9504b70
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions gnucash/gtkbuilder/assistant-qif-import.glade
Expand Up @@ -381,6 +381,7 @@ Please enter a name for the account. If the file was exported from another accou
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<signal name="changed" handler="gnc_ui_qif_import_acct_valid_cb" swapped="no"/>
<signal name="activate" handler="gnc_ui_qif_import_acct_enter_cb" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
Expand Down
34 changes: 33 additions & 1 deletion gnucash/import-export/qif-imp/assistant-qif-import.c
Expand Up @@ -237,6 +237,7 @@ void gnc_ui_qif_import_date_valid_cb (GtkWidget *widget, gpointer user_data);

void gnc_ui_qif_import_account_prepare (GtkAssistant *assistant, gpointer user_data);
void gnc_ui_qif_import_acct_valid_cb (GtkWidget *widget, gpointer user_data);
void gnc_ui_qif_import_acct_enter_cb (GtkWidget * widget, gpointer user_data);

void gnc_ui_qif_import_loaded_files_prepare (GtkAssistant *assistant, gpointer user_data);
void gnc_ui_qif_import_load_another_cb (GtkButton *button, gpointer user_data);
Expand Down Expand Up @@ -2134,10 +2135,41 @@ gnc_ui_qif_import_account_prepare (GtkAssistant *assistant, gpointer user_data)
}


/********************************************************************
* gnc_ui_qif_import_acct_enter_cb
*
* Invoked when the "enter" button is clicked on the acct entry.
********************************************************************/
void
gnc_ui_qif_import_acct_enter_cb (GtkWidget * widget,
gpointer user_data)
{
QIFImportWindow * wind = user_data;

GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
gint num = gtk_assistant_get_current_page (assistant);
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);

const gchar * acct_name = gtk_entry_get_text (GTK_ENTRY(wind->acct_entry));

if (!acct_name || acct_name[0] == 0)
{
/* Disable the assistant "Next" Button */
gtk_assistant_set_page_complete (assistant, page, FALSE);
}
else
{
/* Enable the assistant "Next" Button and proceed */
gtk_assistant_set_page_complete (assistant, page, TRUE);
gtk_assistant_set_current_page (assistant, num + 1);
}
}


/********************************************************************
* gnc_ui_qif_import_acct_valid_cb
*
* Invoked when the "next" button is clicked on the default acct page.
* Change signal for the acct entry to enable "Next" button.
********************************************************************/
void
gnc_ui_qif_import_acct_valid_cb (GtkWidget * widget,
Expand Down

0 comments on commit 9504b70

Please sign in to comment.