Commit 1142c122 authored by BST 1999  Alex Roberts's avatar BST 1999 Alex Roberts Committed by gedit

Erk! i havent been keeping this up to date.. ahwell.. here goes..

Sat Jun 26 22:22:17 BST 1999  Alex Roberts  <bse@gedit.pn.org>

	* Erk! i havent been keeping this up to date.. ahwell.. here goes..

	* gE_document.[ch]: (gE_window_new) Make it a GnomeApp arg, instead
	  of a GtkWidget.. much nicer.. And commented out the call to
	  gE_set_menu_toggle_states, gnome-libs 1.0.11 doenst seem to like it..

	* gE_mdi.c: various improvements.. (iirc ;)

	* gE_prefs.[ch]: Added a "close doc" flag..

	* gE_prefs_box.c: Moved the print tab to a Document tab, and added a
	  option for what to do when the last documnet of the window is closed..
	  right now only the first option works.. this corresponds with the
	  flag, above.

	* commands.c: Made the close callback check the "close doc" flag, and
	  it will either open a new doc if there arent any more, or print hola! to
	  stdout.. as i said, its not fully implemented yet.


Thu Jun 17 19:00:32 BST 1999  Alex Roberts  <bse@gedit.pn.org>

	* commands.c: (doc_changed_cb)
	  gE_files.c: (gE_file_save) Update the window title when the file is
	  saved or modified.
