[gnome-latex: 63/205] Recent manager: save as



commit 3648cbb6e2aa90d544624a017ebd19c6d8eaed07
Author: Sébastien Wilmet <sebastien wilmet gmail com>
Date:   Mon Sep 14 19:38:21 2009 +0200

    Recent manager: save as
    
    Now, when we save a document to an other name, the file is added to the
    recent manager, so the file is accessible in File -> Open Recent.

 TODO            | 4 ++--
 src/callbacks.c | 9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/TODO b/TODO
index f91caaa..7f2b655 100644
--- a/TODO
+++ b/TODO
@@ -22,8 +22,8 @@ Wed Sep 9, 2009 to Wed Sep 16, 2009
        - lists: itemize, enumerate, description
        - various: label, ref, pageref, cite, footnote, index
 
-[-] open recent
-       - when "save as", add the file to the recent manager
+[x] open recent
+       x when "save as", add the file to the recent manager
 
 [-] symbol tables
        - the categories must take the minimum place but the presentation must be nice
diff --git a/src/callbacks.c b/src/callbacks.c
index 0a724f6..efe97e7 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -1150,7 +1150,14 @@ save_as_dialog (void)
        );
 
        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
-               latexila.active_doc->path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+       {
+               latexila.active_doc->path = gtk_file_chooser_get_filename (
+                               GTK_FILE_CHOOSER (dialog));
+               gchar *uri = gtk_file_chooser_get_uri ( GTK_FILE_CHOOSER (dialog));
+
+               GtkRecentManager *manager = gtk_recent_manager_get_default ();
+               gtk_recent_manager_add_item (manager, uri);
+       }
 
        gtk_widget_destroy (dialog);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]