From de7f075fd55223b746443d5deb626f3286e90068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Fri, 12 Jan 2007 23:02:47 +0000 Subject: [PATCH] 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 --- src/import-export/import-account-matcher.c | 13 +++++++++++++ src/import-export/import-match-picker.c | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index 9d1de85e7a..1d5a5fdf23 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -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) { diff --git a/src/import-export/import-match-picker.c b/src/import-export/import-match-picker.c index 8f59409ce0..e6ed430812 100644 --- a/src/import-export/import-match-picker.c +++ b/src/import-export/import-match-picker.c @@ -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); } /********************************************************************\