diff --git a/ChangeLog b/ChangeLog index 01b16d5a94..6b78df4d2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2006-04-15 David Hampton + * src/gnome-utils/gnc-tree-view-price.c: + * src/gnome-utils/dialog-account.c: + * src/gnome-utils/glade/commodity.glade: + * src/gnome-utils/dialog-commodity.c: + * src/gnome/gnc-plugin-basic-commands.c: + * src/gnome/glade/commodities.glade: + * src/gnome/glade/account.glade: + * src/gnome/glade/price.glade: + * src/gnome/dialog-commodities.c: Replace "commodity" with + "security" where it is user visible. If its possible to determine + that the user is operating on a currency instead of a commodity, + update titles/labels to specify "security". Fixes 338382. + * src/backend/file/io-gncxml-v2.c: * src/import-export/hbci/gnc-hbci-kvp.[ch]: * src/engine/Account.c: diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c index 7fed1d3722..3d2fce749c 100644 --- a/src/gnome-utils/dialog-account.c +++ b/src/gnome-utils/dialog-account.c @@ -1277,7 +1277,7 @@ gnc_account_window_create(AccountWindow *aw) gtk_box_pack_start(GTK_BOX(box), aw->commodity_edit, TRUE, TRUE, 0); gtk_widget_show (aw->commodity_edit); - label = glade_xml_get_widget (xml, "commodity_label"); + label = glade_xml_get_widget (xml, "security_label"); gnc_general_select_make_mnemonic_target (GNC_GENERAL_SELECT(aw->commodity_edit), label); g_signal_connect (G_OBJECT (aw->commodity_edit), "changed", diff --git a/src/gnome-utils/dialog-commodity.c b/src/gnome-utils/dialog-commodity.c index df487e85a3..d8bd229a01 100644 --- a/src/gnome-utils/dialog-commodity.c +++ b/src/gnome-utils/dialog-commodity.c @@ -229,20 +229,21 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel, { SelectCommodityWindow * retval = g_new0(SelectCommodityWindow, 1); GladeXML *xml; - const char * namespace, *title; - GtkWidget *button; + const char * namespace, *title, *text; + GtkWidget *button, *label; - xml = gnc_glade_xml_new ("commodity.glade", "Commodity Selector Dialog"); + xml = gnc_glade_xml_new ("commodity.glade", "Security Selector Dialog"); glade_xml_signal_autoconnect_full( xml, gnc_glade_autoconnect_full_func, retval ); - retval->dialog = glade_xml_get_widget (xml, "Commodity Selector Dialog"); + retval->dialog = glade_xml_get_widget (xml, "Security Selector Dialog"); retval->namespace_combo = glade_xml_get_widget (xml, "namespace_combo"); retval->commodity_combo = glade_xml_get_widget (xml, "commodity_combo"); retval->commodity_entry = glade_xml_get_widget (xml, "commodity_entry"); retval->select_user_prompt = glade_xml_get_widget (xml, "select_user_prompt"); retval->ok_button = glade_xml_get_widget (xml, "ok_button"); + label = glade_xml_get_widget (xml, "item_label"); gtk_label_set_text (GTK_LABEL (retval->select_user_prompt), ""); @@ -255,19 +256,23 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel, switch (mode) { case DIAG_COMM_ALL: - title = _("Select currency/security"); + title = _("Select security/currency"); + text = _("_Security/currency:"); break; case DIAG_COMM_NON_CURRENCY: title = _("Select security"); + text = _("_Security:"); break; case DIAG_COMM_CURRENCY: default: title = _("Select currency"); + text = _("Cu_rrency:"); button = glade_xml_get_widget (xml, "new_button"); gtk_widget_destroy(button); break; } gtk_window_set_title (GTK_WINDOW(retval->dialog), title); + gtk_label_set_text_with_mnemonic (GTK_LABEL(label), text); /* build the menus of namespaces and commodities */ gnc_ui_update_namespace_picker(retval->namespace_combo, @@ -825,29 +830,32 @@ gnc_ui_quote_tz_menu_create(void) /** Build the new/edit commodity dialog box */ static CommodityWindow * -gnc_ui_new_commodity_dialog(const char * selected_namespace, +gnc_ui_build_commodity_dialog(const char * selected_namespace, GtkWidget *parent, const char * fullname, const char * mnemonic, const char * cusip, - int fraction) + int fraction, + gboolean edit) { CommodityWindow * retval = g_new0(CommodityWindow, 1); GtkWidget *help_button; GtkWidget *box; GtkWidget *menu; - GtkWidget *widget; + GtkWidget *widget, *sec_label; GladeXML *xml; gboolean include_iso; + const gchar *title; + gchar *text; ENTER(" "); - xml = gnc_glade_xml_new ("commodity.glade", "Commodity Dialog"); + xml = gnc_glade_xml_new ("commodity.glade", "Security Dialog"); glade_xml_signal_autoconnect_full( xml, gnc_glade_autoconnect_full_func, retval ); - retval->dialog = glade_xml_get_widget (xml, "Commodity Dialog"); + retval->dialog = glade_xml_get_widget (xml, "Security Dialog"); if (parent != NULL) gtk_window_set_transient_for (GTK_WINDOW (retval->dialog), GTK_WINDOW (parent)); retval->edit_commodity = NULL; @@ -858,8 +866,8 @@ gnc_ui_new_commodity_dialog(const char * selected_namespace, /* Determine the commodity section of the dialog */ retval->table = glade_xml_get_widget (xml, "edit_table"); - widget = glade_xml_get_widget (xml, "commodity_label"); - gtk_container_child_get(GTK_CONTAINER(retval->table), widget, + sec_label = glade_xml_get_widget (xml, "security_label"); + gtk_container_child_get(GTK_CONTAINER(retval->table), sec_label, "bottom-attach", &retval->comm_section_top, NULL); widget = glade_xml_get_widget (xml, "quote_label"); gtk_container_child_get(GTK_CONTAINER(retval->table), widget, @@ -924,9 +932,16 @@ gnc_ui_new_commodity_dialog(const char * selected_namespace, retval->is_currency = TRUE; gnc_ui_update_commodity_info (retval); include_iso = TRUE; + title = _("Edit currency"); + text = g_strdup_printf("%s", _("Currency Information")); } else { include_iso = FALSE; + title = edit ? _("Edit security") : _("New security"); + text = g_strdup_printf("%s", _("Security Information")); } + gtk_window_set_title(GTK_WINDOW(retval->dialog), title); + gtk_label_set_markup(GTK_LABEL(sec_label), text); + g_free(text); /* Are price quotes supported */ if (gnc_quote_source_fq_installed()) { @@ -1032,8 +1047,9 @@ gnc_ui_common_commodity_modal(gnc_commodity *commodity, } } - win = gnc_ui_new_commodity_dialog(namespace, parent, fullname, - mnemonic, cusip, fraction); + win = gnc_ui_build_commodity_dialog(namespace, parent, fullname, + mnemonic, cusip, fraction, + (commodity != NULL)); /* Update stock quote info based on existing commodity */ gnc_ui_commodity_update_quote_info(win, commodity); @@ -1112,7 +1128,7 @@ gnc_ui_new_commodity_modal(const char * default_namespace, ********************************************************************/ /** Given an existing commodity, uses the - * gnc_ui_new_commodity_dialog() routine to build a basic edit + * 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. */ diff --git a/src/gnome-utils/glade/commodity.glade b/src/gnome-utils/glade/commodity.glade index 0dc115e9a6..9486ffd70b 100644 --- a/src/gnome-utils/glade/commodity.glade +++ b/src/gnome-utils/glade/commodity.glade @@ -4,9 +4,9 @@ - + 6 - Select currency/security + Select security/currency GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False @@ -287,9 +287,9 @@ 0 - + True - _Currency/security: + _Security/currency: True False GTK_JUSTIFY_CENTER @@ -323,9 +323,9 @@ - + 6 - New Commodity + New Security GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True @@ -645,9 +645,9 @@ - + True - <b>Commodity Information</b> + <b>Security Information</b> False True GTK_JUSTIFY_LEFT diff --git a/src/gnome-utils/gnc-tree-view-price.c b/src/gnome-utils/gnc-tree-view-price.c index caa2c345e9..d94ff8d690 100644 --- a/src/gnome-utils/gnc-tree-view-price.c +++ b/src/gnome-utils/gnc-tree-view-price.c @@ -430,7 +430,7 @@ gnc_tree_view_price_new (QofBook *book, sample_text = gnc_commodity_get_printname(gnc_default_currency()); sample_text2 = g_strdup_printf("%s%s", sample_text, sample_text); - gnc_tree_view_add_text_column (view, _("Commodity"), "commodity", NULL, + gnc_tree_view_add_text_column (view, _("Security"), "security", NULL, sample_text2, GNC_TREE_MODEL_PRICE_COL_COMMODITY, GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, diff --git a/src/gnome/dialog-commodities.c b/src/gnome/dialog-commodities.c index 3862941af6..e485b1c93a 100644 --- a/src/gnome/dialog-commodities.c +++ b/src/gnome/dialog-commodities.c @@ -292,8 +292,8 @@ gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd) GtkTreeView *view; GtkTreeSelection *selection; - xml = gnc_glade_xml_new ("commodities.glade", "Commodities Dialog"); - dialog = glade_xml_get_widget (xml, "Commodities Dialog"); + xml = gnc_glade_xml_new ("commodities.glade", "Securities Dialog"); + dialog = glade_xml_get_widget (xml, "Securities Dialog"); cd->dialog = dialog; cd->session = gnc_get_current_session(); diff --git a/src/gnome/glade/account.glade b/src/gnome/glade/account.glade index 6ebb346154..519aeef710 100644 --- a/src/gnome/glade/account.glade +++ b/src/gnome/glade/account.glade @@ -238,9 +238,9 @@ - + True - Co_mmodity: + _Security/currency: True False GTK_JUSTIFY_LEFT diff --git a/src/gnome/glade/commodities.glade b/src/gnome/glade/commodities.glade index 89bc1e334d..7de30d231b 100644 --- a/src/gnome/glade/commodities.glade +++ b/src/gnome/glade/commodities.glade @@ -3,8 +3,8 @@ - - Commodities + + Securities GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False @@ -165,7 +165,7 @@ True - <b>Commodities</b> + <b>Securities</b> True True GTK_JUSTIFY_LEFT diff --git a/src/gnome/glade/price.glade b/src/gnome/glade/price.glade index c3350204d7..7f0622cdaf 100644 --- a/src/gnome/glade/price.glade +++ b/src/gnome/glade/price.glade @@ -412,7 +412,7 @@ True - Co_mmodity: + _Security: True False GTK_JUSTIFY_CENTER @@ -483,7 +483,7 @@ - _Source: + S_ource: True False GTK_JUSTIFY_CENTER diff --git a/src/gnome/gnc-plugin-basic-commands.c b/src/gnome/gnc-plugin-basic-commands.c index febd23be9b..d204bb36bb 100644 --- a/src/gnome/gnc-plugin-basic-commands.c +++ b/src/gnome/gnc-plugin-basic-commands.c @@ -147,7 +147,7 @@ static GtkActionEntry gnc_plugin_actions [] = { { "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL, N_("View and edit the prices for stocks and mutual funds"), G_CALLBACK (gnc_main_window_cmd_tools_price_editor) }, - { "ToolsCommodityEditorAction", NULL, N_("_Commodity Editor"), NULL, + { "ToolsCommodityEditorAction", NULL, N_("_Security Editor"), NULL, N_("View and edit the commodities for stocks and mutual funds"), G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor) }, { "ToolsFinancialCalculatorAction", NULL, N_("_Financial Calculator"), NULL,