Commit 897c7caf authored by Jody Goldberg's avatar Jody Goldberg

Make accelerators possible in gnumeric_toolbars.


Make accelerators possible in gnumeric_toolbars.

Enable the workbook close optimization that clears the formula list before
removing the cells.

Add some (currently broken) accelerators for font attributes.
parent 255ee961
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
2000-05-10 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c (workbook_format_toolbar) : Add
accelerators for Bold, Underline, and Italic.
(workbook_create_format_toolbar) : Pass accel_group.
* src/workbook.c (workbook_create_standard_toobar) : Pass the
acceleration group to the toolbar.
2000-05-10 Jon K Hellan <hellan@acm.org>
* src/dialogs/dialog-analysis-tools.c (dialog_data_analysis):
......
......@@ -28,8 +28,8 @@ sort_clause_destroy (SortClause *clause)
/* The routines to do the sorting */
static int
sort_compare_values (const SortData * ain,
const SortData * bin,
int clause)
const SortData * bin,
int clause)
{
Cell *ca, *cb;
Value *a, *b;
......@@ -170,7 +170,7 @@ sort_range (Sheet *sheet, Range *range,
start_col = range->start.col;
end_row = range->end.row;
end_col = range->end.col;
if (columns) {
length = end_row - start_row + 1;
divisions = end_col - start_col + 1;
......@@ -181,7 +181,7 @@ sort_range (Sheet *sheet, Range *range,
for (lp = 0; lp < length; lp++) {
data [lp].cells = g_new (Cell *, divisions);
for (lp2 = 0; lp2 < divisions; lp2++) {
Cell *cell;
if (columns)
......@@ -235,10 +235,3 @@ sort_contents (Sheet *sheet, Range *range,
{
sort_range (sheet, range, data, columns, sort_qsort_func);
}
2000-05-07 Jody Goldberg <jgoldberg@home.com>
* gnumeric-toolbar.c (gnumeric_toolbar_new) : Take an accel_group.
(gnumeric_toolbar_construct) : Ditto.
2000-05-10 Jon K Hellan <hellan@acm.org>
* widget-font-selector.c (list_realized): Rename to
......
......@@ -49,10 +49,11 @@ gnumeric_toolbar_get_type (void)
return type;
}
void
static void
gnumeric_toolbar_construct (GnumericToolbar *toolbar,
GnomeUIInfo *info,
void *data)
GtkAccelGroup *accel_group,
gpointer data)
{
GtkToolbar *gtk_toolbar = GTK_TOOLBAR (toolbar);
......@@ -66,21 +67,23 @@ gnumeric_toolbar_construct (GnumericToolbar *toolbar,
/*
* Fixme: load the show_state from configuration
*/
gnome_app_fill_toolbar_with_data (
gtk_toolbar, info, NULL, data);
gnome_app_fill_toolbar_with_data (gtk_toolbar, info,
accel_group, data);
gtk_toolbar_set_style (gtk_toolbar, GTK_TOOLBAR_ICONS);
}
GtkWidget *
gnumeric_toolbar_new (GnomeUIInfo *info, void *data)
gnumeric_toolbar_new (GnomeUIInfo *info,
GtkAccelGroup *accel_group,
void *data)
{
GnumericToolbar *toolbar;
g_return_val_if_fail (info != NULL, NULL);
toolbar = gtk_type_new (gnumeric_toolbar_get_type ());
gnumeric_toolbar_construct (toolbar, info, data);
gnumeric_toolbar_construct (toolbar, info, accel_group, data);
return GTK_WIDGET (toolbar);
}
......@@ -116,6 +119,3 @@ gnumeric_toolbar_get_widget (GnumericToolbar *toolbar, int pos)
return NULL;
}
......@@ -18,10 +18,8 @@ typedef struct {
GtkType gnumeric_toolbar_get_type (void);
GtkWidget *gnumeric_toolbar_new (GnomeUIInfo *info,
GtkAccelGroup *accel_group,
void *data);
void gnumeric_toolbar_construct (GnumericToolbar *toolbar,
GnomeUIInfo *info,
void *data);
GtkWidget *gnumeric_toolbar_get_widget (GnumericToolbar *toolbar,
int pos);
......
......@@ -297,14 +297,29 @@ static GnomeUIInfo workbook_format_toolbar [] = {
/* Placeholder: font selector */
/* Placeholder: size selector */
{ GNOME_APP_UI_TOGGLEITEM, N_("Bold"), N_("Sets the bold font"),
bold_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TEXT_BOLD },
{ GNOME_APP_UI_TOGGLEITEM, N_("Italic"), N_("Makes the font italic"),
italic_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TEXT_ITALIC },
{ GNOME_APP_UI_TOGGLEITEM, N_("Underline"), N_("Underlines the font"),
underline_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TEXT_UNDERLINE },
{ GNOME_APP_UI_TOGGLEITEM,
N_("Bold"),
N_("Sets the bold font"),
&bold_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TEXT_BOLD,
'b', GDK_CONTROL_MASK
},
{ GNOME_APP_UI_TOGGLEITEM,
N_("Italic"),
N_("Makes the font italic"),
&italic_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TEXT_ITALIC,
'i', GDK_CONTROL_MASK
},
{ GNOME_APP_UI_TOGGLEITEM,
N_("Underline"),
N_("Underlines the font"),
&underline_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_TEXT_UNDERLINE,
'u', GDK_CONTROL_MASK
},
GNOMEUIINFO_SEPARATOR,
......@@ -531,16 +546,19 @@ workbook_create_format_toolbar (Workbook *wb)
GnomeDockItemBehavior behavior;
GList *l;
int i, len;
toolbar = gnumeric_toolbar_new (
workbook_format_toolbar, wb);
GnomeApp *app = GNOME_APP (wb->toplevel);
g_return_val_if_fail (app != NULL, NULL);
toolbar = gnumeric_toolbar_new (workbook_format_toolbar,
app->accel_group, wb);
behavior = GNOME_DOCK_ITEM_BEH_NORMAL;
if(!gnome_preferences_get_menubar_detachable())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
gnome_app_add_toolbar (
GNOME_APP (wb->toplevel),
app,
GTK_TOOLBAR (toolbar),
name,
behavior,
......
......@@ -311,6 +311,17 @@ workbook_do_destroy (Workbook *wb)
workbook_deps_destroy (wb);
/*
* All formulas are going to be removed. Unqueue them before removing
* the cells so that we need not search the lists.
*/
g_list_free (wb->formula_cell_list);
wb->formula_cell_list = NULL;
/* Just drop the eval queue. */
g_list_free (wb->eval_queue);
wb->eval_queue = NULL;
/* Erase all cells. */
g_hash_table_foreach (wb->sheets, &cb_sheet_destroy_contents, NULL);
......@@ -321,17 +332,6 @@ workbook_do_destroy (Workbook *wb)
wb->auto_expr = NULL;
}
/* Problems with insert/delete column/row caused formula_cell_list
to be messed up. */
if (wb->formula_cell_list) {
fprintf (stderr, "Reminder: FIXME in workbook_do_destroy\n");
g_list_free (wb->formula_cell_list);
wb->formula_cell_list = NULL;
}
/* Just drop the eval queue. */
g_list_free (wb->eval_queue);
wb->eval_queue = NULL;
gtk_window_set_focus (GTK_WINDOW (wb->toplevel), NULL);
/* Detach and destroy all sheets. */
......@@ -1015,6 +1015,7 @@ sort_cmd (Workbook *wb, int asc)
clause[i].offset = i;
clause[i].asc = asc;
clause[i].cs = FALSE;
/* FIXME : Why sort as strings ? */
clause[i].val = FALSE;
}
......@@ -2424,13 +2425,15 @@ workbook_create_standard_toobar (Workbook *wb)
"25%",
NULL
};
const char *name = "StandardToolbar";
int i, len;
GtkWidget *toolbar, *zoom, *entry;
GnomeApp *app = GNOME_APP (wb->toplevel);
const char *name = "StandardToolbar";
g_return_val_if_fail (app != NULL, NULL);
toolbar = gnumeric_toolbar_new (workbook_standard_toolbar, wb);
toolbar = gnumeric_toolbar_new (workbook_standard_toolbar,
app->accel_group, wb);
behavior = GNOME_DOCK_ITEM_BEH_NORMAL;
if(!gnome_preferences_get_menubar_detachable())
......
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