Commit 52071802 authored by Chema Celorio's avatar Chema Celorio Committed by Jose Maria Celorio

bump to 0.9.1 and require gnome-print 0.22

2000-08-30  Chema Celorio  <chema@celorio.com>

	* configure.in: bump to 0.9.1 and require gnome-print 0.22

2000-08-30  Chema Celorio  <chema@celorio.com>

	Fixed small bugs/issues here & there

	* file.c (gedit_view_insert_if_mapped): after more than 10 hrs. finaly
	fixed the crash reported in
       #19044: program crashed
       #20097: gedit DnD crash
       #20743: crashes when opening DOS file
       #22287: (crash during mime) loaded a temp file from gftp. bryce weiner <cogburn@fuse.net>.
	It is based on a semi-hacky soltuion, but users want a stable editor.
parent 797596f5
......@@ -15,9 +15,71 @@ KNOWN BUGS :
this is most likely the reason. If you have this crash it will be
a great help for gedit if you find a way of reproducing it.
From the bug Tracking System
----------------------------
Gtk Editable bug :
#5260: [0.5.4] crash while copy/pasting (gtk_editable)
#12325: [0.7.0] crash while copy/pasting (gtk_editable)
#13576: [0.7.0] crash while copy/pasting (gtk_editable)
#14104: [0.7.0] crash while selecting text (gtk_editable)
#14204: [0.5.4] crash while pasting from Netscape (gtk_editable)
#14756: [0.7.0] crash while copy/pasting (gtk_editable)
#15528: [0.7.9] crash while selecting text (gtk_editable)
#15669: [0.7.9] crash while copy/pasting (gtk_editable)
#15746: [0.7.9] crash while selcting all (gtk_editable)
#16197: [0.7.9] crash while pasting text (gtk_editable)
#18635: crash when copy and paste
#16169: gedit-0.9.0pre2 static compile mistakenly links in libgnomeprint.so.6
- Asked michael to take a look.
- Requested more info
#18440: opening two files
- Closed
#19044: program crashed
- A problem with the widgets sensitivity
Subject: gedit; Reported by: jon <jon@linux.chickenstock.org>; 30 days old.
#19540: Save crashes
Subject: gedit; Reported by: Anthony DeRobertis <anthony.derobertis@crossmedia.net>; 25 days old.
#19862: Deleting entire lines fails to update screen
Subject: gedit; Reported by: Marcus Urban <pup@houston.rr.com>; 23 days old.
#20097: gedit DnD crash
Subject: gedit; Reported by: Peter Weilbacher <weilbach@uni-sw.gwdg.de>; 20 days old.
#20325: GEdit crshed with Cut and Past between two open docs
Subject: gedit; Reported by: Herbert U.Huebner <herbert-u-.huebner@webave.com>; 18 days old.
#20365: copy/paste does not work
Subject: gedit; Reported by: Thomas Koeller <tkoeller@gmx.net>; 18 days old.
#20659: would not automatically start file for edit.
Subject: gedit; Reported by: Yong Chiew Ning <cnyong@attglobal.net>; 16 days old.
#20985:
Subject: gedit; Reported by: Haight Ashbury <ulrich@mavnet.dynip.com>; 13 days old.
#20989: "gedit" caused fatal bus error
Subject: gedit; Reported by: Dana Kowalski <Dana.Kowalski@rl.af.mil>; 13 days old.
#21750: Word wrapping
Subject: gedit; Reported by: Luke Worth <luke_worth@mail.com>.
#21816: Crash while dbl-clicking text (selecting 1 word)
Subject: gedit; Reported by: Mike Esler <mike.esler@nrlssc.navy.mil>.
#22287: crash during mime
Subject: gedit; Reported by: bryce weiner <cogburn@fuse.net>.
#22290: optionally display the full filepath in the titlebar and/or filelist
Subject: gedit; Reported by: Ulrich Eckhardt <uli@DoomMachine>.
Reproducible gmc bug
??? #20743: crashes when opening DOS file
Subject: gedit; Reported by: Wayne Dyer <dwdyer@austin.rr.com>; 15 days old.
FIXED :
open gedit with a filename that does not exist, when the popup dialog appears
click esc. g_assert is reached
2000-08-30 Chema Celorio <chema@celorio.com>
* configure.in: bump to 0.9.1 and require gnome-print 0.22
2000-08-27 Alastair McKinstry <mckinstry@computer.org>
* gedit.desktop: Added Irish translation.
......@@ -23,7 +27,6 @@
* New logo and icon.
>>>>>>> 1.222
2000-06-04 Chema Celorio <chema@celorio.com>
* configure.in: bump version to 0.7.9
......
......@@ -11,6 +11,10 @@ gedit 0.9.1
[ ] Add a convert tabs to space feature
[ ] When replacing all, don't push to the undo stack the whole document
add each replacement by itself.
[ ] When opening a file for the second time, ask the user if he would
rather open another view of the same file
[ ] Clean the code that return widgets from a function (for setting the
sensitivity)
** Roberto **
......
AC_INIT(src/gedit.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gedit, 0.9.0)
AM_INIT_AUTOMAKE(gedit, 0.9.1)
AM_MAINTAINER_MODE
AM_ACLOCAL_INCLUDE(macros)
......@@ -62,14 +62,14 @@ AM_PATH_GTK(1.2.7,,
dnl ******************************
dnl GnomePrint checking
dnl ******************************
AC_MSG_CHECKING(for GnomePrint libraries >= 0.19)
AC_MSG_CHECKING(for GnomePrint libraries >= 0.22)
if gnome-config --libs print > /dev/null 2>&1; then
vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" | \
awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
if test "$vers" -ge 19; then
if test "$vers" -ge 22; then
AC_MSG_RESULT(found)
else
AC_MSG_ERROR(You need at least GNOME print 0.19 for this version of gedit)
AC_MSG_ERROR(You need at least GNOME print 0.22 for this version of gedit)
fi
else
AC_MSG_ERROR(Did not find GnomePrint installed)
......
2000-08-30 Chema Celorio <chema@celorio.com>
Fixed small bugs/issues here & there
* file.c (gedit_view_insert_if_mapped): after more than 10 hrs. finaly
fixed the crash reported in
#19044: program crashed
#20097: gedit DnD crash
#20743: crashes when opening DOS file
#22287: (crash during mime) loaded a temp file from gftp. bryce weiner <cogburn@fuse.net>.
It is based on a semi-hacky soltuion, but users want a stable editor.
2000-07-09 Chema Celorio <chema@celorio.com>
* file.c (gedit_file_save): fix 16143
......
......@@ -105,18 +105,24 @@ void
filenames_dropped (GtkWidget *widget, GdkDragContext *context, gint x, gint y,
GtkSelectionData *selection_data, guint info, guint time)
{
GList *names, *tmp_list;
GList *names, *list;
gedit_debug (DEBUG_SEARCH, "");
names = gnome_uri_list_extract_filenames ((char *)selection_data->data);
tmp_list = names;
while (tmp_list)
list = gnome_uri_list_extract_filenames (selection_data->data);
names = list;
while (names != NULL)
{
gedit_document_new_with_file ((gchar *)tmp_list->data);
tmp_list = tmp_list->next;
gchar *filename;
filename = g_strdup ((gchar *)names->data);
gedit_document_new_with_file (filename);
g_free (filename);
names = names->next;
}
gnome_uri_list_free_strings (list);
}
void
......
......@@ -20,10 +20,12 @@
<modal>True</modal>
<logo>gedit-logo.png</logo>
<copyright>(C) 1998, 1999, 2000 Alex Roberts and Evan Lawrence</copyright>
<authors>Alex Roberts &lt;bse@error.fsnet.co.uk&gt;
Evan Lawrence
<authors>Chema Celorio &lt;chema@celorio.com&gt;
Jason Leach &lt;leach@wam.umd.edu&gt;
Chema Celorio &lt;chema@celorio.com&gt;
Based in gedit 0.6.1 by :
Alex Roberts &lt;bse@error.fsnet.co.uk&gt;
Evan Lawrence
Artwork by :
Steve Hall &lt;steve_hall@mindspring.com&gt;
......
......@@ -41,7 +41,7 @@ goto_line_clicked_cb (GtkWidget *widget, gint button)
{
gint line, lines = 0;
gulong pos;
View *view = VIEW (mdi->active_view);
View *view = GEDIT_VIEW (mdi->active_view);
Document *doc = gedit_document_current();
GtkText *text = GTK_TEXT (view->text);
GtkWidget *entry;
......
......@@ -404,7 +404,7 @@ prepare_fontscolors_page (GladeXML *gui)
/* setup the initial states */
if (mdi->active_view)
style = gtk_style_copy (gtk_widget_get_style (VIEW (mdi->active_view)->text));
style = gtk_style_copy (gtk_widget_get_style (GEDIT_VIEW (mdi->active_view)->text));
else
style = gtk_style_new ();
......
......@@ -47,8 +47,6 @@ guchar* gedit_document_get_buffer (Document * doc);
guint gedit_document_get_buffer_length (Document * doc);
Document * gedit_document_new (void);
Document * gedit_document_new_with_title (gchar *title);
gint gedit_document_new_with_file (gchar *file_name);
Document * gedit_document_current (void);
static gchar* gedit_document_get_config_string (GnomeMDIChild *child);
......@@ -61,7 +59,7 @@ static void gedit_document_init (Document *doc);
GtkType gedit_document_get_type (void);
void gedit_mdi_init (void);
void gedit_document_load ( GList *file_list);
gboolean gedit_document_load ( GList *file_list);
void gedit_document_set_title (Document *doc);
void gedit_document_swap_hc_cb (GtkWidget *widget, gpointer data);
void gedit_document_set_undo (Document *doc, gint undo_state, gint redo_state);
......@@ -352,7 +350,7 @@ gedit_document_new (void)
}
Document *
gedit_document_new_with_title (gchar *title)
gedit_document_new_with_title (const gchar *title)
{
Document *doc;
......@@ -369,12 +367,11 @@ gedit_document_new_with_title (gchar *title)
gedit_window_set_widgets_sensitivity (TRUE);
return doc;
}
gint
gedit_document_new_with_file (gchar *file_name)
gedit_document_new_with_file (const gchar *file_name)
{
Document *doc;
......@@ -382,14 +379,15 @@ gedit_document_new_with_file (gchar *file_name)
doc = gedit_document_current();
if (doc!=NULL)
if (doc!=NULL)
if (doc->changed || doc->filename)
doc = NULL;
if (gedit_file_open (doc, file_name) == 1)
return FALSE;
gedit_window_set_widgets_sensitivity (TRUE);
return TRUE;
}
......@@ -467,7 +465,7 @@ gedit_document_create_view (GnomeMDIChild *child)
g_return_val_if_fail (child != NULL, NULL);
g_return_val_if_fail (GNOME_IS_MDI_CHILD (child), NULL);
new_view = VIEW (gedit_view_new (DOCUMENT (child)));
new_view = GEDIT_VIEW (gedit_view_new (DOCUMENT (child)));
gedit_view_set_font (new_view, settings->font);
gedit_view_set_readonly (new_view, DOCUMENT (child)->readonly);
......@@ -590,7 +588,8 @@ gedit_mdi_init (void)
gedit_debug (DEBUG_DOCUMENT, "end");
}
void
gboolean
gedit_document_load ( GList *file_list)
{
gchar *file_name;
......@@ -603,17 +602,16 @@ gedit_document_load ( GList *file_list)
for (;file_list; file_list = file_list->next)
{
file_name = gedit_file_convert_to_full_pathname (file_list->data);
if (g_file_exists (file_name))
gedit_document_new_with_file ((gchar *) file_name);
else
gedit_file_create_popup ((guchar *) file_name);
g_free (file_name);
}
if (gedit_document_current()==NULL)
if (gedit_document_current() == NULL)
gedit_document_new ();
return FALSE;
}
......@@ -632,25 +630,31 @@ gedit_document_set_title (Document *doc)
gedit_debug (DEBUG_DOCUMENT, "");
if (doc == NULL)
return;
if (doc->filename == NULL)
if (doc->filename == NULL) {
docname = g_strdup_printf (_("Untitled %i"), doc->untitled_number);
else
} else {
docname = g_strdup (g_basename (doc->filename));
if (doc->changed)
}
if (doc->changed) {
title = g_strdup_printf ("gedit: %s %s", docname, _("(modified)"));
else if (doc->readonly)
} else if (doc->readonly) {
title = g_strdup_printf ("gedit: %s %s", docname, _("(readonly)"));
else
} else {
title = g_strdup_printf ("gedit: %s", docname);
}
gtk_window_set_title (gedit_window_active(), title);
g_free (docname);
g_free (title);
gedit_debug (DEBUG_DOCUMENT, "end");
}
......@@ -743,8 +747,6 @@ gedit_document_swap_hc_cb (GtkWidget *widget, gpointer data)
return;
}
g_print ("NewFileName: %s\n", new_file_name);
/* Scan the documents to see if the file we are looking for is allready open */
for (n = 0; n < g_list_length (mdi->children); n++)
{
......@@ -776,7 +778,7 @@ gedit_document_set_undo (Document *doc, gint undo_state, gint redo_state)
for ( n=0; n < g_list_length (doc->views); n++)
{
nth_view = VIEW (g_list_nth_data (doc->views, n));
nth_view = GEDIT_VIEW (g_list_nth_data (doc->views, n));
gedit_view_set_undo (nth_view, undo_state, redo_state);
}
......
......@@ -82,14 +82,14 @@ guchar* gedit_document_get_buffer (Document * doc);
guint gedit_document_get_buffer_length (Document * doc);
Document * gedit_document_new (void);
Document * gedit_document_new_with_title (gchar *title);
gint gedit_document_new_with_file (gchar *file_name);
Document * gedit_document_new_with_title (const gchar *title);
gint gedit_document_new_with_file (const gchar *file_name);
Document * gedit_document_current (void);
GtkType gedit_document_get_type (void);
void gedit_mdi_init (void);
void gedit_document_load ( GList *file_list);
gboolean gedit_document_load ( GList *file_list);
void gedit_document_set_title (Document *doc);
void gedit_document_swap_hc_cb (GtkWidget *widget, gpointer data);
void gedit_document_set_undo (Document *doc, gint undo_state, gint redo_state);
......
......@@ -45,11 +45,6 @@
GtkWidget *save_file_selector = NULL;
GtkWidget *open_file_selector = NULL;
gint gedit_file_open (Document *doc, gchar *fname);
gint gedit_file_save (Document *doc, gchar *fname);
void gedit_file_save_as (Document *doc);
gint gedit_file_stdin (Document *doc);
void file_new_cb (GtkWidget *widget, gpointer cbdata);
void file_open_cb (GtkWidget *widget, gpointer cbdata);
gint file_save_document (Document * doc);
......@@ -61,7 +56,7 @@ void file_close_all_cb(GtkWidget *widget, gpointer cbdata);
void file_revert_cb (GtkWidget *widget, gpointer cbdata);
void file_quit_cb (GtkWidget *widget, gpointer cbdata);
gint gedit_file_create_popup (guchar *title);
gint gedit_file_create_popup (const gchar *title);
static void gedit_file_open_ok_sel (GtkWidget *widget, GtkFileSelection *files);
static void gedit_file_save_as_ok_sel (GtkWidget *w, gpointer cbdata);
static gint delete_event_cb (GtkWidget *w, GdkEventAny *e);
......@@ -75,6 +70,55 @@ static void gedit_close_all_flag_verify (guchar *function);
gchar * gedit_file_convert_to_full_pathname (const gchar * fname);
typedef struct {
Document *doc;
View *view;
gchar *tmp_buf;
} HackyStruct;
static gboolean
gedit_view_insert_if_mapped (HackyStruct *hack)
{
g_return_val_if_fail (GEDIT_IS_VIEW (hack->view), FALSE);
if (!GTK_WIDGET_REALIZED (hack->view->text)) {
g_print ("not mapped, returning\n");
return TRUE;
}
gtk_text_insert (GTK_TEXT (hack->view->text), NULL,
NULL, NULL, hack->tmp_buf, strlen (hack->tmp_buf));
gedit_view_set_position (hack->view, 0);
g_free (hack->tmp_buf);
g_free (hack);
return FALSE;
}
static void
gedit_document_insert_text_when_mapped (Document *doc, const gchar * tmp_buf,
gint pos, gboolean something)
{
HackyStruct *hack;
gedit_debug (DEBUG_FILE, "");
hack = g_new (HackyStruct, 1);
hack->doc = doc;
hack->view = g_list_nth_data (doc->views, 0);
hack->tmp_buf = g_strdup (tmp_buf);
gtk_idle_add ((GtkFunction) gedit_view_insert_if_mapped,
hack);
}
/* TODO : add flash on all operations ....Chema*/
/* what happens when you open the same doc
twice. I think we should add another view
......@@ -90,19 +134,18 @@ gchar * gedit_file_convert_to_full_pathname (const gchar * fname);
* Return value: 0 on success, 1 on error.
*/
gint
gedit_file_open (Document *doc, gchar *fname)
gedit_file_open (Document *doc, const gchar *fname)
{
gchar *tmp_buf;
struct stat stats;
FILE *fp;
Document *currentdoc;
View *view;
gedit_debug (DEBUG_FILE, "");
gint _debug;
g_return_val_if_fail (fname != NULL, 1);
gedit_debug (DEBUG_FILE, "");
currentdoc = gedit_document_current();
g_return_val_if_fail (fname != NULL, 1);
if (stat(fname, &stats) || !S_ISREG(stats.st_mode))
{
......@@ -122,7 +165,7 @@ gedit_file_open (Document *doc, gchar *fname)
g_free (errstr);
return 1;
}
if ((tmp_buf = g_new0 (gchar, stats.st_size + 1)) == NULL)
{
gnome_app_error (gedit_window_active_app(), _("Could not allocate the required memory."));
......@@ -138,28 +181,33 @@ gedit_file_open (Document *doc, gchar *fname)
return 1;
}
fread (tmp_buf, 1, stats.st_size, fp);
_debug = fread (tmp_buf, 1, stats.st_size, fp);
fclose (fp);
if (doc==NULL)
if (doc==NULL) {
doc = gedit_document_new ();
doc->filename = g_strdup (fname);
doc->untitled_number = 0;
gedit_document_insert_text (doc, tmp_buf, 0, FALSE);
gedit_document_set_readonly (doc, access (fname, W_OK) ? TRUE : FALSE);
doc->filename = g_strdup (fname);
doc->untitled_number = 0;
gedit_document_insert_text_when_mapped (doc, tmp_buf, 0, FALSE);
gedit_document_set_readonly (doc, access (fname, W_OK) ? TRUE : FALSE);
} else {
/* Vefify that doc->filenam == NULL ??? */
doc->filename = g_strdup (fname);
doc->untitled_number = 0;
gedit_document_insert_text (doc, tmp_buf, 0, FALSE);
gedit_document_set_readonly (doc, access (fname, W_OK) ? TRUE : FALSE);
/* Set the cursor position to the start */
view = g_list_nth_data (doc->views, 0);
g_return_val_if_fail (view!=NULL, 1);
gedit_view_set_position (view, 0);
g_free (tmp_buf);
}
/* Set the cursor position to the start */
view = g_list_nth_data (doc->views, 0);
g_return_val_if_fail (view!=NULL, 1);
gedit_view_set_position (view, 0);
doc->changed = FALSE;
gedit_document_set_title (doc);
gedit_document_text_changed_signal_connect (doc);
g_free (tmp_buf);
gedit_flash_va ("%s %s", _(MSGBAR_FILE_OPENED), fname);
gedit_recent_add (fname);
......@@ -168,6 +216,74 @@ gedit_file_open (Document *doc, gchar *fname)
return 0;
}
/**
* gedit_file_save_as:
* @doc:
*
* creates the save as dialog and connects the signals to
* the button
**/
static void
gedit_file_save_as (Document *doc)
{
gedit_debug (DEBUG_FILE, "");
if (doc == NULL)
doc = gedit_document_current();
if (doc == NULL)
return;
if (save_file_selector && GTK_WIDGET_VISIBLE (save_file_selector))
return;
if (save_file_selector == NULL)
{
save_file_selector = gtk_file_selection_new (NULL);
gtk_signal_connect(GTK_OBJECT(save_file_selector),
"delete_event",
GTK_SIGNAL_FUNC(delete_event_cb),
save_file_selector);
gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_file_selector)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC(cancel_cb),
save_file_selector);
/* If this save as was the result of a close all, and the user cancels the
save, clear the flag */
gtk_signal_connect(GTK_OBJECT(save_file_selector),
"delete_event",
GTK_SIGNAL_FUNC(gedit_close_all_flag_clear),
NULL);
gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_file_selector)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC(gedit_close_all_flag_clear),
NULL);
/*
g_print ("1. Doc->filename %s untitled #%i\n", doc->filename, doc->untitled_number);
*/
/* OK clicked */
gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_file_selector)->ok_button),
"clicked",
GTK_SIGNAL_FUNC (gedit_file_save_as_ok_sel),
doc);
}
gtk_window_set_title (GTK_WINDOW(save_file_selector), _("Save As..."));
if (!GTK_WIDGET_VISIBLE (save_file_selector))
{
gtk_window_position (GTK_WINDOW (save_file_selector), GTK_WIN_POS_MOUSE);
gtk_widget_show(save_file_selector);
}
return;
}
/**
* gedit_file_save:
* @doc: Document window that contains the text we want to save
......@@ -179,7 +295,7 @@ gedit_file_open (Document *doc, gchar *fname)
* Return value: 0 on success, 1 on error.
*/
gint
gedit_file_save (Document *doc, gchar *fname)
gedit_file_save (Document *doc, const gchar *fname)
{
FILE *file_pointer;
gchar *buffer;
......@@ -189,7 +305,7 @@ gedit_file_save (Document *doc, gchar *fname)
g_return_val_if_fail (doc!=NULL, 1);
view = VIEW ( g_list_nth_data(doc->views, 0) );
view = GEDIT_VIEW ( g_list_nth_data(doc->views, 0) );
g_return_val_if_fail (view!=NULL, 1);
......@@ -283,72 +399,6 @@ gedit_file_save (Document *doc, gchar *fname)
}
/**
* gedit_file_save_as:
* @doc:
*
* creates the save as dialog and connects the signals to
* the button
**/
void
gedit_file_save_as (Document *doc)
{
gedit_debug (DEBUG_FILE, "");
if (doc == NULL)
doc = gedit_document_current();
if (doc == NULL)
return;