Commit 0ef3dbc4 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

New file, new routines to deal with file save and file load dialog boxes.

1998-09-02  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/file.c (workbook_save_as, workbook_save,
	dialog_query_load_file): New file, new routines to deal with file
	save and file load dialog boxes.

	* src/workbook.c: Improved our toolbar with new actions.

	* src/xml-io.c: Fixed the order in which parameters were passed to
	sheet_cell_get/sheet_cell_new
parent 0d4172b7
1998-09-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (workbook_save_as, workbook_save,
dialog_query_load_file): New file, new routines to deal with file
save and file load dialog boxes.
* src/workbook.c: Improved our toolbar with new actions.
* src/xml-io.c: Fixed the order in which parameters were passed to
sheet_cell_get/sheet_cell_new
* src/sheet.c (sheet_clear_region): Redraw the deleted region.
(sheet_clear_region_content): Same.
(sheet_cell_remove): same.
......
1998-09-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (workbook_save_as, workbook_save,
dialog_query_load_file): New file, new routines to deal with file
save and file load dialog boxes.
* src/workbook.c: Improved our toolbar with new actions.
* src/xml-io.c: Fixed the order in which parameters were passed to
sheet_cell_get/sheet_cell_new
* src/sheet.c (sheet_clear_region): Redraw the deleted region.
(sheet_clear_region_content): Same.
(sheet_cell_remove): same.
......
1998-09-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (workbook_save_as, workbook_save,
dialog_query_load_file): New file, new routines to deal with file
save and file load dialog boxes.
* src/workbook.c: Improved our toolbar with new actions.
* src/xml-io.c: Fixed the order in which parameters were passed to
sheet_cell_get/sheet_cell_new
* src/sheet.c (sheet_clear_region): Redraw the deleted region.
(sheet_clear_region_content): Same.
(sheet_cell_remove): same.
......
1998-09-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (workbook_save_as, workbook_save,
dialog_query_load_file): New file, new routines to deal with file
save and file load dialog boxes.
* src/workbook.c: Improved our toolbar with new actions.
* src/xml-io.c: Fixed the order in which parameters were passed to
sheet_cell_get/sheet_cell_new
* src/sheet.c (sheet_clear_region): Redraw the deleted region.
(sheet_clear_region_content): Same.
(sheet_cell_remove): same.
......
......@@ -17,9 +17,6 @@ GNUMERIC_BASE_SOURCES = \
sheet.h \
sheet-view.c \
sheet-view.h \
\
\
\
cell.h \
cell.c \
clipboard.c \
......@@ -34,6 +31,8 @@ GNUMERIC_BASE_SOURCES = \
eval.c \
expr.c \
expr.h \
file.c \
file.h \
func.c \
func.h \
fn-sheet.c \
......
......@@ -660,6 +660,7 @@ static void
cell_properties_close (void)
{
gtk_main_quit ();
gtk_widget_destroy (cell_format_prop_win);
cell_format_prop_win = 0;
}
......
#ifndef DIALOGS_H
#define DIALOGS_H
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Sheet *sheet);
int dialog_paste_special (void);
void dialog_insert_cells (Sheet *sheet);
void dialog_delete_cells (Sheet *sheet);
void dialog_zoom (Sheet *sheet);
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Sheet *sheet);
int dialog_paste_special (void);
void dialog_insert_cells (Sheet *sheet);
void dialog_delete_cells (Sheet *sheet);
void dialog_zoom (Sheet *sheet);
char *dialog_query_load_file (void);
#endif
......@@ -660,6 +660,7 @@ static void
cell_properties_close (void)
{
gtk_main_quit ();
gtk_widget_destroy (cell_format_prop_win);
cell_format_prop_win = 0;
}
......
#ifndef DIALOGS_H
#define DIALOGS_H
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Sheet *sheet);
int dialog_paste_special (void);
void dialog_insert_cells (Sheet *sheet);
void dialog_delete_cells (Sheet *sheet);
void dialog_zoom (Sheet *sheet);
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Sheet *sheet);
int dialog_paste_special (void);
void dialog_insert_cells (Sheet *sheet);
void dialog_delete_cells (Sheet *sheet);
void dialog_zoom (Sheet *sheet);
char *dialog_query_load_file (void);
#endif
......@@ -19,6 +19,8 @@ typedef struct {
} StyleRegion;
typedef struct {
char *filename;
GtkWidget *toplevel;
GtkWidget *notebook;
GtkWidget *table;
......@@ -267,6 +269,9 @@ void sheet_selection_row_extend_to (Sheet *sheet, int row);
*/
Workbook *workbook_new (void);
Workbook *workbook_new_with_sheets (int sheet_count);
void workbook_save_as (Workbook *);
void workbook_save (Workbook *);
void workbook_attach_sheet (Workbook *, Sheet *);
Sheet *workbook_focus_current_sheet (Workbook *wb);
Sheet *workbook_get_current_sheet (Workbook *wb);
......
......@@ -5,7 +5,6 @@
#include "gnumeric-util.h"
#include "gnumeric-sheet.h"
#include "dialogs.h"
#include "xml-io.h"
#include "pixmaps.h"
......@@ -19,19 +18,37 @@
Workbook *current_workbook;
static void
workbook_new_cmd (void)
new_cmd (void)
{
workbook_new_with_sheets (1);
Workbook *wb;
wb = workbook_new_with_sheets (1);
gtk_widget_show (wb->toplevel);
}
static void
open_cmd (void)
{
char *fname = dialog_query_load_file ();
Workbook *wb;
if (!fname)
return;
wb = gnumericReadXmlWorkbook (fname);
if (wb)
gtk_widget_show (wb->toplevel);
}
static void
workbook_open_cmd (void)
save_cmd (GtkWidget *widget, Workbook *wb)
{
workbook_save (wb);
}
static void
workbook_save_cmd (void)
save_as_cmd (GtkWidget *widget, Workbook *wb)
{
workbook_save_as (wb);
}
static void
......@@ -75,12 +92,6 @@ quit_cmd (void)
gtk_main_quit ();
}
static void
save_cmd (GtkWidget *widget, Workbook *wb)
{
gnumericWriteXmlWorkbook (wb, "default.wb");
}
static void
paste_cmd (GtkWidget *widget, Workbook *wb)
{
......@@ -213,8 +224,14 @@ format_cells_cmd (GtkWidget *widget, Workbook *wb)
}
static GnomeUIInfo workbook_menu_file [] = {
{ GNOME_APP_UI_ITEM, N_("New"), NULL, new_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW },
{ GNOME_APP_UI_ITEM, N_("Open"), NULL, open_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN },
{ GNOME_APP_UI_ITEM, N_("Save"), NULL, save_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE },
{ GNOME_APP_UI_ITEM, N_("Save as..."), NULL, save_as_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE },
{ GNOME_APP_UI_ITEM, N_("Exit"), NULL, quit_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT },
GNOMEUIINFO_END
......@@ -276,13 +293,13 @@ static GnomeUIInfo workbook_menu [] = {
static GnomeUIInfo workbook_toolbar [] = {
GNOMEUIINFO_ITEM_STOCK (N_("New"),
N_("Create a new sheet"),
workbook_new_cmd, GNOME_STOCK_PIXMAP_NEW),
new_cmd, GNOME_STOCK_PIXMAP_NEW),
GNOMEUIINFO_ITEM_STOCK (N_("Open"),
N_("Opens an existing workbook"),
workbook_open_cmd, GNOME_STOCK_PIXMAP_OPEN),
open_cmd, GNOME_STOCK_PIXMAP_OPEN),
GNOMEUIINFO_ITEM_STOCK (N_("Save"),
N_("Saves the workbook"),
workbook_save_cmd, GNOME_STOCK_PIXMAP_SAVE),
save_cmd, GNOME_STOCK_PIXMAP_SAVE),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_STOCK (N_("Cut"),
N_("Cuts the selection to the clipboard"),
......
......@@ -882,9 +882,9 @@ static Cell *readXmlCell(parseXmlContextPtr ctxt, xmlNodePtr tree) {
xmlGetIntValue(tree, "Col", &col);
xmlGetIntValue(tree, "Row", &row);
ret = sheet_cell_get(ctxt->sheet, row, col);
ret = sheet_cell_get(ctxt->sheet, col, row);
if (ret == NULL)
ret = sheet_cell_new(ctxt->sheet, row, col);
ret = sheet_cell_new(ctxt->sheet, col, row);
if (ret == NULL) return(NULL);
if (tree->content != NULL)
......
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