Commit ff0d5928 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Fix numbering after separator. (workbook_control_gui_init): Remove

2003-07-07  Morten Welinder  <terra@gnome.org>

	* src/workbook-control-gui.c (workbook_control_gui_init): Fix
	numbering after separator.
	(workbook_control_gui_init): Remove assignments to members
	menu_item_sheets_edit_reorder and menu_item_sheets_format_reorder.
	(Wrong, but unused anyway.)

	* src/workbook-view.c (wb_view_sendto): Fix encoding confusion.
	(wb_view_sendto): Fix uninitialized use of "problem".
parent 2df16798
2003-07-07 Morten Welinder <terra@gnome.org>
* src/workbook-control-gui.c (workbook_control_gui_init): Fix
numbering after separator.
(workbook_control_gui_init): Remove assignments to members
menu_item_sheets_edit_reorder and menu_item_sheets_format_reorder.
(Wrong, but unused anyway.)
* src/workbook-view.c (wb_view_sendto): Fix encoding confusion.
(wb_view_sendto): Fix uninitialized use of "problem".
2003-07-06 Jody Goldberg <jody@gnome.org>
For John Gill <jng@renre.com>
......
2003-07-07 Morten Welinder <terra@gnome.org>
* src/workbook-control-gui.c (workbook_control_gui_init): Fix
numbering after separator.
(workbook_control_gui_init): Remove assignments to members
menu_item_sheets_edit_reorder and menu_item_sheets_format_reorder.
(Wrong, but unused anyway.)
* src/workbook-view.c (wb_view_sendto): Fix encoding confusion.
(wb_view_sendto): Fix uninitialized use of "problem".
2003-07-06 Jody Goldberg <jody@gnome.org>
For John Gill <jng@renre.com>
......
2003-07-07 Morten Welinder <terra@gnome.org>
* src/workbook-control-gui.c (workbook_control_gui_init): Fix
numbering after separator.
(workbook_control_gui_init): Remove assignments to members
menu_item_sheets_edit_reorder and menu_item_sheets_format_reorder.
(Wrong, but unused anyway.)
* src/workbook-view.c (wb_view_sendto): Fix encoding confusion.
(wb_view_sendto): Fix uninitialized use of "problem".
2003-07-06 Jody Goldberg <jody@gnome.org>
For John Gill <jng@renre.com>
......
......@@ -341,7 +341,7 @@ dnl
AC_CHECK_HEADERS(ieeefp.h ieee754.h)
dnl Check for some functions
AC_CHECK_FUNCS(random drand48 finite memmove)
AC_CHECK_FUNCS(random drand48 finite memmove mkdtemp)
dnl FIXME: Does this really belong here?
AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
......
......@@ -5211,15 +5211,15 @@ workbook_control_gui_init (WorkbookControlGUI *wbcg,
workbook_menu_view [2].widget;
wbcg->menu_item_sheet_display_formulas =
workbook_menu_format_sheet [2].widget;
wbcg->menu_item_sheet_hide_zero =
workbook_menu_format_sheet [3].widget;
wbcg->menu_item_sheet_hide_grid =
wbcg->menu_item_sheet_hide_zero =
workbook_menu_format_sheet [4].widget;
wbcg->menu_item_sheet_hide_col_header =
wbcg->menu_item_sheet_hide_grid =
workbook_menu_format_sheet [5].widget;
wbcg->menu_item_sheet_hide_row_header =
wbcg->menu_item_sheet_hide_col_header =
workbook_menu_format_sheet [6].widget;
wbcg->menu_item_sheet_hide_row_header =
workbook_menu_format_sheet [7].widget;
wbcg->menu_item_hide_detail =
workbook_menu_data_outline [0].widget;
......@@ -5239,10 +5239,6 @@ workbook_control_gui_init (WorkbookControlGUI *wbcg,
wbcg->menu_item_sheet_remove =
workbook_menu_edit_sheet [3].widget;
wbcg->menu_item_sheets_edit_reorder =
workbook_menu_edit_sheet [4].widget;
wbcg->menu_item_sheets_format_reorder =
workbook_menu_format_sheet [1].widget;
#else
bonobo_window_set_contents (BONOBO_WINDOW (wbcg->toplevel), wbcg->table);
......
......@@ -57,6 +57,9 @@
#include <locale.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include "mathfunc.h"
/* WorkbookView signals */
enum {
......@@ -711,16 +714,49 @@ wb_view_sendto (WorkbookView *wbv, CommandContext *context)
io_context = gnumeric_io_context_new (context);
if (fs != NULL) {
char *argv[3];
char *template = g_build_path (G_DIR_SEPARATOR_S,
g_get_tmp_dir (), "gnm-sendto.XXXXXX", NULL);
char *file_utf8 = g_path_get_basename (workbook_get_filename (wb));
const char *dirname = "gnm-sendto";
char *template;
char *basename = g_path_get_basename (workbook_get_filename (wb));
char *full_name;
#ifdef HAVE_MKDTEMP
template = g_build_path (G_DIR_SEPARATOR_S,
g_get_tmp_dir (),
dirname,
".XXXXXX", NULL);
mkdtemp (template);
#else
while (1) {
char tail[sizeof (pid_t) * 4 + 8 + 2 + 1];
sprintf (tail, "-%ld-%08d",
(long)getpid (),
(int)(1e8 * random_01 ()));
template = g_build_path (G_DIR_SEPARATOR_S,
g_get_tmp_dir (),
dirname,
tail,
NULL);
if (mkdir (template, 0700) == 0)
break;
if (errno != EEXIST) {
g_free (template);
gnumeric_error_save (COMMAND_CONTEXT (io_context),
_("Failed to create temporary file for sending."));
gnumeric_io_error_display (io_context);
problem = TRUE;
goto out;
}
g_free (template);
}
#endif
full_name = g_build_path (G_DIR_SEPARATOR_S,
template, file_utf8, NULL);
g_free (file_utf8);
template, basename, NULL);
g_free (basename);
wbv_save_to_file (wbv, fs, full_name, io_context);
......@@ -728,29 +764,33 @@ wb_view_sendto (WorkbookView *wbv, CommandContext *context)
gnumeric_io_warning_occurred (io_context))
gnumeric_io_error_display (io_context);
if (!gnumeric_io_error_occurred (io_context)) {
/* wbv_save_to_file would have errored if this failed */
char *file_locale = g_filename_from_utf8 (full_name,
-1, NULL, NULL, NULL);
if (gnumeric_io_error_occurred (io_context)) {
problem = TRUE;
} else {
char *argv[3];
argv[0] = (char *)"evolution-1.4";
argv[1] = g_strdup_printf ("mailto:?attach=%s", file_locale);
argv[1] = g_strdup_printf ("mailto:?attach=%s", full_name);
argv[2] = NULL;
problem = g_spawn_async (template,
argv, NULL, G_SPAWN_SEARCH_PATH,
NULL, NULL, NULL, NULL);
g_free (argv[1]);
g_free (file_locale);
}
g_free (template);
/* 5 minutes to ensure the file is loaded by the mailer */
/*
* We wait a while before we clean up to ensure the file is
* loaded by the mailer.
*/
g_timeout_add (1000 * 10, cb_cleanup_sendto, full_name);
} else {
gnumeric_error_save (COMMAND_CONTEXT (io_context),
_("Default file saver is not available."));
gnumeric_io_error_display (io_context);
problem = TRUE;
}
out:
g_object_unref (G_OBJECT (io_context));
return !problem;
......
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