changeset 4792:34b21e766f5e

Automated merge with ssh://hg.atheme.org//hg/audacious
author Jonathan Schleifer <js-audacious@webkeks.org>
date Thu, 02 Oct 2008 23:45:02 +0200
parents 7d2882c8a37a (diff) 06079e59fc4b (current diff)
children 7f318fa97ea3
files
diffstat 7 files changed, 14 insertions(+), 282 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/Makefile	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/Makefile	Thu Oct 02 23:45:02 2008 +0200
@@ -150,7 +150,7 @@
        ui/carbon-menubar.ui
 
 CLEAN = build_stamp.c libaudacious.exe.a
-EXT_DEPS = ../libguess/libguess.a ../libSAD/libSAD.so
+EXT_DEPS = ../libguess/libguess.a ../libSAD/${LIB_PREFIX}SAD${LIB_SUFFIX}
 
 ifeq ($(USE_EGGSM),yes)
 EXT_DEPS += ../libeggsmclient/libeggsmclient.a
--- a/src/audacious/audconfig.c	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/audconfig.c	Thu Oct 02 23:45:02 2008 +0200
@@ -151,7 +151,6 @@
     .filepopup_pixelsize = 150,        /* short side length of the picture in the filepopup */
     .filepopup_delay = 20,             /* delay until the filepopup comes up */
     .use_file_cover = FALSE,           /* use filename.jpg for coverart */
-    .use_xmms_style_fileselector = FALSE,
     .use_extension_probing = TRUE,
     .colorize_r = 255, .colorize_g = 255, .colorize_b = 255,
     .filepopup_showprogressbar = TRUE,
@@ -263,7 +262,6 @@
     {"show_filepopup_for_tuple", &cfg.show_filepopup_for_tuple, TRUE},
     {"recurse_for_cover", &cfg.recurse_for_cover, TRUE},
     {"use_file_cover", &cfg.use_file_cover, TRUE},
-    {"use_xmms_style_fileselector", &cfg.use_xmms_style_fileselector, TRUE},
     {"use_extension_probing", &cfg.use_extension_probing, TRUE},
     {"filepopup_showprogressbar", &cfg.filepopup_showprogressbar, TRUE},
     {"close_jtf_dialog", &cfg.close_jtf_dialog, TRUE},
--- a/src/audacious/audconfig.h	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/audconfig.h	Thu Oct 02 23:45:02 2008 +0200
@@ -108,7 +108,6 @@
     gint filepopup_pixelsize;
     gint filepopup_delay;
     gboolean use_file_cover;
-    gboolean use_xmms_style_fileselector;
     gboolean use_extension_probing;
     gint colorize_r; gint colorize_g; gint colorize_b;
     gboolean filepopup_showprogressbar;
--- a/src/audacious/playlist_container.c	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/playlist_container.c	Thu Oct 02 23:45:02 2008 +0200
@@ -51,7 +51,7 @@
 	for (node = registered_plcs; node != NULL; node = g_list_next(node)) {
 		plc = PLAYLIST_CONTAINER(node->data);
 
-		if (!g_strcasecmp(plc->ext, ext))
+		if (!g_ascii_strncasecmp(plc->ext, ext, strlen(ext)))
 			return plc;
 	}
 
--- a/src/audacious/strings.c	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/strings.c	Thu Oct 02 23:45:02 2008 +0200
@@ -327,11 +327,9 @@
 		gchar **symbols;
 		nsymbols = backtrace(addrbuf, nsymmax);
 		symbols = backtrace_symbols(addrbuf, nsymbols);
-#endif
 
 		fprintf(stderr, "WARNING! String '%s' was not UTF-8! Backtrace (%d):\n", str, nsymbols);
 
-#ifdef HAVE_EXECINFO
 		for (i = 0; i < nsymbols; i++)
 			fprintf(stderr, "#%d > %s\n", i, symbols[i]);
 		
--- a/src/audacious/ui_fileopener.c	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/ui_fileopener.c	Thu Oct 02 23:45:02 2008 +0200
@@ -108,7 +108,7 @@
 }
 
 static void
