Remove option menu dependency from business-options-gnome

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21502 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens
2011-10-28 14:13:54 +00:00
parent ad2c2353c1
commit 3c809a4a2d
3 changed files with 42 additions and 8 deletions
@@ -30,6 +30,7 @@
#include <libguile.h>
#include "gnc-ui-util.h"
#include "dialog-utils.h"
#include "qof.h"
#include "option-util.h"
#include "gnc-general-search.h"
@@ -425,18 +426,22 @@ static GtkWidget *
create_taxtable_widget (GNCOption *option, GtkWidget *hbox)
{
GtkWidget *widget;
GtkBuilder *builder;
widget = gtk_option_menu_new ();
gnc_ui_taxtables_optionmenu (widget, gnc_get_current_book (), TRUE, NULL);
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "business-options-gnome.glade", "taxtable_store");
gnc_builder_add_from_file (builder, "business-options-gnome.glade", "taxtable_menu");
widget = GTK_WIDGET (gtk_builder_get_object (builder, "taxtable_menu"));
gnc_taxtables_combo (GTK_COMBO_BOX(widget), gnc_get_current_book (), TRUE, NULL);
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
gnc_option_set_widget (option, widget);
gnc_ui_optionmenu_set_changed_callback (widget,
(void(*)(GtkWidget*, gpointer))gnc_option_changed_option_cb,
option);
g_signal_connect (widget, "changed",
G_CALLBACK (gnc_option_changed_option_cb), option);
g_object_unref(G_OBJECT(builder));
return widget;
}
@@ -477,7 +482,7 @@ taxtable_set_value (GNCOption *option, gboolean use_default,
taxtable = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncTaxTable"), 1, 0);
widget = gnc_option_get_gtk_widget (option);
gnc_ui_optionmenu_set_value (widget, taxtable);
gnc_simple_combo_set_value (GTK_COMBO_BOX(widget), taxtable);
return FALSE;
}
@@ -487,7 +492,7 @@ taxtable_get_value (GNCOption *option, GtkWidget *widget)
{
GncTaxTable *taxtable;
taxtable = gnc_ui_optionmenu_get_value (widget);
taxtable = gnc_simple_combo_get_value (GTK_COMBO_BOX(widget));
return SWIG_NewPointerObj(taxtable, SWIG_TypeQuery("_p__gncTaxTable"), 0);
}
@@ -1,5 +1,6 @@
gtkbuilderdir = $(GNC_GTKBUILDER_DIR)
gtkbuilder_DATA = \
business-options-gnome.glade \
dialog-customer.glade \
dialog-invoice.glade \
dialog-vendor.glade
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<object class="GtkWindow" id="dummy_toplevel">
<property name="can_focus">False</property>
<child>
<object class="GtkComboBox" id="taxtable_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">taxtable_store</property>
<child>
<object class="GtkCellRendererText" id="taxtable_cell_renderer_text"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
<object class="GtkListStore" id="taxtable_store">
<columns>
<!-- column-name taxtable_name -->
<column type="gchararray"/>
<!-- column-name taxtable_value -->
<column type="gpointer"/>
</columns>
</object>
</interface>