Commit cd9b6682 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg
Browse files

Do not change the target style if editing has not yet been enabled.


2000-04-09  Jody Goldberg <jgoldberg@home.com>

	* src/dialogs/dialog-cell-format.c : Do not change the target style if
	  editing has not yet been enabled.

	* src/workbook.c (workbook_set_saveinfo) : If the save function is
	  NULL default to xml.

	* src/format.c (format_value) : Add some error checking.

	* src/cell.c (calc_text_dimensions) : Make static

	* src/main.c : Add main.h

2000-04-03  Dom Lachowicz <dominicl@seas.upenn.edu>

 	* src/workbook.c (sheet_action_reorder_sheet): Right click on a
 	sheet tab, and if there's more than one sheet, you'll get an
 	option to bring up the re-order sheets dialog

 	* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) :  Do not
	  override default fonts and colours.

	* src/dialogs/sheet-order.glade,
	* src/dialogs/sheet-order.glade.h,
	* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
	  up_clicked_cb, down_clicked_cb, close_clicked_cb,
	  dialog_sheet_order_impl) : Improve look by moving buttons to the
	  right edge rather than using stock buttons on the bottom and side.

2000-04-07  Jody Goldberg <jgoldberg@home.com>

	* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
	  after editing.
	(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
	  start to edit.
parent 2742644c
......@@ -4,6 +4,7 @@ and longer term bugs.
Release Critical
----------------
spans are not recalculated when a value is entered in a previously empty cell.
Long term breakage
------------------
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
2000-04-09 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-cell-format.c : Do not change the target style if
editing has not yet been enabled.
* src/workbook.c (workbook_set_saveinfo) : If the save function is
NULL default to xml.
* src/format.c (format_value) : Add some error checking.
* src/cell.c (calc_text_dimensions) : Make static
* src/main.c : Add main.h
2000-04-03 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/workbook.c (sheet_action_reorder_sheet): Right click on a
sheet tab, and if there's more than one sheet, you'll get an
option to bring up the re-order sheets dialog
* src/dialogs/dialog-plugin-manager.c (refresh_right_frame) : Do not
override default fonts and colours.
* src/dialogs/sheet-order.glade,
* src/dialogs/sheet-order.glade.h,
* src/dialogs/dialog-sheet-order.c (row_cb, delete_clicked_cb,
up_clicked_cb, down_clicked_cb, close_clicked_cb,
dialog_sheet_order_impl) : Improve look by moving buttons to the
right edge rather than using stock buttons on the bottom and side.
2000-04-07 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_finish_editing) : resensitize the toolbars
after editing.
(workbook_start_editing_at_cursor) : Desensitize the toolbars when we
start to edit.
2000-04-09 Morten Welinder <terra@diku.dk>
* src/sheet-style.c (sheet_unique_cb): Plug leak.
......
......@@ -36,10 +36,7 @@ Description Difficulty Integration
eg when mousing over the colour combo toolbar
we should be told what colour is selected.
- gtk-combo-box : should handle standard keys Low Low
Enter = accept.
- gtk-combo-text : list should auto scroll when the Low Low
- gtk-combo-text : list should auto scroll when the Medium Low
mouse moves outside. A prettier mouse over for the
text entry would be nice.
......
......@@ -534,8 +534,13 @@ cell_set_text_simple (Cell *cell, const char *text)
*/
cell->entered_text = NULL;
}
cell_render_value (cell);
/* FIXME : This calls calc_dimension much too early in the
* import process. There is no point calculating spans or
* dimensions before the cells neighbours or format has been
* applied.
*/
cell_render_value (cell);
}
}
......@@ -1258,7 +1263,7 @@ cell_calculate_span (Cell const * const cell,
* The line splitting code is VERY similar to cell-draw.c:cell_split_text
* please keep it that way.
*/
void
static void
calc_text_dimensions (Cell *cell,
MStyle const * const mstyle,
char const * const text)
......
......@@ -740,10 +740,12 @@ cb_format_entry (GtkEditable *w, FormatState *state)
if (!g_strcasecmp (state->format.spec, tmp))
return;
g_free ((char *)state->format.spec);
state->format.spec = g_strdup (tmp);
mstyle_set_format (state->result, state->format.spec);
fmt_dialog_changed (state);
if (state->enable_edit) {
g_free ((char *)state->format.spec);
state->format.spec = g_strdup (tmp);
mstyle_set_format (state->result, state->format.spec);
fmt_dialog_changed (state);
}
draw_format_preview (state);
}
......@@ -993,11 +995,13 @@ cb_align_h_toggle (GtkToggleButton *button, FormatState *state)
if (!gtk_toggle_button_get_active (button))
return;
mstyle_set_align_h (
state->result,
GPOINTER_TO_INT (gtk_object_get_data (
GTK_OBJECT (button), "align")));
fmt_dialog_changed (state);
if (state->enable_edit) {
mstyle_set_align_h (
state->result,
GPOINTER_TO_INT (gtk_object_get_data (
GTK_OBJECT (button), "align")));
fmt_dialog_changed (state);
}
}
static void
......@@ -1006,19 +1010,23 @@ cb_align_v_toggle (GtkToggleButton *button, FormatState *state)
if (!gtk_toggle_button_get_active (button))
return;
mstyle_set_align_v (
state->result,
GPOINTER_TO_INT (gtk_object_get_data (
GTK_OBJECT (button), "align")));
fmt_dialog_changed (state);
if (state->enable_edit) {
mstyle_set_align_v (
state->result,
GPOINTER_TO_INT (gtk_object_get_data (
GTK_OBJECT (button), "align")));
fmt_dialog_changed (state);
}
}
static void
cb_align_wrap_toggle (GtkToggleButton *button, FormatState *state)
{
mstyle_set_fit_in_cell (state->result,
gtk_toggle_button_get_active (button));
fmt_dialog_changed (state);
if (state->enable_edit) {
mstyle_set_fit_in_cell (state->result,
gtk_toggle_button_get_active (button));
fmt_dialog_changed (state);
}
}
static void
......@@ -1118,6 +1126,10 @@ cb_font_preview_color (GtkObject *obj, guint r, guint g, guint b, guint a,
{
GtkStyle *style;
GdkColor col;
if (!state->enable_edit)
return;
state->font.color.r = col.red = r;
state->font.color.g = col.green = g;
state->font.color.b = col.blue = b;
......@@ -1168,9 +1180,11 @@ cb_font_changed (GtkWidget *widget, GtkStyle *previous_style, FormatState *state
static void
cb_font_strike_toggle (GtkToggleButton *button, FormatState *state)
{
mstyle_set_font_strike (state->result,
gtk_toggle_button_get_active (button));
fmt_dialog_changed (state);
if (state->enable_edit) {
mstyle_set_font_strike (state->result,
gtk_toggle_button_get_active (button));
fmt_dialog_changed (state);
}
}
static void
......@@ -1179,6 +1193,9 @@ cb_font_underline_changed (GtkEditable *w, FormatState *state)
gchar const *tmp = gtk_entry_get_text (GTK_ENTRY (w));
StyleUnderlineType res = UNDERLINE_NONE;
if (!state->enable_edit)
return;
/* There must be a better way than this */
if (!g_strcasecmp (tmp, _("Single")))
res = UNDERLINE_SINGLE;
......
......@@ -22,12 +22,6 @@
#include "plugin.h"
#include "workbook.h"
#include "color.h"
#define DESCR_FORE_COLOR &gs_black
#define DESCR_BACK_COLOR &gs_white
#define DESCR_FONT_FACE "-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-1"
#define GLADE_FILE "plugin-manager.glade"
typedef struct
......@@ -94,8 +88,7 @@ static void
refresh_right_frame (PluginData *pd, PluginManager *pm)
{
gchar *str;
GdkFont *font = gdk_font_load (DESCR_FONT_FACE);
if (!pd)
str = g_strdup (_("File name:"));
else
......@@ -125,12 +118,11 @@ refresh_right_frame (PluginData *pd, PluginManager *pm)
gtk_text_backward_delete (GTK_TEXT (pm->desc_text), gtk_text_get_length (GTK_TEXT (pm->desc_text)));
if (pd && plugin_data_get_descr (pd))
gtk_text_insert (GTK_TEXT (pm->desc_text), font, DESCR_FORE_COLOR,
DESCR_BACK_COLOR, plugin_data_get_descr (pd), -1);
gtk_text_insert (GTK_TEXT (pm->desc_text), NULL, NULL, NULL,
plugin_data_get_descr (pd), -1);
gtk_text_thaw (GTK_TEXT (pm->desc_text));
gtk_text_set_editable (GTK_TEXT (pm->desc_text), FALSE);
gdk_font_unref (font);
}
/*
......
......@@ -25,11 +25,13 @@ typedef struct {
Workbook *wb;
GtkWidget *dialog;
GtkWidget *clist;
GtkWidget *up_btn;
GtkWidget *down_btn;
GtkWidget *delete_btn;
GtkWidget *close_btn;
gint current_row;
} SheetManager;
enum { BUTTON_UP = 0, BUTTON_DOWN, BUTTON_DELETE, BUTTON_CLOSE };
/*
* Add one sheet's name to the clist
*/
......@@ -96,38 +98,31 @@ row_cb (GtkWidget *w, gint row, gint col,
sm->current_row = row;
can_go = (row != 0); /* top row test */
gnome_dialog_set_sensitive (GNOME_DIALOG (sm->dialog),
BUTTON_UP, can_go);
gtk_widget_set_sensitive (sm->up_btn, can_go);
can_go = !(row >= (numrows - 1)); /* bottom row test */
gnome_dialog_set_sensitive (GNOME_DIALOG (sm->dialog),
BUTTON_DOWN, can_go);
gtk_widget_set_sensitive (sm->down_btn, can_go);
/* don't delete the last remaining sheet */
can_go = (numrows > 1);
gnome_dialog_set_sensitive (GNOME_DIALOG (sm->dialog),
BUTTON_DELETE, can_go);
gtk_widget_set_sensitive (sm->delete_btn, can_go);
/* Display/focus on the selected sheet underneath us */
gtk_notebook_set_page (GTK_NOTEBOOK (sm->wb->notebook), row);
} else {
sm->current_row = -1;
gnome_dialog_set_sensitive (GNOME_DIALOG (sm->dialog),
BUTTON_UP, FALSE);
gnome_dialog_set_sensitive (GNOME_DIALOG (sm->dialog),
BUTTON_DOWN, FALSE);
gnome_dialog_set_sensitive (GNOME_DIALOG (sm->dialog),
BUTTON_DELETE, FALSE);
gtk_widget_set_sensitive (sm->up_btn, FALSE);
gtk_widget_set_sensitive (sm->down_btn, FALSE);
gtk_widget_set_sensitive (sm->delete_btn, FALSE);
}
}
/*
* User wanted to delete this sheet from the workbook
*/
static void
delete_cb (SheetManager *sm)
delete_clicked_cb (GtkWidget *button, SheetManager *sm)
{
GtkCList *clist = GTK_CLIST (sm->clist);
GList *selection = GTK_CLIST (clist)->selection;
......@@ -193,7 +188,7 @@ move_cb (SheetManager *sm, gint direction)
* User wants to move the sheet up
*/
static void
up_cb (SheetManager *sm)
up_clicked_cb (GtkWidget *button, SheetManager *sm)
{
move_cb (sm, -1); /* c-array style : move -1 == left == up */
}
......@@ -202,11 +197,17 @@ up_cb (SheetManager *sm)
* User wants to move the sheet down
*/
static void
down_cb (SheetManager *sm)
down_clicked_cb (GtkWidget *button, SheetManager *sm)
{
move_cb (sm, 1); /* c-array style : move 1 == right == down */
}
static void
close_clicked_cb (GtkWidget *button, SheetManager *sm)
{
gnome_dialog_close (GNOME_DIALOG (sm->dialog));
}
/*
* Actual implementation of the sheet order dialog
*/
......@@ -217,10 +218,17 @@ dialog_sheet_order_impl (Workbook *wb, GladeXML *gui)
int bval;
sm.wb = wb;
sm.dialog = glade_xml_get_widget (gui, "dialog");
sm.clist = glade_xml_get_widget (gui, "sheet_name_clist");
sm.dialog = glade_xml_get_widget (gui, "dialog");
sm.clist = glade_xml_get_widget (gui, "sheet_clist");
sm.up_btn = glade_xml_get_widget (gui, "up_btn");
sm.down_btn = glade_xml_get_widget (gui, "down_btn");
sm.delete_btn = glade_xml_get_widget (gui, "delete_btn");
sm.close_btn = glade_xml_get_widget (gui, "close_btn");
sm.current_row = -1;
gtk_clist_column_titles_passive (GTK_CLIST (sm.clist));
gtk_signal_connect (GTK_OBJECT (sm.dialog), "key_press_event",
GTK_SIGNAL_FUNC (key_event_cb), NULL);
......@@ -230,52 +238,41 @@ dialog_sheet_order_impl (Workbook *wb, GladeXML *gui)
gtk_signal_connect (GTK_OBJECT (sm.clist), "unselect_row",
GTK_SIGNAL_FUNC (row_cb), &sm);
gtk_signal_connect (GTK_OBJECT (sm.up_btn), "clicked",
GTK_SIGNAL_FUNC (up_clicked_cb), &sm);
gtk_signal_connect (GTK_OBJECT (sm.down_btn), "clicked",
GTK_SIGNAL_FUNC (down_clicked_cb), &sm);
gtk_signal_connect (GTK_OBJECT (sm.delete_btn), "clicked",
GTK_SIGNAL_FUNC (delete_clicked_cb), &sm);
gtk_signal_connect (GTK_OBJECT (sm.close_btn), "clicked",
GTK_SIGNAL_FUNC (close_clicked_cb), &sm);
populate_sheet_clist (&sm);
if (GTK_CLIST (sm.clist)->rows > 0) {
gtk_widget_grab_focus (sm.clist);
} else {
gnome_dialog_set_sensitive (GNOME_DIALOG (sm.dialog),
BUTTON_UP, FALSE);
gnome_dialog_set_sensitive (GNOME_DIALOG (sm.dialog),
BUTTON_DOWN, FALSE);
gnome_dialog_set_sensitive (GNOME_DIALOG (sm.dialog),
BUTTON_DELETE, FALSE);
gtk_widget_set_sensitive (sm.up_btn, FALSE);
gtk_widget_set_sensitive (sm.down_btn, FALSE);
gtk_widget_set_sensitive (sm.delete_btn, FALSE);
}
gtk_clist_column_titles_passive (GTK_CLIST (sm.clist));
#if 0
gnome_dialog_set_default (GNOME_DIALOG (sm.dialog), BUTTON_CLOSE);
#endif
gtk_window_set_policy (GTK_WINDOW (sm.dialog), FALSE, TRUE, FALSE);
gtk_widget_show_all (GNOME_DIALOG (sm.dialog)->vbox);
do {
bval = gnumeric_dialog_run (sm.wb, GNOME_DIALOG (sm.dialog));
switch (bval) {
case BUTTON_UP:
up_cb (&sm);
break;
case BUTTON_DOWN:
down_cb (&sm);
break;