Use double-clicks in general import dialogs.

In the import account matcher and import transaction match picker tree
views, let double-clicks on rows close the corresponding dialogs.

BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15347 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-01-12 23:02:47 +00:00
parent 14888d5730
commit de7f075fd5
2 changed files with 26 additions and 0 deletions

View File

@ -113,6 +113,17 @@ gnc_import_add_account(struct _accountpickerdialog * picker)
gnc_tree_view_account_set_selected_account(picker->account_tree, new_account);
}
/* When user double-clicks an account */
static void
account_tree_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
GtkTreeViewColumn *column,
struct _accountpickerdialog *picker)
{
g_return_if_fail(picker && picker->dialog);
gtk_dialog_response(GTK_DIALOG(picker->dialog), GTK_RESPONSE_OK);
}
static gpointer test_acct_online_id_match(Account *acct, gpointer param_online_id)
{
const gchar * current_online_id = gnc_import_get_acc_online_id(acct);
@ -207,6 +218,8 @@ Account * gnc_import_select_account(gncUIWidget parent,
gnc_tree_view_account_set_selected_account(picker->account_tree, default_selection);
gtk_window_set_modal(GTK_WINDOW(picker->dialog), TRUE);
g_signal_connect(picker->account_tree, "row-activated",
G_CALLBACK(account_tree_row_activated_cb), picker);
do {
response = gtk_dialog_run(GTK_DIALOG(picker->dialog));
switch (response) {

View File

@ -286,6 +286,17 @@ match_transaction_changed_cb (GtkTreeSelection *selection,
-1);
}
static void
match_transaction_row_activated_cb (GtkTreeView *view, GtkTreePath *path,
GtkTreeViewColumn *column,
GNCImportMatchPicker *matcher)
{
g_return_if_fail (matcher && matcher->transaction_matcher);
gtk_dialog_response (GTK_DIALOG (matcher->transaction_matcher),
GTK_RESPONSE_OK);
}
static void
add_column(GtkTreeView *view, const gchar *title, int col_num)
{
@ -367,6 +378,8 @@ gnc_import_match_picker_init_match_view (GNCImportMatchPicker * matcher)
selection = gtk_tree_view_get_selection(view);
g_signal_connect(selection, "changed",
G_CALLBACK(match_transaction_changed_cb), matcher);
g_signal_connect(view, "row-activated",
G_CALLBACK(match_transaction_row_activated_cb), matcher);
}
/********************************************************************\