Commit 86c531df authored by Almer S. Tigelaar's avatar Almer S. Tigelaar Committed by Almer S. Tigelaar

New, combine all the enabling/disabling of menu items here including the

2001-05-08  Almer S. Tigelaar  <almer@gnome.org>

	* src/workbook-control-gui.c (wbcg_menu_state_update): New, combine
	all the enabling/disabling of menu items here including the newly
	added show/hide menu items.
	(wbcg_menu_state_enable_insert): Remove.
	(wbcg_menu_state_paste_special): Remove.
	(workbook_control_gui_ctor_class): Init menu_state_update callback
	and remove paste_special and enable_insert initializations.
	(workbook_control_gui_init): Initialize show/hide menu items.

	* src/workbook-control-gui-priv.h: Add show/hide detail menu items
	and tidy structure lay-out.

	* src/workbook-control-priv.h: Remove menu_state_enable_insert
	and menu_state_paste_special callbacks and add menu_state_update
	callback.

	* src/workbook-control.[ch]: Add wb_menu_state_update and
	remove wb_menu_state_paste_special and wb_menu_state_enable_insert.
	(wb_control_sheet_add): call wb_menu_state_update, Remove
	call to menu_state_paste_special.

	* src/sheet-private.h: Add enable_showhide_detail.

	* src/sheet.c (sheet_new): Initialize menu state booleans.
	(sheet_menu_state_enable_insert): Use wb_control_menu_state_update.

	* src/workbook-view.c (wb_view_menus_update): Idem and
	remove call to wb_control_menu_state_paste_special.

	* src/application.c (application_clipboard_clear): Idem.
	(application_clipboard_copy): Idem.
	(application_clipboard_cut): Idem.

	* src/selection.c (sheet_selection_set_internal): Add comment for
	show/hide detail enabling/disabling, something we can't do just yet.
