changeset 2640:66e128528d54 trunk

[svn] improve save/load playlist UI: - Load/Save List dialog remembers last used directory for playlist. - centering some error dialogs.
author yaz
date Thu, 22 Mar 2007 00:38:29 -0700
parents ed67025aeea5
children c06b07b17fb5
files ChangeLog src/audacious/build_stamp.c src/audacious/ui_playlist.c
diffstat 3 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 21 13:47:48 2007 -0700
+++ b/ChangeLog	Thu Mar 22 00:38:29 2007 -0700
@@ -1,3 +1,10 @@
+2007-03-21 20:47:48 +0000  Giacomo Lozito <james@develia.org>
+  revision [4296]
+  - give focus to jump_to_track window before filling it with information; this way user can start typing while huge playlists are loaded
+  trunk/src/audacious/ui_jumptotrack.c |   92 ++++++++++++++++++++---------------
+  1 file changed, 55 insertions(+), 37 deletions(-)
+
+
 2007-03-21 12:51:52 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4294]
   - reassign copyright to yaz.
--- a/src/audacious/build_stamp.c	Wed Mar 21 13:47:48 2007 -0700
+++ b/src/audacious/build_stamp.c	Thu Mar 22 00:38:29 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070321-4294";
+const gchar *svn_stamp = "20070321-4296";
--- a/src/audacious/ui_playlist.c	Wed Mar 21 13:47:48 2007 -0700
+++ b/src/audacious/ui_playlist.c	Thu Mar 22 00:38:29 2007 -0700
@@ -777,6 +777,7 @@
                                     _("Error writing playlist \"%s\": %s"),
                                     filename, strerror(errno));
 
+    gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */
     gtk_dialog_run(GTK_DIALOG(dialog));
     gtk_widget_destroy(dialog);
 }
@@ -825,6 +826,8 @@
                                            GTK_BUTTONS_OK,
                                            _(markup),
                                            filename);
+
+    gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */
     gtk_dialog_run(GTK_DIALOG(dialog));
     gtk_widget_destroy(dialog);
 }
@@ -858,7 +861,7 @@
 
     g_return_if_fail(filename != NULL);
 
-    str_replace_in(&cfg.playlist_path, g_strdup(filename));
+    str_replace_in(&cfg.playlist_path, g_path_get_dirname(filename));
 
     playlist_clear(playlist);
     mainwin_clear_song_info();
@@ -878,7 +881,9 @@
     g_return_val_if_fail(title != NULL, NULL);
 
     dialog = make_filebrowser(title, FALSE);
+    gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), cfg.playlist_path);
     gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename);
+    gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */
 
     if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
         filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
@@ -895,11 +900,11 @@
     Playlist *playlist = playlist_get_active();
 
     playlist->attribute =
-        gtk_toggle_button_get_active(button) & PLAYLIST_STATIC ? PLAYLIST_STATIC : PLAYLIST_PLAIN;
-    g_print("static_toggle: e: attribute = %d\n", playlist->attribute);
+        gtk_toggle_button_get_active(button) ?
+        playlist->attribute | PLAYLIST_STATIC :
+        playlist->attribute & ~PLAYLIST_STATIC;
 }
 
-
 static gchar *
 playlist_file_selection_save(const gchar * title,
                         const gchar * default_filename)
@@ -911,10 +916,11 @@
     g_return_val_if_fail(title != NULL, NULL);
 
     dialog = make_filebrowser(title, TRUE);
+    gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), cfg.playlist_path);
     gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename);
 
     /* static playlist */
-    toggle = gtk_check_button_new_with_label("Save as a Static Playlist");
+    toggle = gtk_check_button_new_with_label("Save as Static Playlist");
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
                                  (playlist_get_active()->attribute & PLAYLIST_STATIC) ? TRUE : FALSE);
     gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), toggle);