GnuCash
2.6.99
|
Files | |
file | dialog-commodity.c |
"select" and "new" commodity windows | |
file | dialog-commodity.h |
"select" and "new" commodity windows | |
Data Structures | |
struct | select_commodity_window |
struct | commodity_window |
Typedefs | |
typedef struct select_commodity_window | SelectCommodityWindow |
typedef struct commodity_window | CommodityWindow |
typedef void(* | gnc_commodity_help_callback )(void) |
Enumerations | |
enum | { SOURCE_COL_NAME = 0, SOURCE_COL_FQ_SUPPORTED, NUM_SOURCE_COLS } |
enum | dialog_commodity_mode { DIAG_COMM_CURRENCY, DIAG_COMM_NON_CURRENCY, DIAG_COMM_ALL } |
Functions | |
void | gnc_ui_select_commodity_new_cb (GtkButton *button, gpointer user_data) |
void | gnc_ui_select_commodity_changed_cb (GtkComboBox *cbwe, gpointer user_data) |
void | gnc_ui_select_commodity_namespace_changed_cb (GtkComboBox *cbwe, gpointer user_data) |
void | gnc_ui_commodity_changed_cb (GtkWidget *dummy, gpointer user_data) |
void | gnc_ui_commodity_quote_info_cb (GtkWidget *w, gpointer data) |
gboolean | gnc_ui_commodity_dialog_to_object (CommodityWindow *w) |
void | gnc_ui_commodity_set_help_callback (gnc_commodity_help_callback cb) |
void | gnc_ui_update_namespace_picker (GtkWidget *cbwe, const char *init_string, dialog_commodity_mode mode) |
Commodity Selection | |
gnc_commodity * | gnc_ui_select_commodity_modal_full (gnc_commodity *orig_sel, GtkWidget *parent, dialog_commodity_mode mode, const char *user_message, const char *cusip, const char *fullname, const char *mnemonic) |
gnc_commodity * | gnc_ui_select_commodity_modal (gnc_commodity *orig_sel, GtkWidget *parent, dialog_commodity_mode mode) |
Commodity Creation or Modification | |
gnc_commodity * | gnc_ui_new_commodity_modal_full (const char *name_space, GtkWidget *parent, const char *cusip, const char *fullname, const char *mnemonic, const char *user_symbol, int fraction) |
gnc_commodity * | gnc_ui_new_commodity_modal (const char *default_namespace, GtkWidget *parent) |
gboolean | gnc_ui_edit_commodity_modal (gnc_commodity *commodity, GtkWidget *parent) |
Auxiliary Dialog Functions | |
void | gnc_ui_update_commodity_picker (GtkWidget *cbwe, const gchar *name_space, const gchar *init_string) |
gchar * | gnc_ui_namespace_picker_ns (GtkWidget *cbwe) |
void | gnc_ui_update_namespace_picker (GtkWidget *cbwe, const gchar *sel, dialog_commodity_mode mode) |
The dialog commodity types are used to determine what commodity namespaces the currency dialog will present to a user. These values can be safely changed from one release to the next. Note that if values are added, the routines in dialog-commodity.c will need to be updated to match.
Definition at line 46 of file dialog-commodity.h.
void gnc_ui_commodity_set_help_callback | ( | gnc_commodity_help_callback | cb | ) |
This function is used to set the action routine for the help button in the commodity dialog windows. If the action routine is unset, the help button will not be visible to the user.
cb | The function to be called when the user clicks the help button. |
Definition at line 137 of file dialog-commodity.c.
gboolean gnc_ui_edit_commodity_modal | ( | gnc_commodity * | commodity, |
GtkWidget * | parent | ||
) |
Given an existing commodity, uses the gnc_ui_build_commodity_dialog() routine to build a basic edit dialog, then fills in the price quote information at the bottom of the dialog.
Allow the user to edit the information about a commodity. For currencies, only the price quote information may be changed. For any other commodity, all aspects of the commodity information may be changed except that the namespace may not be changed to indicate a currency. The new information overwrites any old information, so this routine may not be used to create new commodities.
commodity | The commodity to edit. |
parent | The parent window of the new dialog. |
Definition at line 1265 of file dialog-commodity.c.
gchar * gnc_ui_namespace_picker_ns | ( | GtkWidget * | cbwe | ) |
Given a combo box, return the currently selected namespaces.
cbwe | The combo box of namespaces. |
Definition at line 711 of file dialog-commodity.c.
gnc_commodity * gnc_ui_new_commodity_modal | ( | const char * | default_namespace, |
GtkWidget * | parent | ||
) |
Ask the user to provide the information necessary to create a new commodity.
default_namespace | If present, this will be the default namespace for the new commodity. This value will be ignored if it is the namespace for ISO 4217 currencies. |
parent | The parent window of the new dialog. |
Definition at line 1243 of file dialog-commodity.c.
gnc_commodity * gnc_ui_new_commodity_modal_full | ( | const char * | name_space, |
GtkWidget * | parent, | ||
const char * | cusip, | ||
const char * | fullname, | ||
const char * | mnemonic, | ||
const char * | user_symbol, | ||
int | fraction | ||
) |
Ask the user to provide the information necessary to create a new commodity.
namespace | If present, this will be the default namespace for the new commodity. This value will be ignored if it is the namespace for ISO 4217 currencies. |
parent | The parent window of the new dialog. |
cusip | If present, this will be the default exchange specific data for the new commodity. |
fullname | If present, this will be the default fullname for the new commodity. |
mnemonic | If present, this will be the default mnemonic for the new commodity. |
user_symbol | If present, this will be the default user symbol for the new commodity. |
fraction | If present, this will be the default fraction for the new commodity. If absent, a default of 1000 will be used. |
Definition at line 1220 of file dialog-commodity.c.
void gnc_ui_select_commodity_changed_cb | ( | GtkComboBox * | cbwe, |
gpointer | user_data | ||
) |
This function is called whenever the commodity combo box is changed. Its function is to determine if a valid commodity has been selected, record the selection, and update the OK button.
cbwe | A pointer to the commodity name entry widget in the dialog. |
user_data | A pointer to the data structure describing the current state of the commodity picker. |
Definition at line 376 of file dialog-commodity.c.
gnc_commodity * gnc_ui_select_commodity_modal | ( | gnc_commodity * | orig_sel, |
GtkWidget * | parent, | ||
dialog_commodity_mode | mode | ||
) |
Ask the user to select a commodity from the existing set of commodities. The user will also have the option of creating a new commodity from this dialog box.. If the user decides to create a new one, those provided values are used as default values for the new commodity.
orig_sel | A pointer to a commodity that should initially be selected in the dialog box. |
parent | The parent window for this new selection window. |
mode | Determines which namespaces the user may select a commodity from. |
Definition at line 228 of file dialog-commodity.c.
gnc_commodity * gnc_ui_select_commodity_modal_full | ( | gnc_commodity * | orig_sel, |
GtkWidget * | parent, | ||
dialog_commodity_mode | mode, | ||
const char * | user_message, | ||
const char * | cusip, | ||
const char * | fullname, | ||
const char * | mnemonic | ||
) |
Ask the user to select a commodity from the existing set of commodities. Arguments to this function determine the message placed at the top of the dialog but force no restriction on the commodities that may be chosen. The user will also have the option of creating a new commodity from this dialog box.. If the user decides to create a new one, those provided values are used as default values for the new commodity.
orig_sel | A pointer to a commodity that should initially be selected in the dialog box. |
parent | The parent window of the new dialog. |
user_message | A string that will be installed in the top of the dialog box as an instruction to the user. If NULL, a generic instruction will be used. |
cusip | If present, a note will be added to the user instruction providing this exchange specific code, and this will be the default exchange specific data for any newly created commodities. |
fullname | If present, a note will be added to the user instruction providing this commodity's full name, and this will be the default fullname for any newly created commodities. |
mnemonic | If present, a note will be added to the user instruction providing this commodity's mnemonic, and this will be the default mnemonic for any newly created commodities. |
mode | Determines which namespaces the user may select a commodity from. |
Definition at line 147 of file dialog-commodity.c.
void gnc_ui_select_commodity_namespace_changed_cb | ( | GtkComboBox * | cbwe, |
gpointer | user_data | ||
) |
This function is called whenever the commodity namespace combo box is changed. Its function is to update the commodity name combo box with the strings that are appropriate to the selected namespace.
cbwe | A pointer to the commodity namespace entry widget in the dialog. |
user_data | A pointer to the data structure describing the current state of the commodity picker. |
Definition at line 417 of file dialog-commodity.c.
void gnc_ui_select_commodity_new_cb | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
This function is called whenever the user clicks on the "New" button in the commodity picker. Its function is pop up a new dialog alling the user to create a new commodity.
button | A pointer to the "new" button widget in the dialog. |
user_data | A pointer to the data structure describing the current state of the commodity picker. |
Definition at line 332 of file dialog-commodity.c.
void gnc_ui_update_commodity_picker | ( | GtkWidget * | cbwe, |
const gchar * | name_space, | ||
const gchar * | sel | ||
) |
Given a combo box, fill in all the known commodities for the specified namespace, and then select one.
cbwe | The widget to populate with information. |
namespace | All commodities with this namespace will be added to the combo box. |
sel | The commodity that should be initially selected when the combo box appears. |
Definition at line 447 of file dialog-commodity.c.
void gnc_ui_update_namespace_picker | ( | GtkWidget * | cbwe, |
const gchar * | sel, | ||
dialog_commodity_mode | mode | ||
) |
Given a combo box, fill in the known commodity namespaces and then select one.
cbwe | The widget to populate with information. |
sel | The namespace that should be initially selected when the combo box appears. |
mode | Determines which namespaces the user may select a commodity |