psppire_window_set_filename (PSPPIRE_WINDOW (de), file_name);
add_most_recent (file_name, the_recent_mgr);
}
+ else
+ {
+ delete_recent (file_name, the_recent_mgr);
+ }
psppire_window_set_unsaved (PSPPIRE_WINDOW (de), FALSE);
}
G_CALLBACK (regression_dialog), de);
}
- {
+ {
GtkUIManager *uim = GTK_UI_MANAGER (get_object_assert (de->builder, "uimanager1", GTK_TYPE_UI_MANAGER));
GtkWidget *recent_data =
gtk_recent_filter_add_pattern (filter, "*.por");
gtk_recent_filter_add_pattern (filter, "*.POR");
+ gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu_data), GTK_RECENT_SORT_MRU);
+
gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu_data), filter);
}
gtk_recent_filter_add_pattern (filter, "*.sps");
gtk_recent_filter_add_pattern (filter, "*.SPS");
+ gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu_files), GTK_RECENT_SORT_MRU);
+
gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu_files), filter);
}
g_free (uri);
}
+
+
+/*
+ If FILE_NAME exists in the recent list, then delete it.
+ */
+void
+delete_recent (const char *file_name, GtkRecentManager *rm)
+{
+ gchar *uri = g_filename_to_uri (file_name, NULL, NULL);
+
+ if ( uri )
+ gtk_recent_manager_remove_item (rm, uri, NULL);
+
+ g_free (uri);
+
+}
+
void psppire_window_save (PsppireWindow *w);
void add_most_recent (const char *file_name, GtkRecentManager *rm);
+void delete_recent (const char *file_name, GtkRecentManager *rm);
G_END_DECLS