Commit dcca75a6 authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

Use updated gui-utils.

* plugin-gnomedb.c (view_data_sources): Use updated gui-utils.

* uihello.c (hello_message): Use updated gui-utils.

* src/gui-file.c (go_file_is_writable, gui_get_image_save_info,
check_multiple_sheet_support_if_needed, do_save_as,
gui_file_save_as): Use updated gui-utils

* src/item-cursor.c (item_cursor_target_region_ok): Ditto

* src/print.c (sheet_print): Ditto.

* src/session.c (interaction_function): Ditto.

* src/wbcg-actions.c (cb_edit_search_replace_query): Ditto.

* src/workbook-control-gui.c (wbcg_error_error) Ditto.
(wbcg_close_if_user_permits):

* dialog-view.c (cb_view_ok_clicked): Use updated gui-utils.

* dialog-tabulate.c (tabulate_ok_clicked): Ditto.

* dialog-stf.c (cancel_clicked): Ditto.

* dialog-stf-main-page.c (encodings_changed_cb): Ditto.

* dialog-stf-format-page.c (cb_col_check_clicked): Ditto.

* dialog-stf-fixed-page.c (fixed_page_autodiscover): Ditto.

* dialog-stf-export.c (stf_export_dialog): Ditto.

* dialog-solver.c (dialog_solver): Ditto.

* dialog-sheet-order.c (cb_ok_clicked, cb_sheet_order_changed): Ditto.

* dialog-search.c (search_clicked): Ditto.

* dialog-search-replace.c (ok_clicked): Ditto.

* dialog-scenarios.c (scenario_add_ok_clicked_cb,
scenarios_summary_clicked_cb, dialog_scenarios): Ditto.

* dialog-plugin-manager.c (cb_pm_button_activate_all_clicked,
cb_pm_button_deactivate_all_clicked, cb_active_toggled): Ditto.

* dialog-paste-special.c (dialog_paste_special): Ditto.

* dialog-merge.c (cb_merge_merge_clicked): Ditto.

* dialog-insert-cells.c (dialog_insert_cells): Ditto.

* dialog-hyperlink.c (dhl_get_target_cur_wb, dialog_hyperlink): Ditto.

* dialog-goto-cell.c (dialog_goto_cell): Ditto.

* dialog-goal-seek.c (dialog_goal_seek): Ditto.

* dialog-formula-guru.c (dialog_formula_guru): Ditto.

* dialog-delete-cells.c (dialog_delete_cells): Ditto.

* dialog-define-names.c (cb_scope_changed, name_guru_add,
dialog_define_names): Ditto.

* dialog-cell-sort.c (dialog_cell_sort): Ditto.

* dialog-cell-format.c (cb_fmt_dialog_dialog_buttons): Ditto.

* dialog-autosave.c (dialog_autosave): Ditto.

* dialog-autocorrect.c (dialog_autocorrect): Ditto.