-util_run_filebrowser_gtk2style(gboolean play_button, gboolean show)
+run_filebrowser_gtk2style(gboolean play_button, gboolean show)
 {
     static GtkWidget *window = NULL;
     GtkWidget *vbox, *hbox, *bbox;
@@ -118,8 +118,8 @@
     gchar *window_title, *toggle_text;
     gpointer action_stock, storage;
 
-    if(!show) {
-        if(window){
+    if (!show) {
+        if (window){
             gtk_widget_hide(window);
             return;
         }
@@ -127,12 +127,12 @@
             return;
     }
     else {
-        if(window) {
+        if (window) {
             gtk_window_present(GTK_WINDOW(window)); /* raise filebrowser */
             return;
         }
     }
-    
+
     window_title = play_button ? _("Open Files") : _("Add Files");
     toggle_text = play_button ?
         _("Close dialog on Open") : _("Close dialog on Add");
@@ -191,270 +191,14 @@
                      G_CALLBACK(gtk_widget_destroyed), &window);
 
     g_signal_connect(window, "key_press_event",
-		     G_CALLBACK(filebrowser_on_keypress),
-		     NULL);
+                     G_CALLBACK(filebrowser_on_keypress),
+                     NULL);
 
     gtk_widget_show_all(window);
 }
 
 /*
- * Derived from Beep Media Player 0.9.6.1.
- * Which is (C) 2003 - 2006 Milosz Derezynski &c
- *
- * Although I changed it quite a bit. -nenolod
- */
-static void filebrowser_changed_classic(GtkFileSelection * filesel)
-{
-    GList *list;
-    GList *node;
-    char *filename = (char *)
-    gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
-    GtkListStore *store;
-    GtkTreeIter iter;
-
-    if ((list = input_scan_dir(filename)) != NULL)
-    {
-        /*
-         * We enter a directory that has been "hijacked" by an
-         * input-plugin. This is used by the CDDA plugin
-         */
-        store =
-            GTK_LIST_STORE(gtk_tree_view_get_model
-                   (GTK_TREE_VIEW(filesel->file_list)));
-        gtk_list_store_clear(store);
-
-        node = list;
-        while (node) {
-            gtk_list_store_append(store, &iter);
-            gtk_list_store_set(store, &iter, 0, node->data, -1);
-            g_free(node->data);
-            node = g_list_next(node);
-        }
-
-        g_list_free(list);
-    }
-}
-
-static void filebrowser_entry_changed_classic(GtkEditable * entry, gpointer data)
-{
-    filebrowser_changed_classic(GTK_FILE_SELECTION(data));
-}
-
-
-static gboolean
-util_filebrowser_is_dir_classic(GtkFileSelection * filesel)
-{
-    char *text;
-    struct stat buf;
-    gboolean retv = FALSE;
-
-    text = g_strdup(gtk_file_selection_get_filename(filesel));
-
-    if (stat(text, &buf) == 0 && S_ISDIR(buf.st_mode)) {
-    /* Selected directory */
-    int len = strlen(text);
-    if (len > 3 && !strcmp(text + len - 4, "/../")) {
-        if (len == 4)
-        /* At the root already */
-        *(text + len - 3) = '\0';
-        else {
-        char *ptr;
-        *(text + len - 4) = '\0';
-        ptr = strrchr(text, '/');
-        *(ptr + 1) = '\0';
-        }
-    } else if (len > 2 && !strcmp(text + len - 3, "/./"))
-        *(text + len - 2) = '\0';
-    gtk_file_selection_set_filename(filesel, text);
-    retv = TRUE;
-    }
-    g_free(text);
-    return retv;
-}
-
-static void filebrowser_add_files_classic(gchar ** files,
-                  GtkFileSelection * filesel)
-{
-    int ctr = 0;
-    char *ptr;
-    Playlist *playlist = playlist_get_active();
-
-
-    while (files[ctr] != NULL) {
-        gchar *filename = g_filename_to_uri((const gchar *) files[ctr++], NULL, NULL);
-        playlist_add(playlist, filename);
-        g_free(filename);
-    }
-    hook_call("playlist update", playlist);
-
-    gtk_label_get(GTK_LABEL(GTK_BIN(filesel->history_pulldown)->child),
-          &ptr);
-
-    /* This will give an extra slash if the current dir is the root. */
-    cfg.filesel_path = g_strconcat(ptr, "/", NULL);
-}
-
-static void filebrowser_ok_classic(GtkWidget * w, GtkWidget * filesel)
-{
-    gchar **files;
-
-    if (util_filebrowser_is_dir_classic(GTK_FILE_SELECTION(filesel)))
-    return;
-    files = gtk_file_selection_get_selections(GTK_FILE_SELECTION(filesel));
-    filebrowser_add_files_classic(files, GTK_FILE_SELECTION(filesel));
-    gtk_widget_destroy(filesel);
-}
-
-static void filebrowser_play_classic(GtkWidget * w, GtkWidget * filesel)
-{
-    gchar **files;
-
-    if (util_filebrowser_is_dir_classic
-    (GTK_FILE_SELECTION(GTK_FILE_SELECTION(filesel))))
-    return;
-    playlist_clear(playlist_get_active());
-    files = gtk_file_selection_get_selections(GTK_FILE_SELECTION(filesel));
-    filebrowser_add_files_classic(files, GTK_FILE_SELECTION(filesel));
-    gtk_widget_destroy(filesel);
-    playback_initiate();
-}
-
-static void filebrowser_add_selected_files_classic(GtkWidget * w, gpointer data)
-{
-    gchar **files;
-
-    GtkFileSelection *filesel = GTK_FILE_SELECTION(data);
-    files = gtk_file_selection_get_selections(filesel);
-
-    filebrowser_add_files_classic(files, filesel);
-    gtk_tree_selection_unselect_all(gtk_tree_view_get_selection
-                    (GTK_TREE_VIEW(filesel->file_list)));
-
-    gtk_entry_set_text(GTK_ENTRY(filesel->selection_entry), "");
-}
-
-static void filebrowser_add_all_files_classic(GtkWidget * w, gpointer data)
-{
-    gchar **files;
-    GtkFileSelection *filesel;
-
-    filesel = data;
-    gtk_tree_selection_select_all(gtk_tree_view_get_selection
-                  (GTK_TREE_VIEW(filesel->file_list)));
-    files = gtk_file_selection_get_selections(filesel);
-    filebrowser_add_files_classic(files, filesel);
-    gtk_tree_selection_unselect_all(gtk_tree_view_get_selection
-                    (GTK_TREE_VIEW(filesel->file_list)));
-    gtk_entry_set_text(GTK_ENTRY(filesel->selection_entry), "");
-}
-
-static void
-util_run_filebrowser_classic(gboolean play_button, gboolean show)
-{
-    static GtkWidget *dialog;
-    GtkWidget *button_add_selected, *button_add_all, *button_close,
-    *button_add;
-    char *title;
-
-    if (!show) {
-        if(dialog) {
-            gtk_widget_hide(dialog);
-            return;
-        }
-        else
-            return;
-    }
-    else {
-        if (dialog) {
-            gtk_window_present(GTK_WINDOW(dialog));
-            return;
-        }
-    }
-
-    if (play_button)
-    title = _("Play files");
-    else
-    title = _("Load files");
-
-    dialog = gtk_file_selection_new(title);
-
-    gtk_file_selection_set_select_multiple
-    (GTK_FILE_SELECTION(dialog), TRUE);
-
-    if (cfg.filesel_path)
-    gtk_file_selection_set_filename(GTK_FILE_SELECTION(dialog),
-                    cfg.filesel_path);
-
-    gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dialog));
-    gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
-
-    gtk_widget_hide(GTK_FILE_SELECTION(dialog)->ok_button);
-    gtk_widget_destroy(GTK_FILE_SELECTION(dialog)->cancel_button);
-
-    /*
-     * The mnemonics are quite unorthodox, but that should guarantee they're unique in any locale
-     * plus kinda easy to use
-     */
-    button_add_selected =
-    gtk_dialog_add_button(GTK_DIALOG(dialog), "Add selected",
-                  GTK_RESPONSE_NONE);
-    gtk_button_set_use_underline(GTK_BUTTON(button_add_selected), TRUE);
-    g_signal_connect(G_OBJECT(button_add_selected), "clicked",
-             G_CALLBACK(filebrowser_add_selected_files_classic), dialog);
-
-    button_add_all =
-    gtk_dialog_add_button(GTK_DIALOG(dialog), "Add all",
-                  GTK_RESPONSE_NONE);
-    gtk_button_set_use_underline(GTK_BUTTON(button_add_all), TRUE);
-    g_signal_connect(G_OBJECT(button_add_all), "clicked",
-             G_CALLBACK(filebrowser_add_all_files_classic), dialog);
-
-    if (play_button) {
-    button_add =
-        gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_MEDIA_PLAY,
-                  GTK_RESPONSE_NONE);
-    gtk_button_set_use_stock(GTK_BUTTON(button_add), TRUE);
-    g_signal_connect(G_OBJECT(button_add), "clicked",
-             G_CALLBACK(filebrowser_play_classic), dialog);
-    g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button),
-             "clicked", G_CALLBACK(filebrowser_play_classic), dialog);
-    } else {
-    button_add =
-        gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_ADD,
-                  GTK_RESPONSE_NONE);
-    gtk_button_set_use_stock(GTK_BUTTON(button_add), TRUE);
-    g_signal_connect(G_OBJECT(button_add), "clicked",
-             G_CALLBACK(filebrowser_ok_classic), dialog);
-    g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button),
-             "clicked", G_CALLBACK(filebrowser_ok_classic), dialog);
-    }
-
-    button_close =
-    gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE,
-                  GTK_RESPONSE_NONE);
-    gtk_button_set_use_stock(GTK_BUTTON(button_close), TRUE);
-    g_signal_connect_swapped(G_OBJECT(button_close), "clicked",
-                 G_CALLBACK(gtk_widget_destroy),
-                 G_OBJECT(dialog));
-
-    gtk_widget_set_size_request(dialog, 600, 450);
-    gtk_widget_realize(dialog);
-
-    g_signal_connect(G_OBJECT
-             (GTK_FILE_SELECTION(dialog)->history_pulldown),
-             "changed", G_CALLBACK(filebrowser_entry_changed_classic),
-             dialog);
-
-    g_signal_connect(G_OBJECT(dialog), "destroy",
-             G_CALLBACK(gtk_widget_destroyed), &dialog);
-
-    filebrowser_changed_classic(GTK_FILE_SELECTION(dialog));
-
-    gtk_widget_show(dialog);
-}
-
-/*
- * util_run_filebrowser(gboolean play_button)
+ * run_filebrowser(gboolean play_button)
  *
  * Inputs:
  *     - gboolean play_button
@@ -463,24 +207,15 @@
  *
  * Outputs:
  *     - none
- *
- * Side Effects:
- *     - either a GTK1 or a GTK2 fileselector is launched
  */
 void
 run_filebrowser(gboolean play_button)
 {
-    if (!cfg.use_xmms_style_fileselector)
-        util_run_filebrowser_gtk2style(play_button, TRUE);
-    else
-        util_run_filebrowser_classic(play_button, TRUE);
+    run_filebrowser_gtk2style(play_button, TRUE);
 }
 
 void
 hide_filebrowser(void)
 {
-    if (!cfg.use_xmms_style_fileselector)
-        util_run_filebrowser_gtk2style(FALSE, FALSE);
-    else
-        util_run_filebrowser_classic(FALSE, FALSE);
+    run_filebrowser_gtk2style(FALSE, FALSE);
 }
--- a/src/audacious/ui_legacy.c	Thu Oct 02 23:44:39 2008 +0200
+++ b/src/audacious/ui_legacy.c	Thu Oct 02 23:45:02 2008 +0200
@@ -132,6 +132,8 @@
 }
 
 #ifdef GDK_WINDOWING_QUARTZ
+#include "images/audacious_player.xpm"
+
 static void
 set_dock_icon(void)
 {