fill filename when saving
authorColin Leroy <colin@colino.net>
Thu, 1 Jul 2004 10:27:17 +0000 (10:27 +0000)
committerColin Leroy <colin@colino.net>
Thu, 1 Jul 2004 10:27:17 +0000 (10:27 +0000)
ChangeLog-gtk2.claws
configure.ac
src/gtk/filesel.c

index 932c8d19ebc295fa9a24c539b255a036d7e3c48e..d2b27da9873be14fa67e7d3a73cd1ecf84c67c5a 100644 (file)
@@ -1,9 +1,14 @@
+2004-07-01 [colin]     0.9.11cvs17.4
+
+       * src/gtk/filesel.c
+               Fill filename when saving
+               
 2004-06-27 [colin]     0.9.11cvs17.3
 
        * src/gtk/filesel.[ch]
                Use the new GTK file selector
                Update prototype to match the reality: multiple file
-               selection is open-only
+               selection is open-only          
        * src/compose.c
                Match the new prototypes        
        * configure.ac
index 6d7728a8f7b64cafcd8ed05dc1b82256fd4e968f..2e1d61cc852eae118d34f03179e1ad04c6cdae8b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=17.3
+EXTRA_VERSION=17.4
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 85535c4a4605d0990b6e6d2e909a417a62298be2..e0c7df5ccd42770cc12e3e64bf8e6a78984516d3 100644 (file)
@@ -60,8 +60,21 @@ static GList *filesel_create(const gchar *title, const gchar *path, gboolean mul
 
        gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(chooser), multiple_files);
 
-       if (path)
-               gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(chooser), path);
+       if (path) {
+               char *filename = NULL;
+               char *realpath = strdup(path);
+               if ((filename = strrchr(path,'/')) != NULL) {
+                       filename+=sizeof(char);
+                       *(strrchr(realpath, '/')+sizeof(char)) = '\0';
+               } else {
+                       filename = (char *) path;
+                       free(realpath); 
+                       realpath = strdup(get_home_dir());
+               }
+               gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(chooser), realpath);
+               gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(chooser), filename);
+               free(realpath);
+       }
 
        if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_OK) 
                slist = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (chooser));