changeset 887:a8fb5974c3a9 trunk

[svn] * Skin thumbnails are refreshable!
author nhjm449
date Sun, 26 Mar 2006 13:51:07 -0800
parents 5a94062b9393
children 053b35fd1f3e
files audacious/glade/prefswin.glade audacious/main.c audacious/main.h audacious/prefswin.c
diffstat 4 files changed, 93 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 			  <property name="yalign">0.5</property>
 			  <property name="xscale">1</property>
 			  <property name="yscale">1</property>
-			  <property name="top_padding">12</property>
+			  <property name="top_padding">6</property>
 			  <property name="bottom_padding">0</property>
 			  <property name="left_padding">12</property>
 			  <property name="right_padding">0</property>
@@ -1010,28 +1010,68 @@
 				  <property name="xscale">1</property>
 				  <property name="yscale">1</property>
 				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">12</property>
+				  <property name="bottom_padding">6</property>
 				  <property name="left_padding">0</property>
 				  <property name="right_padding">0</property>
 
 				  <child>
-				    <widget class="GtkLabel" id="label21">
+				    <widget class="GtkHBox" id="hbox5">
 				      <property name="visible">True</property>
-				      <property name="label" translatable="yes">&lt;b&gt;_Skin&lt;/b&gt;</property>
-				      <property name="use_underline">True</property>
-				      <property name="use_markup">True</property>
-				      <property name="justify">GTK_JUSTIFY_LEFT</property>
-				      <property name="wrap">False</property>
-				      <property name="selectable">False</property>
-				      <property name="xalign">0</property>
-				      <property name="yalign">0.5</property>
-				      <property name="xpad">0</property>
-				      <property name="ypad">0</property>
-				      <property name="mnemonic_widget">category_notebook</property>
-				      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-				      <property name="width_chars">-1</property>
-				      <property name="single_line_mode">False</property>
-				      <property name="angle">0</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">0</property>
+
+				      <child>
+					<widget class="GtkLabel" id="label21">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">&lt;b&gt;_Skin&lt;/b&gt;</property>
+					  <property name="use_underline">True</property>
+					  <property name="use_markup">True</property>
+					  <property name="justify">GTK_JUSTIFY_LEFT</property>
+					  <property name="wrap">False</property>
+					  <property name="selectable">False</property>
+					  <property name="xalign">0</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					  <property name="mnemonic_widget">category_notebook</property>
+					  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+					  <property name="width_chars">-1</property>
+					  <property name="single_line_mode">False</property>
+					  <property name="angle">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">True</property>
+					  <property name="fill">True</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkButton" id="skin_refresh_button">
+					  <property name="visible">True</property>
+					  <property name="tooltip" translatable="yes">Refresh skin list</property>
+					  <property name="relief">GTK_RELIEF_HALF</property>
+					  <property name="focus_on_click">False</property>
+					  <signal name="clicked" handler="on_skin_refresh_button_clicked" object="prefswin" last_modification_time="Sun, 26 Mar 2006 08:23:22 GMT"/>
+
+					  <child>
+					    <widget class="GtkImage" id="image3">
+					      <property name="visible">True</property>
+					      <property name="stock">gtk-refresh</property>
+					      <property name="icon_size">4</property>
+					      <property name="xalign">0.5</property>
+					      <property name="yalign">0.5</property>
+					      <property name="xpad">0</property>
+					      <property name="ypad">0</property>
+					    </widget>
+					  </child>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
 				    </widget>
 				  </child>
 				</widget>
--- 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)
--- 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 <sys/types.h>
+#include <sys/stat.h>
 
 #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
--- 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 <gtk/gtk.h>
 #include <glade/glade.h>
 #include <string.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 
 #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);