Bug #655518 Migrate Price / Securities from GladeXML to Builder

Patch by Robert Fewell

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21120 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens
2011-08-07 09:15:12 +00:00
parent d689c0ecd0
commit 7519d18404
9 changed files with 1214 additions and 1625 deletions

View File

@@ -3,6 +3,7 @@
* (GnuCash) *
* Copyright (C) 2000 Bill Gribble <grib@billgribble.com> *
* Copyright (c) 2006 David Hampton <hampton@employees.org> *
* Copyright (c) 2011 Robert Fewell *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@@ -47,6 +48,7 @@
#include "gnc-ui-util.h"
#include "gnc-ui.h"
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
enum
@@ -128,7 +130,6 @@ static void gnc_ui_select_commodity_response_cb (GtkDialog * dialog, gint respon
/********************************************************************
* gnc_ui_commodity_set_help_callback
********************************************************************/
void
gnc_ui_commodity_set_help_callback (gnc_commodity_help_callback cb)
{
@@ -215,10 +216,10 @@ gnc_ui_select_commodity_modal_full(gnc_commodity * orig_sel,
return retval;
}
/********************************************************************
* gnc_ui_select_commodity_modal()
********************************************************************/
gnc_commodity *
gnc_ui_select_commodity_modal(gnc_commodity * orig_sel,
GtkWidget * parent,
@@ -237,28 +238,61 @@ gnc_ui_select_commodity_modal(gnc_commodity * orig_sel,
/********************************************************************
* gnc_ui_select_commodity_create()
********************************************************************/
static SelectCommodityWindow *
gnc_ui_select_commodity_create(const gnc_commodity * orig_sel,
dialog_commodity_mode mode)
{
SelectCommodityWindow * retval = g_new0(SelectCommodityWindow, 1);
GladeXML *xml;
GtkBuilder *builder;
const char *title, *text;
gchar *namespace;
GtkWidget *button, *label;
xml = gnc_glade_xml_new ("commodity.glade", "Security Selector Dialog");
glade_xml_signal_autoconnect_full( xml,
gnc_glade_autoconnect_full_func,
retval );
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"commodity.glade", "Security Selector Dialog");
retval->dialog = glade_xml_get_widget (xml, "Security Selector Dialog");
retval->namespace_combo = glade_xml_get_widget (xml, "namespace_cbe");
retval->commodity_combo = glade_xml_get_widget (xml, "commodity_cbe");
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_builder_connect_signals_full (builder, gnc_builder_connect_full_func, retval);
retval->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Security Selector Dialog"));
retval->namespace_combo = GTK_WIDGET(gtk_builder_get_object (builder, "ss_namespace_cbe"));
retval->commodity_combo = GTK_WIDGET(gtk_builder_get_object (builder, "ss_commodity_cbe"));
retval->select_user_prompt = GTK_WIDGET(gtk_builder_get_object (builder, "select_user_prompt"));
retval->ok_button = GTK_WIDGET(gtk_builder_get_object (builder, "ss_ok_button"));
label = GTK_WIDGET(gtk_builder_get_object (builder, "item_label"));
/* namespace List Store - create here as we get an error if created in builder */
{
GtkListStore *store;
GtkTreeIter iter;
gchar string[] = "Dummy namespace Line";
store = gtk_list_store_new( 1, G_TYPE_STRING );
gtk_list_store_append( store, &iter );
gtk_list_store_set( store, &iter, 0, string, -1 );
gtk_combo_box_set_model( GTK_COMBO_BOX( retval->namespace_combo ),
GTK_TREE_MODEL( store ) );
g_object_unref( G_OBJECT( store ) );
gtk_combo_box_entry_set_text_column( GTK_COMBO_BOX_ENTRY( retval->namespace_combo ), 0 );
}
/* commodity List Store - create here as we get an error if created in builder */
{
GtkListStore *store;
GtkTreeIter iter;
gchar string[] = "Dummy commodity Line";
store = gtk_list_store_new( 1, G_TYPE_STRING );
gtk_list_store_append( store, &iter );
gtk_list_store_set( store, &iter, 0, string, -1 );
gtk_combo_box_set_model( GTK_COMBO_BOX( retval->commodity_combo ),
GTK_TREE_MODEL( store ) );
g_object_unref( G_OBJECT( store ) );
gtk_combo_box_entry_set_text_column( GTK_COMBO_BOX_ENTRY( retval->commodity_combo ), 0 );
}
gtk_combo_box_remove_text(GTK_COMBO_BOX(retval->namespace_combo), 0);
gtk_combo_box_remove_text(GTK_COMBO_BOX(retval->commodity_combo), 0);
@@ -288,7 +322,7 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel,
default:
title = _("Select currency");
text = _("Cu_rrency:");
button = glade_xml_get_widget (xml, "new_button");
button = GTK_WIDGET(gtk_builder_get_object (builder, "ss_new_button"));
gtk_widget_destroy(button);
break;
}
@@ -302,6 +336,9 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel,
namespace = gnc_ui_namespace_picker_ns(retval->namespace_combo);
gnc_ui_update_commodity_picker(retval->commodity_combo, namespace,
gnc_commodity_get_printname(orig_sel));
g_object_unref(G_OBJECT(builder));
g_free(namespace);
return retval;
}
@@ -443,6 +480,7 @@ gnc_ui_update_commodity_picker (GtkWidget *cbe,
GList * iterator = NULL;
GList * commodity_items = NULL;
GtkComboBox *combo_box;
GtkEntry *entry;
GtkTreeModel *model;
gnc_commodity_table *table;
gint current = 0, match = 0;
@@ -455,6 +493,11 @@ gnc_ui_update_commodity_picker (GtkWidget *cbe,
combo_box = GTK_COMBO_BOX(cbe);
model = gtk_combo_box_get_model(combo_box);
gtk_list_store_clear(GTK_LIST_STORE(model));
/* Erase the entry text */
entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo_box)));
gtk_editable_delete_text(GTK_EDITABLE(entry),0,-1);
gtk_combo_box_set_active(combo_box, -1);
table = gnc_commodity_table_get_table (gnc_get_current_book ());
@@ -483,9 +526,8 @@ gnc_ui_update_commodity_picker (GtkWidget *cbe,
/********************************************************************
* gnc_ui_update_namespace_picker
* gnc_ui_select_commodity_destroy
********************************************************************/
#if 0
void
gnc_ui_select_commodity_destroy(SelectCommodityWindow * w)
@@ -495,10 +537,10 @@ gnc_ui_select_commodity_destroy(SelectCommodityWindow * w)
gtk_widget_destroy (GTK_WIDGET (w->dialog));
}
/********************************************************************
* gnc_ui_select_commodity_ok_cb()
********************************************************************/
/********************************************************************
* gnc_ui_select_commodity_response_cb
********************************************************************/
static void
gnc_ui_select_commodity_response_cb (GtkDialog * dialog, gint response, gpointer data)
{
@@ -561,6 +603,7 @@ gnc_ui_select_commodity_response_cb (GtkDialog * dialog, gint response, gpointer
}
#endif
/********************************************************************
*
* Commodity Selector dialog routines are above this line.
@@ -568,7 +611,6 @@ gnc_ui_select_commodity_response_cb (GtkDialog * dialog, gint response, gpointer
* Commodity New/Edit dialog routines are below this line.
*
********************************************************************/
static void
gnc_set_commodity_section_sensitivity (GtkWidget *widget, gpointer user_data)
{
@@ -584,6 +626,7 @@ gnc_set_commodity_section_sensitivity (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive(widget, !cw->is_currency);
}
static void
gnc_ui_update_commodity_info (CommodityWindow *cw)
{
@@ -591,6 +634,7 @@ gnc_ui_update_commodity_info (CommodityWindow *cw)
gnc_set_commodity_section_sensitivity, cw);
}
static void
gnc_set_fq_sensitivity (GtkWidget *widget, gpointer user_data)
{
@@ -606,6 +650,7 @@ gnc_set_fq_sensitivity (GtkWidget *widget, gpointer user_data)
g_object_set(widget, "sensitive", FALSE, NULL);
}
static void
gnc_ui_update_fq_info (CommodityWindow *cw)
{
@@ -613,10 +658,10 @@ gnc_ui_update_fq_info (CommodityWindow *cw)
gnc_set_fq_sensitivity, cw);
}
/********************************************************************
* gnc_ui_update_namespace_picker
********************************************************************/
void
gnc_ui_update_namespace_picker (GtkWidget *cbe,
const char * init_string,
@@ -627,7 +672,7 @@ gnc_ui_update_namespace_picker (GtkWidget *cbe,
GList *namespaces, *node;
gint current = 0, match = 0;
g_return_if_fail(GTK_IS_COMBO_BOX_ENTRY(cbe));
g_return_if_fail(GTK_IS_COMBO_BOX_ENTRY (cbe));
/* Erase the old entries */
combo_box = GTK_COMBO_BOX(cbe);
@@ -669,7 +714,9 @@ gnc_ui_update_namespace_picker (GtkWidget *cbe,
{
if (g_utf8_collate(node->data, GNC_COMMODITY_NS_LEGACY) == 0)
continue;
gtk_combo_box_append_text(combo_box, node->data);
/* Hide the template entry */
if (g_utf8_collate(node->data, "template" ) != 0)
gtk_combo_box_append_text(combo_box, node->data);
if (init_string && (g_utf8_collate(node->data, init_string) == 0))
match = current;
current++;
@@ -679,6 +726,7 @@ gnc_ui_update_namespace_picker (GtkWidget *cbe,
g_list_free(namespaces);
}
gchar *
gnc_ui_namespace_picker_ns (GtkWidget *cbe)
{
@@ -698,8 +746,10 @@ gnc_ui_namespace_picker_ns (GtkWidget *cbe)
return namespace;
}
/********************************************************************/
/********************************************************************
* gnc_ui_commodity_quote_info_cb *
*******************************************************************/
void
gnc_ui_commodity_quote_info_cb (GtkWidget *w, gpointer data)
{
@@ -730,6 +780,7 @@ gnc_ui_commodity_quote_info_cb (GtkWidget *w, gpointer data)
LEAVE(" ");
}
void
gnc_ui_commodity_changed_cb(GtkWidget * dummy, gpointer user_data)
{
@@ -759,6 +810,7 @@ gnc_ui_commodity_changed_cb(GtkWidget * dummy, gpointer user_data)
LEAVE("sensitive=%d, default = %d", ok, ok ? 0 : 1);
}
/********************************************************************\
* gnc_ui_source_menu_create *
* create the menu of stock quote sources *
@@ -818,10 +870,10 @@ gnc_ui_source_menu_create(QuoteSourceType type)
return combo;
}
/********************************************************************\
* price quote timezone handling
*/
/********************************************************************
* price quote timezone handling *
*******************************************************************/
static gchar *
known_timezones[] =
{
@@ -834,6 +886,7 @@ known_timezones[] =
NULL
};
static guint
gnc_find_timezone_menu_position(const gchar *timezone)
{
@@ -855,6 +908,7 @@ gnc_find_timezone_menu_position(const gchar *timezone)
return 0;
}
static gchar *
gnc_timezone_menu_position_to_string(guint pos)
{
@@ -862,6 +916,7 @@ gnc_timezone_menu_position_to_string(guint pos)
return known_timezones[pos - 1];
}
static GtkWidget *
gnc_ui_quote_tz_menu_create(void)
{
@@ -885,8 +940,10 @@ gnc_ui_quote_tz_menu_create(void)
return combo;
}
/** Build the new/edit commodity dialog box
*/
/*******************************************************
* Build the new/edit commodity dialog box *
*******************************************************/
static CommodityWindow *
gnc_ui_build_commodity_dialog(const char * selected_namespace,
GtkWidget *parent,
@@ -901,53 +958,71 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
GtkWidget *box;
GtkWidget *menu;
GtkWidget *widget, *sec_label;
GladeXML *xml;
GtkBuilder *builder;
gboolean include_iso;
const gchar *title;
gchar *text;
ENTER(" ");
xml = gnc_glade_xml_new ("commodity.glade", "Security Dialog");
ENTER("widget=%p, selected namespace=%s, fullname=%s, mnemonic=%s",
parent, selected_namespace, fullname, mnemonic);
glade_xml_signal_autoconnect_full( xml,
gnc_glade_autoconnect_full_func,
retval );
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"commodity.glade", "adjustment1");
gnc_builder_add_from_file (builder,"commodity.glade", "Security Dialog");
retval->dialog = glade_xml_get_widget (xml, "Security Dialog");
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, retval);
retval->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Security Dialog"));
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW (retval->dialog), GTK_WINDOW (parent));
retval->edit_commodity = NULL;
help_button = glade_xml_get_widget (xml, "help_button");
help_button = GTK_WIDGET(gtk_builder_get_object (builder, "help_button"));
if (!help_callback)
gtk_widget_hide (help_button);
/* Determine the commodity section of the dialog */
retval->table = glade_xml_get_widget (xml, "edit_table");
sec_label = glade_xml_get_widget (xml, "security_label");
retval->table = GTK_WIDGET(gtk_builder_get_object (builder, "edit_table"));
sec_label = GTK_WIDGET(gtk_builder_get_object (builder, "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");
widget = GTK_WIDGET(gtk_builder_get_object (builder, "quote_label"));
gtk_container_child_get(GTK_CONTAINER(retval->table), widget,
"top-attach", &retval->comm_section_bottom, NULL);
/* Get widget pointers */
retval->fullname_entry = glade_xml_get_widget (xml, "fullname_entry");
retval->mnemonic_entry = glade_xml_get_widget (xml, "mnemonic_entry");
retval->namespace_combo = glade_xml_get_widget (xml, "namespace_cbe");
retval->code_entry = glade_xml_get_widget (xml, "code_entry");
retval->fraction_spinbutton = glade_xml_get_widget (xml,
"fraction_spinbutton");
retval->ok_button = glade_xml_get_widget (xml, "ok_button");
retval->get_quote_check = glade_xml_get_widget (xml, "get_quote_check");
retval->source_label = glade_xml_get_widget (xml, "source_label");
retval->source_button[SOURCE_SINGLE] = glade_xml_get_widget (xml, "single_source_button");
retval->source_button[SOURCE_MULTI] = glade_xml_get_widget (xml, "multi_source_button");
retval->quote_tz_label = glade_xml_get_widget (xml, "quote_tz_label");
retval->fullname_entry = GTK_WIDGET(gtk_builder_get_object (builder, "fullname_entry"));
retval->mnemonic_entry = GTK_WIDGET(gtk_builder_get_object (builder, "mnemonic_entry"));
retval->namespace_combo = GTK_WIDGET(gtk_builder_get_object (builder, "namespace_cbe"));
retval->code_entry = GTK_WIDGET(gtk_builder_get_object (builder, "code_entry"));
retval->fraction_spinbutton = GTK_WIDGET(gtk_builder_get_object (builder,
"fraction_spinbutton"));
retval->ok_button = GTK_WIDGET(gtk_builder_get_object (builder, "ok_button"));
retval->get_quote_check = GTK_WIDGET(gtk_builder_get_object (builder, "get_quote_check"));
retval->source_label = GTK_WIDGET(gtk_builder_get_object (builder, "source_label"));
retval->source_button[SOURCE_SINGLE] = GTK_WIDGET(gtk_builder_get_object (builder, "single_source_button"));
retval->source_button[SOURCE_MULTI] = GTK_WIDGET(gtk_builder_get_object (builder, "multi_source_button"));
retval->quote_tz_label = GTK_WIDGET(gtk_builder_get_object (builder, "quote_tz_label"));
/* namespace List Store - create here as we get an error if created in builder */
{
GtkListStore *store;
GtkTreeIter iter;
gchar string[] = "Dummy namespace Line";
store = gtk_list_store_new( 1, G_TYPE_STRING );
gtk_list_store_append( store, &iter );
gtk_list_store_set( store, &iter, 0, string, -1 );
gtk_combo_box_set_model( GTK_COMBO_BOX( retval->namespace_combo ),
GTK_TREE_MODEL( store ) );
g_object_unref( G_OBJECT( store ) );
gtk_combo_box_entry_set_text_column( GTK_COMBO_BOX_ENTRY( retval->namespace_combo ), 0 );
}
/* Build custom widgets */
box = glade_xml_get_widget (xml, "single_source_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "single_source_box"));
if (gnc_commodity_namespace_is_iso(selected_namespace))
{
menu = gnc_ui_source_menu_create(SOURCE_CURRENCY);
@@ -959,7 +1034,7 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
retval->source_menu[SOURCE_SINGLE] = menu;
gtk_box_pack_start(GTK_BOX(box), menu, TRUE, TRUE, 0);
box = glade_xml_get_widget (xml, "multi_source_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "multi_source_box"));
menu = gnc_ui_source_menu_create(SOURCE_MULTI);
retval->source_menu[SOURCE_MULTI] = menu;
gtk_box_pack_start(GTK_BOX(box), menu, TRUE, TRUE, 0);
@@ -967,8 +1042,8 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
if (gnc_quote_source_num_entries(SOURCE_UNKNOWN))
{
retval->source_button[SOURCE_UNKNOWN] =
glade_xml_get_widget (xml, "unknown_source_button");
box = glade_xml_get_widget (xml, "unknown_source_box");
GTK_WIDGET(gtk_builder_get_object (builder, "unknown_source_button"));
box = GTK_WIDGET(gtk_builder_get_object (builder, "unknown_source_box"));
menu = gnc_ui_source_menu_create(SOURCE_UNKNOWN);
retval->source_menu[SOURCE_UNKNOWN] = menu;
gtk_box_pack_start(GTK_BOX(box), menu, TRUE, TRUE, 0);
@@ -977,20 +1052,19 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
{
guint row;
widget = glade_xml_get_widget (xml, "unknown_source_alignment");
widget = GTK_WIDGET(gtk_builder_get_object (builder, "unknown_source_alignment"));
gtk_container_child_get(GTK_CONTAINER(retval->table), widget,
"top-attach", &row, NULL);
gtk_table_set_row_spacing(GTK_TABLE(retval->table), row, 0);
gtk_widget_destroy(widget);
widget = glade_xml_get_widget (xml, "unknown_source_box");
widget = GTK_WIDGET(gtk_builder_get_object (builder, "unknown_source_box"));
gtk_widget_destroy(widget);
}
box = glade_xml_get_widget (xml, "quote_tz_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "quote_tz_box"));
retval->quote_tz_menu = gnc_ui_quote_tz_menu_create();
gtk_box_pack_start(GTK_BOX(box), retval->quote_tz_menu, TRUE, TRUE, 0);
/* Commodity editing is next to nil */
if (gnc_commodity_namespace_is_iso(selected_namespace))
{
@@ -1013,27 +1087,25 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
/* Are price quotes supported */
if (gnc_quote_source_fq_installed())
{
gtk_widget_destroy(glade_xml_get_widget (xml, "finance_quote_warning"));
gtk_widget_destroy(GTK_WIDGET(gtk_builder_get_object (builder, "finance_quote_warning")));
}
else
{
/* Determine the price quote of the dialog */
widget = glade_xml_get_widget (xml, "fq_warning_alignment");
widget = GTK_WIDGET(gtk_builder_get_object (builder, "fq_warning_alignment"));
gtk_container_child_get(GTK_CONTAINER(retval->table), widget,
"bottom-attach", &retval->fq_section_top, NULL);
widget = glade_xml_get_widget (xml, "quote_tz_alignment");
widget = GTK_WIDGET(gtk_builder_get_object (builder, "quote_tz_alignment"));
gtk_container_child_get(GTK_CONTAINER(retval->table), widget,
"bottom-attach", &retval->fq_section_bottom, NULL);
gnc_ui_update_fq_info (retval);
}
#ifdef DRH
g_signal_connect (G_OBJECT (retval->dialog), "close",
G_CALLBACK (commodity_close), retval);
#endif
/* Fill in any data, top to bottom */
gtk_entry_set_text (GTK_ENTRY (retval->fullname_entry), fullname ? fullname : "");
gtk_entry_set_text (GTK_ENTRY (retval->mnemonic_entry), mnemonic ? mnemonic : "");
gnc_cbe_add_completion(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
@@ -1042,10 +1114,13 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
selected_namespace,
include_iso ? DIAG_COMM_ALL : DIAG_COMM_NON_CURRENCY);
gtk_entry_set_text (GTK_ENTRY (retval->code_entry), cusip ? cusip : "");
if (fraction > 0)
gtk_spin_button_set_value (GTK_SPIN_BUTTON (retval->fraction_spinbutton),
fraction);
g_object_unref(G_OBJECT(builder));
LEAVE(" ");
return retval;
}
@@ -1168,9 +1243,9 @@ gnc_ui_common_commodity_modal(gnc_commodity *commodity,
}
/** Create and run the new/edit commodity dialog.
*/
/********************************************************
* Create and run the new/edit commodity dialog. *
********************************************************/
gnc_commodity *
gnc_ui_new_commodity_modal_full(const char * namespace,
GtkWidget * parent,
@@ -1188,8 +1263,10 @@ gnc_ui_new_commodity_modal_full(const char * namespace,
return result;
}
/** External routine for popping up the new commodity dialog box.
*/
/********************************************************************
* External routine for popping up the new commodity dialog box. *
********************************************************************/
gnc_commodity *
gnc_ui_new_commodity_modal(const char * default_namespace,
GtkWidget * parent)
@@ -1203,10 +1280,10 @@ gnc_ui_new_commodity_modal(const char * default_namespace,
return result;
}
/********************************************************************
* gnc_ui_edit_commodity_modal()
********************************************************************/
/** 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
@@ -1229,7 +1306,6 @@ gnc_ui_edit_commodity_modal(gnc_commodity *commodity,
/********************************************************************
* gnc_ui_commodity_dialog_to_object()
********************************************************************/
gboolean
gnc_ui_commodity_dialog_to_object(CommodityWindow * w)
{

View File

@@ -1,6 +1,5 @@
gladedir = $(GNC_GLADE_DIR)
glade_DATA = \
commodity.glade \
dialog-book-close.glade \
dialog-file-access.glade \
dialog-object-references.glade \

View File

@@ -1,5 +1,6 @@
gtkbuilderdir = $(GNC_GTKBUILDER_DIR)
gtkbuilder_DATA = \
commodity.glade \
transfer.glade
EXTRA_DIST = $(gtkbuilder_DATA)

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2001 Gnumatic, Inc. *
* Author: Dave Peticolas <dave@krondo.com> *
* Copyright (C) 2003,2005 David Hampton *
* Copyright (C) 2011 Robert Fewell *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@@ -98,6 +99,7 @@ gnc_prices_dialog_window_destroy_cb (GtkObject *object, gpointer data)
LEAVE(" ");
}
void
gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data)
{
@@ -108,6 +110,7 @@ gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data)
LEAVE(" ");
}
void
gnc_prices_dialog_response (GtkDialog *dialog, gint response_id, gpointer data)
{
@@ -118,6 +121,7 @@ gnc_prices_dialog_response (GtkDialog *dialog, gint response_id, gpointer data)
LEAVE(" ");
}
void
gnc_prices_dialog_edit_clicked (GtkWidget *widget, gpointer data)
{
@@ -144,12 +148,14 @@ gnc_prices_dialog_edit_clicked (GtkWidget *widget, gpointer data)
LEAVE(" ");
}
static void
remove_helper(GNCPrice *price, GNCPriceDB *pdb)
{
gnc_pricedb_remove_price (pdb, price);
}
void
gnc_prices_dialog_remove_clicked (GtkWidget *widget, gpointer data)
{
@@ -207,22 +213,33 @@ gnc_prices_dialog_remove_clicked (GtkWidget *widget, gpointer data)
LEAVE(" ");
}
void
gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
{
PricesDialog *pdb_dialog = data;
GladeXML *xml;
GtkWidget *dialog, *button, *date, *label;
GtkBuilder *builder;
GtkWidget *dialog, *button, *date, *label, *box;
gint result;
gboolean delete_user, delete_last;
ENTER(" ");
xml = gnc_glade_xml_new ("price.glade", "Deletion Date");
dialog = glade_xml_get_widget (xml, "Deletion Date");
date = glade_xml_get_widget (xml, "date");
label = glade_xml_get_widget (xml, "date_label");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "price.glade", "Deletion Date");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Deletion Date"));
box = GTK_WIDGET(gtk_builder_get_object (builder, "date_hbox"));
date = gnc_date_edit_new (time (NULL), FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (box), date, TRUE, TRUE, 0);
gtk_widget_show (date);
gtk_entry_set_activates_default(GTK_ENTRY(GNC_DATE_EDIT(date)->date_entry), TRUE);
label = GTK_WIDGET(gtk_builder_get_object (builder, "date_label"));
gnc_date_make_mnemonic_target (GNC_DATE_EDIT(date), label);
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pdb_dialog);
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pdb_dialog);
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (pdb_dialog->dialog));
result = gtk_dialog_run (GTK_DIALOG (dialog));
@@ -234,9 +251,9 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
ts.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (date));
ts.tv_nsec = 0;
button = glade_xml_get_widget (xml, "delete_manual");
button = GTK_WIDGET(gtk_builder_get_object (builder, "delete_manual"));
delete_user = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
button = glade_xml_get_widget (xml, "delete_last");
button = GTK_WIDGET(gtk_builder_get_object (builder, "delete_last"));
delete_last = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
gnc_pricedb_remove_old_prices(pdb_dialog->price_db, ts,
@@ -247,6 +264,7 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
LEAVE(" ");
}
void
gnc_prices_dialog_add_clicked (GtkWidget *widget, gpointer data)
{
@@ -266,6 +284,7 @@ gnc_prices_dialog_add_clicked (GtkWidget *widget, gpointer data)
LEAVE(" ");
}
void
gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
{
@@ -354,6 +373,7 @@ gnc_price_dialog_filter_ns_func (gnc_commodity_namespace *namespace,
return FALSE;
}
static gboolean
gnc_price_dialog_filter_cm_func (gnc_commodity *commodity,
gpointer data)
@@ -364,6 +384,7 @@ gnc_price_dialog_filter_cm_func (gnc_commodity *commodity,
return gnc_pricedb_has_prices(pdb_dialog->price_db, commodity, NULL);
}
static void
row_activated_cb (GtkTreeView *view, GtkTreePath *path,
GtkTreeViewColumn *column, gpointer data)
@@ -391,26 +412,26 @@ row_activated_cb (GtkTreeView *view, GtkTreePath *path,
}
}
static void
gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
{
GtkWidget *dialog, *scrolled_window;
GladeXML *xml;
GtkBuilder *builder;
GtkTreeView *view;
GtkTreeSelection *selection;
ENTER(" ");
xml = gnc_glade_xml_new ("price.glade", "Prices Dialog");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "price.glade", "Prices Dialog");
dialog = glade_xml_get_widget (xml, "Prices Dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Prices Dialog"));
pdb_dialog->dialog = dialog;
pdb_dialog->session = gnc_get_current_session();
pdb_dialog->book = qof_session_get_book(pdb_dialog->session);
pdb_dialog->price_db = gnc_pricedb_get_db(pdb_dialog->book);
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pdb_dialog);
/* parent */
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
@@ -419,7 +440,7 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
/* price tree */
scrolled_window = glade_xml_get_widget (xml, "price_list_window");
scrolled_window = GTK_WIDGET(gtk_builder_get_object (builder, "price_list_window"));
view = gnc_tree_view_price_new(pdb_dialog->book,
"gconf-section", GCONF_SECTION,
"show-column-menu", TRUE,
@@ -444,23 +465,28 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
{
GtkWidget *button;
button = glade_xml_get_widget (xml, "edit_button");
button = GTK_WIDGET(gtk_builder_get_object (builder, "edit_button"));
pdb_dialog->edit_button = button;
button = glade_xml_get_widget (xml, "remove_button");
button = GTK_WIDGET(gtk_builder_get_object (builder, "remove_button"));
pdb_dialog->remove_button = button;
if (!gnc_quote_source_fq_installed())
{
button = glade_xml_get_widget (xml, "get_quotes_button");
button = GTK_WIDGET(gtk_builder_get_object (builder, "get_quotes_button"));
gtk_widget_set_sensitive(button, FALSE);
}
}
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pdb_dialog);
g_object_unref(G_OBJECT(builder));
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog));
LEAVE(" ");
}
static void
close_handler (gpointer user_data)
{
@@ -473,6 +499,7 @@ close_handler (gpointer user_data)
LEAVE(" ");
}
static void
refresh_handler (GHashTable *changes, gpointer user_data)
{
@@ -480,6 +507,7 @@ refresh_handler (GHashTable *changes, gpointer user_data)
LEAVE(" ");
}
static gboolean
show_handler (const char *class, gint component_id,
gpointer user_data, gpointer iter_data)
@@ -498,6 +526,7 @@ show_handler (const char *class, gint component_id,
return(TRUE);
}
/********************************************************************\
* gnc_prices_dialog *
* opens up a window showing all price information *

View File

@@ -4,6 +4,7 @@
* Author: Dave Peticolas <dave@krondo.com> *
* Copyright (c) 2006 David Hampton <hampton@employees.org> *
* Copyright (c) 2009 Herbert Thoma <herbie@hthoma.de> *
* Copyright (c) 2011 Robert Fewell *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@@ -51,8 +52,10 @@
#define GCONF_SECTION "dialogs/price_editor"
#define DIALOG_PRICE_EDIT_SOURCE "user:price-editor"
/* This static indicates the debugging module that this .o belongs to. */
/* static short module = MOD_GUI; */
static QofLogModule log_module = GNC_MOD_GUI;
typedef struct
{
@@ -80,6 +83,7 @@ typedef struct
} PriceEditDialog;
void pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data);
void pedit_data_changed_cb (GtkWidget *w, gpointer data);
void pedit_commodity_ns_changed_cb (GtkComboBoxEntry *cbe, gpointer data);
@@ -94,6 +98,7 @@ gnc_prices_set_changed (PriceEditDialog *pedit_dialog, gboolean changed)
gtk_widget_set_sensitive (pedit_dialog->apply_button, changed);
}
static int
type_string_to_index (const char *type)
{
@@ -112,6 +117,7 @@ type_string_to_index (const char *type)
return 4;
}
static const char *
type_index_to_string (int index)
{
@@ -130,6 +136,7 @@ type_index_to_string (int index)
}
}
static void
price_to_gui (PriceEditDialog *pedit_dialog)
{
@@ -188,6 +195,7 @@ price_to_gui (PriceEditDialog *pedit_dialog)
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), value);
}
static const char *
gui_to_price (PriceEditDialog *pedit_dialog)
{
@@ -203,12 +211,12 @@ gui_to_price (PriceEditDialog *pedit_dialog)
fullname = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe));
commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), namespace, fullname);
if (!commodity)
return _("You must select a commodity.");
return _("You must select a Security.");
currency = gnc_currency_edit_get_currency
(GNC_CURRENCY_EDIT (pedit_dialog->currency_edit));
if (!currency)
return _("You must select a currency.");
return _("You must select a Currency.");
date.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
date.tv_nsec = 0;
@@ -241,6 +249,7 @@ gui_to_price (PriceEditDialog *pedit_dialog)
return NULL;
}
static void
pedit_dialog_destroy_cb (GtkWidget *widget, gpointer data)
{
@@ -259,6 +268,7 @@ pedit_dialog_destroy_cb (GtkWidget *widget, gpointer data)
g_free (pedit_dialog);
}
void
pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
{
@@ -300,6 +310,7 @@ pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
}
}
void
pedit_commodity_ns_changed_cb (GtkComboBoxEntry *cbe, gpointer data)
{
@@ -314,6 +325,7 @@ pedit_commodity_ns_changed_cb (GtkComboBoxEntry *cbe, gpointer data)
g_free(namespace);
}
void
pedit_commodity_changed_cb (GtkComboBoxEntry *cbe, gpointer data)
{
@@ -354,6 +366,7 @@ pedit_commodity_changed_cb (GtkComboBoxEntry *cbe, gpointer data)
g_free(fullname);
}
void
pedit_data_changed_cb (GtkWidget *w, gpointer data)
{
@@ -362,12 +375,13 @@ pedit_data_changed_cb (GtkWidget *w, gpointer data)
gnc_prices_set_changed (pedit_dialog, TRUE);
}
static void
gnc_price_pedit_dialog_create (GtkWidget *parent,
PriceEditDialog *pedit_dialog,
QofSession *session)
{
GladeXML *xml;
GtkBuilder *builder;
GNCPrintAmountInfo print_info;
GtkWidget *dialog;
GtkWidget *entry;
@@ -376,34 +390,74 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
GtkWidget *label;
gchar *namespace;
xml = gnc_glade_xml_new ("price.glade", "Price Dialog");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "price.glade", "liststore1");
gnc_builder_add_from_file (builder, "price.glade", "Price Dialog");
pedit_dialog->session = session;
pedit_dialog->book = qof_session_get_book(pedit_dialog->session);
pedit_dialog->price_db = gnc_pricedb_get_db(pedit_dialog->book);
dialog = glade_xml_get_widget (xml, "Price Dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Price Dialog"));
pedit_dialog->dialog = dialog;
/* parent */
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
w = glade_xml_get_widget (xml, "namespace_cbe");
w = GTK_WIDGET(gtk_builder_get_object (builder, "namespace_cbe"));
pedit_dialog->namespace_cbe = w;
gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->namespace_cbe), 0);
gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->namespace_cbe));
gnc_ui_update_namespace_picker(w, NULL, DIAG_COMM_ALL);
w = glade_xml_get_widget (xml, "commodity_cbe");
/* namespace List Store - create here as we get an error if created in builder */
{
GtkListStore *store;
GtkTreeIter iter;
gchar string[] = "Dummy namespace Line";
store = gtk_list_store_new( 1, G_TYPE_STRING );
gtk_list_store_append( store, &iter );
gtk_list_store_set( store, &iter, 0, string, -1 );
gtk_combo_box_set_model( GTK_COMBO_BOX( pedit_dialog->namespace_cbe ),
GTK_TREE_MODEL( store ) );
g_object_unref( G_OBJECT( store ) );
gtk_combo_box_entry_set_text_column( GTK_COMBO_BOX_ENTRY( pedit_dialog->namespace_cbe ), 0 );
}
gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->namespace_cbe), 0);
gnc_ui_update_namespace_picker(w, NULL, DIAG_COMM_ALL);
gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->namespace_cbe));
gtk_combo_box_set_active(GTK_COMBO_BOX(pedit_dialog->namespace_cbe), 1);
w = GTK_WIDGET(gtk_builder_get_object (builder, "commodity_cbe"));
pedit_dialog->commodity_cbe = w;
/* commodity List Store - create here as we get an error if created in builder */
{
GtkListStore *store;
GtkTreeIter iter;
gchar string[] = "Dummy commodity Line";
store = gtk_list_store_new( 1, G_TYPE_STRING );
gtk_list_store_append( store, &iter );
gtk_list_store_set( store, &iter, 0, string, -1 );
gtk_combo_box_set_model( GTK_COMBO_BOX( pedit_dialog->commodity_cbe ),
GTK_TREE_MODEL( store ) );
g_object_unref( G_OBJECT( store ) );
gtk_combo_box_entry_set_text_column( GTK_COMBO_BOX_ENTRY( pedit_dialog->commodity_cbe ), 0 );
}
gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe), 0);
gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->commodity_cbe));
namespace = gnc_ui_namespace_picker_ns(pedit_dialog->namespace_cbe);
gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbe, namespace, NULL);
g_free(namespace);
box = glade_xml_get_widget (xml, "currency_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_box"));
w = gnc_currency_edit_new ();
gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT (w),
gnc_default_currency ());
@@ -412,10 +466,10 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
gtk_widget_show (w);
g_signal_connect (G_OBJECT (GTK_COMBO_BOX(w)), "changed",
G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
label = glade_xml_get_widget (xml, "currency_label");
label = GTK_WIDGET(gtk_builder_get_object (builder, "currency_label"));
gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
box = glade_xml_get_widget (xml, "date_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "date_box"));
w = gnc_date_edit_new (time (NULL), FALSE, FALSE);
pedit_dialog->date_edit = w;
gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
@@ -425,17 +479,17 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
g_signal_connect (G_OBJECT (GNC_DATE_EDIT (w)->date_entry), "changed",
G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
gtk_entry_set_activates_default(GTK_ENTRY(GNC_DATE_EDIT(w)->date_entry), TRUE);
label = glade_xml_get_widget (xml, "date_label");
label = GTK_WIDGET(gtk_builder_get_object (builder, "date_label"));
gnc_date_make_mnemonic_target (GNC_DATE_EDIT(w), label);
w = glade_xml_get_widget (xml, "source_entry");
w = GTK_WIDGET(gtk_builder_get_object (builder, "source_entry"));
pedit_dialog->source_entry = w;
w = glade_xml_get_widget (xml, "type_combobox");
w = GTK_WIDGET(gtk_builder_get_object (builder, "type_combobox"));
pedit_dialog->type_combobox = w;
box = glade_xml_get_widget (xml, "price_box");
box = GTK_WIDGET(gtk_builder_get_object (builder, "price_box"));
w = gnc_amount_edit_new ();
pedit_dialog->price_edit = w;
gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
@@ -444,29 +498,29 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (w), print_info);
gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
gtk_widget_show (w);
label = glade_xml_get_widget (xml, "price_label");
label = GTK_WIDGET(gtk_builder_get_object (builder, "price_label"));
gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (w));
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
w = glade_xml_get_widget (xml, "cancel_button");
w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_cancel_button"));
pedit_dialog->cancel_button = w;
w = glade_xml_get_widget (xml, "apply_button");
w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_apply_button"));
pedit_dialog->apply_button = w;
gnc_prices_set_changed (pedit_dialog, FALSE);
w = glade_xml_get_widget (xml, "ok_button");
w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_ok_button"));
pedit_dialog->ok_button = w;
glade_xml_signal_autoconnect_full( xml,
gnc_glade_autoconnect_full_func,
pedit_dialog );
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pedit_dialog);
g_object_unref(G_OBJECT(builder));
}
static void
close_handler (gpointer user_data)
{
@@ -475,6 +529,7 @@ close_handler (gpointer user_data)
gtk_dialog_response(GTK_DIALOG(pedit_dialog->dialog), GTK_RESPONSE_CANCEL);
}
static void
refresh_handler (GHashTable *changes, gpointer user_data)
{
@@ -483,6 +538,7 @@ refresh_handler (GHashTable *changes, gpointer user_data)
// gnc_prices_load_prices (pedit_dialog);
}
static gboolean
show_handler (const char *class, gint component_id,
gpointer user_data, gpointer iter_data)
@@ -497,6 +553,7 @@ show_handler (const char *class, gint component_id,
return(TRUE);
}
/********************************************************************\
* gnc_price_edit_dialog *
* opens up a window to edit price information *
@@ -554,6 +611,7 @@ gnc_price_edit_dialog (GtkWidget * parent,
gtk_widget_show (pedit_dialog->dialog);
}
/********************************************************************\
* gnc_price_edit_by_guid *
* opens up a window to edit price information *

View File

@@ -3,7 +3,6 @@ glade_DATA = \
budget.glade \
lots.glade \
newuser.glade \
price.glade \
print.glade \
progress.glade \
reconcile.glade \

View File

@@ -1,728 +0,0 @@
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.10 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="Prices Dialog">
<property name="border_width">6</property>
<property name="title" translatable="yes">Price Editor</property>
<property name="default_width">400</property>
<property name="default_height">400</property>
<property name="type_hint">normal</property>
<signal name="destroy" handler="gnc_prices_dialog_window_destroy_cb"/>
<signal name="close" handler="gnc_prices_dialog_close_cb" after="yes"/>
<signal name="response" handler="gnc_prices_dialog_response"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox121">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkHBox" id="hbox118">
<property name="visible">True</property>
<child>
<widget class="GtkScrolledWindow" id="price_list_window">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">3</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox5">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="orientation">vertical</property>
<property name="layout_style">spread</property>
<child>
<widget class="GtkButton" id="add_button">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Add a new price.</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="gnc_prices_dialog_add_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="remove_button">
<property name="label">gtk-remove</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Remove the current price</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="gnc_prices_dialog_remove_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="edit_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Edit the current price.</property>
<signal name="clicked" handler="gnc_prices_dialog_edit_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<widget class="GtkHBox" id="hbox115">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8477426">
<property name="visible">True</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="remove_old_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Remove prices older than a user-entered date</property>
<signal name="clicked" handler="gnc_prices_dialog_remove_old_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment6">
<property name="visible">True</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<widget class="GtkHBox" id="hbox116">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8477427">
<property name="visible">True</property>
<property name="label" translatable="yes">Remove _Old</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="get_quotes_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Get new online quotes for stock accounts.</property>
<signal name="clicked" handler="gnc_prices_dialog_get_quotes_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment7">
<property name="visible">True</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<widget class="GtkHBox" id="hbox117">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8477428">
<property name="visible">True</property>
<property name="label" translatable="yes">Get _Quotes</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="hbuttonbox4">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="close_button">
<property name="label">gtk-close</property>
<property name="response_id">-7</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="Price Dialog">
<property name="border_width">6</property>
<property name="title" translatable="yes">Price Editor</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<signal name="response" handler="pedit_dialog_response_cb"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox18">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
<widget class="GtkComboBoxEntry" id="commodity_cbe">
<property name="visible">True</property>
<property name="items">Dummy security entry</property>
<signal name="changed" handler="pedit_commodity_changed_cb"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="namespace_cbe">
<property name="visible">True</property>
<property name="items">Dummy namespace entry</property>
<signal name="changed" handler="pedit_commodity_ns_changed_cb"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="namespace_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Namespace:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">namespace_cbe</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="commodity_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Security:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">commodity_cbe</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="currency_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Cu_rrency:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="date_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Date:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="source_label">
<property name="xalign">0</property>
<property name="label" translatable="yes">S_ource:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">source_entry</property>
</widget>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="type_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Type:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">type_combobox</property>
</widget>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="price_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Price:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
</widget>
<packing>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="currency_box">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="date_box">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="source_entry">
<property name="can_focus">True</property>
<property name="editable">False</property>
<signal name="changed" handler="pedit_data_changed_cb"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="price_box">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="type_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes">Bid
Ask
Last
Net Asset Value
Unknown</property>
<signal name="changed" handler="pedit_data_changed_cb"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area18">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancel_button">
<property name="label">gtk-cancel</property>
<property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="apply_button">
<property name="label">gtk-apply</property>
<property name="response_id">-10</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="ok_button">
<property name="label">gtk-ok</property>
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="Deletion Date">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox19">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
<widget class="GtkLabel" id="label8477429">
<property name="visible">True</property>
<property name="label" translatable="yes">Delete all stock prices based upon the critera below:</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="delete_manual">
<property name="label" translatable="yes">Delete _manually entered prices</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">If activated, delete manually entered stock prices dated earlier than the specified date. Otherwise only stock prices added by Finance::Quote will be deleted.</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="delete_last">
<property name="label" translatable="yes">Delete _last price for a stock</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">If activated, delete all prices before the specified date. Otherwise the last stock price dated before the date will be kept and all earlier quotes deleted.</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8477431">
<property name="visible">True</property>
<property name="xalign">0</property>
</widget>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="date_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Date:</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="Custom" id="date">
<property name="visible">True</property>
<property name="creation_function">gnc_date_edit_new_glade</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area19">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="label">gtk-cancel</property>
<property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="label">gtk-ok</property>
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

File diff suppressed because it is too large Load Diff