Commit 94c47dab authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Revamp pasting. This needs alot of testing. Some initial work on a

Revamp pasting.
This needs alot of testing.
Some initial work on a function druid.

2000-05-26  Jody Goldberg <jgoldberg@home.com>

	* src/selection.c (selection_is_simple) : Use a command context.
	(sheet_selection_paste) : Delete.

	* src/plugin.c : rename error_plugin_problem -> error_plugin.

	* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
	(context_paste_special_cmd) : Ditto.

	* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
	  preparation for the function druid.

	* src/corba-sheet.c : Delete Sheet_selection_paste.
	  this will need to be replaced with a new signature.

	* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.

	* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
	  clipboard_paste_region.
	(cmd_ins_del_row_col_{undo,redo}) : Ditto.
	(cmd_clear_{undo,redo}) : Ditto.
	(cmd_set_date_time_{undo,redo}) : Ditto.
	(cmd_paste_cut_*) : new functions.

	* src/command-context*.c : Add progress, remove splits_array.

	* src/cmd-edit.c (cmd_paste) : New function.
	(cmd_paste_to_selection) : New function.

	* src/clipboard.c : Reorganize/rewrite.
	(clipboard_paste_region) : paste content.
	(clipboard_paste) : paste content from clipboard or X selection.
	(paste_target_init) : New function.
	(sheet_paste_selection) : merge into clipboard_paste_region.

	* src/application.c (application_clipboard_copy) : rename
	  clipboard_copy_cell_range -> clipboard_copy_range.

	* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.

	* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
