# HG changeset patch # User nhjm449 # Date 1143409867 28800 # Node ID a8fb5974c3a94ec6398eed2fbebbcd98a98c64c2 # Parent 5a94062b9393ef347efa015558425297abe70c3e [svn] * Skin thumbnails are refreshable! diff -r 5a94062b9393 -r a8fb5974c3a9 audacious/glade/prefswin.glade --- a/audacious/glade/prefswin.glade Sat Mar 25 23:14:27 2006 -0800 +++ b/audacious/glade/prefswin.glade Sun Mar 26 13:51:07 2006 -0800 @@ -991,7 +991,7 @@ 0.5 1 1 - 12 + 6 0 12 0 @@ -1010,28 +1010,68 @@ 1 1 0 - 12 + 6 0 0 - + True - <b>_Skin</b> - True - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - category_notebook - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + 0 + + + + True + <b>_Skin</b> + True + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + category_notebook + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + Refresh skin list + GTK_RELIEF_HALF + False + + + + + True + gtk-refresh + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + diff -r 5a94062b9393 -r a8fb5974c3a9 audacious/main.c --- a/audacious/main.c Sat Mar 25 23:14:27 2006 -0800 +++ b/audacious/main.c Sun Mar 26 13:51:07 2006 -0800 @@ -369,7 +369,7 @@ return cfg.gentitle_format; } -static void +void make_directory(const gchar * path, mode_t mode) { if (mkdir(path, mode) == 0) diff -r 5a94062b9393 -r a8fb5974c3a9 audacious/main.h --- a/audacious/main.h Sat Mar 25 23:14:27 2006 -0800 +++ b/audacious/main.h Sun Mar 26 13:51:07 2006 -0800 @@ -26,6 +26,8 @@ #include "textbox.h" #include "vis.h" +#include +#include #define BMP_USER_PLUGIN_DIR_BASENAME "Plugins" #define BMP_SKIN_DIR_BASENAME "Skins" @@ -140,6 +142,7 @@ void bmp_config_save(void); void bmp_config_load(void); +void make_directory(const gchar * path, mode_t mode); void report_error(const gchar *error_text); #endif diff -r 5a94062b9393 -r a8fb5974c3a9 audacious/prefswin.c --- a/audacious/prefswin.c Sat Mar 25 23:14:27 2006 -0800 +++ b/audacious/prefswin.c Sun Mar 26 13:51:07 2006 -0800 @@ -25,6 +25,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include "glade.h" @@ -1435,6 +1443,23 @@ gpointer data) {} +static void +on_skin_refresh_button_clicked(GtkButton * button, + gpointer data) +{ + GladeXML *xml; + GtkWidget *widget; + + const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; + + del_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR]); + make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755); + + xml = prefswin_get_xml(); + + widget = glade_xml_get_widget(xml, "skin_view"); + skin_view_update(GTK_TREE_VIEW(widget)); +} static void prefswin_set_skin_update(gboolean state) @@ -1797,7 +1822,12 @@ G_CALLBACK(mainwin_drag_data_received), widget); - widget = glade_xml_get_widget(xml, "playlist_font_button"); + widget = glade_xml_get_widget(xml, "skin_refresh_button"); + g_signal_connect(widget, "clicked", + G_CALLBACK(on_skin_refresh_button_clicked), + NULL); + + widget = glade_xml_get_widget(xml, "playlist_font_button"); g_signal_connect(mainwin, "drag-data-received", G_CALLBACK(mainwin_drag_data_received1), widget);