Commit 8bcbc366 authored by Morten Welinder's avatar Morten Welinder

code cleanup.

parent c1d445fd
2010-10-20 Morten Welinder <terra@gnome.org>
* src/gui-util.c (gnm_xml_get_widget): Elminate. Change all
callers to go_gtk_builder_get_widget. ("The light that burns
twice as bright burns for half as long - and you have burned so
very, very brightly, Roy.")
2010-10-19 Morten Welinder <terra@gnome.org>
* src/gui-util.c (gnumeric_keyed_dialog): When dialog is
......
......@@ -65,7 +65,7 @@ dialog_tool_preset_to_range (GenericToolState *state)
gnm_dao_load_range (GNM_DAO (state->gdao), sel);
gnm_dao_focus_output_range (GNM_DAO (state->gdao));
w = gnm_xml_get_widget (state->gui, "notebook1");
w = go_gtk_builder_get_widget (state->gui, "notebook1");
g_return_if_fail (w && GTK_IS_NOTEBOOK (w));
gtk_notebook_set_current_page (GTK_NOTEBOOK(w), 0);
}
......@@ -84,7 +84,7 @@ dialog_tool_init_outputs (GenericToolState *state, GCallback sensitivity_cb)
{
GtkWidget *dao_box;
dao_box = gnm_xml_get_widget (state->gui, "dao");
dao_box = go_gtk_builder_get_widget (state->gui, "dao");
if (dao_box == NULL) {
state->gdao = NULL;
......
......@@ -125,7 +125,7 @@ advanced_filter_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
dao = parse_output ((GenericToolState *) state, NULL);
w = gnm_xml_get_widget (state->gui, "unique-button");
w = go_gtk_builder_get_widget (state->gui, "unique-button");
unique = (1 == gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)));
if (dao->type == InPlaceOutput)
......
......@@ -92,7 +92,7 @@ chi_squared_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
w = gnm_xml_get_widget (state->base.gui, "test-of-independence");
w = go_gtk_builder_get_widget (state->base.gui, "test-of-independence");
data->independence = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
data->n_c = (data->input->v_range.cell.b.col - data->input->v_range.cell.a.col + 1);
......@@ -228,7 +228,7 @@ dialog_chi_square_tool (WBCGtk *wbcg, Sheet *sheet, gboolean independence)
else
type ="test-of-homogeneity";
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (gnm_xml_get_widget (state->base.gui,
(GTK_TOGGLE_BUTTON (go_gtk_builder_get_widget (state->base.gui,
type)),
TRUE);
......
......@@ -164,7 +164,7 @@ frequency_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->predetermined = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (state->predetermined_button));
if (data->predetermined) {
w = gnm_xml_get_widget (state->base.gui, "labels_2_button");
w = go_gtk_builder_get_widget (state->base.gui, "labels_2_button");
data->bin = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2),
state->base.sheet);
......@@ -175,11 +175,11 @@ frequency_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->chart = gnm_gui_group_value (state->base.gui, chart_group);
w = gnm_xml_get_widget (state->base.gui, "labels_button");
w = go_gtk_builder_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
w = gnm_xml_get_widget (state->base.gui, "percentage-button");
w = go_gtk_builder_get_widget (state->base.gui, "percentage-button");
data->percentage = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
w = gnm_xml_get_widget (state->base.gui, "exact-button");
w = go_gtk_builder_get_widget (state->base.gui, "exact-button");
data->exact = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg), state->base.sheet,
......
......@@ -282,7 +282,7 @@ kaplan_meier_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
}
data->median = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (gnm_xml_get_widget
GTK_TOGGLE_BUTTON (go_gtk_builder_get_widget
(state->base.gui,
"median-button")));
data->chart = gtk_toggle_button_get_active (
......@@ -494,10 +494,10 @@ dialog_kaplan_meier_tool_setup_treeview (KaplanMeierToolState *state)
{
guint i;
GtkCellRenderer *renderer;
GtkWidget *scrolled = gnm_xml_get_widget (state->base.gui, "groups-scrolled");
GtkWidget *scrolled = go_gtk_builder_get_widget (state->base.gui, "groups-scrolled");
GtkTreeSelection *selection;
state->groups_treeview = GTK_TREE_VIEW (gnm_xml_get_widget
state->groups_treeview = GTK_TREE_VIEW (go_gtk_builder_get_widget
(state->base.gui,
"groups-tree"));
state->groups_list = gtk_list_store_new (GROUP_COLUMNS,
......@@ -625,40 +625,40 @@ dialog_kaplan_meier_tool (WBCGtk *wbcg, Sheet *sheet)
state->censorship_button = GTK_WIDGET (gnm_xml_get_widget
state->censorship_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"censor-button"));
state->censor_spin_from = GTK_WIDGET (gnm_xml_get_widget
state->censor_spin_from = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"censored-spinbutton1"));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (state->censor_spin_from), 0.,G_MAXSHORT);
state->censor_spin_to = GTK_WIDGET (gnm_xml_get_widget
state->censor_spin_to = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"censored-spinbutton2"));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (state->censor_spin_to), 0.,G_MAXSHORT);
state->graph_button = GTK_WIDGET (gnm_xml_get_widget
state->graph_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"graph-button"));
state->tick_button = GTK_WIDGET (gnm_xml_get_widget
state->tick_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"tick-button"));
state->add_group_button = GTK_WIDGET (gnm_xml_get_widget
state->add_group_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"add-button"));
state->remove_group_button = GTK_WIDGET (gnm_xml_get_widget
state->remove_group_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"remove-button"));
state->std_error_button = GTK_WIDGET (gnm_xml_get_widget
state->std_error_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"std-error-button"));
state->logrank_button = GTK_WIDGET (gnm_xml_get_widget
state->logrank_button = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"logrank-button"));
state->groups_check = GTK_WIDGET (gnm_xml_get_widget
state->groups_check = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"groups-check"));
state->groups_table = GTK_WIDGET (gnm_xml_get_widget
state->groups_table = GTK_WIDGET (go_gtk_builder_get_widget
(state->base.gui,
"groups-table"));
state->groups_input = gnm_expr_entry_new (state->base.wbcg, TRUE);
......@@ -718,7 +718,7 @@ dialog_kaplan_meier_tool (WBCGtk *wbcg, Sheet *sheet)
gnumeric_editable_enters (GTK_WINDOW (state->base.dialog),
GTK_WIDGET (state->groups_input));
widget = gnm_xml_get_widget (state->base.gui, "groups-label");
widget = go_gtk_builder_get_widget (state->base.gui, "groups-label");
gtk_label_set_mnemonic_widget (GTK_LABEL (widget),
GTK_WIDGET (state->groups_input));
go_atk_setup_label (widget, GTK_WIDGET (state->groups_input));
......
......@@ -151,14 +151,14 @@ normality_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnm_gui_group_value (state->base.gui, grouped_by_group);
w = gnm_xml_get_widget (state->base.gui, "labels_button");
w = go_gtk_builder_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
data->alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
data->type = gnm_gui_group_value (state->base.gui, test_group);
w = gnm_xml_get_widget (state->base.gui, "normalprobabilityplot");
w = go_gtk_builder_get_widget (state->base.gui, "normalprobabilityplot");
data->graph = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg), state->base.sheet,
......
......@@ -120,7 +120,7 @@ principal_components_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
GNM_EXPR_ENTRY (state->input_entry), state->sheet);
data->group_by = gnm_gui_group_value (state->gui, grouped_by_group);
w = gnm_xml_get_widget (state->gui, "labels_button");
w = go_gtk_builder_get_widget (state->gui, "labels_button");
data->labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (cmd_analysis_tool (WORKBOOK_CONTROL (state->wbcg), state->sheet,
......
......@@ -205,7 +205,7 @@ sign_test_two_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.range_2 = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2), state->base.sheet);
w = gnm_xml_get_widget (state->base.gui, "labels_button");
w = go_gtk_builder_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (w));
......@@ -215,7 +215,7 @@ sign_test_two_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
w = gnm_xml_get_widget (state->base.gui, "signtest");
w = go_gtk_builder_get_widget (state->base.gui, "signtest");
engine = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))
? analysis_tool_sign_test_two_engine
: analysis_tool_signed_rank_test_two_engine;
......@@ -277,7 +277,7 @@ dialog_sign_test_two_tool (WBCGtk *wbcg, Sheet *sheet, signtest_type type)
state);
int_to_entry (GTK_ENTRY (state->median_entry), 0);
w = gnm_xml_get_widget (state->base.gui,
w = go_gtk_builder_get_widget (state->base.gui,
(type == SIGNTEST) ? "signtest"
: "signedranktest");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
......@@ -318,7 +318,7 @@ sign_test_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnm_gui_group_value (state->base.gui, grouped_by_group);
w = gnm_xml_get_widget (state->base.gui, "labels_button");
w = go_gtk_builder_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (w));
......@@ -327,7 +327,7 @@ sign_test_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
w = gnm_xml_get_widget (state->base.gui, "signtest");
w = go_gtk_builder_get_widget (state->base.gui, "signtest");
engine = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))
? analysis_tool_sign_test_engine
: analysis_tool_signed_rank_test_engine;
......@@ -422,7 +422,7 @@ dialog_sign_test_tool (WBCGtk *wbcg, Sheet *sheet, signtest_type type)
int_to_entry (GTK_ENTRY (state->median_entry), 0);
float_to_entry (GTK_ENTRY (state->alpha_entry), 0.05);
w = gnm_xml_get_widget (state->base.gui,
w = go_gtk_builder_get_widget (state->base.gui,
(type == SIGNTEST) ? "signtest"
: "signedranktest");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
......
......@@ -140,7 +140,7 @@ wilcoxon_mann_whitney_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
GNM_EXPR_ENTRY (state->input_entry), state->sheet);
data->group_by = gnm_gui_group_value (state->gui, grouped_by_group);
w = gnm_xml_get_widget (state->gui, "labels_button");
w = go_gtk_builder_get_widget (state->gui, "labels_button");
data->labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (cmd_analysis_tool (WORKBOOK_CONTROL (state->wbcg), state->sheet,
......@@ -198,7 +198,7 @@ dialog_wilcoxon_m_w_tool (WBCGtk *wbcg, Sheet *sheet)
return 0;
g_signal_connect_after
(G_OBJECT (gnm_xml_get_widget
(G_OBJECT (go_gtk_builder_get_widget
(state->gui,
"grouped_by_row")), "toggled",
G_CALLBACK (wilcoxon_mann_whitney_tool_update_sensitivity_cb),
......
This diff is collapsed.
......@@ -70,7 +70,7 @@ map_op (AutoFilterState *state, GnmFilterOp *op,
char const *op_widget, char const *val_widget)
{
int i;
GtkWidget *w = gnm_xml_get_widget (state->gui, val_widget);
GtkWidget *w = go_gtk_builder_get_widget (state->gui, val_widget);
char const *txt = gtk_entry_get_text (GTK_ENTRY (w));
GnmValue *v = NULL;
......@@ -78,7 +78,7 @@ map_op (AutoFilterState *state, GnmFilterOp *op,
if (txt == NULL || *txt == '\0')
return NULL;
w = gnm_xml_get_widget (state->gui, op_widget);
w = go_gtk_builder_get_widget (state->gui, op_widget);
i = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
switch (i) {
case 0: return NULL;
......@@ -133,7 +133,7 @@ cb_autofilter_ok (G_GNUC_UNUSED GtkWidget *button,
GnmFilterOp op1;
GnmValue *v1 = map_op (state, &op1, "op1", "value1");
if (op1 != GNM_FILTER_UNUSED) {
w = gnm_xml_get_widget (state->gui, "and_button");
w = go_gtk_builder_get_widget (state->gui, "and_button");
cond = gnm_filter_condition_new_double (op0, v0,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)),
op1, v1);
......@@ -143,13 +143,13 @@ cb_autofilter_ok (G_GNUC_UNUSED GtkWidget *button,
} else {
int bottom, percentage, count;
w = gnm_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
w = go_gtk_builder_get_widget (state->gui, "top_vs_bottom_option_menu");
bottom = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
w = go_gtk_builder_get_widget (state->gui, "item_vs_percentage_option_menu");
percentage = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
w = gnm_xml_get_widget (state->gui, "item_count");
w = go_gtk_builder_get_widget (state->gui, "item_count");
count = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w));
if (bottom >= 0 && percentage >= 0)
cond = gnm_filter_condition_new_bucket (
......@@ -174,7 +174,7 @@ static void
cb_top10_type_changed (GtkComboBox *menu,
AutoFilterState *state)
{
GtkWidget *spin = gnm_xml_get_widget (state->gui, "item_count");
GtkWidget *spin = go_gtk_builder_get_widget (state->gui, "item_count");
gtk_spin_button_set_range (GTK_SPIN_BUTTON (spin), 1.,
(gtk_combo_box_get_active (menu) > 0) ? 100. : 500.);
......@@ -184,7 +184,7 @@ static void
init_operator (AutoFilterState *state, GnmFilterOp op, GnmValue const *v,
char const *op_widget, char const *val_widget)
{
GtkWidget *w = gnm_xml_get_widget (state->gui, op_widget);
GtkWidget *w = go_gtk_builder_get_widget (state->gui, op_widget);
char const *str = v ? value_peek_string (v) : NULL;
char *content = NULL;
int i;
......@@ -217,7 +217,7 @@ init_operator (AutoFilterState *state, GnmFilterOp op, GnmValue const *v,
}
gtk_combo_box_set_active (GTK_COMBO_BOX (w), i);
w = gnm_xml_get_widget (state->gui, val_widget);
w = go_gtk_builder_get_widget (state->gui, val_widget);
gnumeric_editable_enters (GTK_WINDOW (state->dialog), w);
if (v != NULL)
gtk_entry_set_text (GTK_ENTRY (w), content ? content : str);
......@@ -276,20 +276,20 @@ dialog_auto_filter (WBCGtk *wbcg,
if (is_expr) {
gtk_label_set_text
(GTK_LABEL (gnm_xml_get_widget (state->gui, "col-label1")), label);
(GTK_LABEL (go_gtk_builder_get_widget (state->gui, "col-label1")), label);
gtk_label_set_text
(GTK_LABEL (gnm_xml_get_widget (state->gui, "col-label2")), label);
(GTK_LABEL (go_gtk_builder_get_widget (state->gui, "col-label2")), label);
} else {
gtk_label_set_text
(GTK_LABEL (gnm_xml_get_widget (state->gui, "col-label")), label);
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
(GTK_LABEL (go_gtk_builder_get_widget (state->gui, "col-label")), label);
w = go_gtk_builder_get_widget (state->gui, "item_vs_percentage_option_menu");
g_signal_connect (G_OBJECT (w),
"changed",
G_CALLBACK (cb_top10_type_changed), state);
}
g_free (label);
state->dialog = gnm_xml_get_widget (state->gui, "dialog");
state->dialog = go_gtk_builder_get_widget (state->gui, "dialog");
if (cond != NULL) {
GnmFilterOp const op = cond->op[0];
if (is_expr && 0 == (op & GNM_FILTER_OP_TYPE_MASK)) {
......@@ -298,46 +298,46 @@ dialog_auto_filter (WBCGtk *wbcg,
if (cond->op[1] != GNM_FILTER_UNUSED)
init_operator (state, cond->op[1],
cond->value[1], "op1", "value1");
w = gnm_xml_get_widget (state->gui,
w = go_gtk_builder_get_widget (state->gui,
cond->is_and ? "and_button" : "or_button");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
} else if (!is_expr &&
GNM_FILTER_OP_TOP_N == (op & GNM_FILTER_OP_TYPE_MASK)) {
w = gnm_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
w = go_gtk_builder_get_widget (state->gui, "top_vs_bottom_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), (op & 1) ? 1 : 0);
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
w = go_gtk_builder_get_widget (state->gui, "item_vs_percentage_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), (op & 2) ? 1 : 0);
w = gnm_xml_get_widget (state->gui, "item_count");
w = go_gtk_builder_get_widget (state->gui, "item_count");
gtk_spin_button_set_value (GTK_SPIN_BUTTON (w),
cond->count);
}
} else {
/* initialize the combo boxes (not done by li.ui) */
if (is_expr) {
w = gnm_xml_get_widget (state->gui, "op0");
w = go_gtk_builder_get_widget (state->gui, "op0");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
w = gnm_xml_get_widget (state->gui, "op1");
w = go_gtk_builder_get_widget (state->gui, "op1");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
} else {
w = gnm_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
w = go_gtk_builder_get_widget (state->gui, "top_vs_bottom_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
w = go_gtk_builder_get_widget (state->gui, "item_vs_percentage_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
}
}
w = gnm_xml_get_widget (state->gui, "ok_button");
w = go_gtk_builder_get_widget (state->gui, "ok_button");
g_signal_connect (G_OBJECT (w),
"clicked",
G_CALLBACK (cb_autofilter_ok), state);
w = gnm_xml_get_widget (state->gui, "cancel_button");
w = go_gtk_builder_get_widget (state->gui, "cancel_button");
g_signal_connect (G_OBJECT (w),
"clicked",
G_CALLBACK (cb_autofilter_cancel), state);
/* a candidate for merging into attach guru */
gnumeric_init_help_button (
gnm_xml_get_widget (state->gui, "help_button"),
go_gtk_builder_get_widget (state->gui, "help_button"),
is_expr ? GNUMERIC_HELP_LINK_AUTOFILTER_CUSTOM :
GNUMERIC_HELP_LINK_AUTOFILTER_TOP_TEN);
......
......@@ -594,18 +594,18 @@ dialog_autoformat (WBCGtk *wbcg)
state->more_down = FALSE;
state->selected_template = NULL;
state->dialog = GTK_DIALOG (gnm_xml_get_widget (gui, "dialog"));
state->category = GTK_COMBO_BOX (gnm_xml_get_widget (gui, "format_category"));
state->scroll = GTK_VSCROLLBAR (gnm_xml_get_widget (gui, "format_scroll"));
state->gridlines = GTK_CHECK_MENU_ITEM (gnm_xml_get_widget (gui, "format_gridlines"));
state->dialog = GTK_DIALOG (go_gtk_builder_get_widget (gui, "dialog"));
state->category = GTK_COMBO_BOX (go_gtk_builder_get_widget (gui, "format_category"));
state->scroll = GTK_VSCROLLBAR (go_gtk_builder_get_widget (gui, "format_scroll"));
state->gridlines = GTK_CHECK_MENU_ITEM (go_gtk_builder_get_widget (gui, "format_gridlines"));
state->info_name = GTK_ENTRY (gnm_xml_get_widget (gui, "format_info_name"));
state->info_author = GTK_ENTRY (gnm_xml_get_widget (gui, "format_info_author"));
state->info_cat = GTK_ENTRY (gnm_xml_get_widget (gui, "format_info_cat"));
state->info_descr = GTK_TEXT_VIEW (gnm_xml_get_widget (gui, "format_info_descr"));
state->info_name = GTK_ENTRY (go_gtk_builder_get_widget (gui, "format_info_name"));
state->info_author = GTK_ENTRY (go_gtk_builder_get_widget (gui, "format_info_author"));
state->info_cat = GTK_ENTRY (go_gtk_builder_get_widget (gui, "format_info_cat"));
state->info_descr = GTK_TEXT_VIEW (go_gtk_builder_get_widget (gui, "format_info_descr"));
state->ok = GTK_BUTTON (gnm_xml_get_widget (gui, "format_ok"));
state->cancel = GTK_BUTTON (gnm_xml_get_widget (gui, "format_cancel"));
state->ok = GTK_BUTTON (go_gtk_builder_get_widget (gui, "format_ok"));
state->cancel = GTK_BUTTON (go_gtk_builder_get_widget (gui, "format_cancel"));
action_group = gtk_action_group_new ("settings-actions");
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
......@@ -629,14 +629,14 @@ dialog_autoformat (WBCGtk *wbcg)
state->gridlines = GTK_CHECK_MENU_ITEM (gtk_ui_manager_get_widget (ui_manager, "/bar/settings/gridlines"));
gtk_box_pack_start (GTK_BOX (gnm_xml_get_widget (gui, "category-box")),
gtk_box_pack_start (GTK_BOX (go_gtk_builder_get_widget (gui, "category-box")),
gtk_ui_manager_get_widget (ui_manager, "/bar"),
FALSE, TRUE, 0);
for (i = 0; i < NUM_PREVIEWS; i++) {
char *name;
name = g_strdup_printf ("format_frame%d", i+1);
state->frame[i] = GTK_FRAME (gnm_xml_get_widget (gui, name));
state->frame[i] = GTK_FRAME (go_gtk_builder_get_widget (gui, name));
g_free (name);
state->canvas[i] = GOC_CANVAS (g_object_new (GOC_TYPE_CANVAS, NULL));
......@@ -709,7 +709,7 @@ dialog_autoformat (WBCGtk *wbcg)
}
gnumeric_init_help_button (
gnm_xml_get_widget (gui, "help_button"),
go_gtk_builder_get_widget (gui, "help_button"),
GNUMERIC_HELP_LINK_AUTOFORMAT);
gtk_dialog_set_default_response (state->dialog, GTK_RESPONSE_OK);
......
......@@ -137,12 +137,12 @@ dialog_autosave (WBCGtk *wbcg)
state->wbcg = wbcg;
state->wb = wb_control_get_workbook (WORKBOOK_CONTROL (wbcg));
state->dialog = gnm_xml_get_widget (gui, "AutoSave");
state->minutes_entry = gnm_xml_get_widget (gui, "minutes");
state->prompt_cb = gnm_xml_get_widget (gui, "prompt_on_off");
state->autosave_on_off = gnm_xml_get_widget (gui, "autosave_on_off");
state->ok_button = gnm_xml_get_widget (gui, "button1");
state->cancel_button = gnm_xml_get_widget (gui, "button2");
state->dialog = go_gtk_builder_get_widget (gui, "AutoSave");
state->minutes_entry = go_gtk_builder_get_widget (gui, "minutes");
state->prompt_cb = go_gtk_builder_get_widget (gui, "prompt_on_off");
state->autosave_on_off = go_gtk_builder_get_widget (gui, "autosave_on_off");
state->ok_button = go_gtk_builder_get_widget (gui, "button1");
state->cancel_button = go_gtk_builder_get_widget (gui, "button2");
if (!state->dialog || !state->minutes_entry || !state->prompt_cb ||
!state->autosave_on_off) {
......@@ -174,7 +174,7 @@ dialog_autosave (WBCGtk *wbcg)
g_object_set_data_full (G_OBJECT (state->dialog),
"state", state, (GDestroyNotify)g_free);
gnumeric_init_help_button (
gnm_xml_get_widget (gui, "button3"),
go_gtk_builder_get_widget (gui, "button3"),
GNUMERIC_HELP_LINK_AUTOSAVE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (state->autosave_on_off),
......
......@@ -70,7 +70,7 @@ cb_cell_comment_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
char const *author;
author = gtk_entry_get_text
(GTK_ENTRY (gnm_xml_get_widget
(GTK_ENTRY (go_gtk_builder_get_widget
(state->gui, "new-author-entry")));
g_object_get (G_OBJECT (state->gtv), "text", &text,
"attributes", &attr, NULL);
......@@ -118,10 +118,10 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
state->pos = pos;
state->gui = gui;
state->dialog = gnm_xml_get_widget (state->gui, "comment_dialog");
state->dialog = go_gtk_builder_get_widget (state->gui, "comment_dialog");
g_return_if_fail (state->dialog != NULL);
box = gnm_xml_get_widget (state->gui, "dialog-vbox");
box = go_gtk_builder_get_widget (state->gui, "dialog-vbox");
g_return_if_fail (box != NULL);
state->gtv = gnm_text_view_new ();
gtk_widget_show_all (GTK_WIDGET (state->gtv));
......@@ -137,8 +137,8 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
cellref_as_string (&out, &ref, FALSE);
cell_name = g_string_free (out.accum, FALSE);
old_author = gnm_xml_get_widget (state->gui, "old-author-entry");
new_author = gnm_xml_get_widget (state->gui, "new-author-entry");
old_author = go_gtk_builder_get_widget (state->gui, "old-author-entry");
new_author = go_gtk_builder_get_widget (state->gui, "new-author-entry");
real_user = g_get_real_name ();
if ((real_user != NULL) && g_utf8_validate (real_user, -1, NULL)) {
......@@ -167,30 +167,30 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
title = g_strdup_printf (_("New Cell Comment (%s)"),
cell_name);
gtk_widget_hide (old_author);
gtk_widget_hide (gnm_xml_get_widget (state->gui,
gtk_widget_hide (go_gtk_builder_get_widget (state->gui,
"old-author-label"));
}
gtk_window_set_title (GTK_WINDOW (state->dialog), title);
g_free (title);
state->ok_button = gnm_xml_get_widget (state->gui, "ok_button");
state->ok_button = go_gtk_builder_get_widget (state->gui, "ok_button");
g_signal_connect (G_OBJECT (state->ok_button),
"clicked",
G_CALLBACK (cb_cell_comment_ok_clicked), state);
state->cancel_button = gnm_xml_get_widget (state->gui, "cancel_button");
state->cancel_button = go_gtk_builder_get_widget (state->gui, "cancel_button");
g_signal_connect (G_OBJECT (state->cancel_button),
"clicked",
G_CALLBACK (cb_cell_comment_cancel_clicked), state);
check = gnm_xml_get_widget (state->gui, "wrap-check");
check = go_gtk_builder_get_widget (state->gui, "wrap-check");
g_signal_connect (G_OBJECT (check),
"toggled",
G_CALLBACK (cb_wrap_toggled), state->gtv);
cb_wrap_toggled (GTK_TOGGLE_BUTTON (check), G_OBJECT (state->gtv));
gnumeric_init_help_button (
gnm_xml_get_widget (state->gui, "help_button"),
go_gtk_builder_get_widget (state->gui, "help_button"),
GNUMERIC_HELP_LINK_CELL_COMMENT);
wbc_gtk_attach_guru (state->wbcg, state->dialog);
......
......@@ -315,7 +315,7 @@ setup_pattern_button (GdkScreen *screen,
int const select_index,
unsigned size)
{
GtkWidget *tmp = gnm_xml_get_widget (gui, name);
GtkWidget *tmp = go_gtk_builder_get_widget (gui, name);
if (tmp != NULL) {
GtkButton *button = GTK_BUTTON (tmp);
if (flag) {
......@@ -411,11 +411,11 @@ setup_color_pickers (FormatState *state,
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (frame), combo);
w = gnm_xml_get_widget (state->gui, container);
w = go_gtk_builder_get_widget (state->gui, container);
gtk_box_pack_start (GTK_BOX (w), frame, FALSE, FALSE, 0);
gtk_widget_show_all (frame);
w = gnm_xml_get_widget (state->gui, label);
w = go_gtk_builder_get_widget (state->gui, label);
gtk_label_set_mnemonic_widget (GTK_LABEL (w), combo);
if (def_sc)
......@@ -434,7 +434,7 @@ setup_color_pickers (FormatState *state,
static GtkWidget *
init_button_image (GtkBuilder *gui, char const *name)
{
GtkWidget *tmp = gnm_xml_get_widget (gui, name);
GtkWidget *tmp = go_gtk_builder_get_widget (gui, name);
if (tmp != NULL) {
GdkScreen *screen = gtk_widget_get_screen (tmp);
GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (
......@@ -570,7 +570,7 @@ fmt_dialog_init_align_radio (char const *const name,
FormatState *state,
GCallback handler)
{
GtkWidget *tmp = gnm_xml_get_widget (state->gui, name);
GtkWidget *tmp = go_gtk_builder_get_widget (state->gui, name);
if (tmp != NULL) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmp),
val == target);
......@@ -648,7 +648,7 @@ fmt_dialog_init_align_page (FormatState *state)
if (0 == (state->conflicts & (1 << MSTYLE_WRAP_TEXT)))
wrap = gnm_style_get_wrap_text (state->style);
w = gnm_xml_get_widget (state->gui, "align_wrap");
w = go_gtk_builder_get_widget (state->gui, "align_wrap");
state->align.wrap = GTK_CHECK_BUTTON (w);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), wrap);
g_signal_connect (G_OBJECT (w),
......@@ -662,8 +662,8 @@ fmt_dialog_init_align_page (FormatState *state)
state->align.indent = gnm_style_get_indent (state->style);
state->align.indent_label =
gnm_xml_get_widget (state->gui, "halign_indent_label");
w = gnm_xml_get_widget (state->gui, "halign_indent");
go_gtk_builder_get_widget (state->gui, "halign_indent_label");
w = go_gtk_builder_get_widget (state->gui, "halign_indent");
state->align.indent_button = GTK_SPIN_BUTTON (w);
gtk_spin_button_set_value (state->align.indent_button, state->align.indent);
gtk_widget_set_sensitive (GTK_WIDGET (state->align.indent_button),
......@@ -689,7 +689,7 @@ fmt_dialog_init_align_page (FormatState *state)
} else
r = 0;
state->align.rotation = (GORotationSel *) go_rotation_sel_new ();
gtk_box_pack_start (GTK_BOX (gnm_xml_get_widget (state->gui, "alignment_box")),
gtk_box_pack_start (GTK_BOX (go_gtk_builder_get_widget (state->gui, "alignment_box")),
GTK_WIDGET (state->align.rotation), TRUE, TRUE, 0);
go_rotation_sel_set_rotation (state->align.rotation, r);
g_signal_connect (G_OBJECT (state->align.rotation), "rotation-changed",
......@@ -811,10 +811,10 @@ fmt_dialog_init_font_page (FormatState *state)
{
GtkWidget *tmp = font_selector_new ();
FontSelector *font_widget = FONT_SELECTOR (tmp);
GtkWidget *container = gnm_xml_get_widget (state->gui, "font_box");
GtkWidget *container = go_gtk_builder_get_widget (state->gui, "font_box");
GtkWidget *uline = go_combo_text_new_default ();
char const *uline_str;
GtkWidget *strike = gnm_xml_get_widget (state->gui, "strikethrough_button");
GtkWidget *strike = go_gtk_builder_get_widget (state->gui, "strikethrough_button");
gboolean strikethrough = FALSE;
GOFontScript script = GO_FONT_SCRIPT_STANDARD;
int i;
......@@ -861,10 +861,10 @@ fmt_dialog_init_font_page (FormatState *state)
"entry_changed",
G_CALLBACK (cb_font_underline_changed), state);
gtk_widget_show_all (uline);
gtk_box_pack_start (GTK_BOX (gnm_xml_get_widget (state->gui, "underline-box")),
gtk_box_pack_start (GTK_BOX (go_gtk_builder_get_widget (state->gui, "underline-box")),
uline, TRUE, TRUE, 0);
tmp = gnm_xml_get_widget (state->gui, "underline_label");
tmp = go_gtk_builder_get_widget (state->gui, "underline_label");
gtk_label_set_mnemonic_widget (GTK_LABEL (tmp), uline);
if (0 == (state->conflicts & (1 << MSTYLE_FONT_STRIKETHROUGH)))
......@@ -878,14 +878,14 @@ fmt_dialog_init_font_page (FormatState *state)
if (0 == (state->conflicts & (1 << MSTYLE_FONT_SCRIPT)))
script = gnm_style_get_font_script (state->style);
font_selector_set_script (state->font.selector, script);
if (NULL != (tmp = gnm_xml_get_widget (state->gui, "superscript_button"))) {
if (NULL != (tmp = go_gtk_builder_get_widget (state->gui, "superscript_button"))) {
state->font.superscript = GTK_TOGGLE_BUTTON (tmp);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmp),
script == GO_FONT_SCRIPT_SUPER);
g_signal_connect (G_OBJECT (tmp), "toggled",
G_CALLBACK (cb_font_script_toggle), state);
}
if (NULL != (tmp = gnm_xml_get_widget (state->gui, "subscript_button"))) {
if (NULL != (tmp = go_gtk_builder_get_widget (state->gui, "subscript_button"))) {