parent 3d9176b0
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* src/selection.c (selection_is_simple) : Use a command context.
(sheet_selection_paste) : Delete.
* src/plugin.c : rename error_plugin_problem -> error_plugin.
* src/item-grid.c (context_paste_cmd) : Use cmd_paste_to_selection.
(context_paste_special_cmd) : Ditto.
* src/gnumeric-sheet.c : remove cached 'controlling_entry' in
preparation for the function druid.
* src/corba-sheet.c : Delete Sheet_selection_paste.
this will need to be replaced with a new signature.
* src/item-cursor.c (item_cursor_do_action) : Use new cmd_paste.
* src/commands.c (cmd_area_set_text_{undo,redo}) : Use new
clipboard_paste_region.
(cmd_ins_del_row_col_{undo,redo}) : Ditto.
(cmd_clear_{undo,redo}) : Ditto.
(cmd_set_date_time_{undo,redo}) : Ditto.
(cmd_paste_cut_*) : new functions.
* src/command-context*.c : Add progress, remove splits_array.
* src/cmd-edit.c (cmd_paste) : New function.
(cmd_paste_to_selection) : New function.
* src/clipboard.c : Reorganize/rewrite.
(clipboard_paste_region) : paste content.
(clipboard_paste) : paste content from clipboard or X selection.
(paste_target_init) : New function.
(sheet_paste_selection) : merge into clipboard_paste_region.
* src/application.c (application_clipboard_copy) : rename
clipboard_copy_cell_range -> clipboard_copy_range.
* idl/Gnumeric.idl : Merge InvalidValue, SplitsArray -> InvalidCmd.
* src/workbook.c (workbook_setup_status_area) : Include a progress bar.
* src/sheet.c (sheet_update) : SPANCALC_NO_DRAW exists now.
2000-05-26 Michael Meeks <michael@helixcode.com>
......@@ -144,7 +185,6 @@
* src/file.c (workbook_import) : set the import dialog's parent widget
to be the PARENT workbook, not the new unrealized workbook.
* src/cell.c (cell_set_expr_internal) : Actually assign the format
after we ref it.
(cell_get_format) : Cells with format 'General' may appear to have
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* plugin.c (init_plugin) : rename
gnumeric_error_plugin_problem -> gnumeric_error_plugin.
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* Release 0.54
......
......@@ -474,7 +474,7 @@ init_plugin (CommandContext *context, PluginData *pd)
return PLUGIN_QUIET_ERROR;
if (!has_gnumeric_been_compiled_with_guile_support ()) {
gnumeric_error_plugin_problem (context,
gnumeric_error_plugin (context,
_("Gnumeric has not been compiled with support for guile."));
return PLUGIN_QUIET_ERROR;
}
......
2000-05-26 Jody Goldberg <jgoldberg@home.com>
* python.c (init_plugin) : rename
gnumeric_error_plugin_problem -> gnumeric_error_plugin
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* Release 0.54
......
......@@ -910,7 +910,7 @@ init_plugin (CommandContext *context, PluginData * pd)
if (PyErr_Occurred ()) {
exc_string = string_from_exception ();
PyErr_Print (); /* Also do a full traceback to stderr */
gnumeric_error_plugin_problem (context, exc_string);
gnumeric_error_plugin (context, exc_string);
g_free (exc_string);
Py_Finalize ();
return PLUGIN_QUIET_ERROR;
......
......@@ -146,7 +146,7 @@ application_clipboard_copy (Sheet *sheet, Range const *area)
if (application_set_selected_sheet (sheet) ) {
app.clipboard_cut_range = *area;
app.clipboard_copied_contents =
clipboard_copy_cell_range (sheet, area);
clipboard_copy_range (sheet, area);
workbook_view_set_paste_special_state (sheet->workbook, TRUE);
......
......@@ -14,13 +14,11 @@ typedef enum {
/* Cell has been queued for recalc */
CELL_QUEUED_FOR_RECALC = 0x2,
#if TODO
/* Cell has be linked into the workbook wide expression list */
CELL_IN_EXPR_LIST = 0x4,
/* Cell is linked into the sheet */
CELL_IN_SHEET_LIST = 0x8
#endif
} CellFlags;
typedef struct _CellComment CellComment;
......
This diff is collapsed.
......@@ -44,22 +44,21 @@ struct _CellRegion {
GList *styles;
};
CellRegion *clipboard_copy_cell_range (Sheet *sheet, Range const *r);
void clipboard_paste_region (CommandContext *context, CellRegion *region,
Sheet *dest_sheet,
int dest_col,
int dest_row,
int paste_flags,
guint32 time32);
void clipboard_release (CellRegion *region);
struct _PasteTarget {
Sheet *sheet;
Range range;
int paste_flags;
};
CellRegion *clipboard_copy_range (Sheet *sheet, Range const *r);
void clipboard_release (CellRegion *region);
void clipboard_paste_region (CommandContext *context,
PasteTarget const *pt,
CellRegion *content);
void clipboard_paste (CommandContext *context,
PasteTarget const *pt, guint32 time);
PasteTarget*paste_target_init (PasteTarget *pt,
Sheet *sheet, Range const *r, int flags);
void x_clipboard_bind_workbook (Workbook *wb);
typedef struct _PasteTarget PasteTarget;
void sheet_paste_selection (CommandContext *context, Sheet *sheet,
CellRegion *content, Range const *r,
PasteTarget *pt);
#endif /* GNUMERIC_CLIPBOARD_H */
......@@ -24,13 +24,20 @@
*/
#include "config.h"
#include "cmd-edit.h"
#include "selection.h"
#include "application.h"
#include "workbook.h"
#include "sheet.h"
#include "cell.h"
#include "expr.h"
#include "eval.h"
#include "selection.h"
#include "parse-util.h"
#include "stdio.h"
#include "ranges.h"
#include "command-context.h"
#include "commands.h"
#include "clipboard.h"
#include <gnome.h>
/**
* cmd_select_all:
......@@ -257,3 +264,104 @@ cmd_select_cur_inputs (Sheet *sheet)
/* TODO : finish this */
sheet_update (sheet);
}
/**
* cmd_paste :
* @sheet: The destination sheet
* @range : The range to paste to within the destination sheet.
* @flags: Any paste special flags.
*
* Pastes the current cut buffer, copy buffer, or X selection to
* the destination sheet range.
*
* When pasting a cut the destination MUST be the same size as the src.
*
* When pasting a copy the destination can be a singleton, or an integer
* multiple of the size of the source. This is not tested here.
* Full undo support.
*/
void
cmd_paste (CommandContext *context, PasteTarget const *pt, guint32 time)
{
CellRegion *content;
Range const *src_range;
g_return_if_fail (pt->sheet != NULL);
g_return_if_fail (IS_SHEET (pt->sheet));
src_range = application_clipboard_area_get ();
content = application_clipboard_contents_get ();
if (content == NULL && src_range != NULL) {
/* Pasting a Cut */
ExprRelocateInfo rinfo;
Sheet *src_sheet = application_clipboard_sheet_get ();
/* Validate the size & shape of the target here. */
int const cols = (src_range->end.col - src_range->start.col);
int const rows = (src_range->end.row - src_range->start.col);
Range dst = pt->range;
if (range_is_singleton (&dst)) {
dst.end.col = dst.start.col + cols;
dst.end.row = dst.start.row + rows;
} else if ((dst.end.col - dst.start.col) != cols ||
(dst.end.row - dst.start.row) != rows) {
char * msg = g_strdup_printf (
_("destination has a different shape (%dRx%dC) than the original (%dRx%dC)\n\n"
"Try selecting a single cell or an area of the same shape and size."),
(dst.end.row - dst.start.row)+1,
(dst.end.col - dst.start.col)+1,
rows+1, cols+1);
gnumeric_error_invalid (context, _("Unable to paste into selection"), msg);
g_free (msg);
return;
}
rinfo.origin = *src_range;
rinfo.col_offset = dst.start.col - rinfo.origin.start.col;
rinfo.row_offset = dst.start.row - rinfo.origin.start.row;
rinfo.origin_sheet = src_sheet;
rinfo.target_sheet = pt->sheet;
cmd_paste_cut (context, &rinfo);
application_clipboard_clear ();
} else
/*
* Pasting a Copy or from the X selection
* We can not check the size of the range here. The source may
* be an X selection whose size is not known until later.
* Check it then.
*/
clipboard_paste (context, pt, time);
}
/**
* cmd_paste_to_selection :
* @dest_sheet: The sheet into which things should be pasted
* @flags: special paste flags (eg transpose)
*
* Using the current selection as a target
* Full undo support.
*/
void
cmd_paste_to_selection (CommandContext *context, Sheet *dest_sheet, int paste_flags)
{
Range const *dest_range;
PasteTarget pt;
g_return_if_fail (!application_clipboard_is_empty ());
if (!selection_is_simple (context, dest_sheet, _("Paste")))
return;
dest_range = selection_first_range (dest_sheet, FALSE);
g_return_if_fail (dest_range !=NULL);
pt.sheet = dest_sheet;
pt.range = *dest_range;
pt.paste_flags = paste_flags;
cmd_paste (context, &pt, GDK_CURRENT_TIME);
}
......@@ -10,4 +10,8 @@ void cmd_select_cur_array (Sheet *sheet);
void cmd_select_cur_depends (Sheet *sheet);
void cmd_select_cur_inputs (Sheet *sheet);
void cmd_paste_to_selection (CommandContext *context, Sheet *sheet, int flags);
void cmd_paste (CommandContext *context, PasteTarget const *pt,
guint32 time);
#endif /* GNUMERIC_CMD_EDIT_H */
......@@ -16,7 +16,7 @@
#define CCG_CLASS(o) CMD_CONTEXT_CORBA_CLASS (GTK_OBJECT (o)->klass)
static void
ccc_error_plugin_problem (CommandContext *context, char const * message)
ccc_error_plugin (CommandContext *context, char const * message)
{
/* FIXME set exception */
}
......@@ -34,25 +34,21 @@ ccc_error_save (CommandContext *context, char const * message)
}
static void
ccc_error_splits_array (CommandContext *context)
ccc_error_sys_err (CommandContext *context, char const * message)
{
#if 0
CommandContextCorba *ccc = COMMAND_CONTEXT_CORBA (context);
/* FIXME set exception */
#endif
}
static void
ccc_error_sys_err (CommandContext *context, char const * message)
ccc_error_invalid (CommandContext *context, char const * message, char const *value)
{
/* FIXME set exception */
}
static void
ccc_error_invalid (CommandContext *context, char const * message, char const *value)
ccc_set_progress (CommandContext *context, gfloat f)
{
/* FIXME set exception */
/* Ignore */
}
static void
......@@ -60,12 +56,12 @@ ccc_init_class (GtkObjectClass *object_class)
{
CommandContextClass *cc_class = (CommandContextClass *) object_class;
cc_class->error_plugin_problem = ccc_error_plugin_problem;
cc_class->error_read = ccc_error_read;
cc_class->error_save = ccc_error_save;
cc_class->error_splits_array = ccc_error_splits_array;
cc_class->error_sys_err = ccc_error_sys_err;
cc_class->error_invalid = ccc_error_invalid;
cc_class->error_plugin = &ccc_error_plugin;
cc_class->error_read = &ccc_error_read;
cc_class->error_save = &ccc_error_save;
cc_class->error_sys_err = &ccc_error_sys_err;
cc_class->error_invalid = &ccc_error_invalid;
cc_class->set_progress = &ccc_set_progress;
}
GNUMERIC_MAKE_TYPE(command_context_corba, "CommandContextCorba", CommandContextCorba, ccc_init_class, NULL, PARENT_TYPE)
......
......@@ -10,13 +10,15 @@
#include "gnumeric-type-util.h"
#include "command-context-gui.h"
#include "gnumeric-util.h"
#include "workbook-private.h"
#include "workbook.h"
#define PARENT_TYPE command_context_get_type ()
#define CCG_CLASS(o) CMD_CONTEXT_GUI_CLASS (GTK_OBJECT (o)->klass)
static void
ccg_error_plugin_problem (CommandContext *context, char const * message)
ccg_error_plugin (CommandContext *context, char const * message)
{
CommandContextGui *ccg = COMMAND_CONTEXT_GUI (context);
......@@ -39,15 +41,6 @@ ccg_error_save (CommandContext *context, char const * message)
gnumeric_notice (ccg->wb, GNOME_MESSAGE_BOX_ERROR, message);
}
static void
ccg_error_splits_array (CommandContext *context)
{
CommandContextGui *ccg = COMMAND_CONTEXT_GUI (context);
gnumeric_notice (ccg->wb, GNOME_MESSAGE_BOX_ERROR,
_("You cannot change part of an array."));
}
static void
ccg_error_sys_err (CommandContext *context, char const * message)
{
......@@ -66,17 +59,25 @@ ccg_error_invalid (CommandContext *context, char const * message, char const * v
g_free (buf);
}
static void
ccg_set_progress (CommandContext *context, gfloat f)
{
CommandContextGui *ccg = COMMAND_CONTEXT_GUI (context);
gnome_appbar_set_progress (ccg->wb->priv->appbar, f);
}
static void
ccg_init_class (GtkObjectClass *object_class)
{
CommandContextClass *cc_class = (CommandContextClass *) object_class;
cc_class->error_plugin_problem = &ccg_error_plugin_problem;
cc_class->error_read = &ccg_error_read;
cc_class->error_save = &ccg_error_save;
cc_class->error_splits_array = &ccg_error_splits_array;
cc_class->error_sys_err = &ccg_error_sys_err;
cc_class->error_invalid = &ccg_error_invalid;
cc_class->error_plugin = &ccg_error_plugin;
cc_class->error_read = &ccg_error_read;
cc_class->error_save = &ccg_error_save;
cc_class->error_sys_err = &ccg_error_sys_err;
cc_class->error_invalid = &ccg_error_invalid;
cc_class->set_progress = &ccg_set_progress;
}
GNUMERIC_MAKE_TYPE(command_context_gui, "CommandContextGui", CommandContextGui, ccg_init_class, NULL, PARENT_TYPE)
......
......@@ -9,6 +9,7 @@
#include <config.h>
#include "gnumeric-type-util.h"
#include "command-context.h"
#include <gnome.h> /* Ick. This is required to get _("") */