Commit eee0eb83 authored by Arturo Espinosa's avatar Arturo Espinosa

New workbook routine to set the title Hack in autogen.sh to sed the



New workbook routine to set the title
Hack in autogen.sh to sed the libtool script and allow library dependecies
Python plugin now loads its startup file from a system directory.
parent c6889be1
1998-09-26 Miguel de Icaza <miguel@nuclecu.unam.mx>
* plugins/python/python.c (init_plugin): Use the system
installation directory to load the python scripts.
* autogen.sh: Hack to make libtool add library dependcy
information (it modifies the libtool file after it has been
created).
* src/workbook.c (workbook_set_filename): New routine to set the
filename being edited of the workbook.
* src/sheet-object.c (create_object): Swap arguments to the
ellipse object to guarrantee we pass valid information.
......
1998-09-26 Miguel de Icaza <miguel@nuclecu.unam.mx>
* plugins/python/python.c (init_plugin): Use the system
installation directory to load the python scripts.
* autogen.sh: Hack to make libtool add library dependcy
information (it modifies the libtool file after it has been
created).
* src/workbook.c (workbook_set_filename): New routine to set the
filename being edited of the workbook.
* src/sheet-object.c (create_object): Swap arguments to the
ellipse object to guarrantee we pass valid information.
......
1998-09-26 Miguel de Icaza <miguel@nuclecu.unam.mx>
* plugins/python/python.c (init_plugin): Use the system
installation directory to load the python scripts.
* autogen.sh: Hack to make libtool add library dependcy
information (it modifies the libtool file after it has been
created).
* src/workbook.c (workbook_set_filename): New routine to set the
filename being edited of the workbook.
* src/sheet-object.c (create_object): Swap arguments to the
ellipse object to guarrantee we pass valid information.
......
1998-09-26 Miguel de Icaza <miguel@nuclecu.unam.mx>
* plugins/python/python.c (init_plugin): Use the system
installation directory to load the python scripts.
* autogen.sh: Hack to make libtool add library dependcy
information (it modifies the libtool file after it has been
created).
* src/workbook.c (workbook_set_filename): New routine to set the
filename being edited of the workbook.
* src/sheet-object.c (create_object): Swap arguments to the
ellipse object to guarrantee we pass valid information.
......
......@@ -15,3 +15,7 @@ PKG_NAME="Gnumeric"
}
. $srcdir/macros/autogen.sh
mv libtool xlibtool
sed 's/^archive_cmds="\(.*\)"$/archive_cmds="\1 \\$deplibs"/' < xlibtool > libtool
chmod +x libtool
\ No newline at end of file
......@@ -47,9 +47,11 @@ if $python_val; then
PYTHON_VERSION=`python -c 'import sys ; print sys.version[0:3]'`
changequote([, ])dnl
if test -f $PYTHON_PREFIX/include/python$PYTHON_VERSION/Python.h; then
PYTHON_LIBS="python$PYTHON_VERSION -L$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"
PYTHON_LIBS="python$PYTHON_VERSION"
PYTHON_LIB_LOC="-L$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"
PYTHON_CFLAGS="-I$PYTHON_PREFIX/include/python$PYTHON_VERSION"
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_LIB_LOC)
AC_SUBST(PYTHON_CFLAGS)
else
python_val=false
......
......@@ -25,4 +25,11 @@ INCLUDES = \
$(PYTHON_CFLAGS) \
$(GNOME_INCLUDEDIR)
libpython_la_LIBADD = -l$(PYTHON_LIBS)
libpython_la_LIBADD = -l$(PYTHON_LIBS) $(PYTHON_LIB_LOC)
Pythonscriptsdir = $(datadir)/gnumeric/python
Pythonscripts_DATA = gnumeric_startup.py
EXTRA_DIST = gnumeric_startup.py
......@@ -163,7 +163,7 @@ initgnumeric(void)
{
PyImport_AddModule("gnumeric");
Py_InitModule("gnumeric", gnumeric_funcs);
g_print("gnumeric module initialized\n");
g_print("Gnumeric/Python module initialized\n");
}
static int
......@@ -193,22 +193,17 @@ init_plugin(PluginData * pd)
/* plugin stuff */
/* run the magic python file */
/* XXX should run single Python file in system directory. This file would
* then contain policy for the loading the remainder of the Python
* scripts.
*/
{
char *homedir = getenv("HOME");
char *fname;
char *name;
FILE *fp;
g_warning ("FIXME: This should load a system installed file");
fname = g_copy_strings(homedir ? homedir : "", "/.gnumeric/main.py", NULL);
fp = fopen(fname, "r");
PyRun_SimpleFile(fp, fname);
/* XXX Detect Python exception and popup window with info */
g_free(fname);
name = gnome_unconditional_datadir_file ("gnumeric/python/gnumeric_startup.py");
fp = fopen (name, "r");
if (fp){
PyRun_SimpleFile(fp, name);
}
g_free(name);
}
return 0;
......
......@@ -44,10 +44,7 @@ workbook_save_as (Workbook *wb)
char *name = gtk_file_selection_get_filename (fsel);
if (name [strlen (name)-1] != '/'){
if (wb->filename)
g_free (wb->filename);
wb->filename = g_strdup (name);
workbook_set_filename (wb, name);
gnumericWriteXmlWorkbook (wb, wb->filename);
}
......
......@@ -313,6 +313,9 @@ Workbook *workbook_new (void);
void workbook_destroy (Workbook *wb);
Workbook *workbook_new_with_sheets (int sheet_count);
void workbook_set_filename (Workbook *, char *);
void workbook_set_title (Workbook *, char *);
void workbook_save_as (Workbook *);
void workbook_save (Workbook *);
void workbook_attach_sheet (Workbook *, Sheet *);
......
......@@ -903,6 +903,8 @@ workbook_new (void)
wb->max_iterations = 1;
workbook_set_title (wb, _("Untitled.gnumeric"));
workbook_setup_status_area (wb);
workbook_setup_edit_area (wb);
workbook_setup_sheets (wb);
......@@ -1054,3 +1056,30 @@ workbook_feedback_set (Workbook *workbook, WorkbookFeedbackType type, void *data
}
}
void
workbook_set_title (Workbook *wb, char *title)
{
char *title;
g_return_if_fail (wb != NULL);
g_return_if_fail (title != NULL);
title = g_copy_strings ("Gnumeric: ", title, NULL);
gtk_window_set_title (GTK_WINDOW (wb->toplevel), title);
g_free (title);
}
void
workbook_set_filename (Workbook *wb, char *name)
{
g_return_if_fail (wb != NULL);
g_return_if_fail (name != NULL);
if (wb->filename)
g_free (wb->filename);
wb->filename = g_strdup (name);
workbook_set_title (wb, g_basename (name));
}
......@@ -628,7 +628,7 @@ Workbook *gnumericReadXmlWorkbook(const char *filename) {
ctxt.nameTable = g_hash_table_new(g_str_hash, g_str_equal);
ctxt.fontIdx = 1;
wb = readXmlWorkbook(&ctxt, res->root);
wb->filename = g_strdup (filename);
workbook_set_filename (wb, filename);
workbook_recalc(wb);
g_hash_table_foreach(ctxt.nameTable, nameFree, NULL);
g_hash_table_destroy(ctxt.nameTable);
......
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