Commit 8b236ce4 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

fix all calls to gnumeric_notice ditto ditto ditto ditto ditto ditto ditto

2002-01-25  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* dialog-advanced-filter.c : fix all calls to gnumeric_notice
	* dialog-analysis-tools.c : ditto
	* dialog-autocorrect.c : ditto
	* dialog-autosave.c : ditto
	* dialog-cell-sort.c : ditto
	* dialog-consolidate.c : ditto
	* dialog-define-names.c : ditto
	* dialog-goal-seek.c : ditto
	* dialog-search-replace.c : ditto
	* dialog-search.c : ditto
	* dialog-solver.c : ditto
	* dialog-tabulate.c : ditto

2002-01-25  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* src/gui-util.c (gnumeric_dialog_run) : use GTK functions
	(gnumeric_notice) : create GTK_Message_Dialog
	* src/gui-util.h (gnumeric_notice) : change type of second argument
	* src/gui-file.c : fix all calls to gnumeric_notice
	* src/print.c : ditto
	* src/style.c : ditto
	* src/workbook-cmd-format.c : ditto
	* src/workbook-control-gui.c : ditto
parent 94018bad
2002-01-25 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_dialog_run) : use GTK functions
(gnumeric_notice) : create GTK_Message_Dialog
* src/gui-util.h (gnumeric_notice) : change type of second argument
* src/gui-file.c : fix all calls to gnumeric_notice
* src/print.c : ditto
* src/style.c : ditto
* src/workbook-cmd-format.c : ditto
* src/workbook-control-gui.c : ditto
2002-01-25 Jody Goldberg <jody@gnome.org>
* src/sheet-control-gui.c (scg_context_menu) : fix the icon names.
......
Gnumeric 1.1.0
Andreas:
* Fix gnumeric_notice
Jody:
* Initial port to gnome2.
* Enable microhash depend mechanism.
......@@ -8,6 +11,9 @@ Jody:
--------------------------------------------------------------------------
Gnumeric 1.0.4
Andreas:
Fix LaTeX and HTML exporter crashes
Jody:
http://bugzilla.gnome.org/show_bug.cgi?id=69400
......
2002-01-25 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_dialog_run) : use GTK functions
(gnumeric_notice) : create GTK_Message_Dialog
* src/gui-util.h (gnumeric_notice) : change type of second argument
* src/gui-file.c : fix all calls to gnumeric_notice
* src/print.c : ditto
* src/style.c : ditto
* src/workbook-cmd-format.c : ditto
* src/workbook-control-gui.c : ditto
2002-01-25 Jody Goldberg <jody@gnome.org>
* src/sheet-control-gui.c (scg_context_menu) : fix the icon names.
......
2002-01-25 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_dialog_run) : use GTK functions
(gnumeric_notice) : create GTK_Message_Dialog
* src/gui-util.h (gnumeric_notice) : change type of second argument
* src/gui-file.c : fix all calls to gnumeric_notice
* src/print.c : ditto
* src/style.c : ditto
* src/workbook-cmd-format.c : ditto
* src/workbook-control-gui.c : ditto
2002-01-25 Jody Goldberg <jody@gnome.org>
* src/sheet-control-gui.c (scg_context_menu) : fix the icon names.
......
2002-01-25 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/gui-util.c (gnumeric_dialog_run) : use GTK functions
(gnumeric_notice) : create GTK_Message_Dialog
* src/gui-util.h (gnumeric_notice) : change type of second argument
* src/gui-file.c : fix all calls to gnumeric_notice
* src/print.c : ditto
* src/style.c : ditto
* src/workbook-cmd-format.c : ditto
* src/workbook-control-gui.c : ditto
2002-01-25 Jody Goldberg <jody@gnome.org>
* src/sheet-control-gui.c (scg_context_menu) : fix the icon names.
......
2002-01-25 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-advanced-filter.c : fix all calls to gnumeric_notice
* dialog-analysis-tools.c : ditto
* dialog-autocorrect.c : ditto
* dialog-autosave.c : ditto
* dialog-cell-sort.c : ditto
* dialog-consolidate.c : ditto
* dialog-define-names.c : ditto
* dialog-goal-seek.c : ditto
* dialog-search-replace.c : ditto
* dialog-search.c : ditto
* dialog-solver.c : ditto
* dialog-tabulate.c : ditto
2002-01-24 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-analysis-tools.c (tool_load_selection) : use
......
......@@ -242,7 +242,7 @@ loop:
text = gtk_entry_get_text (GTK_ENTRY (list_range));
if (!parse_range (text, &list)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid cell names "
"in 'List Range:'"));
gtk_widget_grab_focus (list_range);
......@@ -255,7 +255,7 @@ loop:
text = gtk_entry_get_text (GTK_ENTRY (criteria_range));
error_flag = parse_range (text, &crit);
if (! error_flag) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid cell names "
"in 'Criteria Range:'"));
gtk_widget_grab_focus (criteria_range);
......@@ -269,7 +269,7 @@ loop:
Range r;
text = gtk_entry_get_text (GTK_ENTRY (copy_to));
if (!parse_range (text, &r)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid "
"cell range in 'Copy To:'"));
gtk_widget_grab_focus (copy_to);
......@@ -316,7 +316,7 @@ loop:
case OK: break;
case N_COLUMNS_ERROR:
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You should introduce the same number of "
"columns in the `List Range' and in "
"`Criteria Range:'"));
......
......@@ -615,7 +615,7 @@ gnumeric_expr_entry_parse_to_list (GnumericExprEntry *ee, Sheet *sheet)
static void
error_in_entry (WorkbookControlGUI *wbcg, GtkWidget *entry, const char *err_str)
{
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR, err_str);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, err_str);
gtk_widget_grab_focus (entry);
gtk_entry_set_position (GTK_ENTRY (entry), 0);
......@@ -1156,7 +1156,7 @@ dialog_correlation_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
GTK_SIGNAL_FUNC (corr_tool_ok_clicked_cb),
GTK_SIGNAL_FUNC (tool_update_sensitivity_cb),
0)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Correlation Tool dialog."));
g_free (state);
return 0;
......@@ -1271,7 +1271,7 @@ dialog_covariance_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
GTK_SIGNAL_FUNC (cov_tool_ok_clicked_cb),
GTK_SIGNAL_FUNC (tool_update_sensitivity_cb),
0)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Covariance Tool dialog."));
g_free (state);
return 0;
......@@ -1499,7 +1499,7 @@ dialog_descriptive_stat_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_desc_stat_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Descriptive Statistics Tool dialog."));
g_free (state);
return 0;
......@@ -1602,7 +1602,7 @@ dialog_ranking_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
GTK_SIGNAL_FUNC (rank_tool_ok_clicked_cb),
GTK_SIGNAL_FUNC (tool_update_sensitivity_cb),
0)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Rank and Percentile Tools dialog."));
g_free (state);
return 0;
......@@ -2011,7 +2011,7 @@ dialog_ttest_tool (WorkbookControlGUI *wbcg, Sheet *sheet, ttest_type test)
state->input_var2_str = _("_Variable 2 Range:");;
if (dialog_ttest_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Mean Tests Tool dialog."));
g_free (state);
return 0;
......@@ -2197,7 +2197,7 @@ dialog_ftest_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = _("_Variable 2 Range");
if (dialog_ftest_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the FTest Tool dialog."));
g_free (state);
return 0;
......@@ -2451,7 +2451,7 @@ dialog_sampling_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_sampling_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Sampling Tool dialog."));
g_free (state);
return 0;
......@@ -2826,7 +2826,7 @@ random_tool_ok_clicked_cb (GtkWidget *button, RandomToolState *state)
break;
default:
text = g_strdup_printf (_("An unexpected error has occurred: %d."), err);
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR, text);
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, text);
g_free (text);
break;
}
......@@ -3000,7 +3000,7 @@ dialog_random_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_random_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Random Tool dialog."));
g_free (state);
return 0;
......@@ -3063,20 +3063,20 @@ regression_tool_ok_clicked_cb (GtkWidget *button, RegressionToolState *state)
gtk_widget_destroy (state->dialog);
break;
case 1:
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("There are too few data points to conduct this "
"regression.\nThere must be at least as many "
"data points as free variables."));
break;
case 2:
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("Two or more of the independent variables "
"are linearly dependent,\nand the regression "
"cannot be calculated. Remove one of these\n"
"variables and try the regression again."));
break;
case 3:
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("There must be an equal number of entries "
"for each variable in the regression."));
break;
......@@ -3267,7 +3267,7 @@ dialog_regression_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->help_link = "regression-tool.html";
if (dialog_regression_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Regression Tool dialog."));
g_free (state);
return 0;
......@@ -3438,7 +3438,7 @@ dialog_exp_smoothing_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_exp_smoothing_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Exponential Smoothing "
"Tool dialog."));
g_free (state);
......@@ -3608,7 +3608,7 @@ dialog_average_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_average_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Moving Average Tool dialog."));
g_free (state);
return 0;
......@@ -3711,7 +3711,7 @@ dialog_fourier_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
GTK_SIGNAL_FUNC (fourier_tool_ok_clicked_cb),
GTK_SIGNAL_FUNC (tool_update_sensitivity_cb),
0)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Fourier Analyis Tool dialog."));
g_free (state);
return 0;
......@@ -4065,7 +4065,7 @@ dialog_histogram_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = _("Bin _Range:");
if (dialog_histogram_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Histogram Tool dialog."));
g_free (state);
return 0;
......@@ -4243,7 +4243,7 @@ dialog_anova_single_factor_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_anova_single_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the ANOVA (single factor) tool dialog."));
g_free (state);
return 0;
......@@ -4446,7 +4446,7 @@ dialog_anova_two_factor_tool (WorkbookControlGUI *wbcg, Sheet *sheet)
state->input_var2_str = NULL;
if (dialog_anova_two_factor_tool_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the ANOVA (two factor) tool dialog."));
g_free (state);
return 0;
......
......@@ -283,7 +283,7 @@ dialog_autocorrect (WorkbookControlGUI *wbcg)
state->first_letter.exceptions = NULL;
if (dialog_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the AutoCorrect dialog."));
cb_autocorrect_destroy (NULL, state);
return;
......
......@@ -114,7 +114,7 @@ loop:
int tmp = atoi (gtk_entry_get_text (
GTK_ENTRY (p.minutes_entry)));
if (tmp <= 0) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a proper "
"number of minutes in the entry."));
gtk_widget_grab_focus (p.minutes_entry);
......
......@@ -316,7 +316,7 @@ dialog_cell_sort_ok (SortFlow *sf)
}
if (division < divstart || division > divend) {
gnumeric_notice (sf->wbcg,
GNOME_MESSAGE_BOX_ERROR,
GTK_MESSAGE_ERROR,
sf->top
? _("Column must be within range")
: _("Row must be within range"));
......@@ -325,7 +325,7 @@ dialog_cell_sort_ok (SortFlow *sf)
}
array[lp].offset = division - divstart;
} else if (lp <= 0) {
gnumeric_notice (sf->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (sf->wbcg, GTK_MESSAGE_ERROR,
sf->top
? _("First column must be valid")
: _("First row must be valid"));
......@@ -367,7 +367,7 @@ dialog_cell_sort_del_clause (SortFlow *sf)
gtk_widget_show_all (sf->dialog);
sf->clauses[sf->num_clause] = NULL;
} else
gnumeric_notice (sf->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (sf->wbcg, GTK_MESSAGE_ERROR,
_("At least one clause is required."));
}
......@@ -376,10 +376,10 @@ dialog_cell_sort_add_clause (SortFlow *sf, WorkbookControlGUI *wbcg)
{
if ((sf->num_clause >= sf->max_col_clause && sf->top)
|| (sf->num_clause >= sf->max_row_clause && !(sf->top)))
gnumeric_notice (sf->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (sf->wbcg, GTK_MESSAGE_ERROR,
_("Can't add more than the selection length."));
else if (sf->num_clause >= MAX_CLAUSE)
gnumeric_notice (sf->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (sf->wbcg, GTK_MESSAGE_ERROR,
_("Maximum number of clauses has been reached."));
else {
if (sf->header)
......
......@@ -214,7 +214,7 @@ cb_dialog_clicked (GtkWidget *widget, ConsolidateState *state)
* a suitable error message
*/
if (cs == NULL) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR, state->construct_error);
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, state->construct_error);
g_free (state->construct_error);
state->construct_error = NULL;
......
......@@ -361,7 +361,7 @@ name_guru_add (NameGuruState *state)
/* If the expression is invalid */
if (expr == NULL) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR, perr.message);
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, perr.message);
gtk_widget_grab_focus (GTK_WIDGET (state->expr_text));
parse_error_free (&perr);
return FALSE;
......@@ -374,7 +374,7 @@ name_guru_add (NameGuruState *state)
expr_name_set_expr (expr_name, expr);
dirty = TRUE;
} else
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("You cannot redefine a builtin name."));
} else {
char const *error = NULL;
......@@ -391,7 +391,7 @@ name_guru_add (NameGuruState *state)
expr_name = expr_name_add (&pos, name, expr, &error);
if (expr_name == NULL) {
g_return_val_if_fail (error != NULL, FALSE);
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR, error);
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, error);
gtk_widget_grab_focus (GTK_WIDGET (state->expr_text));
return FALSE;
}
......@@ -587,7 +587,7 @@ dialog_define_names (WorkbookControlGUI *wbcg)
state = g_new0 (NameGuruState, 1);
if (name_guru_init (state, wbcg)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Name Guru."));
g_free (state);
return;
......
......@@ -350,7 +350,7 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
target = global_range_parse (state->sheet,
gtk_entry_get_text (GTK_ENTRY (state->set_cell_entry)));
if (target == NULL) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid cell name in 'Set Cell:'!"));
focus_on_entry (GTK_WIDGET (state->set_cell_entry));
return;
......@@ -359,7 +359,7 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
state->set_cell = sheet_cell_get (r->a.sheet, r->a.col, r->a.row);
value_release (target);
if (state->set_cell == NULL || !cell_has_expr (state->set_cell)) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("The cell named in 'Set Cell:' must contain a formula!"));
focus_on_entry (GTK_WIDGET (state->set_cell_entry));
return;
......@@ -369,7 +369,7 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
target = global_range_parse (state->sheet,
gtk_entry_get_text (GTK_ENTRY (state->change_cell_entry)));
if (target == NULL) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid cell "
"name in 'By Changing Cell:'!"));
focus_on_entry (GTK_WIDGET (state->change_cell_entry));
......@@ -380,7 +380,7 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
state->change_cell = sheet_cell_get (r->a.sheet, r->a.col, r->a.row);
value_release (target);
if (cell_has_expr (state->change_cell)) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("The cell named in 'By changing cell' "
"must not contain a formula."));
focus_on_entry (GTK_WIDGET (state->change_cell_entry));
......@@ -393,7 +393,7 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
if (format != NULL)
target_value_format = format;
if (value == NULL){
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("The value given in 'To Value:' "
"is not valid."));
focus_on_entry (GTK_WIDGET (state->to_value_entry));
......@@ -654,7 +654,7 @@ dialog_goal_seek (WorkbookControlGUI *wbcg, Sheet *sheet)
state->sheet = sheet;
if (dialog_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Goal-Seek dialog."));
g_free (state);
return;
......
......@@ -129,7 +129,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
err = search_replace_verify (sr, TRUE);
if (err) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR, err);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, err);
g_free (err);
search_replace_free (sr);
return;
......@@ -137,7 +137,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
!sr->search_other_values &&
!sr->search_expressions &&
!sr->search_comments) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You must select some cell types to search."));
search_replace_free (sr);
return;
......
......@@ -347,7 +347,7 @@ search_clicked (GtkWidget *widget, DialogState *dd)
err = search_replace_verify (sr, FALSE);
if (err) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR, err);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, err);
g_free (err);
search_replace_free (sr);
return;
......@@ -355,7 +355,7 @@ search_clicked (GtkWidget *widget, DialogState *dd)
!sr->search_other_values &&
!sr->search_expressions &&
!sr->search_comments) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("You must select some cell types to search."));
search_replace_free (sr);
return;
......
......@@ -809,7 +809,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
workbook_recalc (state->sheet->workbook);
if (res == SOLVER_LP_OPTIMAL) {
gnumeric_notice (state->wbcg,
GNOME_MESSAGE_BOX_INFO,
GTK_MESSAGE_INFO,
_("Solver found an optimal solution. All "
"constraints and optimality conditions "
"are satisfied.\n"));
......@@ -824,7 +824,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
(_("Solver was not successful:"
" %i"), res);
}
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_WARNING, str);
gnumeric_notice (state->wbcg, GTK_MESSAGE_WARNING, str);
g_free (str);
}
......@@ -845,7 +845,7 @@ cb_dialog_solve_clicked (GtkWidget *button, SolverState *state)
str = g_strdup_printf
(_("Constraint `%s' is for a cell that "
"is not an input cell."), s);
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR, str);
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR, str);
g_free (str);
}
......@@ -1092,7 +1092,7 @@ dialog_solver (WorkbookControlGUI *wbcg, Sheet *sheet)
state->ov_cell_stack = NULL;
if (dialog_init (state)) {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Solver dialog."));
g_free (state);
return;
......
......@@ -380,13 +380,13 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
cells[dims] = single_cell (dd->sheet, text);
if (!cells[dims]) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a single valid cell as dependency cell"));
focus_on_entry (GTK_WIDGET (w));
goto error;
}
if (cell_has_expr (cells[dims])) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("The dependency cells should not contain an expression"));
focus_on_entry (GTK_WIDGET (w));
goto error;
......@@ -395,7 +395,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
text = get_table_entry (dd->source_table, row, COL_MIN, &w);
v = format_match_number (text, NULL, NULL);
if (!v) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid number as minimum"));
focus_on_entry (GTK_WIDGET (w));
goto error;
......@@ -406,7 +406,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
text = get_table_entry (dd->source_table, row, COL_MAX, &w);
v = format_match_number (text, NULL, NULL);
if (!v) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid number as maximum"));
focus_on_entry (GTK_WIDGET (w));
goto error;
......@@ -415,7 +415,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
value_release (v);
if (maxima[dims] < minima[dims]) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("The maximum value should be bigger than the minimum"));
focus_on_entry (GTK_WIDGET (w));
goto error;
......@@ -425,7 +425,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
if (*text) {
v = format_match_number (text, NULL, NULL);
if (!v) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a valid number as step size"));
focus_on_entry (GTK_WIDGET (w));
goto error;
......@@ -434,7 +434,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
value_release (v);
if (steps[dims] <= 0) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("The step size should be positive"));
focus_on_entry (GTK_WIDGET (w));
goto error;
......@@ -446,7 +446,7 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
}
if (dims == 0) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce one or more dependency cells"));
goto error;
}
......@@ -456,14 +456,14 @@ ok_clicked (GtkWidget *widget, DialogState *dd)
resultcell = single_cell (dd->sheet, text);
if (!resultcell) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("You should introduce a single valid cell as result cell"));
focus_on_entry (GTK_WIDGET (dd->resultrangetext));
goto error;
}
if (!cell_has_expr (resultcell)) {
gnumeric_notice (dd->wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (dd->wbcg, GTK_MESSAGE_ERROR,
_("The target cell should contain an expression"));
focus_on_entry (GTK_WIDGET (dd->resultrangetext));
goto error;
......
......@@ -151,14 +151,14 @@ can_try_save_to (WorkbookControlGUI *wbcg, const char *name)
} else if (name [strlen (name) - 1] == '/' ||
g_file_test (name, G_FILE_TEST_IS_DIR)) {
msg = g_strdup_printf (_("%s\nis a directory name"), name);
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR, msg);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, msg);
g_free (msg);
result = FALSE;
} else if (access (name, W_OK) != 0 && errno != ENOENT) {
msg = g_strdup_printf (
_("You do not have permission to save to\n%s"),
name);
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR, msg);
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR, msg);
g_free (msg);
result = FALSE;
} else if (g_file_exists (name)) {
......@@ -207,7 +207,7 @@ do_save_as (WorkbookControlGUI *wbcg, WorkbookView *wb_view,
gboolean success = FALSE;
if (*name == 0 || name [strlen (name) - 1] == '/') {
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Please enter a file name,\nnot a directory"));
return FALSE;
}
......
......@@ -51,11 +51,13 @@ gnumeric_dialog_question_yes_no (WorkbookControlGUI *wbcg,
* Wrap overlong lines.
*/
void
gnumeric_notice (WorkbookControlGUI *wbcg, char const *type, char const *str)
gnumeric_notice (WorkbookControlGUI *wbcg, GtkMessageType type, char const *str)
{
GtkWidget *dialog;
dialog = gnome_message_box_new (str, type, GNOME_STOCK_BUTTON_OK, NULL);
dialog = gtk_message_dialog_new (wbcg == NULL ? NULL : wbcg_toplevel (wbcg),
GTK_DIALOG_DESTROY_WITH_PARENT, type,
GTK_BUTTONS_OK, str);
gnumeric_dialog_run (wbcg, GTK_DIALOG (dialog));
}
......@@ -156,17 +158,21 @@ gint
gnumeric_dialog_run (WorkbookControlGUI *wbcg, GtkDialog *dialog)
{
GtkWindow *toplevel;
gint result;
g_return_val_if_fail (GNOME_IS_DIALOG (dialog), -1);
g_return_val_if_fail (GTK_IS_DIALOG (dialog), GTK_RESPONSE_NONE);
if (wbcg) {
g_return_val_if_fail (IS_WORKBOOK_CONTROL_GUI (wbcg), -1);
g_return_val_if_fail (IS_WORKBOOK_CONTROL_GUI (wbcg), GTK_RESPONSE_NONE);
toplevel = wbcg_toplevel (wbcg);
if (GTK_WINDOW (dialog)->transient_parent != toplevel)
gtk_window_set_transient_for (GTK_WINDOW (dialog), toplevel);
}
return gtk_dialog_run (dialog);
result = gtk_dialog_run (dialog);
gtk_widget_destroy (dialog);
return result;
}
/**
......
......@@ -11,7 +11,7 @@ gboolean gnumeric_dialog_question_yes_no (WorkbookControlGUI *wbcg,
const gchar *message,
gboolean default_answer);
gboolean gnumeric_dialog_file_selection (WorkbookControlGUI *wbcg, GtkFileSelection *fsel);
void gnumeric_notice (WorkbookControlGUI *wbcg, const char *type, const char *str);
void gnumeric_notice (WorkbookControlGUI *wbcg, GtkMessageType type, const char *str);
void gnumeric_non_modal_dialog (WorkbookControlGUI *wbcg, GtkWindow *dialog);
gint gnumeric_dialog_run (WorkbookControlGUI *wbcg, GtkDialog *dialog);
......
......@@ -1197,7 +1197,7 @@ sheet_print (WorkbookControlGUI *wbcg, Sheet *sheet,
* FIXME: not a great message, but at this point we don't
* know *what* went wrong.
*/
gnumeric_notice (wbcg, GNOME_MESSAGE_BOX_ERROR,
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Printing failed"));
}
}
......
......@@ -311,7 +311,7 @@ font_init (void)
fontmap_fn, lc_all, lang);
/* Ick ! We should do this somewhere when we have a command context. */
gnumeric_notice (NULL, GNOME_MESSAGE_BOX_ERROR, msg);
gnumeric_notice (NULL, GTK_MESSAGE_ERROR, msg);
exit (1);
}
......
......@@ -131,7 +131,7 @@ loop :
char *msg = g_strdup_printf (
_("You entered an invalid column width value. It must be bigger than %d"),