Mercurial > audlegacy
changeset 4081:05140463a43e
install skin if user drag'n'drops it on mainwin
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 09 Dec 2007 14:41:10 +0100 |
parents | 1e754514065d |
children | 46f8c5fb6575 |
files | src/audacious/ui_main.c src/audacious/ui_preferences.c src/audacious/ui_preferences.h |
diffstat | 3 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/ui_main.c Sun Dec 09 13:56:34 2007 +0100 +++ b/src/audacious/ui_main.c Sun Dec 09 14:41:10 2007 +0100 @@ -1164,6 +1164,15 @@ return; } + /* perhaps make suffix check case-insensitive -- desowin */ + if (str_has_prefix_nocase((char*)selection_data->data, "file:///")) { + if (str_has_suffix_nocase((char*)selection_data->data, ".wsz\r\n") || + str_has_suffix_nocase((char*)selection_data->data, ".zip\r\n")) { + on_skin_view_drag_data_received(GTK_WIDGET(user_data), context, x, y, selection_data, info, time, NULL); + return; + } + } + playlist_clear(playlist); playlist_add_url(playlist, (gchar *) selection_data->data); playback_initiate();
--- a/src/audacious/ui_preferences.c Sun Dec 09 13:56:34 2007 +0100 +++ b/src/audacious/ui_preferences.c Sun Dec 09 14:41:10 2007 +0100 @@ -1000,7 +1000,7 @@ } } -static void +void on_skin_view_drag_data_received(GtkWidget * widget, GdkDragContext * context, gint x, gint y, @@ -1039,7 +1039,6 @@ cfg_db_set_string(db, NULL, "skin", path); cfg_db_close(db); } - } static void
--- a/src/audacious/ui_preferences.h Sun Dec 09 13:56:34 2007 +0100 +++ b/src/audacious/ui_preferences.h Sun Dec 09 14:41:10 2007 +0100 @@ -26,5 +26,10 @@ gint prefswin_page_new(GtkWidget *container, gchar *name, gchar *imgurl); void prefswin_page_destroy(GtkWidget *container); - +void on_skin_view_drag_data_received(GtkWidget * widget, + GdkDragContext * context, + gint x, gint y, + GtkSelectionData * selection_data, + guint info, guint time, + gpointer user_data); #endif