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.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13789 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-04-15 21:26:56 +00:00
parent c29ce7478d
commit 54374be00d
10 changed files with 64 additions and 35 deletions

View File

@ -1,5 +1,18 @@
2006-04-15 David Hampton <hampton@employees.org> 2006-04-15 David Hampton <hampton@employees.org>
* 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/backend/file/io-gncxml-v2.c:
* src/import-export/hbci/gnc-hbci-kvp.[ch]: * src/import-export/hbci/gnc-hbci-kvp.[ch]:
* src/engine/Account.c: * src/engine/Account.c:

View File

@ -1277,7 +1277,7 @@ gnc_account_window_create(AccountWindow *aw)
gtk_box_pack_start(GTK_BOX(box), aw->commodity_edit, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(box), aw->commodity_edit, TRUE, TRUE, 0);
gtk_widget_show (aw->commodity_edit); 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); gnc_general_select_make_mnemonic_target (GNC_GENERAL_SELECT(aw->commodity_edit), label);
g_signal_connect (G_OBJECT (aw->commodity_edit), "changed", g_signal_connect (G_OBJECT (aw->commodity_edit), "changed",

View File

@ -229,20 +229,21 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel,
{ {
SelectCommodityWindow * retval = g_new0(SelectCommodityWindow, 1); SelectCommodityWindow * retval = g_new0(SelectCommodityWindow, 1);
GladeXML *xml; GladeXML *xml;
const char * namespace, *title; const char * namespace, *title, *text;
GtkWidget *button; 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, glade_xml_signal_autoconnect_full( xml,
gnc_glade_autoconnect_full_func, gnc_glade_autoconnect_full_func,
retval ); 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->namespace_combo = glade_xml_get_widget (xml, "namespace_combo");
retval->commodity_combo = glade_xml_get_widget (xml, "commodity_combo"); retval->commodity_combo = glade_xml_get_widget (xml, "commodity_combo");
retval->commodity_entry = glade_xml_get_widget (xml, "commodity_entry"); retval->commodity_entry = glade_xml_get_widget (xml, "commodity_entry");
retval->select_user_prompt = glade_xml_get_widget (xml, "select_user_prompt"); retval->select_user_prompt = glade_xml_get_widget (xml, "select_user_prompt");
retval->ok_button = glade_xml_get_widget (xml, "ok_button"); 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), ""); 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) { switch (mode) {
case DIAG_COMM_ALL: case DIAG_COMM_ALL:
title = _("Select currency/security"); title = _("Select security/currency");
text = _("_Security/currency:");
break; break;
case DIAG_COMM_NON_CURRENCY: case DIAG_COMM_NON_CURRENCY:
title = _("Select security"); title = _("Select security");
text = _("_Security:");
break; break;
case DIAG_COMM_CURRENCY: case DIAG_COMM_CURRENCY:
default: default:
title = _("Select currency"); title = _("Select currency");
text = _("Cu_rrency:");
button = glade_xml_get_widget (xml, "new_button"); button = glade_xml_get_widget (xml, "new_button");
gtk_widget_destroy(button); gtk_widget_destroy(button);
break; break;
} }
gtk_window_set_title (GTK_WINDOW(retval->dialog), title); 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 */ /* build the menus of namespaces and commodities */
gnc_ui_update_namespace_picker(retval->namespace_combo, 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 /** Build the new/edit commodity dialog box
*/ */
static CommodityWindow * static CommodityWindow *
gnc_ui_new_commodity_dialog(const char * selected_namespace, gnc_ui_build_commodity_dialog(const char * selected_namespace,
GtkWidget *parent, GtkWidget *parent,
const char * fullname, const char * fullname,
const char * mnemonic, const char * mnemonic,
const char * cusip, const char * cusip,
int fraction) int fraction,
gboolean edit)
{ {
CommodityWindow * retval = g_new0(CommodityWindow, 1); CommodityWindow * retval = g_new0(CommodityWindow, 1);
GtkWidget *help_button; GtkWidget *help_button;
GtkWidget *box; GtkWidget *box;
GtkWidget *menu; GtkWidget *menu;
GtkWidget *widget; GtkWidget *widget, *sec_label;
GladeXML *xml; GladeXML *xml;
gboolean include_iso; gboolean include_iso;
const gchar *title;
gchar *text;
ENTER(" "); 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, glade_xml_signal_autoconnect_full( xml,
gnc_glade_autoconnect_full_func, gnc_glade_autoconnect_full_func,
retval ); retval );
retval->dialog = glade_xml_get_widget (xml, "Commodity Dialog"); retval->dialog = glade_xml_get_widget (xml, "Security Dialog");
if (parent != NULL) if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW (retval->dialog), GTK_WINDOW (parent)); gtk_window_set_transient_for (GTK_WINDOW (retval->dialog), GTK_WINDOW (parent));
retval->edit_commodity = NULL; retval->edit_commodity = NULL;
@ -858,8 +866,8 @@ gnc_ui_new_commodity_dialog(const char * selected_namespace,
/* Determine the commodity section of the dialog */ /* Determine the commodity section of the dialog */
retval->table = glade_xml_get_widget (xml, "edit_table"); retval->table = glade_xml_get_widget (xml, "edit_table");
widget = glade_xml_get_widget (xml, "commodity_label"); sec_label = glade_xml_get_widget (xml, "security_label");
gtk_container_child_get(GTK_CONTAINER(retval->table), widget, gtk_container_child_get(GTK_CONTAINER(retval->table), sec_label,
"bottom-attach", &retval->comm_section_top, NULL); "bottom-attach", &retval->comm_section_top, NULL);
widget = glade_xml_get_widget (xml, "quote_label"); widget = glade_xml_get_widget (xml, "quote_label");
gtk_container_child_get(GTK_CONTAINER(retval->table), widget, 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; retval->is_currency = TRUE;
gnc_ui_update_commodity_info (retval); gnc_ui_update_commodity_info (retval);
include_iso = TRUE; include_iso = TRUE;
title = _("Edit currency");
text = g_strdup_printf("<b>%s</b>", _("Currency Information"));
} else { } else {
include_iso = FALSE; include_iso = FALSE;
title = edit ? _("Edit security") : _("New security");
text = g_strdup_printf("<b>%s</b>", _("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 */ /* Are price quotes supported */
if (gnc_quote_source_fq_installed()) { 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, win = gnc_ui_build_commodity_dialog(namespace, parent, fullname,
mnemonic, cusip, fraction); mnemonic, cusip, fraction,
(commodity != NULL));
/* Update stock quote info based on existing commodity */ /* Update stock quote info based on existing commodity */
gnc_ui_commodity_update_quote_info(win, 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 /** 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 * dialog, then fills in the price quote information at the bottom of
* the dialog. * the dialog.
*/ */

View File

@ -4,9 +4,9 @@
<glade-interface> <glade-interface>
<requires lib="gnome"/> <requires lib="gnome"/>
<widget class="GtkDialog" id="Commodity Selector Dialog"> <widget class="GtkDialog" id="Security Selector Dialog">
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Select currency/security </property> <property name="title" translatable="yes">Select security/currency </property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property> <property name="modal">False</property>
@ -287,9 +287,9 @@
<property name="right_padding">0</property> <property name="right_padding">0</property>
<child> <child>
<widget class="GtkLabel" id="label808"> <widget class="GtkLabel" id="item_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">_Currency/security:</property> <property name="label">_Security/currency:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
@ -323,9 +323,9 @@
</child> </child>
</widget> </widget>
<widget class="GtkDialog" id="Commodity Dialog"> <widget class="GtkDialog" id="Security Dialog">
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">New Commodity</property> <property name="title">New Security</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property> <property name="modal">True</property>
@ -645,9 +645,9 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="commodity_label"> <widget class="GtkLabel" id="security_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Commodity Information&lt;/b&gt;</property> <property name="label">&lt;b&gt;Security Information&lt;/b&gt;</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>

View File

@ -430,7 +430,7 @@ gnc_tree_view_price_new (QofBook *book,
sample_text = gnc_commodity_get_printname(gnc_default_currency()); sample_text = gnc_commodity_get_printname(gnc_default_currency());
sample_text2 = g_strdup_printf("%s%s", sample_text, sample_text); 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, sample_text2,
GNC_TREE_MODEL_PRICE_COL_COMMODITY, GNC_TREE_MODEL_PRICE_COL_COMMODITY,
GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,

View File

@ -292,8 +292,8 @@ gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd)
GtkTreeView *view; GtkTreeView *view;
GtkTreeSelection *selection; GtkTreeSelection *selection;
xml = gnc_glade_xml_new ("commodities.glade", "Commodities Dialog"); xml = gnc_glade_xml_new ("commodities.glade", "Securities Dialog");
dialog = glade_xml_get_widget (xml, "Commodities Dialog"); dialog = glade_xml_get_widget (xml, "Securities Dialog");
cd->dialog = dialog; cd->dialog = dialog;
cd->session = gnc_get_current_session(); cd->session = gnc_get_current_session();

View File

@ -238,9 +238,9 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="commodity_label"> <widget class="GtkLabel" id="security_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Co_mmodity:</property> <property name="label" translatable="yes">_Security/currency:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>

View File

@ -3,8 +3,8 @@
<glade-interface> <glade-interface>
<widget class="GtkDialog" id="Commodities Dialog"> <widget class="GtkDialog" id="Securities Dialog">
<property name="title" translatable="yes">Commodities</property> <property name="title" translatable="yes">Securities</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property> <property name="modal">False</property>
@ -165,7 +165,7 @@
<child> <child>
<widget class="GtkLabel" id="label1"> <widget class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Commodities&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Securities&lt;/b&gt;</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>

View File

@ -412,7 +412,7 @@
<child> <child>
<widget class="GtkLabel" id="commodity_label"> <widget class="GtkLabel" id="commodity_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Co_mmodity:</property> <property name="label" translatable="yes">_Security:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
@ -483,7 +483,7 @@
<child> <child>
<widget class="GtkLabel" id="source_label"> <widget class="GtkLabel" id="source_label">
<property name="label" translatable="yes">_Source:</property> <property name="label" translatable="yes">S_ource:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>

View File

@ -147,7 +147,7 @@ static GtkActionEntry gnc_plugin_actions [] = {
{ "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL, { "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL,
N_("View and edit the prices for stocks and mutual funds"), N_("View and edit the prices for stocks and mutual funds"),
G_CALLBACK (gnc_main_window_cmd_tools_price_editor) }, 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"), N_("View and edit the commodities for stocks and mutual funds"),
G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor) }, G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor) },
{ "ToolsFinancialCalculatorAction", NULL, N_("_Financial Calculator"), NULL, { "ToolsFinancialCalculatorAction", NULL, N_("_Financial Calculator"), NULL,