parent 964c0638
Sat Jun 26 22:22:17 BST 1999 Alex Roberts <bse@gedit.pn.org>
* Erk! i havent been keeping this up to date.. ahwell.. here goes..
* gE_document.[ch]: (gE_window_new) Make it a GnomeApp arg, instead
of a GtkWidget.. much nicer.. And commented out the call to
gE_set_menu_toggle_states, gnome-libs 1.0.11 doenst seem to like it..
* gE_mdi.c: various improvements.. (iirc ;)
* gE_prefs.[ch]: Added a "close doc" flag..
* gE_prefs_box.c: Moved the print tab to a Document tab, and added a
option for what to do when the last documnet of the window is closed..
right now only the first option works.. this corresponds with the
flag, above.
* commands.c: Made the close callback check the "close doc" flag, and
it will either open a new doc if there arent any more, or print hola! to
stdout.. as i said, its not fully implemented yet.
Thu Jun 17 19:00:32 BST 1999 Alex Roberts <bse@gedit.pn.org>
* commands.c: (doc_changed_cb)
gE_files.c: (gE_file_save) Update the window title when the file is
saved or modified.
Thu Jun 17 14:49:22 BST 1999 Alex Roberts <bse@gedit.pn.org>
(From patch supplied by Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>)
* src/gE_files.c: (gE_file_save) Better error checking when saving
files.
Fixed a couple of memory leaks too.
1999-06-16 Tomas Ogren <stric@ing.umu.se>
* src/gE_about.c src/gE_plugin_api.c src/gE_prefs_box.c src/search.c
......
......@@ -67,6 +67,7 @@ void
doc_changed_cb(GtkWidget *w, gpointer cbdata)
{
gchar MOD_label[255];
gchar *str;
gE_document *doc = (gE_document *) cbdata;
......@@ -74,9 +75,19 @@ gchar MOD_label[255];
gtk_signal_disconnect (GTK_OBJECT(doc->text), (gint) doc->changed_id);
doc->changed_id = FALSE;
sprintf(MOD_label, "*%s", GNOME_MDI_CHILD(doc)->name);
str = g_malloc (strlen (GNOME_MDI_CHILD(doc)->name) + 2);
sprintf(str, "*%s", GNOME_MDI_CHILD(doc)->name);
/*gtk_label_set(GTK_LABEL(doc->tab_label), MOD_label);*/
gnome_mdi_child_set_name (GNOME_MDI_CHILD (doc), MOD_label);
gnome_mdi_child_set_name (GNOME_MDI_CHILD (doc), str);
g_free (str);
str = g_malloc0 (strlen (GEDIT_ID) +
strlen (GNOME_MDI_CHILD (gE_document_current())->name) + 4);
sprintf (str, "%s - %s", GNOME_MDI_CHILD (gE_document_current())->name, GEDIT_ID);
gtk_window_set_title(GTK_WINDOW(mdi->active_window), str);
g_free(str);
}
......@@ -719,7 +730,16 @@ file_close_cb(GtkWidget *widget, gpointer cbdata)
if (mdi->active_child == NULL)
return;
gnome_mdi_remove_child (mdi, mdi->active_child, FALSE);
if (gnome_mdi_remove_child (mdi, mdi->active_child, FALSE))
{
if (mdi->active_child == NULL)
{
if (!settings->close_doc)
gE_document_new ();
else
g_print ("hola!\n");
}
}
}
......
......@@ -75,7 +75,7 @@ static char *lastmsg = NULL;
static gint msgbar_timeout_id;
/*gE_window */
void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
void gE_window_new(GnomeMDI *mdi, GnomeApp *app)
{
/*GnomeUIInfo * gedit_menu;
gE_window *w;*/
......@@ -92,13 +92,13 @@ void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
/* various initializations */
/*w = g_malloc0(sizeof(gE_window));*/
settings->auto_indent = TRUE;
/* settings->auto_indent = TRUE;
settings->show_tabs = TRUE;
settings->splitscreen = FALSE;
settings->show_status = TRUE;
settings->have_toolbar = TRUE;
*/
ptr = g_new(int, 1);
*ptr = ++last_assigned_integer;
g_hash_table_insert (win_int_to_pointer, ptr, app);
......@@ -159,8 +159,8 @@ void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
gE_document_new ();
gE_set_menu_toggle_states();
/* gE_set_menu_toggle_states();*/
g_list_foreach(plugins, (GFunc) add_plugins_to_window, GNOME_APP(app));
settings->num_recent = 0;
......@@ -174,6 +174,9 @@ void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
gtk_signal_connect (GTK_OBJECT (app),
"drag_data_received",
GTK_SIGNAL_FUNC (filenames_dropped), NULL);
gnome_app_install_menu_hints(app, gnome_mdi_get_menubar_info(app));
} /* gE_window_new */
......
......@@ -39,7 +39,7 @@ extern GtkWidget *col_label;
extern void gE_window_set_auto_indent (gint auto_indent);
extern void gE_window_set_status_bar (gint show_status);
extern void gE_window_new(GnomeMDI *mdi, GtkWidget *app);
extern void gE_window_new(GnomeMDI *mdi, GnomeApp *app);
/* gE_document_new : relocated to gE_mdi.[ch] */
/* gE_document_new_with_file : relocated to gE_mdi.[ch] */
/* gE_document_current: relocated to gE_mdi.[ch] */
......
......@@ -195,6 +195,7 @@ gE_file_save(gE_document *doc, gchar *fname)
{
FILE *fp;
gchar *title;
gchar *tmpstr;
/* FIXME: not sure what to do with all the gE_window refs..
i'll comment them out for now.. */
......@@ -208,29 +209,39 @@ gE_file_save(gE_document *doc, gchar *fname)
}
gtk_text_thaw (GTK_TEXT(doc->text));
if (fputs (gtk_editable_get_chars (GTK_EDITABLE (doc->text), 0,
gtk_text_get_length (GTK_TEXT (doc->text))), fp) == EOF)
tmpstr = gtk_editable_get_chars (GTK_EDITABLE (doc->text), 0,
gtk_text_get_length (GTK_TEXT (doc->text)));
if (fputs (tmpstr, fp) == EOF)
{
perror("Error saving file");
fclose(fp);
g_free (tmpstr);
return 1;
}
g_free (tmpstr);
if (fclose(fp) != 0)
{
perror("Error saving file");
return 1;
}
fflush(fp);
fclose(fp);
if (doc->filename != fname)
{
g_free(doc->filename);
doc->filename = g_malloc0 (strlen (fname) + 1);
doc->filename = g_strdup(fname);
}
doc->changed = FALSE;
gnome_mdi_child_set_name (GNOME_MDI_CHILD (doc), g_basename(doc->filename));
tmpstr = g_malloc0 (strlen (GEDIT_ID) +
strlen (GNOME_MDI_CHILD (gE_document_current())->name) + 4);
sprintf (tmpstr, "%s - %s",
GNOME_MDI_CHILD (gE_document_current())->name,
GEDIT_ID);
gtk_window_set_title(GTK_WINDOW(mdi->active_window), tmpstr);
g_free(tmpstr);
if (!doc->changed_id)
doc->changed_id = gtk_signal_connect (GTK_OBJECT(doc->text), "changed",
GTK_SIGNAL_FUNC(doc_changed_cb),doc);
......
......@@ -302,6 +302,7 @@ GTK_SIGNAL_FUNC(gE_document_popup_cb), GTK_OBJECT((gE_window *)(mdi->active_wind
gtk_widget_grab_focus(doc->text);
/*return vpaned;*/
return vpaned;
}
......@@ -311,6 +312,9 @@ static void gE_document_destroy (GtkObject *obj)
doc = GE_DOCUMENT(obj);
if (doc->filename)
g_free (doc->filename);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy)(GTK_OBJECT (doc));
}
......@@ -509,7 +513,7 @@ gint remove_doc_cb (GnomeMDI *mdi, gE_document *doc)
gnome_dialog_set_default (GNOME_DIALOG (msgbox), 2);
ret = gnome_dialog_run_and_close (GNOME_DIALOG (msgbox));
/* switch (ret)
switch (ret)
{
case 0:
file_save_cb (NULL, data);
......@@ -518,17 +522,17 @@ gint remove_doc_cb (GnomeMDI *mdi, gE_document *doc)
return TRUE;
default:
return FALSE;
}*/
if (ret == 0)
}
/* if (ret == 0)
{
/*file_save_cb (NULL, data);*/
if (gE_document_current()->filename)
*/ /*file_save_cb (NULL, data);*/
/* if (gE_document_current()->filename)
file_save_cb (NULL, data);
}
else if (ret == 2)
return FALSE;
}
*/ }
ptr = g_hash_table_lookup(doc_pointer_to_int, doc);
g_hash_table_remove(doc_int_to_pointer, ptr);
......
......@@ -56,6 +56,7 @@ gE_save_settings()
gE_prefs_set_int ("tb pix", (gint) settings->have_tb_pix);
gE_prefs_set_int ("tb relief", (gint) settings->use_relief_toolbar);
gE_prefs_set_int ("splitscreen", (gint) settings->splitscreen);
gE_prefs_set_int ("close doc", (gint) settings->close_doc);
gE_prefs_set_int ("mdi mode", settings->mdi_mode);
gE_prefs_set_int ("scrollbar", settings->scrollbar);
gE_prefs_set_char ("font", settings->font);
......@@ -82,6 +83,7 @@ void gE_get_settings()
settings->have_tb_pix = gE_prefs_get_int("tb pix");
settings->use_relief_toolbar = gE_prefs_get_int("tb relief");
settings->splitscreen = gE_prefs_get_int("splitscreen");
settings->close_doc = gE_prefs_get_int ("close doc");
settings->mdi_mode = gE_prefs_get_int ("mdi mode");
if (!settings->mdi_mode)
settings->mdi_mode = mdi_type[GNOME_MDI_NOTEBOOK];
......
......@@ -47,6 +47,8 @@ typedef struct _gE_preference {
gint width, height;
gint run; /* Flag to see if this is the first time gEdit is run */
gint close_doc;
} gE_preference;
extern gE_preference *settings;
......
......@@ -66,6 +66,14 @@ typedef struct _gE_prefs_data {
gchar *curW;
gchar *curH;
/* Doc Settings */
/* Stuff like Autosave would go here.. if autosave
* was actually implemented ;) */
/* Should print stuff go in here too? hmm.. */
GtkWidget *DButton1;
GtkWidget *DButton2;
/* Toolbar Settings */
/* Hmm, dunno... */
......@@ -198,6 +206,12 @@ void gE_apply(GnomePropertyBox *pbox, gint page, gE_data *data)
settings->width = atoi (gtk_entry_get_text (GTK_ENTRY(prefs->preW)));
settings->height = atoi (gtk_entry_get_text (GTK_ENTRY(prefs->preH)));
/* Document Settings */
if (GTK_TOGGLE_BUTTON (prefs->DButton1)->active)
settings->close_doc = FALSE;
if (GTK_TOGGLE_BUTTON (prefs->DButton2)->active)
settings->close_doc = TRUE;
gE_window_refresh(data->window);
gE_save_settings();
}
......@@ -226,7 +240,11 @@ void get_prefs(gE_data *data)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (prefs->split),
settings->splitscreen);
if (!settings->close_doc)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->DButton1), TRUE);
else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->DButton2), TRUE);
if (!GTK_TOGGLE_BUTTON(prefs->plugins_toggle)->active)
gtk_widget_set_sensitive (GTK_WIDGET (prefs->plugin_list), FALSE);
else
......@@ -315,7 +333,7 @@ static GtkWidget *general_page_new()
/* Print Stuf.. */
static GtkWidget *print_page_new()
static GtkWidget *doc_page_new()
{
GtkWidget *main_vbox, *vbox, *frame, *hbox;
GtkWidget *label;
......@@ -324,6 +342,33 @@ static GtkWidget *print_page_new()
gtk_container_border_width (GTK_CONTAINER (main_vbox), 4);
gtk_widget_show (main_vbox);
/* Document Closing stuffs */
frame = gtk_frame_new (_("Document Settings"));
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 4);
gtk_widget_show (frame);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
hbox = gtk_hbox_new(FALSE, 0);
gtk_container_border_width(GTK_CONTAINER(hbox), 10);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
gtk_widget_show(hbox);
prefs->DButton1 = gtk_radio_button_new_with_label (NULL, "New Document After Closing Last");
gtk_box_pack_start (GTK_BOX (hbox), prefs->DButton1, TRUE, TRUE, 0);
gtk_widget_show (prefs->DButton1);
prefs->DButton2 = gtk_radio_button_new_with_label (
gtk_radio_button_group (GTK_RADIO_BUTTON (prefs->DButton1)),
"Close Window After Closing Last");
gtk_box_pack_start (GTK_BOX (hbox), prefs->DButton2, TRUE, TRUE, 0);
gtk_widget_show (prefs->DButton2);
/* End of docyment closing stuffs */
/* Print COmmand */
frame = gtk_frame_new (_("Print Command"));
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 4);
gtk_widget_show (frame);
......@@ -340,6 +385,7 @@ static GtkWidget *print_page_new()
prefs->pcmd = gtk_entry_new ();
gtk_box_pack_start(GTK_BOX(hbox), prefs->pcmd, TRUE, TRUE, 0);
gtk_widget_show (prefs->pcmd);
/* End Of Print Command */
return main_vbox;
}
......@@ -917,9 +963,9 @@ void gE_prefs_dialog(GtkWidget *widget, gpointer cbdata)
window_page_new(), label);
/* Print Settings */
label = gtk_label_new (_("Print"));
label = gtk_label_new (_("Document"));
gtk_notebook_append_page ( GTK_NOTEBOOK( (prefs->pbox)->notebook),
print_page_new(), label);
doc_page_new(), label);
/* Font Settings */
label = gtk_label_new (_("Font"));
......@@ -967,6 +1013,11 @@ void gE_prefs_dialog(GtkWidget *widget, gpointer cbdata)
GTK_SIGNAL_FUNC (properties_modified), prefs->pbox);
gtk_signal_connect (GTK_OBJECT (prefs->DButton1), "toggled",
GTK_SIGNAL_FUNC (properties_modified), prefs->pbox);
gtk_signal_connect (GTK_OBJECT (prefs->DButton2), "toggled",
GTK_SIGNAL_FUNC (properties_modified), prefs->pbox);
gtk_widget_show_all (GTK_WIDGET (prefs->pbox));
......
......@@ -211,8 +211,8 @@ int main (int argc, char **argv)
use_fontset = TRUE;
gtk_widget_destroy(dummy_widget);
g_slist_foreach(launch_plugins, launch_plugin, NULL);
g_slist_free(launch_plugins);
/* g_slist_foreach(launch_plugins, launch_plugin, NULL);
*/ g_slist_free(launch_plugins);
args = poptGetArgs(ctx);
......@@ -246,12 +246,11 @@ int main (int argc, char **argv)
gnome_mdi_set_child_menu_path (mdi, GNOME_MENU_FILE_STRING);
gnome_mdi_set_child_list_path (mdi, GNOME_MENU_FILES_PATH);
/* gnome_mdi_set_mode (mdi, mdiMode); */
gnome_mdi_set_mode (mdi, GNOME_MDI_NOTEBOOK);
/*window = gE_window_new();
data->window = window;*/
window = g_malloc (sizeof (gE_window));
data->window = window;
window = g_malloc (sizeof (gE_window)); */
/* Init plugins... */
plugins = NULL;
......@@ -267,20 +266,22 @@ int main (int argc, char **argv)
/* connect signals -- FIXME -- We'll do the rest later */
gtk_signal_connect(GTK_OBJECT(mdi), "remove_child", GTK_SIGNAL_FUNC(remove_doc_cb), NULL);
gtk_signal_connect(GTK_OBJECT(mdi), "destroy", GTK_SIGNAL_FUNC(file_quit_cb), NULL);
gtk_signal_connect(GTK_OBJECT(mdi), "view_changed", GTK_SIGNAL_FUNC(view_changed_cb), NULL);
/* gtk_signal_connect(GTK_OBJECT(mdi), "view_changed", GTK_SIGNAL_FUNC(view_changed_cb), NULL);*/
gtk_signal_connect(GTK_OBJECT(mdi), "child_changed", GTK_SIGNAL_FUNC(child_switch), NULL);
gtk_signal_connect(GTK_OBJECT(mdi), "app_created", GTK_SIGNAL_FUNC(gE_window_new), NULL);
gtk_signal_connect(GTK_OBJECT(mdi), "add_view", GTK_SIGNAL_FUNC(add_view_cb), NULL);
gtk_signal_connect(GTK_OBJECT(mdi), "add_child", GTK_SIGNAL_FUNC(add_child_cb), NULL);
gE_get_settings();
/* gnome_mdi_set_mode (mdi, mdiMode); */
gnome_mdi_set_mode (mdi, GNOME_MDI_NOTEBOOK);
gnome_mdi_open_toplevel(mdi);
if (file_list){
if (mdi->active_child == NULL)
return;
return 1;
gnome_mdi_remove_child (mdi, mdi->active_child, FALSE);
......
......@@ -67,6 +67,7 @@ void
doc_changed_cb(GtkWidget *w, gpointer cbdata)
{
gchar MOD_label[255];
gchar *str;
gE_document *doc = (gE_document *) cbdata;
......@@ -74,9 +75,19 @@ gchar MOD_label[255];
gtk_signal_disconnect (GTK_OBJECT(doc->text), (gint) doc->changed_id);
doc->changed_id = FALSE;
sprintf(MOD_label, "*%s", GNOME_MDI_CHILD(doc)->name);
str = g_malloc (strlen (GNOME_MDI_CHILD(doc)->name) + 2);
sprintf(str, "*%s", GNOME_MDI_CHILD(doc)->name);
/*gtk_label_set(GTK_LABEL(doc->tab_label), MOD_label);*/
gnome_mdi_child_set_name (GNOME_MDI_CHILD (doc), MOD_label);
gnome_mdi_child_set_name (GNOME_MDI_CHILD (doc), str);
g_free (str);
str = g_malloc0 (strlen (GEDIT_ID) +
strlen (GNOME_MDI_CHILD (gE_document_current())->name) + 4);
sprintf (str, "%s - %s", GNOME_MDI_CHILD (gE_document_current())->name, GEDIT_ID);
gtk_window_set_title(GTK_WINDOW(mdi->active_window), str);
g_free(str);
}
......@@ -719,7 +730,16 @@ file_close_cb(GtkWidget *widget, gpointer cbdata)
if (mdi->active_child == NULL)
return;
gnome_mdi_remove_child (mdi, mdi->active_child, FALSE);
if (gnome_mdi_remove_child (mdi, mdi->active_child, FALSE))
{
if (mdi->active_child == NULL)
{
if (!settings->close_doc)
gE_document_new ();
else
g_print ("hola!\n");
}
}
}
......
......@@ -75,7 +75,7 @@ static char *lastmsg = NULL;
static gint msgbar_timeout_id;
/*gE_window */
void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
void gE_window_new(GnomeMDI *mdi, GnomeApp *app)
{
/*GnomeUIInfo * gedit_menu;
gE_window *w;*/
......@@ -92,13 +92,13 @@ void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
/* various initializations */
/*w = g_malloc0(sizeof(gE_window));*/
settings->auto_indent = TRUE;
/* settings->auto_indent = TRUE;
settings->show_tabs = TRUE;
settings->splitscreen = FALSE;
settings->show_status = TRUE;
settings->have_toolbar = TRUE;
*/
ptr = g_new(int, 1);
*ptr = ++last_assigned_integer;
g_hash_table_insert (win_int_to_pointer, ptr, app);
......@@ -159,8 +159,8 @@ void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
gE_document_new ();
gE_set_menu_toggle_states();
/* gE_set_menu_toggle_states();*/
g_list_foreach(plugins, (GFunc) add_plugins_to_window, GNOME_APP(app));
settings->num_recent = 0;
......@@ -174,6 +174,9 @@ void gE_window_new(GnomeMDI *mdi, GtkWidget *app)
gtk_signal_connect (GTK_OBJECT (app),
"drag_data_received",
GTK_SIGNAL_FUNC (filenames_dropped), NULL);
gnome_app_install_menu_hints(app, gnome_mdi_get_menubar_info(app));
} /* gE_window_new */
......
......@@ -39,7 +39,7 @@ extern GtkWidget *col_label;
extern void gE_window_set_auto_indent (gint auto_indent);
extern void gE_window_set_status_bar (gint show_status);
extern void gE_window_new(GnomeMDI *mdi, GtkWidget *app);
extern void gE_window_new(GnomeMDI *mdi, GnomeApp *app);
/* gE_document_new : relocated to gE_mdi.[ch] */
/* gE_document_new_with_file : relocated to gE_mdi.[ch] */
/* gE_document_current: relocated to gE_mdi.[ch] */
......
......@@ -195,6 +195,7 @@ gE_file_save(gE_document *doc, gchar *fname)
{
FILE *fp;
gchar *title;
gchar *tmpstr;
/* FIXME: not sure what to do with all the gE_window refs..
i'll comment them out for now.. */
......@@ -208,29 +209,39 @@ gE_file_save(gE_document *doc, gchar *fname)
}
gtk_text_thaw (GTK_TEXT(doc->text));
if (fputs (gtk_editable_get_chars (GTK_EDITABLE (doc->text), 0,
gtk_text_get_length (GTK_TEXT (doc->text))), fp) == EOF)
tmpstr = gtk_editable_get_chars (GTK_EDITABLE (doc->text), 0,
gtk_text_get_length (GTK_TEXT (doc->text)));
if (fputs (tmpstr, fp) == EOF)
{
perror("Error saving file");
fclose(fp);
g_free (tmpstr);
return 1;
}
g_free (tmpstr);
if (fclose(fp) != 0)
{
perror("Error saving file");
return 1;
}
fflush(fp);
fclose(fp);
if (doc->filename != fname)
{
g_free(doc->filename);
doc->filename = g_malloc0 (strlen (fname) + 1);
doc->filename = g_strdup(fname);
}
doc->changed = FALSE;
gnome_mdi_child_set_name (GNOME_MDI_CHILD (doc), g_basename(doc->filename));
tmpstr = g_malloc0 (strlen (GEDIT_ID) +
strlen (GNOME_MDI_CHILD (gE_document_current())->name) + 4);
sprintf (tmpstr, "%s - %s",
GNOME_MDI_CHILD (gE_document_current())->name,
GEDIT_ID);
gtk_window_set_title(GTK_WINDOW(mdi->active_window), tmpstr);
g_free(tmpstr);
if (!doc->changed_id)
doc->changed_id = gtk_signal_connect (GTK_OBJECT(doc->text), "changed",
GTK_SIGNAL_FUNC(doc_changed_cb),doc);
......
......@@ -302,6 +302,7 @@ GTK_SIGNAL_FUNC(gE_document_popup_cb), GTK_OBJECT((gE_window *)(mdi->active_wind
gtk_widget_grab_focus(doc->text);
/*return vpaned;*/
return vpaned;
}
......@@ -311,6 +312,9 @@ static void gE_document_destroy (GtkObject *obj)
doc = GE_DOCUMENT(obj);
if (doc->filename)
g_free (doc->filename);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy)(GTK_OBJECT (doc));
}
......@@ -509,7 +513,7 @@ gint remove_doc_cb (GnomeMDI *mdi, gE_document *doc)
gnome_dialog_set_default (GNOME_DIALOG (msgbox), 2);
ret = gnome_dialog_run_and_close (GNOME_DIALOG (msgbox));
/* switch (ret)
switch (ret)
{
case 0:
file_save_cb (NULL, data);
......@@ -518,17 +522,17 @@ gint remove_doc_cb (GnomeMDI *mdi, gE_document *doc)
return TRUE;
default:
return FALSE;
}*/
if (ret == 0)
}
/* if (ret == 0)
{
/*file_save_cb (NULL, data);*/