mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-29 04:04:07 -06:00
More syntactic sugar converting from gtk_object_xxx functions to
g_object_xxx functions. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12072 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
43a1b6c969
commit
5be61108d5
@ -1,5 +1,8 @@
|
||||
2005-11-29 David Hampton <hampton@employees.org>
|
||||
|
||||
* various: More syntactic sugar converting from gtk_object_xxx
|
||||
functions to g_object_xxx functions.
|
||||
|
||||
* various: Syntactic sugar converting from gtk_signal_xxx
|
||||
functions to g_signal_yyy functions.
|
||||
|
||||
|
@ -273,7 +273,7 @@ business_option_changed (GtkWidget *widget, gpointer data)
|
||||
OpMenuData *omd = data;
|
||||
|
||||
g_return_if_fail (omd);
|
||||
omd->result = gtk_object_get_data (GTK_OBJECT (widget), "this_item");
|
||||
omd->result = g_object_get_data (G_OBJECT (widget), "this_item");
|
||||
|
||||
if (!omd->building_menu) {
|
||||
if (omd->result_p)
|
||||
@ -353,7 +353,7 @@ make_generic_optionmenu (GtkWidget *omenu, GNCBook *book,
|
||||
{
|
||||
OpMenuData *omd;
|
||||
|
||||
omd = gtk_object_get_data (GTK_OBJECT (omenu), "menu-data");
|
||||
omd = g_object_get_data (G_OBJECT (omenu), "menu-data");
|
||||
|
||||
/* If this is the first time we've been called, then build the
|
||||
* Option Menu Data object, register with the component manager, and
|
||||
@ -368,7 +368,7 @@ make_generic_optionmenu (GtkWidget *omenu, GNCBook *book,
|
||||
omd->none_ok = none_ok;
|
||||
omd->get_name = get_name;
|
||||
omd->get_list = get_list;
|
||||
gtk_object_set_data (GTK_OBJECT (omenu), "menu-data", omd);
|
||||
g_object_set_data (G_OBJECT (omenu), "menu-data", omd);
|
||||
|
||||
if (result)
|
||||
omd->result = *result;
|
||||
@ -403,7 +403,7 @@ gnc_ui_optionmenu_set_changed_callback (GtkWidget *omenu,
|
||||
|
||||
if (!omenu) return;
|
||||
|
||||
omd = gtk_object_get_data (GTK_OBJECT (omenu), "menu-data");
|
||||
omd = g_object_get_data (G_OBJECT (omenu), "menu-data");
|
||||
g_return_if_fail (omd);
|
||||
|
||||
omd->changed_cb = changed_cb;
|
||||
@ -417,7 +417,7 @@ gnc_ui_optionmenu_get_value (GtkWidget *omenu)
|
||||
|
||||
if (!omenu) return NULL;
|
||||
|
||||
omd = gtk_object_get_data (GTK_OBJECT (omenu), "menu-data");
|
||||
omd = g_object_get_data (G_OBJECT (omenu), "menu-data");
|
||||
g_return_val_if_fail (omd, NULL);
|
||||
|
||||
return omd->result;
|
||||
@ -433,7 +433,7 @@ gnc_ui_optionmenu_set_value (GtkWidget *omenu, gpointer data)
|
||||
|
||||
if (!omenu) return;
|
||||
|
||||
omd = gtk_object_get_data (GTK_OBJECT (omenu), "menu-data");
|
||||
omd = g_object_get_data (G_OBJECT (omenu), "menu-data");
|
||||
g_return_if_fail (omd);
|
||||
|
||||
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (omenu));
|
||||
@ -444,8 +444,8 @@ gnc_ui_optionmenu_set_value (GtkWidget *omenu, gpointer data)
|
||||
node;
|
||||
node = node->next, counter++)
|
||||
{
|
||||
GtkObject *menuitem = node->data;
|
||||
gpointer this_object = gtk_object_get_data (menuitem, "this_item");
|
||||
GObject *menuitem = node->data;
|
||||
gpointer this_object = g_object_get_data (menuitem, "this_item");
|
||||
|
||||
if (this_object == data) {
|
||||
gtk_option_menu_set_history (GTK_OPTION_MENU (omd->omenu), counter);
|
||||
|
@ -463,7 +463,7 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
|
||||
xml = gnc_glade_xml_new ("customer.glade", "Customer Dialog");
|
||||
cw->dialog = glade_xml_get_widget (xml, "Customer Dialog");
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (cw->dialog), "dialog_info", cw);
|
||||
g_object_set_data (G_OBJECT (cw->dialog), "dialog_info", cw);
|
||||
|
||||
/* Get entry points */
|
||||
cw->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
|
@ -417,7 +417,7 @@ gnc_employee_new_window (GNCBook *bookp,
|
||||
xml = gnc_glade_xml_new ("employee.glade", "Employee Dialog");
|
||||
ew->dialog = glade_xml_get_widget (xml, "Employee Dialog");
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ew->dialog), "dialog_info", ew);
|
||||
g_object_set_data (G_OBJECT (ew->dialog), "dialog_info", ew);
|
||||
|
||||
/* Get entry points */
|
||||
ew->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
|
@ -291,7 +291,6 @@ gnc_job_new_window (GNCBook *bookp, GncOwner *owner, GncJob *job)
|
||||
JobWindow *jw;
|
||||
GladeXML *xml;
|
||||
GtkWidget *owner_box, *owner_label;
|
||||
GtkObject *jwo;
|
||||
|
||||
/*
|
||||
* Find an existing window for this job. If found, bring it to
|
||||
@ -321,9 +320,7 @@ gnc_job_new_window (GNCBook *bookp, GncOwner *owner, GncJob *job)
|
||||
|
||||
/* Find the dialog */
|
||||
jw->dialog = glade_xml_get_widget (xml, "Job Dialog");
|
||||
jwo = GTK_OBJECT (jw->dialog);
|
||||
|
||||
gtk_object_set_data (jwo, "dialog_info", jw);
|
||||
g_object_set_data (G_OBJECT (jw->dialog), "dialog_info", jw);
|
||||
|
||||
/* Get entry points */
|
||||
jw->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
|
@ -662,7 +662,7 @@ gnc_order_window_new_order (GNCBook *bookp, GncOwner *owner)
|
||||
xml = gnc_glade_xml_new ("order.glade", "New Order Dialog");
|
||||
ow->dialog = glade_xml_get_widget (xml, "New Order Dialog");
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ow->dialog), "dialog_info", ow);
|
||||
g_object_set_data (G_OBJECT (ow->dialog), "dialog_info", ow);
|
||||
|
||||
/* Grab the widgets */
|
||||
ow->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
|
@ -175,8 +175,7 @@ static void
|
||||
optionmenu_changed (GtkWidget *widget, NewTaxTable *ntt)
|
||||
{
|
||||
g_return_if_fail (ntt);
|
||||
ntt->type = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget),
|
||||
"option"));
|
||||
ntt->type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(widget), "option"));
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
|
@ -1837,8 +1837,8 @@ gnc_ui_new_account_with_types( AccountGroup *unused,
|
||||
if ( validTypesCopy != NULL ) {
|
||||
/* Attach it with "[...]_full" so we can set the appropriate
|
||||
* GtkDestroyNotify func. */
|
||||
gtk_object_set_data_full( GTK_OBJECT(aw->dialog), "validTypesListCopy",
|
||||
validTypesCopy, (GDestroyNotify)g_list_free );
|
||||
g_object_set_data_full( G_OBJECT(aw->dialog), "validTypesListCopy",
|
||||
validTypesCopy, (GDestroyNotify)g_list_free );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -748,8 +748,6 @@ gnc_ui_quote_tz_menu_create(void)
|
||||
gtk_widget_show(GTK_WIDGET(menu));
|
||||
|
||||
item = gtk_menu_item_new_with_label(_("Use local time"));
|
||||
/* set user data to non NULL so we can detect this item specially. */
|
||||
gtk_object_set_user_data(GTK_OBJECT(item), (gpointer) 1);
|
||||
gtk_widget_show(item);
|
||||
gtk_menu_append(menu, item);
|
||||
|
||||
|
@ -405,17 +405,17 @@ gnc_option_radiobutton_cb(GtkWidget *w, gpointer data)
|
||||
|
||||
widget = gnc_option_get_widget (option);
|
||||
|
||||
_current = gtk_object_get_data(GTK_OBJECT(widget), "gnc_radiobutton_index");
|
||||
_current = g_object_get_data(G_OBJECT(widget), "gnc_radiobutton_index");
|
||||
current = GPOINTER_TO_INT (_current);
|
||||
|
||||
_new_value = gtk_object_get_data (GTK_OBJECT(w), "gnc_radiobutton_index");
|
||||
_new_value = g_object_get_data (G_OBJECT(w), "gnc_radiobutton_index");
|
||||
new_value = GPOINTER_TO_INT (_new_value);
|
||||
|
||||
if (current == new_value)
|
||||
return;
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT(widget), "gnc_radiobutton_index",
|
||||
GINT_TO_POINTER(new_value));
|
||||
g_object_set_data (G_OBJECT(widget), "gnc_radiobutton_index",
|
||||
GINT_TO_POINTER(new_value));
|
||||
gnc_option_changed_widget_cb(widget, option);
|
||||
}
|
||||
|
||||
@ -598,8 +598,8 @@ gnc_option_create_radiobutton_widget(char *name, GNCOption *option)
|
||||
GTK_RADIO_BUTTON (widget) :
|
||||
NULL,
|
||||
label ? _(label) : "");
|
||||
gtk_object_set_data (GTK_OBJECT (widget), "gnc_radiobutton_index",
|
||||
GINT_TO_POINTER (i));
|
||||
g_object_set_data (G_OBJECT (widget), "gnc_radiobutton_index",
|
||||
GINT_TO_POINTER (i));
|
||||
gtk_tooltips_set_tip(tooltips, widget, tip ? _(tip) : "", NULL);
|
||||
g_signal_connect(G_OBJECT(widget), "toggled",
|
||||
G_CALLBACK(gnc_option_radiobutton_cb), option);
|
||||
@ -1002,7 +1002,7 @@ gnc_options_dialog_append_page(GNCOptionWin * propertybox,
|
||||
reset_button = gtk_button_new_with_label (_("Defaults"));
|
||||
g_signal_connect(G_OBJECT(reset_button), "clicked",
|
||||
G_CALLBACK(gnc_options_dialog_reset_cb), propertybox);
|
||||
gtk_object_set_data(GTK_OBJECT(reset_button), "section", section);
|
||||
g_object_set_data(G_OBJECT(reset_button), "section", section);
|
||||
gtk_box_pack_end(GTK_BOX(buttonbox), reset_button, FALSE, FALSE, 0);
|
||||
gtk_widget_show_all(page_content_box);
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(propertybox->notebook),
|
||||
@ -1030,9 +1030,9 @@ gnc_options_dialog_append_page(GNCOptionWin * propertybox,
|
||||
gtk_notebook_get_nth_page(GTK_NOTEBOOK(propertybox->notebook),
|
||||
page_count);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(notebook_page), "listitem", listitem);
|
||||
gtk_object_set_data(GTK_OBJECT(notebook_page), "advanced",
|
||||
GINT_TO_POINTER(advanced));
|
||||
g_object_set_data(G_OBJECT(notebook_page), "listitem", listitem);
|
||||
g_object_set_data(G_OBJECT(notebook_page), "advanced",
|
||||
GINT_TO_POINTER(advanced));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1166,7 +1166,7 @@ gnc_options_dialog_reset_cb(GtkWidget * w, gpointer data)
|
||||
GNCOptionSection *section;
|
||||
gpointer val;
|
||||
|
||||
val = gtk_object_get_data(GTK_OBJECT(w), "section");
|
||||
val = g_object_get_data(G_OBJECT(w), "section");
|
||||
g_return_if_fail (val);
|
||||
g_return_if_fail (win);
|
||||
|
||||
@ -2376,11 +2376,11 @@ gnc_option_set_ui_value_radiobutton (GNCOption *option, gboolean use_default,
|
||||
g_return_val_if_fail (list, TRUE);
|
||||
|
||||
button = list->data;
|
||||
val = gtk_object_get_data (GTK_OBJECT (button), "gnc_radiobutton_index");
|
||||
val = g_object_get_data (G_OBJECT (button), "gnc_radiobutton_index");
|
||||
g_return_val_if_fail (GPOINTER_TO_INT (val) == index, TRUE);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
||||
// gtk_object_set_data(GTK_OBJECT(widget), "gnc_radiobutton_index",
|
||||
// g_object_set_data(G_OBJECT(widget), "gnc_radiobutton_index",
|
||||
// GINT_TO_POINTER(index));
|
||||
return FALSE;
|
||||
}
|
||||
@ -2696,7 +2696,7 @@ gnc_option_get_ui_value_radiobutton (GNCOption *option, GtkWidget *widget)
|
||||
gpointer _index;
|
||||
int index;
|
||||
|
||||
_index = gtk_object_get_data(GTK_OBJECT(widget), "gnc_radiobutton_index");
|
||||
_index = g_object_get_data(G_OBJECT(widget), "gnc_radiobutton_index");
|
||||
index = GPOINTER_TO_INT(_index);
|
||||
|
||||
return (gnc_option_permissible_value(option, index));
|
||||
|
@ -59,9 +59,9 @@ gnc_option_menu_cb(GtkWidget *w, gpointer data)
|
||||
gpointer _index;
|
||||
gint index;
|
||||
|
||||
cb = gtk_object_get_data(GTK_OBJECT(w), "gnc_option_cb");
|
||||
cb = g_object_get_data(G_OBJECT(w), "gnc_option_cb");
|
||||
|
||||
_index = gtk_object_get_data(GTK_OBJECT(w), "gnc_option_index");
|
||||
_index = g_object_get_data(G_OBJECT(w), "gnc_option_index");
|
||||
index = GPOINTER_TO_INT(_index);
|
||||
|
||||
cb(w, index, data);
|
||||
@ -109,17 +109,17 @@ gnc_build_option_menu(GNCOptionInfo *option_info, gint num_options)
|
||||
gtk_tooltips_set_tip(tooltips, menu_item, option_info[i].tip, NULL);
|
||||
gtk_widget_show(menu_item);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(menu_item),
|
||||
"gnc_option_cb",
|
||||
option_info[i].callback);
|
||||
g_object_set_data(G_OBJECT(menu_item),
|
||||
"gnc_option_cb",
|
||||
option_info[i].callback);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(menu_item),
|
||||
"gnc_option_index",
|
||||
GINT_TO_POINTER(i));
|
||||
g_object_set_data(G_OBJECT(menu_item),
|
||||
"gnc_option_index",
|
||||
GINT_TO_POINTER(i));
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(menu_item),
|
||||
"gnc_option_menu",
|
||||
omenu);
|
||||
g_object_set_data(G_OBJECT(menu_item),
|
||||
"gnc_option_menu",
|
||||
omenu);
|
||||
|
||||
if (option_info[i].callback != NULL)
|
||||
g_signal_connect(menu_item, "activate",
|
||||
@ -359,9 +359,9 @@ gnc_option_menu_init(GtkWidget * w)
|
||||
{
|
||||
gtk_option_menu_set_history(GTK_OPTION_MENU(w), i);
|
||||
active = gtk_menu_get_active(GTK_MENU(menu));
|
||||
gtk_object_set_data(GTK_OBJECT(active),
|
||||
"option_index",
|
||||
GINT_TO_POINTER(i));
|
||||
g_object_set_data(G_OBJECT(active),
|
||||
"option_index",
|
||||
GINT_TO_POINTER(i));
|
||||
}
|
||||
|
||||
gtk_option_menu_set_history(GTK_OPTION_MENU(w), 0);
|
||||
@ -410,8 +410,8 @@ gnc_option_menu_get_active(GtkWidget * w)
|
||||
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
|
||||
menuitem = gtk_menu_get_active(GTK_MENU(menu));
|
||||
|
||||
return GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
|
||||
"option_index"));
|
||||
return GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menuitem),
|
||||
"option_index"));
|
||||
}
|
||||
|
||||
|
||||
@ -763,11 +763,11 @@ static GNCCListCheckInfo *
|
||||
gnc_clist_add_check (GtkCList *list)
|
||||
{
|
||||
GNCCListCheckInfo *check_info;
|
||||
GtkObject *object;
|
||||
GObject *object;
|
||||
|
||||
object = GTK_OBJECT (list);
|
||||
object = G_OBJECT (list);
|
||||
|
||||
check_info = gtk_object_get_data (object, "gnc-check-info");
|
||||
check_info = g_object_get_data (object, "gnc-check-info");
|
||||
if (check_info)
|
||||
{
|
||||
PWARN ("clist already has check");
|
||||
@ -776,7 +776,7 @@ gnc_clist_add_check (GtkCList *list)
|
||||
|
||||
check_info = g_new0 (GNCCListCheckInfo, 1);
|
||||
|
||||
gtk_object_set_data (object, "gnc-check-info", check_info);
|
||||
g_object_set_data (object, "gnc-check-info", check_info);
|
||||
|
||||
g_signal_connect (object, "realize",
|
||||
G_CALLBACK (check_realize), check_info);
|
||||
@ -800,7 +800,7 @@ gnc_clist_set_check (GtkCList *list, int row, int col, gboolean checked)
|
||||
|
||||
g_return_if_fail (GTK_IS_CLIST (list));
|
||||
|
||||
check_info = gtk_object_get_data (GTK_OBJECT (list), "gnc-check-info");
|
||||
check_info = g_object_get_data (G_OBJECT (list), "gnc-check-info");
|
||||
if (!check_info)
|
||||
check_info = gnc_clist_add_check (list);
|
||||
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "gnc-date.h"
|
||||
#include "gnc-date-delta.h"
|
||||
|
||||
#define GDD_LABEL "gdd"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -199,7 +200,7 @@ set_units (GtkWidget *widget, gpointer data)
|
||||
GNCDateDelta *gdd;
|
||||
|
||||
units = GPOINTER_TO_INT(data);
|
||||
gdd = GNC_DATE_DELTA(gtk_object_get_user_data(GTK_OBJECT(widget)));
|
||||
gdd = GNC_DATE_DELTA(g_object_get_data(G_OBJECT(widget), GDD_LABEL));
|
||||
|
||||
gdd->units = units;
|
||||
|
||||
@ -227,7 +228,7 @@ fill_units_menu(GNCDateDelta *gdd)
|
||||
for (i = 0; strings[i] != NULL; i++)
|
||||
{
|
||||
item = gtk_menu_item_new_with_label (strings[i]);
|
||||
gtk_object_set_user_data(GTK_OBJECT(item), gdd);
|
||||
g_object_set_data(G_OBJECT(item), GDD_LABEL, gdd);
|
||||
gtk_menu_append (GTK_MENU (menu), item);
|
||||
gtk_widget_show(item);
|
||||
|
||||
@ -245,7 +246,7 @@ set_polarity (GtkWidget *widget, gpointer data)
|
||||
GNCDateDelta *gdd;
|
||||
|
||||
polarity = GPOINTER_TO_INT(data);
|
||||
gdd = GNC_DATE_DELTA(gtk_object_get_user_data(GTK_OBJECT(widget)));
|
||||
gdd = GNC_DATE_DELTA(g_object_get_data(G_OBJECT(widget), GDD_LABEL));
|
||||
|
||||
gdd->polarity = polarity;
|
||||
|
||||
@ -271,7 +272,7 @@ fill_polarity_menu(GNCDateDelta *gdd)
|
||||
for (i = 0; strings[i] != NULL; i++)
|
||||
{
|
||||
item = gtk_menu_item_new_with_label (strings[i]);
|
||||
gtk_object_set_user_data(GTK_OBJECT(item), gdd);
|
||||
g_object_set_data(G_OBJECT(item), GDD_LABEL, gdd);
|
||||
gtk_menu_append (GTK_MENU (menu), item);
|
||||
gtk_widget_show(item);
|
||||
|
||||
|
@ -286,8 +286,7 @@ gnc_dense_cal_init (GncDenseCal *dcal)
|
||||
l = gtk_label_new( _("Date: ") );
|
||||
gtk_container_add( GTK_CONTAINER(hbox), l );
|
||||
l = gtk_label_new( "YY/MM/DD" );
|
||||
gtk_object_set_data( GTK_OBJECT(dcal->transPopup),
|
||||
"dateLabel", (gpointer)l );
|
||||
g_object_set_data( G_OBJECT(dcal->transPopup), "dateLabel", l );
|
||||
gtk_container_add( GTK_CONTAINER(hbox), l );
|
||||
gtk_container_add( GTK_CONTAINER(vbox), hbox );
|
||||
|
||||
@ -296,8 +295,7 @@ gnc_dense_cal_init (GncDenseCal *dcal)
|
||||
cl = GTK_CLIST(gtk_clist_new_with_titles(2, (gchar**)CLIST_TITLES));
|
||||
gtk_clist_set_column_auto_resize( cl, 0, TRUE );
|
||||
gtk_clist_set_column_auto_resize( cl, 1, TRUE );
|
||||
gtk_object_set_data( GTK_OBJECT(dcal->transPopup),
|
||||
"clist", (gpointer)cl );
|
||||
g_object_set_data( G_OBJECT(dcal->transPopup), "clist", cl );
|
||||
gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(cl) );
|
||||
|
||||
gtk_container_add( GTK_CONTAINER(dcal->transPopup), vbox );
|
||||
@ -1038,15 +1036,15 @@ populate_hover_window( GncDenseCal *dcal, gint doc )
|
||||
gchar strftimeBuf[MAX_STRFTIME_BUF_LEN];
|
||||
|
||||
if ( doc >= 0 ) {
|
||||
GtkObject *o;
|
||||
GObject *o;
|
||||
GtkCList *cl;
|
||||
GList *l;
|
||||
gchar *rowText[2];
|
||||
gint row = 0;
|
||||
gdc_mark_data *gdcmd;
|
||||
|
||||
w = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(dcal->transPopup),
|
||||
"dateLabel" ) );
|
||||
w = GTK_WIDGET( g_object_get_data( G_OBJECT(dcal->transPopup),
|
||||
"dateLabel" ) );
|
||||
date = g_date_new_dmy( 1, dcal->month, dcal->year );
|
||||
g_date_add_days( date, doc );
|
||||
/* Note: the ISO date format (%F or equivalently
|
||||
@ -1057,8 +1055,8 @@ populate_hover_window( GncDenseCal *dcal, gint doc )
|
||||
g_date_strftime( strftimeBuf, MAX_STRFTIME_BUF_LEN-1, "%x", date );
|
||||
gtk_label_set_text( GTK_LABEL(w), strftimeBuf );
|
||||
|
||||
o = GTK_OBJECT(dcal->transPopup);
|
||||
cl = GTK_CLIST( gtk_object_get_data(o, "clist" ) );
|
||||
o = G_OBJECT(dcal->transPopup);
|
||||
cl = GTK_CLIST( g_object_get_data(o, "clist" ) );
|
||||
gtk_clist_clear( cl );
|
||||
for ( l = dcal->marks[doc]; l; l = l->next ) {
|
||||
gdcmd = (gdc_mark_data*)l->data;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
|
||||
#define INDEX_LABEL "index"
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
/* static short module = MOD_GUI; */
|
||||
@ -455,7 +456,7 @@ gnc_choose_radio_button_cb(GtkWidget *w, gpointer data)
|
||||
int *result = data;
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
|
||||
*result = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(w)));
|
||||
*result = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w), INDEX_LABEL));
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -516,7 +517,7 @@ gnc_choose_radio_option_dialog(gncUIWidget parent,
|
||||
|
||||
gtk_widget_show(radio_button);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), radio_button, FALSE, FALSE, 0);
|
||||
gtk_object_set_user_data(GTK_OBJECT(radio_button), GINT_TO_POINTER(i));
|
||||
g_object_set_data(G_OBJECT(radio_button), INDEX_LABEL, GINT_TO_POINTER(i));
|
||||
g_signal_connect(radio_button, "clicked",
|
||||
G_CALLBACK(gnc_choose_radio_button_cb),
|
||||
&radio_result);
|
||||
|
@ -267,9 +267,10 @@ gnc_tree_view_init (GncTreeView *view, GncTreeViewClass *klass)
|
||||
* column, but have it take up any extra space in the window. */
|
||||
column = gnc_tree_view_add_text_column (view, NULL, NULL, NULL, NULL,
|
||||
-1, -1, NULL);
|
||||
gtk_object_set(GTK_OBJECT(column),
|
||||
"fixed-width", 1,
|
||||
"expand", TRUE, NULL);
|
||||
g_object_set(G_OBJECT(column),
|
||||
"fixed-width", 1,
|
||||
"expand", TRUE,
|
||||
(gchar *)NULL);
|
||||
|
||||
/* Create the last column which contains the column selection
|
||||
* widget. gnc_tree_view_add_text_column will do most of the
|
||||
@ -280,11 +281,11 @@ gnc_tree_view_init (GncTreeView *view, GncTreeViewClass *klass)
|
||||
gtk_widget_size_request(icon, &requisition);
|
||||
column = gnc_tree_view_add_text_column (view, NULL, NULL, NULL, NULL,
|
||||
-1, -1, NULL);
|
||||
gtk_object_set(GTK_OBJECT(column),
|
||||
"clickable", TRUE,
|
||||
"widget", icon,
|
||||
"fixed-width", requisition.width + 10,
|
||||
NULL);
|
||||
g_object_set(G_OBJECT(column),
|
||||
"clickable", TRUE,
|
||||
"widget", icon,
|
||||
"fixed-width", requisition.width + 10,
|
||||
(gchar *)NULL);
|
||||
g_signal_connect(G_OBJECT(column), "clicked",
|
||||
G_CALLBACK (gnc_tree_view_select_column_cb),
|
||||
view);
|
||||
|
@ -1131,7 +1131,7 @@ advance_toggle( GtkButton *o, SchedXactionEditorDialog *sxed )
|
||||
gchar *spinName;
|
||||
GtkWidget *spin;
|
||||
|
||||
spinName = (gchar*)gtk_object_get_data( GTK_OBJECT(o), "whichOneAmI" );
|
||||
spinName = (gchar*)g_object_get_data( G_OBJECT(o), "whichOneAmI" );
|
||||
spin = glade_xml_get_widget( sxed->gxml, spinName );
|
||||
if ( !spin ) {
|
||||
PERR( "Error getting widget with name \"%s\"", spinName );
|
||||
@ -1481,9 +1481,8 @@ gnc_ui_scheduled_xaction_editor_dialog_create( SchedXactionDialog *sxd,
|
||||
for ( i=0; widgets[i].name != NULL; i++ ) {
|
||||
button = glade_xml_get_widget( sxed->gxml, widgets[i].name );
|
||||
if ( widgets[i].objectData != NULL ) {
|
||||
gtk_object_set_data( GTK_OBJECT(button),
|
||||
"whichOneAmI",
|
||||
widgets[i].objectData );
|
||||
g_object_set_data( G_OBJECT(button), "whichOneAmI",
|
||||
widgets[i].objectData );
|
||||
}
|
||||
g_signal_connect( button, widgets[i].signal,
|
||||
G_CALLBACK( widgets[i].fn ), sxed );
|
||||
@ -1929,8 +1928,7 @@ endgroup_rb_toggled( GtkButton *b, gpointer d )
|
||||
gint id;
|
||||
|
||||
sxed = (SchedXactionEditorDialog*)d;
|
||||
id = GPOINTER_TO_INT(gtk_object_get_data( GTK_OBJECT(b),
|
||||
"whichOneAmI" ));
|
||||
id = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(b), "whichOneAmI" ));
|
||||
|
||||
switch (id) {
|
||||
case END_NEVER_OPTION:
|
||||
|
@ -372,7 +372,7 @@ static void gnc_sxsld_free_toCreateTuple_list( GList *l );
|
||||
static void gnc_sxsld_free_sxState( gpointer key,
|
||||
gpointer value,
|
||||
gpointer userdata );
|
||||
static void gnc_sxsld_free_entry_numeric( GtkObject *o, gpointer ud );
|
||||
static void gnc_sxsld_free_entry_numeric( GObject *o, gpointer ud );
|
||||
|
||||
static gint sxsld_process_to_create_instance( sxSinceLastData *sxsld,
|
||||
toCreateInstance *tci );
|
||||
@ -2275,11 +2275,11 @@ sxsincelast_entry_changed( GtkEditable *e, gpointer ud )
|
||||
|
||||
sxsld = (sxSinceLastData*)ud;
|
||||
|
||||
tci = (toCreateInstance*)gtk_object_get_data( GTK_OBJECT(e), "tci" );
|
||||
tci = (toCreateInstance*)g_object_get_data( G_OBJECT(e), "tci" );
|
||||
g_assert( tci == sxsld->curSelTCI );
|
||||
|
||||
varName = (gchar*)gtk_object_get_data( GTK_OBJECT(e), "varName" );
|
||||
num = (gnc_numeric*)gtk_object_get_data( GTK_OBJECT(e), "numeric" );
|
||||
varName = (gchar*)g_object_get_data( G_OBJECT(e), "varName" );
|
||||
num = (gnc_numeric*)g_object_get_data( G_OBJECT(e), "numeric" );
|
||||
entryText = gtk_editable_get_chars( e, 0, -1 );
|
||||
dummyVarHash = g_hash_table_new( NULL, NULL );
|
||||
/* FIXME?: Should be using xaccParseAmount instead of
|
||||
@ -2798,7 +2798,7 @@ tct_table_entry_key_handle( GtkWidget *widget, GdkEventKey *event, gpointer ud )
|
||||
/* First, deal with formulas in these cells, replacing their
|
||||
* contents with the eval'd value. */
|
||||
ent = GTK_ENTRY(widget);
|
||||
num = (gnc_numeric*)gtk_object_get_data( GTK_OBJECT(ent), "numeric" );
|
||||
num = (gnc_numeric*)g_object_get_data( G_OBJECT(ent), "numeric" );
|
||||
str = g_string_new("");
|
||||
g_string_printf( str, "%0.2f", gnc_numeric_to_double( *num ) );
|
||||
gtk_entry_set_text( ent, str->str );
|
||||
@ -2937,18 +2937,16 @@ sxsincelast_tc_row_sel( GtkCTree *ct,
|
||||
g_string_free( gstr, TRUE );
|
||||
|
||||
entry = gtk_entry_new();
|
||||
gtk_object_set_data( GTK_OBJECT(entry), "varName",
|
||||
varName );
|
||||
gtk_object_set_data( GTK_OBJECT(entry), "tci", tci );
|
||||
g_object_set_data( G_OBJECT(entry), "varName", varName );
|
||||
g_object_set_data( G_OBJECT(entry), "tci", tci );
|
||||
tmpNumValue = g_new0( gnc_numeric, 1 );
|
||||
*tmpNumValue = gnc_numeric_create( 0, 1 );
|
||||
gtk_object_set_data( GTK_OBJECT(entry), "numeric",
|
||||
tmpNumValue );
|
||||
g_object_set_data( G_OBJECT(entry), "numeric", tmpNumValue );
|
||||
if ( tableIdx == varHashSize ) {
|
||||
/* Set a flag so we can know if we're the last row of
|
||||
* the table. */
|
||||
gtk_object_set_data( GTK_OBJECT(entry), "lastVisualElt",
|
||||
(gpointer)1 );
|
||||
g_object_set_data( G_OBJECT(entry), "lastVisualElt",
|
||||
(gpointer)1 );
|
||||
}
|
||||
|
||||
gtk_widget_set_usize( entry, 64, 0 );
|
||||
@ -3896,10 +3894,10 @@ gnc_sxsld_free_sxState( gpointer key,
|
||||
|
||||
static
|
||||
void
|
||||
gnc_sxsld_free_entry_numeric( GtkObject *o, gpointer ud )
|
||||
gnc_sxsld_free_entry_numeric( GObject *o, gpointer ud )
|
||||
{
|
||||
gnc_numeric *num;
|
||||
num = (gnc_numeric*)gtk_object_get_data( o, "numeric" );
|
||||
num = (gnc_numeric*)g_object_get_data( o, "numeric" );
|
||||
g_free( num );
|
||||
}
|
||||
|
||||
|
@ -808,7 +808,7 @@ on_finish (GnomeDruidPage *gnomedruidpage,
|
||||
xaccGroupForEachAccount (our_final_group, (AccountCallback)starting_balance_helper,
|
||||
data, TRUE);
|
||||
ENTER (" ");
|
||||
qof_book_merge_window = gtk_object_get_data (GTK_OBJECT (hierarchy_window), "Merge Druid");
|
||||
qof_book_merge_window = g_object_get_data (G_OBJECT (hierarchy_window), "Merge Druid");
|
||||
if(qof_book_merge_window) {
|
||||
DEBUG ("qof_book_merge_window found");
|
||||
if (our_final_group)
|
||||
|
@ -424,7 +424,7 @@ gnc_ui_qof_book_merge_druid (void)
|
||||
gnc_ui_hierarchy_druid();
|
||||
druid_hierarchy_window = gnc_ui_hierarchy_running();
|
||||
gtk_widget_hide (druid_hierarchy_window);
|
||||
gtk_object_set_data (GTK_OBJECT (druid_hierarchy_window), "Merge Druid", qof_book_merge_window);
|
||||
g_object_set_data (G_OBJECT (druid_hierarchy_window), "Merge Druid", qof_book_merge_window);
|
||||
gtk_widget_show_all (qof_book_merge_window);
|
||||
g_return_if_fail(targetBook != NULL);
|
||||
g_return_if_fail(mergeBook != NULL);
|
||||
|
@ -243,7 +243,7 @@ make_commodity_druid_page(gnc_commodity * comm)
|
||||
|
||||
/* make the page widget */
|
||||
retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
|
||||
gtk_object_set_data(GTK_OBJECT(retval->page), "page_struct", retval);
|
||||
g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
|
||||
|
||||
page = GNOME_DRUID_PAGE_STANDARD(retval->page);
|
||||
|
||||
@ -394,9 +394,7 @@ gnc_ui_commodity_druid_comm_check_cb(GnomeDruidPage * page, gpointer druid,
|
||||
gpointer user_data)
|
||||
{
|
||||
CommodityDruid * cd = user_data;
|
||||
CommodityDruidPage * dpage =
|
||||
(CommodityDruidPage *)gtk_object_get_data(GTK_OBJECT(page),
|
||||
"page_struct");
|
||||
CommodityDruidPage * dpage = g_object_get_data(G_OBJECT(page), "page_struct");
|
||||
const char * new_type;
|
||||
const char * new_name;
|
||||
const char * new_mnemonic;
|
||||
|
@ -54,6 +54,8 @@
|
||||
# include <ktoblzcheck.h>
|
||||
#endif
|
||||
|
||||
#define TEMPLATE_LABEL "template"
|
||||
|
||||
/* -------------------------------------- */
|
||||
/* Data structure */
|
||||
/* -------------------------------------- */
|
||||
@ -213,7 +215,7 @@ static void fill_template_list_func(gpointer data, gpointer user_data)
|
||||
item = gtk_list_item_new_with_label(gnc_trans_templ_get_name(templ));
|
||||
g_assert(item);
|
||||
|
||||
gtk_object_set_user_data(GTK_OBJECT(item), templ);
|
||||
g_object_set_data(G_OBJECT(item), TEMPLATE_LABEL, templ);
|
||||
gtk_container_add(GTK_CONTAINER(list), item );
|
||||
}
|
||||
|
||||
@ -814,7 +816,7 @@ on_template_list_select_child (GtkList *list,
|
||||
gpointer user_data)
|
||||
{
|
||||
HBCITransDialog *td = user_data;
|
||||
GNCTransTempl *templ = gtk_object_get_user_data (GTK_OBJECT(widget)) ;
|
||||
GNCTransTempl *templ = g_object_get_data (G_OBJECT(widget), TEMPLATE_LABEL);
|
||||
|
||||
g_assert(td);
|
||||
|
||||
@ -937,7 +939,7 @@ void add_template_cb(GtkButton *b,
|
||||
gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
|
||||
|
||||
if (td->selected_template) {
|
||||
t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
|
||||
t = g_object_get_data(G_OBJECT(td->selected_template), TEMPLATE_LABEL);
|
||||
|
||||
index = 1+gtk_list_child_position(GTK_LIST(td->template_gtktreeview), td->selected_template);
|
||||
}
|
||||
@ -971,7 +973,7 @@ moveup_template_cb(GtkButton *button,
|
||||
g_assert(td);
|
||||
|
||||
if (td->selected_template) {
|
||||
t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
|
||||
t = g_object_get_data(G_OBJECT(td->selected_template), TEMPLATE_LABEL);
|
||||
|
||||
index = gtk_list_child_position(GTK_LIST(td->template_gtktreeview), td->selected_template);
|
||||
|
||||
@ -1004,7 +1006,7 @@ movedown_template_cb(GtkButton *button,
|
||||
g_assert(td);
|
||||
|
||||
if (td->selected_template) {
|
||||
t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
|
||||
t = g_object_get_data(G_OBJECT(td->selected_template), TEMPLATE_LABEL);
|
||||
|
||||
index = gtk_list_child_position(GTK_LIST(td->template_gtktreeview), td->selected_template);
|
||||
|
||||
@ -1073,7 +1075,7 @@ del_template_cb(GtkButton *button,
|
||||
|
||||
if (td->selected_template) {
|
||||
|
||||
t = gtk_object_get_user_data(GTK_OBJECT(td->selected_template));
|
||||
t = g_object_get_data(G_OBJECT(td->selected_template), TEMPLATE_LABEL);
|
||||
|
||||
index = gtk_list_child_position(GTK_LIST(td->template_gtktreeview), td->selected_template);
|
||||
|
||||
|
@ -83,7 +83,7 @@ void GNCInteractor_delete(GNCInteractor *data)
|
||||
(GTK_TOGGLE_BUTTON (data->close_checkbutton)),
|
||||
NULL);
|
||||
gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (data->dialog));
|
||||
gtk_object_unref (GTK_OBJECT (data->dialog));
|
||||
g_object_unref (G_OBJECT (data->dialog));
|
||||
gtk_widget_destroy (data->dialog);
|
||||
}
|
||||
|
||||
@ -812,7 +812,7 @@ gnc_hbci_add_callbacks(AB_BANKING *ab, GNCInteractor *data)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->parent));
|
||||
gnc_restore_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (dialog));
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (dialog));
|
||||
g_object_ref (G_OBJECT (dialog));
|
||||
gtk_widget_hide_all (dialog);
|
||||
|
||||
GWEN_INHERIT_SETDATA(AB_BANKING, GNCInteractor,
|
||||
|
@ -1130,7 +1130,7 @@ gnc_ui_qif_import_convert(QIFImportWindow * wind)
|
||||
/* get any changes to the imported stocks */
|
||||
for(pageptr = wind->commodity_pages; pageptr; pageptr=pageptr->next) {
|
||||
gtkpage = GNOME_DRUID_PAGE(pageptr->data);
|
||||
page = gtk_object_get_data(GTK_OBJECT(gtkpage), "page_struct");
|
||||
page = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
|
||||
|
||||
mnemonic = gtk_entry_get_text(GTK_ENTRY(page->new_mnemonic_entry));
|
||||
namespace = gnc_ui_namespace_picker_ns((page->new_type_combo));
|
||||
@ -1365,8 +1365,7 @@ gnc_ui_qif_import_comm_check_cb(GnomeDruidPage * page,
|
||||
gpointer user_data)
|
||||
{
|
||||
QIFImportWindow * wind = user_data;
|
||||
QIFDruidPage * qpage =
|
||||
gtk_object_get_data(GTK_OBJECT(page), "page_struct");
|
||||
QIFDruidPage * qpage = g_object_get_data(G_OBJECT(page), "page_struct");
|
||||
|
||||
const char * namespace = gnc_ui_namespace_picker_ns(qpage->new_type_combo);
|
||||
const char * name = gtk_entry_get_text(GTK_ENTRY(qpage->new_name_entry));
|
||||
@ -1521,8 +1520,7 @@ make_qif_druid_page(gnc_commodity * comm)
|
||||
/* make the page widget */
|
||||
retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
|
||||
retval->commodity = comm;
|
||||
gtk_object_set_data(GTK_OBJECT(retval->page),
|
||||
"page_struct", (gpointer)retval);
|
||||
g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
|
||||
|
||||
page = GNOME_DRUID_PAGE_STANDARD(retval->page);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user