[Gnucash-changes] r13789 - gnucash/trunk - Replace "commodity" with "security" where it is user visible. If its

David Hampton hampton at cvs.gnucash.org
Sat Apr 15 17:26:58 EDT 2006


Author: hampton
Date: 2006-04-15 17:26:56 -0400 (Sat, 15 Apr 2006)
New Revision: 13789
Trac: http://svn.gnucash.org/trac/changeset/13789

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/dialog-account.c
   gnucash/trunk/src/gnome-utils/dialog-commodity.c
   gnucash/trunk/src/gnome-utils/glade/commodity.glade
   gnucash/trunk/src/gnome-utils/gnc-tree-view-price.c
   gnucash/trunk/src/gnome/dialog-commodities.c
   gnucash/trunk/src/gnome/glade/account.glade
   gnucash/trunk/src/gnome/glade/commodities.glade
   gnucash/trunk/src/gnome/glade/price.glade
   gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
Log:
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.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/ChangeLog	2006-04-15 21:26:56 UTC (rev 13789)
@@ -1,5 +1,18 @@
 2006-04-15  David Hampton  <hampton at 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/import-export/hbci/gnc-hbci-kvp.[ch]:
 	* src/engine/Account.c:

Modified: gnucash/trunk/src/gnome/dialog-commodities.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-commodities.c	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome/dialog-commodities.c	2006-04-15 21:26:56 UTC (rev 13789)
@@ -292,8 +292,8 @@
   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();

Modified: gnucash/trunk/src/gnome/glade/account.glade
===================================================================
--- gnucash/trunk/src/gnome/glade/account.glade	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome/glade/account.glade	2006-04-15 21:26:56 UTC (rev 13789)
@@ -238,9 +238,9 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkLabel" id="commodity_label">
+			<widget class="GtkLabel" id="security_label">
 			  <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_markup">False</property>
 			  <property name="justify">GTK_JUSTIFY_LEFT</property>

Modified: gnucash/trunk/src/gnome/glade/commodities.glade
===================================================================
--- gnucash/trunk/src/gnome/glade/commodities.glade	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome/glade/commodities.glade	2006-04-15 21:26:56 UTC (rev 13789)
@@ -3,8 +3,8 @@
 
 <glade-interface>
 
-<widget class="GtkDialog" id="Commodities Dialog">
-  <property name="title" translatable="yes">Commodities</property>
+<widget class="GtkDialog" id="Securities Dialog">
+  <property name="title" translatable="yes">Securities</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">False</property>
@@ -165,7 +165,7 @@
 	  <child>
 	    <widget class="GtkLabel" id="label1">
 	      <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_markup">True</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>

Modified: gnucash/trunk/src/gnome/glade/price.glade
===================================================================
--- gnucash/trunk/src/gnome/glade/price.glade	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome/glade/price.glade	2006-04-15 21:26:56 UTC (rev 13789)
@@ -412,7 +412,7 @@
 	  <child>
 	    <widget class="GtkLabel" id="commodity_label">
 	      <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_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_CENTER</property>
@@ -483,7 +483,7 @@
 
 	  <child>
 	    <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_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_CENTER</property>

Modified: gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c	2006-04-15 21:26:56 UTC (rev 13789)
@@ -147,7 +147,7 @@
   { "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,

Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c	2006-04-15 21:26:56 UTC (rev 13789)
@@ -1277,7 +1277,7 @@
   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",

Modified: gnucash/trunk/src/gnome-utils/dialog-commodity.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-commodity.c	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome-utils/dialog-commodity.c	2006-04-15 21:26:56 UTC (rev 13789)
@@ -229,20 +229,21 @@
 {
   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 @@
 
   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 @@
 /** 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 @@
 
   /* 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 @@
     retval->is_currency = TRUE;
     gnc_ui_update_commodity_info (retval);
     include_iso = TRUE;
+    title = _("Edit currency");
+    text = g_strdup_printf("<b>%s</b>", _("Currency Information"));
   } else {
     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 */
   if (gnc_quote_source_fq_installed()) {
@@ -1032,8 +1047,9 @@
     }
   }
 
-  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 @@
  ********************************************************************/
 
 /** 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.
  */

Modified: gnucash/trunk/src/gnome-utils/glade/commodity.glade
===================================================================
--- gnucash/trunk/src/gnome-utils/glade/commodity.glade	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome-utils/glade/commodity.glade	2006-04-15 21:26:56 UTC (rev 13789)
@@ -4,9 +4,9 @@
 <glade-interface>
 <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="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="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">False</property>
@@ -287,9 +287,9 @@
 	      <property name="right_padding">0</property>
 
 	      <child>
-		<widget class="GtkLabel" id="label808">
+		<widget class="GtkLabel" id="item_label">
 		  <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_markup">False</property>
 		  <property name="justify">GTK_JUSTIFY_CENTER</property>
@@ -323,9 +323,9 @@
   </child>
 </widget>
 
-<widget class="GtkDialog" id="Commodity Dialog">
+<widget class="GtkDialog" id="Security Dialog">
   <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="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">True</property>
@@ -645,9 +645,9 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="commodity_label">
+	    <widget class="GtkLabel" id="security_label">
 	      <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_markup">True</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view-price.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-price.c	2006-04-15 18:50:59 UTC (rev 13788)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-price.c	2006-04-15 21:26:56 UTC (rev 13789)
@@ -430,7 +430,7 @@
 
   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,



More information about the gnucash-changes mailing list