X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fsyntax-editor.c;h=5479c2366cbdbea8cfc87eb6e5a09faff1bba12f;hb=d908f52b818f4fdf2ab23797756812ec2986bd2b;hp=024181e6a910fca42083bb3e9d987b14958ed1c6;hpb=732b6a86124e89e24d685ed785d2df55728eb01b;p=pspp-builds.git diff --git a/src/ui/gui/syntax-editor.c b/src/ui/gui/syntax-editor.c index 024181e6..5479c236 100644 --- a/src/ui/gui/syntax-editor.c +++ b/src/ui/gui/syntax-editor.c @@ -78,7 +78,7 @@ save_if_modified (struct syntax_editor *se) GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _("Save contents of syntax editor to %s?"), - e->name + e->name ); gtk_dialog_add_button (GTK_DIALOG (dialog), @@ -466,7 +466,7 @@ save_editor_to_file (struct syntax_editor *se, /* Loads the buffer from the file called FILENAME */ -static gboolean +gboolean load_editor_from_file (struct syntax_editor *se, const gchar *filename, GError **err) @@ -492,6 +492,9 @@ load_editor_from_file (struct syntax_editor *se, gtk_text_buffer_insert (buffer, &iter, text, -1); + + + window_set_name_from_filename ((struct editor_window *)se, filename); gtk_text_buffer_set_modified (buffer, FALSE); @@ -536,6 +539,19 @@ open_syntax_window (GtkMenuItem *menuitem, gpointer parent) window_create (WINDOW_SYNTAX, file_name); load_editor_from_file (se, file_name, NULL); + +#if RECENT_LISTS_AVAILABLE + { + GtkRecentManager *manager = gtk_recent_manager_get_default(); + gchar *uri = g_filename_to_uri (file_name, NULL, NULL); + + if ( ! gtk_recent_manager_add_item (manager, uri)) + g_warning ("Could not add item %s to recent list\n",uri); + + g_free (uri); + } +#endif + } gtk_widget_destroy (dialog);