ds_destroy (&file_name);
execute_syntax (sss);
-
- psppire_window_set_unsaved (PSPPIRE_WINDOW (de), FALSE);
}
static void
set_unsaved (gpointer w)
{
- psppire_window_set_unsaved (PSPPIRE_WINDOW (w), TRUE);
+ psppire_window_set_unsaved (PSPPIRE_WINDOW (w));
}
static void
static void
on_modified_changed (GtkTextBuffer *buffer, PsppireWindow *window)
{
- psppire_window_set_unsaved (window, gtk_text_buffer_get_modified (buffer));
+ if (gtk_text_buffer_get_modified (buffer))
+ psppire_window_set_unsaved (window);
}
-
extern struct source_stream *the_source_stream ;
static void
window->basename ? window->basename : "",
mdash, window->description);
- if ( window->unsaved)
+ if (window->unsaved)
g_string_prepend_c (title, '*');
gtk_window_set_title (GTK_WINDOW (window), title->str);
}
void
-psppire_window_set_unsaved (PsppireWindow *w, gboolean unsaved)
+psppire_window_set_unsaved (PsppireWindow *w)
{
- w->unsaved = unsaved;
+ w->unsaved = TRUE;
psppire_window_set_title (w);
}
g_return_val_if_fail (i->load, FALSE);
- ok = i->load (w, file);
+ ok = i->load (w, file);
if ( ok )
- add_most_recent (file, the_recent_mgr);
+ {
+ add_most_recent (file, the_recent_mgr);
+ w->unsaved = FALSE;
+ }
else
delete_recent (file, the_recent_mgr);
- psppire_window_set_unsaved (w, FALSE);
+ psppire_window_set_title (w);
return ok;
}
void psppire_window_minimise_all (void);
-void psppire_window_set_unsaved (PsppireWindow *, gboolean );
+void psppire_window_set_unsaved (PsppireWindow *);
gboolean psppire_window_get_unsaved (PsppireWindow *);