* dialog-analysis-tools.c (dialog_tool_init): Ditto.
parent 825450ae
2004-09-07 Jon K Hellan <hellan@acm.org>
* src/gui-util.[hc] (gnumeric_notice, gnumeric_notice,
gnumeric_dialog_run, gnumeric_error_info_dialog_show): Replace
WorkboookControlGUI first paremeter with GtkWindow.
* src/gui-file.c (go_file_is_writable, gui_get_image_save_info,
check_multiple_sheet_support_if_needed, do_save_as,
gui_file_save_as): Use updated gui-utils
* src/item-cursor.c (item_cursor_target_region_ok): Ditto
* src/print.c (sheet_print): Ditto.
* src/session.c (interaction_function): Ditto.
* src/wbcg-actions.c (cb_edit_search_replace_query): Ditto.
* src/workbook-control-gui.c (wbcg_error_error) Ditto.
(wbcg_close_if_user_permits):
2004-09-06 Jody Goldberg <jody@gnome.org>
* configure.in : Add a --disable-ssconvert for development.
......
2004-09-07 Jon K Hellan <hellan@acm.org>
* src/gui-util.[hc] (gnumeric_notice, gnumeric_notice,
gnumeric_dialog_run, gnumeric_error_info_dialog_show): Replace
WorkboookControlGUI first paremeter with GtkWindow.
* src/gui-file.c (go_file_is_writable, gui_get_image_save_info,
check_multiple_sheet_support_if_needed, do_save_as,
gui_file_save_as): Use updated gui-utils
* src/item-cursor.c (item_cursor_target_region_ok): Ditto
* src/print.c (sheet_print): Ditto.
* src/session.c (interaction_function): Ditto.
* src/wbcg-actions.c (cb_edit_search_replace_query): Ditto.
* src/workbook-control-gui.c (wbcg_error_error) Ditto.
(wbcg_close_if_user_permits):
2004-09-06 Jody Goldberg <jody@gnome.org>
* configure.in : Add a --disable-ssconvert for development.
......
2004-09-07 Jon K Hellan <hellan@acm.org>
* plugin-gnomedb.c (view_data_sources): Use updated gui-utils.
2004-08-29 Jody Goldberg <jody@gnome.org>
* Release 1.3.2
......
......@@ -21,7 +21,9 @@ view_data_sources (WorkbookControlGUI *wbcg)
if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
NULL, NULL, NULL, NULL))
gnumeric_notice (wbcg, GTK_MESSAGE_INFO, _("Could not run GNOME database configuration tool"));
gnumeric_notice (wbcg_toplevel (wbcg),
GTK_MESSAGE_INFO,
_("Could not run GNOME database configuration tool"));
}
const ModulePluginUIVerbInfo gnome_db_ui_verbs[] = {
......
2004-09-07 Jon K Hellan <hellan@acm.org>
* uihello.c (hello_message): Use updated gui-utils.
2004-08-29 Jody Goldberg <jody@gnome.org>
* Release 1.3.2
......
......@@ -23,7 +23,7 @@ hello_message (WorkbookControlGUI *wbcg)
msg = g_strdup_printf (
_("This is message from the \"%s\" plugin."),
gnm_plugin_get_name (PLUGIN));
gnumeric_notice (wbcg, GTK_MESSAGE_INFO, msg);
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_INFO, msg);
g_free (msg);
}
......
2004-09-07 Jon K Hellan <hellan@acm.org>
* dialog-view.c (cb_view_ok_clicked): Use updated gui-utils.
* dialog-tabulate.c (tabulate_ok_clicked): Ditto.
* dialog-stf.c (cancel_clicked): Ditto.
* dialog-stf-main-page.c (encodings_changed_cb): Ditto.
* dialog-stf-format-page.c (cb_col_check_clicked): Ditto.
* dialog-stf-fixed-page.c (fixed_page_autodiscover): Ditto.
* dialog-stf-export.c (stf_export_dialog): Ditto.
* dialog-solver.c (dialog_solver): Ditto.
* dialog-sheet-order.c (cb_ok_clicked, cb_sheet_order_changed): Ditto.
* dialog-search.c (search_clicked): Ditto.
* dialog-search-replace.c (ok_clicked): Ditto.
* dialog-scenarios.c (scenario_add_ok_clicked_cb,
scenarios_summary_clicked_cb, dialog_scenarios): Ditto.
* dialog-plugin-manager.c (cb_pm_button_activate_all_clicked,
cb_pm_button_deactivate_all_clicked, cb_active_toggled): Ditto.
* dialog-paste-special.c (dialog_paste_special): Ditto.
* dialog-merge.c (cb_merge_merge_clicked): Ditto.
* dialog-insert-cells.c (dialog_insert_cells): Ditto.
* dialog-hyperlink.c (dhl_get_target_cur_wb, dialog_hyperlink): Ditto.
* dialog-goto-cell.c (dialog_goto_cell): Ditto.
* dialog-goal-seek.c (dialog_goal_seek): Ditto.
* dialog-formula-guru.c (dialog_formula_guru): Ditto.
* dialog-delete-cells.c (dialog_delete_cells): Ditto.
* dialog-define-names.c (cb_scope_changed, name_guru_add,
dialog_define_names): Ditto.
* dialog-cell-sort.c (dialog_cell_sort): Ditto.
* dialog-cell-format.c (cb_fmt_dialog_dialog_buttons): Ditto.
* dialog-autosave.c (dialog_autosave): Ditto.
* dialog-autocorrect.c (dialog_autocorrect): Ditto.
* dialog-analysis-tools.c (dialog_tool_init): Ditto.
2004-09-06 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-analysis-tools.c (dialog_ttest_tool): Enable the `put'
......
......@@ -423,7 +423,7 @@ dialog_tool_init (GenericToolState *state,
return FALSE;
dialog_tool_init_error:
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, error_str);
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR, error_str);
g_free (state);
return TRUE;
}
......
......@@ -325,7 +325,7 @@ dialog_autocorrect (WorkbookControlGUI *wbcg)
state->first_letter.exceptions = NULL;
if (dialog_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the AutoCorrect dialog."));
cb_autocorrect_destroy (NULL, state);
return;
......
......@@ -180,7 +180,7 @@ dialog_autosave (WorkbookControlGUI *wbcg)
if (!state->dialog || !state->minutes_entry || !state->prompt_cb ||
!state->autosave_on_off) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the autosave dialog."));
g_free (state);
return;
......
......@@ -2110,7 +2110,8 @@ cb_fmt_dialog_dialog_buttons (GtkWidget *btn, FormatState *state)
validation_rebuild_validation (state);
if (state->validation.valid < 0) {
if (gnumeric_dialog_question_yes_no (state->wbcg,
if (gnumeric_dialog_question_yes_no (
GTK_WINDOW (state->dialog),
_ ("The validation criteria are unusable. Disable validation?"), FALSE))
{
gtk_combo_box_set_active (state->validation.constraint_type, 0);
......
......@@ -1201,7 +1201,7 @@ dialog_cell_sort (WorkbookControlGUI *wbcg)
GTK_ICON_SIZE_LARGE_TOOLBAR,
"Gnumeric-Cell-Sort");
if (dialog_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the Cell-Sort dialog."));
g_free (state);
return;
......
......@@ -247,7 +247,8 @@ cb_scope_changed (G_GNUC_UNUSED GtkToggleButton *button, NameGuruState *state)
err = expr_name_set_scope (state->cur_name,
name_guru_scope_is_sheet (state) ? state->sheet : NULL);
if (err != NULL) {
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, err);
gnumeric_notice (GTK_WINDOW (state->dialog),
GTK_MESSAGE_ERROR, err);
g_free (err);
name_guru_display_scope (state); /* flip it back */
} else
......@@ -345,7 +346,8 @@ name_guru_add (NameGuruState *state)
if (perr.err == NULL)
return TRUE;
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, perr.err->message);
gnumeric_notice (GTK_WINDOW (state->dialog),
GTK_MESSAGE_ERROR, perr.err->message);
gtk_widget_grab_focus (GTK_WIDGET (state->expr_entry));
parse_error_free (&perr);
return FALSE;
......@@ -355,7 +357,7 @@ name_guru_add (NameGuruState *state)
* because it will be would disappear from the lists.
*/
if (gnm_expr_is_err (expr, GNM_ERROR_NAME)) {
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->dialog), GTK_MESSAGE_ERROR,
_("Why would you want to define a name to be #NAME?"));
gtk_widget_grab_focus (GTK_WIDGET (state->expr_entry));
parse_error_free (&perr);
......@@ -576,7 +578,7 @@ dialog_define_names (WorkbookControlGUI *wbcg)
state = g_new0 (NameGuruState, 1);
if (name_guru_init (state, wbcg)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the Name Guru."));
g_free (state);
return;
......
......@@ -162,7 +162,7 @@ dialog_delete_cells (WorkbookControlGUI *wbcg)
state->dialog = glade_xml_get_widget (state->gui, "Delete_cells");
if (state->dialog == NULL) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the Delete Cell dialog."));
g_free (state);
return ;
......
......@@ -972,7 +972,7 @@ dialog_formula_guru (WorkbookControlGUI *wbcg, GnmFunc const *fd)
state->dialog = glade_xml_get_widget (state->gui, "formula_guru");
if (dialog_formula_guru_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the formula guru."));
g_free (state);
return;
......
......@@ -651,7 +651,7 @@ dialog_goal_seek (WorkbookControlGUI *wbcg, Sheet *sheet)
state->cancelled = TRUE;
if (dialog_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the Goal-Seek dialog."));
g_free (state);
return;
......
......@@ -353,7 +353,7 @@ dialog_goto_cell (WorkbookControlGUI *wbcg)
state->dialog = glade_xml_get_widget (state->gui, "goto_dialog");
if (dialog_goto_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the goto dialog."));
g_free (state);
return;
......
......@@ -144,7 +144,8 @@ dhl_get_target_cur_wb (HyperlinkState *state, gboolean *success)
ret = (char *) target;
value_release (val);
} else {
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->dialog),
GTK_MESSAGE_ERROR,
_("Not a range or name"));
gnm_expr_entry_grab_focus (gee, TRUE);
}
......@@ -485,7 +486,7 @@ dialog_hyperlink (WorkbookControlGUI *wbcg, SheetControl *sc)
state->link = link;
if (dhl_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the hyperlink dialog."));
g_free (state);
return;
......
......@@ -162,7 +162,7 @@ dialog_insert_cells (WorkbookControlGUI *wbcg)
state->gui = gui;
state->dialog = glade_xml_get_widget (state->gui, "Insert_cells");
if (state->dialog == NULL) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the Insert Cell dialog."));
g_free (state);
return ;
......
......@@ -286,7 +286,8 @@ cb_merge_merge_clicked (G_GNUC_UNUSED GtkWidget *ignore,
"%i and proceed?"), min_length, max_length,
min_length);
if (gnumeric_dialog_question_yes_no (state->wbcg, text, TRUE)) {
if (gnumeric_dialog_question_yes_no (
GTK_WINDOW (state->dialog), text, TRUE)) {
g_slist_foreach (data_list, cb_merge_trim_data, &min_length);
g_free (text);
} else {
......
......@@ -195,7 +195,7 @@ dialog_paste_special (WorkbookControlGUI *wbcg)
gtk_widget_show_all (hbox);
gtk_widget_grab_focus (first_button);
v = gnumeric_dialog_run (wbcg, state.dialog);
v = gnumeric_dialog_run (wbcg_toplevel (wbcg), state.dialog);
/* If closed with the window manager, cancel */
if (v == -1)
......
......@@ -488,7 +488,8 @@ cb_pm_button_activate_all_clicked (G_GNUC_UNUSED GtkButton *button,
if (activation_error != NULL) {
error = error_info_new_str_with_details (
_("Errors while activating plugins"), activation_error);
gnumeric_error_info_dialog_show (pm_gui->wbcg, error);
gnumeric_error_info_dialog_show (
GTK_WINDOW (pm_gui->dialog_pm), error);
error_info_free (error);
}
}
......@@ -504,7 +505,8 @@ cb_pm_button_deactivate_all_clicked (G_GNUC_UNUSED GtkButton *button,
if (deactivation_error != NULL) {
error = error_info_new_str_with_details (
_("Errors while deactivating plugins"), deactivation_error);
gnumeric_error_info_dialog_show (pm_gui->wbcg, error);
gnumeric_error_info_dialog_show (
GTK_WINDOW (pm_gui->dialog_pm), error);
error_info_free (error);
}
}
......@@ -614,7 +616,7 @@ cb_active_toggled (G_GNUC_UNUSED GtkCellRendererToggle *celltoggle,
);
g_string_append (s, _("\nDo you want to activate this plugin together with its dependencies?"));
if (n_inactive_deps > 0) {
want_activate = gnumeric_dialog_question_yes_no (pm_gui->wbcg, s->str, TRUE);
want_activate = gnumeric_dialog_question_yes_no (GTK_WINDOW (pm_gui->dialog_pm), s->str, TRUE);
}
g_string_free (s, TRUE);
}
......
......@@ -125,14 +125,16 @@ scenario_add_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
rr = value_get_rangeref (cell_range);
if (rr == NULL) {
gnumeric_notice (state->base.wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->base.dialog),
GTK_MESSAGE_ERROR,
_("Invalid changing cells"));
gnm_expr_entry_grab_focus (state->base.input_entry, TRUE);
return;
}
if (rr->a.sheet != state->base.sheet) {
gnumeric_notice (state->base.wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->base.dialog),
GTK_MESSAGE_ERROR,
_("Changing cells should be on the current "
"sheet only."));
gnm_expr_entry_grab_focus (state->base.input_entry, TRUE);
......@@ -143,12 +145,14 @@ scenario_add_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
name = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
if (scenario_name_used (state->base.sheet->scenarios, name)) {
g_free (name);
gnumeric_notice (state->base.wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->base.dialog),
GTK_MESSAGE_ERROR,
_("Scenario name already used"));
goto out;
} else if (check_name (name)) {
g_free (name);
gnumeric_notice (state->base.wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->base.dialog),
GTK_MESSAGE_ERROR,
_("Invalid scenario name"));
goto out;
}
......@@ -173,7 +177,8 @@ scenario_add_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
cmd_scenario_add (wbc, scenario, state->base.sheet);
if (res)
gnumeric_notice (state->base.wbcg, GTK_MESSAGE_WARNING,
gnumeric_notice (GTK_WINDOW (state->base.dialog),
GTK_MESSAGE_WARNING,
_("Changing cells contain at least one "
"expression that is not just a value. "
"Note that showing the scenario will "
......@@ -562,7 +567,8 @@ scenarios_summary_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
if (results == NULL) {
gnumeric_notice (state->base.wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->base.dialog),
GTK_MESSAGE_ERROR,
_("Results entry did not contain valid "
"cell names."));
return;
......@@ -690,7 +696,7 @@ dialog_scenarios (WorkbookControlGUI *wbcg)
return;
error_out:
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, error_str);
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR, error_str);
g_free (state->scenario_state);
g_free (state);
......
......@@ -143,7 +143,7 @@ ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
err = search_replace_verify (sr, TRUE);
if (err) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, err);
gnumeric_notice (GTK_WINDOW (dialog), GTK_MESSAGE_ERROR, err);
g_free (err);
search_replace_free (sr);
return;
......@@ -152,7 +152,7 @@ ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
!sr->search_expressions &&
!sr->search_expression_results &&
!sr->search_comments) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dialog), GTK_MESSAGE_ERROR,
_("You must select some cell types to search."));
search_replace_free (sr);
return;
......
......@@ -318,7 +318,8 @@ search_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
err = search_replace_verify (sr, FALSE);
if (err) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, err);
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR, err);
g_free (err);
search_replace_free (sr);
return;
......@@ -327,7 +328,7 @@ search_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
!sr->search_expressions &&
!sr->search_expression_results &&
!sr->search_comments) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog), GTK_MESSAGE_ERROR,
_("You must select some cell types to search."));
search_replace_free (sr);
return;
......
......@@ -728,17 +728,17 @@ cb_ok_clicked (G_GNUC_UNUSED GtkWidget *ignore, SheetManager *state)
changed_names = g_slist_reverse (changed_names);
if (!one_is_visible) {
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->dialog), GTK_MESSAGE_ERROR,
_("At least one sheet must remain visible!"));
goto cleanup;
}
if (new_order == NULL) {
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->dialog), GTK_MESSAGE_ERROR,
_("You may not delete all sheets in a workbook!"));
goto cleanup;
}
if (workbook_sheet_count (wb) <= (int)g_slist_length (deleted_sheets) ) {
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (state->dialog), GTK_MESSAGE_ERROR,
_("To replace all exisiting sheets, please "
"delete the current workbook and create "
"a new one!"));
......@@ -983,7 +983,7 @@ cb_sheet_order_changed (Workbook *wb, SheetManager *state)
* The order in the dialog and the new sheet order are totally
* different. Ask the user what to do.
*/
if (gnumeric_dialog_question_yes_no (state->wbcg,
if (gnumeric_dialog_question_yes_no (GTK_WINDOW (state->dialog),
_("The sheet order has changed. Do you want to "
"update the list?"), TRUE))
dialog_sheet_order_update_sheet_order (state);
......
......@@ -1442,7 +1442,7 @@ dialog_solver (WorkbookControlGUI *wbcg, Sheet *sheet)
state->cancelled = TRUE;
if (dialog_init (state)) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
_("Could not create the Solver dialog."));
g_free (state);
return;
......
......@@ -464,7 +464,7 @@ stf_export_dialog (WorkbookControlGUI *wbcg, Workbook *wb)
"clicked",
G_CALLBACK (cb_next_page), &state);
gnumeric_dialog_run (wbcg, GTK_DIALOG (state.window));
gnumeric_dialog_run (wbcg_toplevel (wbcg), GTK_DIALOG (state.window));
g_object_unref (G_OBJECT (state.gui));
return state.result;
......
......@@ -50,7 +50,8 @@ fixed_page_autodiscover (StfDialogData *pagedata)
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
_("Autodiscovery did not find any columns in the text. Try manually"));
gnumeric_dialog_run (pagedata->wbcg, GTK_DIALOG (dialog));
gnumeric_dialog_run (GTK_WINDOW (pagedata->dialog),
GTK_DIALOG (dialog));
}
}
......
......@@ -128,7 +128,8 @@ cb_col_check_clicked (GtkToggleButton *togglebutton, gpointer _i)
(_("A maximum of %d columns can be imported."),
SHEET_MAX_COLS);
gtk_toggle_button_set_active (togglebutton, FALSE);
gnumeric_notice (pagedata->wbcg, GTK_MESSAGE_WARNING, msg);
gnumeric_notice (GTK_WINDOW (pagedata->dialog),
GTK_MESSAGE_WARNING, msg);
g_free (msg);
}
}
......
......@@ -171,7 +171,8 @@ encodings_changed_cb (CharmapSelector *cs, char const *new_charmap,
(_("The data is not valid in encoding %s; "
"please select another encoding."),
name ? name : new_charmap);
gnumeric_notice (pagedata->wbcg, GTK_MESSAGE_ERROR, msg);
gnumeric_notice (GTK_WINDOW (pagedata->dialog),
GTK_MESSAGE_ERROR, msg);
g_free (msg);
charmap_selector_set_encoding (pagedata->main.charmap_selector,
......
......@@ -176,7 +176,7 @@ static void
cancel_clicked (G_GNUC_UNUSED GtkWidget *widget, StfDialogData *data)
{
if (gnumeric_dialog_question_yes_no
(data->wbcg,
(GTK_WINDOW (data->dialog),
_("Are you sure you want to cancel?"),
FALSE)) {
data->canceled = TRUE;
......
......@@ -200,13 +200,15 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
cells[dims] = single_cell (dd->sheet, w);
if (!cells[dims]) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("You should introduce a single valid cell as dependency cell"));
gnm_expr_entry_grab_focus (GNM_EXPR_ENTRY (w), TRUE);
goto error;
}
if (cell_has_expr (cells[dims])) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("The dependency cells should not contain an expression"));
gnm_expr_entry_grab_focus (GNM_EXPR_ENTRY (w), TRUE);
goto error;
......@@ -214,7 +216,8 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
if (get_table_float_entry (dd->source_table, row, COL_MIN, cells[dims],
&(minima[dims]), &e_w, FALSE, 0.0)) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("You should introduce a valid number as minimum"));
focus_on_entry (e_w);
goto error;
......@@ -222,14 +225,16 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
if (get_table_float_entry (dd->source_table, row, COL_MAX, cells[dims],
&(maxima[dims]), &e_w, FALSE, 0.0)) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("You should introduce a valid number as maximum"));
focus_on_entry (e_w);
goto error;
}
if (maxima[dims] < minima[dims]) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("The maximum value should be bigger than the minimum"));
focus_on_entry (e_w);
goto error;
......@@ -237,14 +242,16 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
if (get_table_float_entry (dd->source_table, row, COL_STEP, cells[dims],
&(steps[dims]), &e_w, TRUE, 1.0)) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("You should introduce a valid number as step size"));
focus_on_entry (e_w);
goto error;
}
if (steps[dims] <= 0) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("The step size should be positive"));
focus_on_entry (e_w);
goto error;
......@@ -254,7 +261,8 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
}
if (dims == 0) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("You should introduce one or more dependency cells"));
goto error;
}
......@@ -263,14 +271,16 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
resultcell = single_cell (dd->sheet, dd->resultrangetext);
if (!resultcell) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("You should introduce a single valid cell as result cell"));
gnm_expr_entry_grab_focus (dd->resultrangetext, TRUE);
goto error;
}
if (!cell_has_expr (resultcell)) {
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
gnumeric_notice (GTK_WINDOW (dd->dialog),
GTK_MESSAGE_ERROR,
_("The target cell should contain an expression"));
gnm_expr_entry_grab_focus (dd->resultrangetext, TRUE);
goto error;
......
......@@ -80,7 +80,8 @@ cb_view_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
g_strdup_printf (_("Display \"%s\" could not be opened."),
name);
gtk_widget_destroy (state->dialog);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, error_str);
gnumeric_notice (wbcg_toplevel (wbcg),
GTK_MESSAGE_ERROR, error_str);
g_free (error_str);
return;
}
......
......@@ -371,7 +371,7 @@ update_preview_cb (GtkFileChooser *chooser)
* not the workbook.
*/
static gboolean
go_file_is_writable (char const *uri, WorkbookControlGUI *wbcg)
go_file_is_writable (char const *uri, GtkWindow *parent)
{
gboolean result = TRUE;
gchar *msg;
......@@ -387,14 +387,14 @@ go_file_is_writable (char const *uri, WorkbookControlGUI *wbcg)
if (filename [strlen (filename) - 1] == G_DIR_SEPARATOR ||
g_file_test (filename, G_FILE_TEST_IS_DIR)) {
msg = g_strdup_printf (_("%s\nis a directory name"), uri);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, msg);
gnumeric_notice (parent, GTK_MESSAGE_ERROR, msg);
g_free (msg);
result = FALSE;
} else if (access (filename, W_OK) != 0 && errno != ENOENT) {
msg = g_strdup_printf (
_("You do not have permission to save to\n%s"),
uri);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, msg);
gnumeric_notice (parent, GTK_MESSAGE_ERROR, msg);
g_free (msg);
result = FALSE;
} else if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
......@@ -402,7 +402,8 @@ go_file_is_writable (char const *uri, WorkbookControlGUI *wbcg)
_("%s already exists.\n"
"Do you want to save over it?"), uri);
result = gnumeric_dialog_question_yes_no (
wbcg, msg, gnm_app_prefs->file_overwrite_default_answer);
parent, msg,
gnm_app_prefs->file_overwrite_default_answer);
g_free (msg);
}
......@@ -520,7 +521,7 @@ loop :
if (!gnumeric_dialog_file_selection (wbcg, GTK_WIDGET (fsel)))
goto out;
uri = gtk_file_chooser_get_uri (fsel);
if (!go_file_is_writable (uri, wbcg)) {
if (!go_file_is_writable (uri, GTK_WINDOW (fsel))) {
g_free (uri);
goto loop;
}
......@@ -532,7 +533,7 @@ loop :
if (!gnm_vrfy_uri_ext (sel_format->ext,
uri, &new_uri) &&
!gnumeric_dialog_question_yes_no
(wbcg,
(GTK_WINDOW (fsel),
_("The given file extension does not match the"
" chosen file type. Do you want to use this name"
" anyway?"), TRUE)) {
......@@ -571,7 +572,7 @@ gui_image_file_select (WorkbookControlGUI *wbcg, const char *initial)
static gboolean
check_multiple_sheet_support_if_needed (GnmFileSaver *fs,
WorkbookControlGUI *wbcg,
GtkWindow *parent,
WorkbookView *wb_view)
{
gboolean ret_val = TRUE;
......@@ -587,7 +588,8 @@ check_multiple_sheet_support_if_needed (GnmFileSaver *fs,
sheets = workbook_sheets (wb_view_workbook (wb_view));
if (g_list_length (sheets) > 1) {