parent b2f182ff
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-control-gui.c (wbcg_menu_state_update): New, combine
all the enabling/disabling of menu items here including the newly
added show/hide menu items.
(wbcg_menu_state_enable_insert): Remove.
(wbcg_menu_state_paste_special): Remove.
(workbook_control_gui_ctor_class): Init menu_state_update callback
and remove paste_special and enable_insert initializations.
(workbook_control_gui_init): Initialize show/hide menu items.
* src/workbook-control-gui-priv.h: Add show/hide detail menu items
and tidy structure lay-out.
* src/workbook-control-priv.h: Remove menu_state_enable_insert
and menu_state_paste_special callbacks and add menu_state_update
callback.
* src/workbook-control.[ch]: Add wb_menu_state_update and
remove wb_menu_state_paste_special and wb_menu_state_enable_insert.
(wb_control_sheet_add): call wb_menu_state_update, Remove
call to menu_state_paste_special.
* src/sheet-private.h: Add enable_showhide_detail.
* src/sheet.c (sheet_new): Initialize menu state booleans.
(sheet_menu_state_enable_insert): Use wb_control_menu_state_update.
* src/workbook-view.c (wb_view_menus_update): Idem and
remove call to wb_control_menu_state_paste_special.
* src/application.c (application_clipboard_clear): Idem.
(application_clipboard_copy): Idem.
(application_clipboard_cut): Idem.
* src/selection.c (sheet_selection_set_internal): Add comment for
show/hide detail enabling/disabling, something we can't do just yet.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/clipboard.c (clipboard_paste_region) : Add PASTE_IGNORE_COMMENTS.
......@@ -489,7 +527,7 @@ Mon May 7 14:07:45 2001 Morten Welinder <welinder@rentec.com>
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config):
Ditto.
2001-05-02 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c (cb_thaw_ui_toolbar): Callback timer
......
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-control-gui.c (wbcg_menu_state_update): New, combine
all the enabling/disabling of menu items here including the newly
added show/hide menu items.
(wbcg_menu_state_enable_insert): Remove.
(wbcg_menu_state_paste_special): Remove.
(workbook_control_gui_ctor_class): Init menu_state_update callback
and remove paste_special and enable_insert initializations.
(workbook_control_gui_init): Initialize show/hide menu items.
* src/workbook-control-gui-priv.h: Add show/hide detail menu items
and tidy structure lay-out.
* src/workbook-control-priv.h: Remove menu_state_enable_insert
and menu_state_paste_special callbacks and add menu_state_update
callback.
* src/workbook-control.[ch]: Add wb_menu_state_update and
remove wb_menu_state_paste_special and wb_menu_state_enable_insert.
(wb_control_sheet_add): call wb_menu_state_update, Remove
call to menu_state_paste_special.
* src/sheet-private.h: Add enable_showhide_detail.
* src/sheet.c (sheet_new): Initialize menu state booleans.
(sheet_menu_state_enable_insert): Use wb_control_menu_state_update.
* src/workbook-view.c (wb_view_menus_update): Idem and
remove call to wb_control_menu_state_paste_special.
* src/application.c (application_clipboard_clear): Idem.
(application_clipboard_copy): Idem.
(application_clipboard_cut): Idem.
* src/selection.c (sheet_selection_set_internal): Add comment for
show/hide detail enabling/disabling, something we can't do just yet.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/clipboard.c (clipboard_paste_region) : Add PASTE_IGNORE_COMMENTS.
......@@ -489,7 +527,7 @@ Mon May 7 14:07:45 2001 Morten Welinder <welinder@rentec.com>
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config):
Ditto.
2001-05-02 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c (cb_thaw_ui_toolbar): Callback timer
......
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-control-gui.c (wbcg_menu_state_update): New, combine
all the enabling/disabling of menu items here including the newly
added show/hide menu items.
(wbcg_menu_state_enable_insert): Remove.
(wbcg_menu_state_paste_special): Remove.
(workbook_control_gui_ctor_class): Init menu_state_update callback
and remove paste_special and enable_insert initializations.
(workbook_control_gui_init): Initialize show/hide menu items.
* src/workbook-control-gui-priv.h: Add show/hide detail menu items
and tidy structure lay-out.
* src/workbook-control-priv.h: Remove menu_state_enable_insert
and menu_state_paste_special callbacks and add menu_state_update
callback.
* src/workbook-control.[ch]: Add wb_menu_state_update and
remove wb_menu_state_paste_special and wb_menu_state_enable_insert.
(wb_control_sheet_add): call wb_menu_state_update, Remove
call to menu_state_paste_special.
* src/sheet-private.h: Add enable_showhide_detail.
* src/sheet.c (sheet_new): Initialize menu state booleans.
(sheet_menu_state_enable_insert): Use wb_control_menu_state_update.
* src/workbook-view.c (wb_view_menus_update): Idem and
remove call to wb_control_menu_state_paste_special.
* src/application.c (application_clipboard_clear): Idem.
(application_clipboard_copy): Idem.
(application_clipboard_cut): Idem.
* src/selection.c (sheet_selection_set_internal): Add comment for
show/hide detail enabling/disabling, something we can't do just yet.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/clipboard.c (clipboard_paste_region) : Add PASTE_IGNORE_COMMENTS.
......@@ -489,7 +527,7 @@ Mon May 7 14:07:45 2001 Morten Welinder <welinder@rentec.com>
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config):
Ditto.
2001-05-02 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c (cb_thaw_ui_toolbar): Callback timer
......
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-control-gui.c (wbcg_menu_state_update): New, combine
all the enabling/disabling of menu items here including the newly
added show/hide menu items.
(wbcg_menu_state_enable_insert): Remove.
(wbcg_menu_state_paste_special): Remove.
(workbook_control_gui_ctor_class): Init menu_state_update callback
and remove paste_special and enable_insert initializations.
(workbook_control_gui_init): Initialize show/hide menu items.
* src/workbook-control-gui-priv.h: Add show/hide detail menu items
and tidy structure lay-out.
* src/workbook-control-priv.h: Remove menu_state_enable_insert
and menu_state_paste_special callbacks and add menu_state_update
callback.
* src/workbook-control.[ch]: Add wb_menu_state_update and
remove wb_menu_state_paste_special and wb_menu_state_enable_insert.
(wb_control_sheet_add): call wb_menu_state_update, Remove
call to menu_state_paste_special.
* src/sheet-private.h: Add enable_showhide_detail.
* src/sheet.c (sheet_new): Initialize menu state booleans.
(sheet_menu_state_enable_insert): Use wb_control_menu_state_update.
* src/workbook-view.c (wb_view_menus_update): Idem and
remove call to wb_control_menu_state_paste_special.
* src/application.c (application_clipboard_clear): Idem.
(application_clipboard_copy): Idem.
(application_clipboard_cut): Idem.
* src/selection.c (sheet_selection_set_internal): Add comment for
show/hide detail enabling/disabling, something we can't do just yet.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/clipboard.c (clipboard_paste_region) : Add PASTE_IGNORE_COMMENTS.
......@@ -489,7 +527,7 @@ Mon May 7 14:07:45 2001 Morten Welinder <welinder@rentec.com>
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config):
Ditto.
2001-05-02 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c (cb_thaw_ui_toolbar): Callback timer
......
2001-05-08 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-control-gui.c (wbcg_menu_state_update): New, combine
all the enabling/disabling of menu items here including the newly
added show/hide menu items.
(wbcg_menu_state_enable_insert): Remove.
(wbcg_menu_state_paste_special): Remove.
(workbook_control_gui_ctor_class): Init menu_state_update callback
and remove paste_special and enable_insert initializations.
(workbook_control_gui_init): Initialize show/hide menu items.
* src/workbook-control-gui-priv.h: Add show/hide detail menu items
and tidy structure lay-out.
* src/workbook-control-priv.h: Remove menu_state_enable_insert
and menu_state_paste_special callbacks and add menu_state_update
callback.
* src/workbook-control.[ch]: Add wb_menu_state_update and
remove wb_menu_state_paste_special and wb_menu_state_enable_insert.
(wb_control_sheet_add): call wb_menu_state_update, Remove
call to menu_state_paste_special.
* src/sheet-private.h: Add enable_showhide_detail.
* src/sheet.c (sheet_new): Initialize menu state booleans.
(sheet_menu_state_enable_insert): Use wb_control_menu_state_update.
* src/workbook-view.c (wb_view_menus_update): Idem and
remove call to wb_control_menu_state_paste_special.
* src/application.c (application_clipboard_clear): Idem.
(application_clipboard_copy): Idem.
(application_clipboard_cut): Idem.
* src/selection.c (sheet_selection_set_internal): Add comment for
show/hide detail enabling/disabling, something we can't do just yet.
2001-05-08 Jody Goldberg <jgoldberg@home.com>
* src/clipboard.c (clipboard_paste_region) : Add PASTE_IGNORE_COMMENTS.
......@@ -489,7 +527,7 @@ Mon May 7 14:07:45 2001 Morten Welinder <welinder@rentec.com>
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config):
Ditto.
2001-05-02 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c (cb_thaw_ui_toolbar): Callback timer
......
......@@ -273,7 +273,7 @@ application_clipboard_clear (gboolean drop_selection)
sheet->priv->enable_paste_special = FALSE;
WORKBOOK_FOREACH_CONTROL (sheet->workbook, view, control,
wb_control_menu_state_paste_special (control, sheet););
wb_control_menu_state_update (control, sheet, MS_PASTE_SPECIAL););
app.clipboard_sheet = NULL;
......@@ -336,7 +336,7 @@ application_clipboard_copy (WorkbookControl *wbc,
sheet->priv->enable_paste_special = TRUE;
WORKBOOK_FOREACH_CONTROL (sheet->workbook, view, control,
wb_control_menu_state_paste_special (control, sheet););
wb_control_menu_state_update (control, sheet, MS_PASTE_SPECIAL););
/*
* The 'area' and the list itself will be copied
......@@ -374,7 +374,7 @@ application_clipboard_cut (WorkbookControl *wbc,
/* No paste special for copies */
sheet->priv->enable_paste_special = FALSE;
WORKBOOK_FOREACH_CONTROL (sheet->workbook, view, control,
wb_control_menu_state_paste_special (control, sheet););
wb_control_menu_state_update (control, sheet, MS_PASTE_SPECIAL););
/*
* The 'area' and the list itself will be copied
......
......@@ -425,6 +425,22 @@ set_menu_flags:
do_rows = FALSE;
}
sheet_menu_state_enable_insert (sheet, do_cols, do_rows);
/*
* FIXME: Enable/disable the show/hide detail menu items here.
* We can only do this when the data structures have improved, currently
* checking for this will be to slow.
* Once it works, use this code :
*
* sheet->priv->enable_showhide_detail = ....
*
* WORKBOOK_FOREACH_VIEW (sheet->workbook, view, {
* if (sheet == wb_view_cur_sheet (view)) {
* WORKBOOK_VIEW_FOREACH_CONTROL(view, wbc,
* wb_control_menu_state_update (wbc, sheet, MS_SHOWHIDE_DETAIL););
* }
* });
*/
}
void
......
......@@ -19,6 +19,7 @@ struct _SheetPrivate {
gboolean enable_insert_cols;
gboolean enable_insert_cells;
gboolean enable_paste_special;
gboolean enable_showhide_detail;
gboolean selection_content_changed;
gboolean reposition_selection;
......
......@@ -240,6 +240,13 @@ sheet_new (Workbook *wb, char const *name)
sheet->outline_symbols_below = TRUE;
sheet->outline_symbols_right = TRUE;
sheet->frozen_corner.col = sheet->frozen_corner.row = -1;
/* Init menu states */
sheet->priv->enable_insert_rows = TRUE;
sheet->priv->enable_insert_cols = TRUE;
sheet->priv->enable_insert_cells = TRUE;
sheet->priv->enable_paste_special = TRUE;
sheet->priv->enable_showhide_detail = TRUE;
sheet->names = NULL;
......@@ -3931,25 +3938,30 @@ sheet_adjust_preferences (Sheet const *sheet, gboolean redraw, gboolean resize)
void
sheet_menu_state_enable_insert (Sheet *sheet, gboolean col, gboolean row)
{
gboolean col_change, row_change, cell_change;
int flags = 0;
g_return_if_fail (IS_SHEET (sheet));
if ((col_change = (sheet->priv->enable_insert_cols != col)))
if (sheet->priv->enable_insert_cols != col) {
flags |= MS_INSERT_COLS;
sheet->priv->enable_insert_cols = col;
if ((row_change = (sheet->priv->enable_insert_rows != row)))
}
if (sheet->priv->enable_insert_rows != row) {
flags |= MS_INSERT_ROWS;
sheet->priv->enable_insert_rows = row;
if ((cell_change = (sheet->priv->enable_insert_cells != (col|row))))
}
if (sheet->priv->enable_insert_cells != (col|row)) {
flags |= MS_INSERT_CELLS;
sheet->priv->enable_insert_cells = (col|row);
}
if (!col_change && !row_change && !cell_change)
if (!flags)
return;
WORKBOOK_FOREACH_VIEW (sheet->workbook, view, {
if (sheet == wb_view_cur_sheet (view)) {
WORKBOOK_VIEW_FOREACH_CONTROL(view, wbc,
wb_control_menu_state_enable_insert (wbc, sheet,
col_change, row_change, cell_change););
wb_control_menu_state_update (wbc, sheet, flags););
}
});
}
......
......@@ -23,14 +23,21 @@ struct _WorkbookControlGUI {
/* The status bar */
GnomeAppBar *appbar;
/* Menu items that get toggled */
/* Menu items that get enabled/disabled */
GtkWidget *menu_item_undo;
GtkWidget *menu_item_redo;
GtkWidget *menu_item_paste_special;
GtkWidget *menu_item_insert_rows;
GtkWidget *menu_item_insert_cols;
GtkWidget *menu_item_insert_cells;
GtkWidget *menu_item_show_detail;
GtkWidget *menu_item_hide_detail;
GtkWidget *menu_item_sheet_remove;
GtkWidget *menu_item_sheets_edit_reorder;
GtkWidget *menu_item_sheets_format_reorder;
/* Menu items that get toggled */
GtkWidget *menu_item_sheet_display_formulas;
GtkWidget *menu_item_sheet_hide_zero;
GtkWidget *menu_item_sheet_hide_grid;
......@@ -41,10 +48,6 @@ struct _WorkbookControlGUI {
GtkWidget *menu_item_sheet_outline_symbols_below;
GtkWidget *menu_item_sheet_outline_symbols_right;
GtkWidget *menu_item_sheet_remove;
GtkWidget *menu_item_sheets_edit_reorder;
GtkWidget *menu_item_sheets_format_reorder;
/* Toolbars */
GtkWidget *standard_toolbar;
GtkWidget *format_toolbar;
......
......@@ -751,33 +751,51 @@ change_menu_sensitivity (WorkbookControlGUI const *wbcg,
#endif
static void
wbcg_menu_state_enable_insert (WorkbookControl *wbc, Sheet const *sheet,
gboolean col, gboolean row, gboolean cell)
wbcg_menu_state_update (WorkbookControl *wbc, Sheet const *sheet, int flags)
{
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)wbc;
gboolean all = MS_ALL & flags;
g_return_if_fail (wbcg != NULL);
#ifndef ENABLE_BONOBO
if (col)
if (all || MS_INSERT_COLS & flags)
change_menu_sensitivity (wbcg->menu_item_insert_cols,
sheet->priv->enable_insert_cols);
if (row)
if (all || MS_INSERT_ROWS & flags)
change_menu_sensitivity (wbcg->menu_item_insert_rows,
sheet->priv->enable_insert_rows);
if (cell)
if (all || MS_INSERT_CELLS & flags)
change_menu_sensitivity (wbcg->menu_item_insert_cells,
sheet->priv->enable_insert_cells);
if (all || MS_SHOWHIDE_DETAIL & flags) {
change_menu_sensitivity (wbcg->menu_item_show_detail,
sheet->priv->enable_showhide_detail);
change_menu_sensitivity (wbcg->menu_item_hide_detail,
sheet->priv->enable_showhide_detail);
}
if (all || MS_PASTE_SPECIAL & flags)
change_menu_sensitivity (wbcg->menu_item_paste_special,
sheet->priv->enable_paste_special);
#else
if (col)
if (all || MS_INSERT_COLS & flags)
change_menu_sensitivity (wbcg, "/commands/InsertColumns",
sheet->priv->enable_insert_cols);
if (row)
if (all || MS_INSERT_ROWS & flags)
change_menu_sensitivity (wbcg, "/commands/InsertRows",
sheet->priv->enable_insert_rows);
if (cell)
if (all || MS_INSERT_CELLS & flags)
change_menu_sensitivity (wbcg, "/commands/InsertCells",
sheet->priv->enable_insert_cells);
if (all || MS_SHOWHIDE_DETAIL & flags) {
change_menu_sensitivity (wbcg, "/commands/DataOutlineShowDetail",
sheet->priv->enable_showhide_detail);
change_menu_sensitivity (wbcg, "/commands/DataOutlineHideDetail",
sheet->priv->enable_showhide_detail);
}
if (all || MS_PASTE_SPECIAL & flags)
change_menu_sensitivity (wbcg, "/commands/EditPasteSpecial",
sheet->priv->enable_paste_special);
#endif
}
......@@ -845,18 +863,6 @@ wbcg_undo_redo_labels (WorkbookControl *wbc, char const *undo, char const *redo)
#endif
}
static void
wbcg_menu_state_paste_special (WorkbookControl *wbc, Sheet const *sheet)
{
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)wbc;
#ifndef ENABLE_BONOBO
change_menu_sensitivity (wbcg->menu_item_paste_special, sheet->priv->enable_paste_special);
#else
change_menu_sensitivity (wbcg, "/commands/EditPasteSpecial", sheet->priv->enable_paste_special);
#endif
}
static void
wbcg_menu_state_sheet_prefs (WorkbookControl *wbc, Sheet const *sheet)
{
......@@ -3370,6 +3376,11 @@ workbook_control_gui_init (WorkbookControlGUI *wbcg,
workbook_menu_format_sheet [5].widget;
wbcg->menu_item_sheet_hide_row_header =
workbook_menu_format_sheet [6].widget;
wbcg->menu_item_hide_detail =
workbook_menu_data_outline [0].widget;
wbcg->menu_item_show_detail =
workbook_menu_data_outline [1].widget;
wbcg->menu_item_sheet_display_outlines =
workbook_menu_data_outline [5].widget;
wbcg->menu_item_sheet_outline_symbols_below =
......@@ -3514,9 +3525,8 @@ workbook_control_gui_ctor_class (GtkObjectClass *object_class)
wbc_class->paste_from_selection = wbcg_paste_from_selection;
wbc_class->claim_selection = wbcg_claim_selection;
wbc_class->menu_state.paste_special = wbcg_menu_state_paste_special;
wbc_class->menu_state.sheet_prefs = wbcg_menu_state_sheet_prefs;
wbc_class->menu_state.enable_insert = wbcg_menu_state_enable_insert;
wbc_class->menu_state.update = wbcg_menu_state_update;
wbc_class->menu_state.sheet_prefs = wbcg_menu_state_sheet_prefs;
}
GNUMERIC_MAKE_TYPE(workbook_control_gui,
......
......@@ -44,10 +44,8 @@ typedef struct {
char const *undo, char const *redo);
} undo_redo;
struct {
void (*paste_special) (WorkbookControl *wbc, Sheet const *sheet);
void (*sheet_prefs) (WorkbookControl *wbc, Sheet const *sheet);
void (*enable_insert) (WorkbookControl *wbc, Sheet const *sheet,
gboolean col, gboolean row, gboolean cell);
void (*update) (WorkbookControl *wbc, Sheet const *sheet, int flags);
void (*sheet_prefs) (WorkbookControl *wbc, Sheet const *sheet);
} menu_state;
gboolean (*claim_selection) (WorkbookControl *wbc);
......
......@@ -98,14 +98,11 @@ WBC_VIRTUAL_FULL (undo_redo_labels, undo_redo.labels,
(WorkbookControl *wbc, char const *undo, char const *redo),
(wbc, undo, redo))
WBC_VIRTUAL_FULL (menu_state_paste_special, menu_state.paste_special,
(WorkbookControl *wbc, Sheet const *sheet), (wbc, sheet))
WBC_VIRTUAL_FULL (menu_state_sheet_prefs, menu_state.sheet_prefs,
(WorkbookControl *wbc, Sheet const *sheet), (wbc, sheet))
WBC_VIRTUAL_FULL (menu_state_enable_insert, menu_state.enable_insert,
(WorkbookControl *wbc, Sheet const *sheet,
gboolean col, gboolean row, gboolean cell),
(wbc, sheet, col, row, cell))
WBC_VIRTUAL_FULL (menu_state_update, menu_state.update,
(WorkbookControl *wbc, Sheet const *sheet, int flags),
(wbc, sheet, flags))
WBC_VIRTUAL (paste_from_selection,
(WorkbookControl *wbc, PasteTarget const *pt, guint32 time),
......@@ -131,9 +128,8 @@ wb_control_sheet_add (WorkbookControl *wbc, Sheet *new_sheet)
wb_view_edit_line_set (wbv, wbc);
wb_control_auto_expr_value (wbc);
wb_control_format_feedback (wbc);
wb_control_menu_state_paste_special (wbc, new_sheet);
wb_control_menu_state_sheet_prefs (wbc, new_sheet);
wb_control_menu_state_enable_insert (wbc, new_sheet, TRUE, TRUE, TRUE);
wb_control_menu_state_update (wbc, new_sheet, MS_ALL);
}
}
}
......
......@@ -43,10 +43,20 @@ void wb_control_undo_redo_push (WorkbookControl *wbc,
void wb_control_undo_redo_labels (WorkbookControl *wbc,
char const *undo, char const *redo);
void wb_control_menu_state_paste_special (WorkbookControl *wbc, Sheet const *s);
void wb_control_menu_state_sheet_prefs (WorkbookControl *wbc, Sheet const *s);
void wb_control_menu_state_enable_insert (WorkbookControl *wbc, Sheet const *s,
gboolean col, gboolean row, gboolean cell);
/* Menu state update flags, use them to specify which menu items to update */
enum {
MS_ALL = 1 << 0,
MS_INSERT_COLS = 1 << 1,
MS_INSERT_ROWS = 1 << 2,
MS_INSERT_CELLS = 1 << 3,
MS_SHOWHIDE_DETAIL = 1 << 4,
MS_PASTE_SPECIAL = 1 << 5
};
void wb_control_menu_state_update (WorkbookControl *wbc, Sheet const *s, int flags);
void wb_control_menu_state_sheet_prefs (WorkbookControl *wbc, Sheet const *s);
void wb_control_paste_from_selection (WorkbookControl *wbc,
PasteTarget const *pt, guint32 time);
......
......@@ -203,9 +203,7 @@ wb_view_menus_update (WorkbookView *wbv)
sheet = wbv->current_sheet;
if (sheet != NULL) {
WORKBOOK_VIEW_FOREACH_CONTROL (wbv, control, {
wb_control_menu_state_enable_insert (control, sheet,
TRUE, TRUE, TRUE);
wb_control_menu_state_paste_special (control, sheet);
wb_control_menu_state_update (control, sheet, MS_ALL);
wb_control_menu_state_sheet_prefs (control, sheet);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment