Files | |
| file | dialog-account.h |
| Dialog for create/edit an account. | |
Non-Modal | |
| void | gnc_ui_edit_account_window (Account *account) |
| void | gnc_ui_new_account_window (QofBook *book, Account *parent) |
| void | gnc_ui_new_account_with_types (QofBook *book, GList *valid_types) |
Modal | |
| Account * | gnc_ui_new_accounts_from_name_window (const char *name) |
| Account * | gnc_ui_new_accounts_from_name_window_with_types (const char *name, GList *valid_types) |
| Account * | gnc_ui_new_accounts_from_name_with_defaults (const char *name, GList *valid_types, gnc_commodity *default_commodity, Account *parent) |
| void | gnc_ui_register_account_destroy_callback (void(*cb)(Account *)) |
Functions | |
| void | gnc_account_renumber_create_dialog (GtkWidget *window, Account *account) |
| void gnc_ui_edit_account_window | ( | Account * | account | ) |
Disply a window for editing the attributes of an existing account.
| account | This parameter specifies the account whose data will be edited. |
Definition at line 1638 of file dialog-account.c.
01639 { 01640 AccountWindow * aw; 01641 Account *parent; 01642 01643 if (account == NULL) 01644 return; 01645 01646 aw = gnc_find_first_gui_component (DIALOG_EDIT_ACCOUNT_CM_CLASS, 01647 find_by_account, account); 01648 if (aw) { 01649 gtk_window_present(GTK_WINDOW(aw->dialog)); 01650 return; 01651 } 01652 01653 aw = g_new0 (AccountWindow, 1); 01654 01655 aw->book = gnc_account_get_book(account); 01656 aw->modal = FALSE; 01657 aw->dialog_type = EDIT_ACCOUNT; 01658 aw->account = *xaccAccountGetGUID (account); 01659 aw->subaccount_names = NULL; 01660 aw->type = xaccAccountGetType (account); 01661 01662 gnc_suspend_gui_refresh (); 01663 01664 gnc_account_window_create (aw); 01665 gnc_account_to_ui (aw); 01666 01667 gnc_resume_gui_refresh (); 01668 01669 gtk_widget_show_all (aw->dialog); 01670 gtk_widget_hide (aw->opening_balance_page); 01671 01672 parent = gnc_account_get_parent (account); 01673 if (parent == NULL) 01674 parent = account; /* must be at the root */ 01675 01676 gtk_tree_view_collapse_all (aw->parent_tree); 01677 gnc_tree_view_account_set_selected_account ( 01678 GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), parent); 01679 01680 gnc_account_window_set_name (aw); 01681 01682 gnc_window_adjust_for_screen(GTK_WINDOW(aw->dialog)); 01683 01684 aw->component_id = gnc_register_gui_component (DIALOG_EDIT_ACCOUNT_CM_CLASS, 01685 refresh_handler, 01686 close_handler, aw); 01687 01688 gnc_gui_component_set_session (aw->component_id, gnc_get_current_session()); 01689 gnc_gui_component_watch_entity_type (aw->component_id, 01690 GNC_ID_ACCOUNT, 01691 QOF_EVENT_MODIFY | QOF_EVENT_DESTROY); 01692 01693 gtk_window_present(GTK_WINDOW(aw->dialog)); 01694 }
Disply a window for creating a new account. This function will also initially set the parent account of the new account to what the caller specified. The user is free, however, to choose any parent account they wish.
| book | The book in which the new account should be created. This is a required argument. | |
| parent | The initially selected parent account. This argument is optional, but if supplied must be an account contained in the specified book. |
Definition at line 1704 of file dialog-account.c.
01705 { 01706 g_return_if_fail(book != NULL); 01707 if (parent && book) 01708 g_return_if_fail(gnc_account_get_book(parent) == book); 01709 01710 gnc_ui_new_account_window_internal (book, parent, NULL, NULL, NULL, FALSE); 01711 }
| void gnc_ui_new_account_with_types | ( | QofBook * | book, | |
| GList * | valid_types | |||
| ) |
Disply a window for creating a new account. This function will restrict the available account type values to the list specified by the caller.
| unused | This parameter is not used. | |
| valid_types | A GList of GNCAccountType gints [as pointers] which are allowed to be created. The calling function is responsible for freeing this list. |
Definition at line 1714 of file dialog-account.c.
01716 { 01717 gnc_ui_new_account_window_internal( book, NULL, NULL, valid_types, NULL, FALSE ); 01718 }
| Account* gnc_ui_new_accounts_from_name_window | ( | const char * | name | ) |
Disply a modal window for creating a new account
| name | The account name/path to be created. This parameter is not used for determining the initially selected parent account. |
Definition at line 1543 of file dialog-account.c.
01544 { 01545 return gnc_ui_new_accounts_from_name_with_defaults (name, NULL, NULL, NULL); 01546 }
| Account* gnc_ui_new_accounts_from_name_window_with_types | ( | const char * | name, | |
| GList * | valid_types | |||
| ) |
Disply a modal window for creating a new account. This function will restrict the available account type values to the list specified by the caller.
| name | The account name/path to be created. This parameter is not used for determining the initially selected parent account. | |
| valid_types | A GList of GNCAccountType gints [as pointers] which are allowed to be created. The calling function is responsible for freeing this list. |
Definition at line 1549 of file dialog-account.c.
01551 { 01552 return gnc_ui_new_accounts_from_name_with_defaults(name, valid_types, NULL, NULL); 01553 }
| Account* gnc_ui_new_accounts_from_name_with_defaults | ( | const char * | name, | |
| GList * | valid_types, | |||
| gnc_commodity * | default_commodity, | |||
| Account * | parent | |||
| ) |
Display a modal window for creating a new account. This function will restrict the available account type values to the list specified by the caller.
| name | The account name/path to be created. This parameter is not used for determining the initially selected parent account. | |
| valid_types | A GList of GNCAccountType gints [as pointers] which are allowed to be created. The calling function is responsible for freeing this list. | |
| default_commodity | The commodity to initially select when the dialog is presented. | |
| parent | The initially selected parent account. |
Definition at line 1556 of file dialog-account.c.
01560 { 01561 QofBook *book; 01562 AccountWindow *aw; 01563 Account *base_account = NULL; 01564 Account *created_account = NULL; 01565 gchar ** subaccount_names; 01566 gint response; 01567 gboolean done = FALSE; 01568 01569 ENTER("name %s, valid %p, commodity %p, account %p", 01570 name, valid_types, default_commodity, parent); 01571 book = gnc_get_current_book(); 01572 if (!name || *name == '\0') 01573 { 01574 subaccount_names = NULL; 01575 base_account = NULL; 01576 } 01577 else 01578 subaccount_names = gnc_split_account_name (book, name, &base_account); 01579 01580 if (parent != NULL) 01581 { 01582 base_account=parent; 01583 } 01584 aw = gnc_ui_new_account_window_internal (book, base_account, subaccount_names, 01585 valid_types, default_commodity, 01586 TRUE); 01587 01588 while (!done) { 01589 response = gtk_dialog_run (GTK_DIALOG(aw->dialog)); 01590 01591 /* This can destroy the dialog */ 01592 gnc_account_window_response_cb (GTK_DIALOG(aw->dialog), response, (gpointer)aw); 01593 01594 switch (response) { 01595 case GTK_RESPONSE_OK: 01596 created_account = aw->created_account; 01597 done = (created_account != NULL); 01598 break; 01599 01600 case GTK_RESPONSE_HELP: 01601 done = FALSE; 01602 break; 01603 01604 default: 01605 done = TRUE; 01606 break; 01607 } 01608 } 01609 01610 close_handler(aw); 01611 LEAVE("created %s (%p)", xaccAccountGetName(created_account), created_account); 01612 return created_account; 01613 }
1.5.2