mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Clean up usage of the gnc_ui_update_namespace_picker function.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8656 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
b41960509e
commit
12cff36837
@ -1,3 +1,8 @@
|
|||||||
|
2003-06-22 David Hampton <hampton@employees.org>
|
||||||
|
|
||||||
|
* src/gnome-utils/dialog-commodity.[ch]: Clean up usage of the
|
||||||
|
gnc_ui_update_namespace_picker function.
|
||||||
|
|
||||||
2003-06-22 Derek Atkins <derek@ihtfp.com>
|
2003-06-22 Derek Atkins <derek@ihtfp.com>
|
||||||
|
|
||||||
* src/report/standard-reports/category-barchart.scm: Properly
|
* src/report/standard-reports/category-barchart.scm: Properly
|
||||||
|
@ -211,7 +211,7 @@ 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;
|
||||||
char * namespace;
|
const char * namespace;
|
||||||
|
|
||||||
xml = gnc_glade_xml_new ("commodity.glade", "Commodity Selector Dialog");
|
xml = gnc_glade_xml_new ("commodity.glade", "Commodity Selector Dialog");
|
||||||
glade_xml_signal_autoconnect_full( xml,
|
glade_xml_signal_autoconnect_full( xml,
|
||||||
@ -228,14 +228,12 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel)
|
|||||||
gtk_label_set_text ((GtkLabel *)retval->select_user_prompt, "");
|
gtk_label_set_text ((GtkLabel *)retval->select_user_prompt, "");
|
||||||
|
|
||||||
/* build the menus of namespaces and commodities */
|
/* build the menus of namespaces and commodities */
|
||||||
namespace =
|
gnc_ui_update_namespace_picker(retval->namespace_combo,
|
||||||
gnc_ui_update_namespace_picker(retval->namespace_combo,
|
gnc_commodity_get_namespace(orig_sel),
|
||||||
gnc_commodity_get_namespace(orig_sel),
|
TRUE, FALSE);
|
||||||
TRUE, FALSE);
|
namespace = gnc_ui_namespace_picker_ns(retval->namespace_combo);
|
||||||
gnc_ui_update_commodity_picker(retval->commodity_combo, namespace,
|
gnc_ui_update_commodity_picker(retval->commodity_combo, namespace,
|
||||||
gnc_commodity_get_printname(orig_sel));
|
gnc_commodity_get_printname(orig_sel));
|
||||||
g_free(namespace);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,14 +268,9 @@ gnc_ui_select_commodity_new_cb(GtkButton * button,
|
|||||||
w->default_mnemonic,
|
w->default_mnemonic,
|
||||||
w->default_fraction);
|
w->default_fraction);
|
||||||
if(new_commodity) {
|
if(new_commodity) {
|
||||||
char *namespace;
|
gnc_ui_update_namespace_picker(w->namespace_combo,
|
||||||
|
gnc_commodity_get_namespace(new_commodity),
|
||||||
namespace =
|
TRUE, FALSE);
|
||||||
gnc_ui_update_namespace_picker(w->namespace_combo,
|
|
||||||
gnc_commodity_get_namespace
|
|
||||||
(new_commodity),
|
|
||||||
TRUE, FALSE);
|
|
||||||
g_free(namespace);
|
|
||||||
gnc_ui_update_commodity_picker(w->commodity_combo,
|
gnc_ui_update_commodity_picker(w->commodity_combo,
|
||||||
gnc_commodity_get_namespace(new_commodity),
|
gnc_commodity_get_namespace(new_commodity),
|
||||||
gnc_commodity_get_printname(new_commodity));
|
gnc_commodity_get_printname(new_commodity));
|
||||||
@ -410,7 +403,7 @@ gnc_ui_update_commodity_picker(GtkWidget * combobox,
|
|||||||
* gnc_ui_update_namespace_picker
|
* gnc_ui_update_namespace_picker
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
char *
|
void
|
||||||
gnc_ui_update_namespace_picker(GtkWidget * combobox,
|
gnc_ui_update_namespace_picker(GtkWidget * combobox,
|
||||||
const char * init_string,
|
const char * init_string,
|
||||||
gboolean include_iso,
|
gboolean include_iso,
|
||||||
@ -476,15 +469,10 @@ gnc_ui_update_namespace_picker(GtkWidget * combobox,
|
|||||||
safe_strcmp (init_string, "CURRENCY") == 0)
|
safe_strcmp (init_string, "CURRENCY") == 0)
|
||||||
{
|
{
|
||||||
active = "CURRENCY";
|
active = "CURRENCY";
|
||||||
init_string = GNC_COMMODITY_NS_ISO;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
init_string = active;
|
|
||||||
|
|
||||||
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combobox)->entry), active);
|
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combobox)->entry), active);
|
||||||
g_list_free(namespaces);
|
g_list_free(namespaces);
|
||||||
|
|
||||||
return g_strdup (init_string);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
@ -563,7 +551,6 @@ gnc_ui_new_commodity_dialog(const char * selected_namespace,
|
|||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
GladeXML *xml;
|
GladeXML *xml;
|
||||||
gboolean include_iso;
|
gboolean include_iso;
|
||||||
char *temp;
|
|
||||||
|
|
||||||
ENTER(" ");
|
ENTER(" ");
|
||||||
xml = gnc_glade_xml_new ("commodity.glade", "Commodity Dialog");
|
xml = gnc_glade_xml_new ("commodity.glade", "Commodity Dialog");
|
||||||
@ -626,10 +613,9 @@ gnc_ui_new_commodity_dialog(const char * selected_namespace,
|
|||||||
|
|
||||||
gtk_entry_set_text (GTK_ENTRY (retval->fullname_entry), fullname ? fullname : "");
|
gtk_entry_set_text (GTK_ENTRY (retval->fullname_entry), fullname ? fullname : "");
|
||||||
gtk_entry_set_text (GTK_ENTRY (retval->mnemonic_entry), mnemonic ? mnemonic : "");
|
gtk_entry_set_text (GTK_ENTRY (retval->mnemonic_entry), mnemonic ? mnemonic : "");
|
||||||
temp = gnc_ui_update_namespace_picker(retval->namespace_combo,
|
gnc_ui_update_namespace_picker(retval->namespace_combo,
|
||||||
selected_namespace,
|
selected_namespace,
|
||||||
include_iso, TRUE);
|
include_iso, TRUE);
|
||||||
g_free(temp);
|
|
||||||
gtk_entry_set_text (GTK_ENTRY (retval->code_entry), cusip ? cusip : "");
|
gtk_entry_set_text (GTK_ENTRY (retval->code_entry), cusip ? cusip : "");
|
||||||
if (fraction > 0)
|
if (fraction > 0)
|
||||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (retval->fraction_spinbutton),
|
gtk_spin_button_set_value (GTK_SPIN_BUTTON (retval->fraction_spinbutton),
|
||||||
|
@ -207,10 +207,10 @@ gnc_ui_edit_commodity_modal(gnc_commodity *commodity,
|
|||||||
*
|
*
|
||||||
* @note The returned string must be freed by the caller.
|
* @note The returned string must be freed by the caller.
|
||||||
*/
|
*/
|
||||||
char * gnc_ui_update_namespace_picker(GtkWidget * combobox,
|
void gnc_ui_update_namespace_picker(GtkWidget * combobox,
|
||||||
const char * sel,
|
const char * sel,
|
||||||
gboolean include_iso,
|
gboolean include_iso,
|
||||||
gboolean include_all);
|
gboolean include_all);
|
||||||
|
|
||||||
/** Given a combo box, return the currently selected namespaces.
|
/** Given a combo box, return the currently selected namespaces.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user