mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 599324 - Patch: Add double click behaviour to account list in payment dialog
Patch by Geert Janssens git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18406 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e405df93be
commit
5d95e03573
@ -74,6 +74,8 @@ struct _payment_window {
|
||||
void gnc_payment_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_payment_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_payment_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_payment_acct_tree_row_activated_cb (GtkWidget *widget, GtkTreePath *path,
|
||||
GtkTreeViewColumn *column, PaymentWindow *pw);
|
||||
|
||||
|
||||
static void
|
||||
@ -360,6 +362,35 @@ gnc_payment_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
g_free (pw);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_payment_acct_tree_row_activated_cb (GtkWidget *widget, GtkTreePath *path,
|
||||
GtkTreeViewColumn *column, PaymentWindow *pw)
|
||||
{
|
||||
GtkTreeView *view;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
g_return_if_fail(widget);
|
||||
view = GTK_TREE_VIEW(widget);
|
||||
|
||||
model = gtk_tree_view_get_model(view);
|
||||
if (gtk_tree_model_get_iter(model, &iter, path))
|
||||
{
|
||||
if (gtk_tree_model_iter_has_child(model, &iter))
|
||||
{
|
||||
/* There are children,
|
||||
* just expand or collapse the row. */
|
||||
if (gtk_tree_view_row_expanded(view, path))
|
||||
gtk_tree_view_collapse_row(view, path);
|
||||
else
|
||||
gtk_tree_view_expand_row(view, path, FALSE);
|
||||
}
|
||||
else
|
||||
/* It's an account without any children, so click the Ok button. */
|
||||
gnc_payment_ok_cb(widget, pw);
|
||||
}
|
||||
}
|
||||
|
||||
/* Select the list of accounts to show in the tree */
|
||||
static void
|
||||
gnc_payment_set_account_types (GncTreeViewAccount *tree)
|
||||
@ -483,6 +514,9 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
||||
g_signal_connect (G_OBJECT (pw->invoice_choice), "changed",
|
||||
G_CALLBACK (gnc_payment_dialog_invoice_changed_cb), pw);
|
||||
|
||||
g_signal_connect (G_OBJECT (pw->acct_tree), "row-activated",
|
||||
G_CALLBACK (gnc_payment_acct_tree_row_activated_cb), pw);
|
||||
|
||||
/* Register with the component manager */
|
||||
pw->component_id =
|
||||
gnc_register_gui_component (cm_class,
|
||||
|
Loading…
Reference in New Issue
Block a user