changeset 2019:d3a62e1075e2 trunk

[svn] Allow \ to / conversion to be switched on & off, by external contributor Chris Kehler <cbkehler@sympatico.ca>.
author chainsaw
date Wed, 29 Nov 2006 12:45:02 -0800
parents 58ea18909fe7
children d624b7efb96c
files ChangeLog audacious/glade/prefswin.glade audacious/main.c audacious/main.h audacious/playlist.c audacious/prefswin.c audacious/util.c
diffstat 7 files changed, 64 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Nov 28 12:06:18 2006 -0800
+++ b/ChangeLog	Wed Nov 29 12:45:02 2006 -0800
@@ -1,3 +1,11 @@
+2006-11-28 20:06:18 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [3031]
+  - MirBSD support from <bsiegert -at- gmx.de>
+  
+  trunk/configure.ac |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2006-11-28 02:12:56 +0000  William Pitcock <nenolod@nenolod.net>
   revision [3029]
   - avoid a race condition in produce_audio() where we have closed output, 
--- a/audacious/glade/prefswin.glade	Tue Nov 28 12:06:18 2006 -0800
+++ b/audacious/glade/prefswin.glade	Wed Nov 29 12:45:02 2006 -0800
@@ -1790,6 +1790,41 @@
 		      </child>
 
 		      <child>
+			<widget class="GtkAlignment" id="alignment88">
+			  <property name="visible">True</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xscale">1</property>
+			  <property name="yscale">1</property>
+			  <property name="top_padding">0</property>
+			  <property name="bottom_padding">0</property>
+			  <property name="left_padding">12</property>
+			  <property name="right_padding">0</property>
+
+			  <child>
+			    <widget class="GtkCheckButton" id="playlist_convert_slash">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Convert forward slash '\' to backslash '/'</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			      <signal name="realize" handler="on_playlist_convert_slash_realize" after="yes" last_modification_time="Sat, 03 Jul 2004 04:40:06 GMT"/>
+			      <signal name="toggled" handler="on_playlist_convert_slash_toggled" last_modification_time="Sat, 03 Jul 2004 04:40:16 GMT"/>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
 			<widget class="GtkAlignment" id="alignment15">
 			  <property name="visible">True</property>
 			  <property name="xalign">0.5</property>
--- a/audacious/main.c	Tue Nov 28 12:06:18 2006 -0800
+++ b/audacious/main.c	Wed Nov 29 12:45:02 2006 -0800
@@ -127,7 +127,7 @@
     FALSE,                      /* equalizer shaded */
     FALSE,                      /* allow multiple instances */
     TRUE,                       /* always show cb */
-    TRUE, TRUE,                 /* convert '_' and %20 */
+    TRUE, TRUE, TRUE,           /* convert '_', %20 and '\' */
     TRUE,                       /* show numbers in playlist */
     TRUE,                       /* snap windows */
     TRUE,                       /* save window positions */
@@ -257,6 +257,7 @@
     {"always_show_cb", &cfg.always_show_cb, TRUE},
     {"convert_underscore", &cfg.convert_underscore, TRUE},
     {"convert_twenty", &cfg.convert_twenty, TRUE},
+    {"convert_slash", &cfg.convert_slash, TRUE },
     {"show_numbers_in_pl", &cfg.show_numbers_in_pl, TRUE},
     {"show_separator_in_pl", &cfg.show_separator_in_pl, TRUE},
     {"snap_windows", &cfg.snap_windows, TRUE},
--- a/audacious/main.h	Tue Nov 28 12:06:18 2006 -0800
+++ b/audacious/main.h	Wed Nov 29 12:45:02 2006 -0800
@@ -62,7 +62,7 @@
     gboolean playlist_visible, equalizer_visible, player_visible;
     gboolean player_shaded, playlist_shaded, equalizer_shaded;
     gboolean allow_multiple_instances, always_show_cb;
-    gboolean convert_underscore, convert_twenty;
+    gboolean convert_underscore, convert_twenty, convert_slash;
     gboolean show_numbers_in_pl;
     gboolean snap_windows, save_window_position;
     gboolean dim_titlebar;
--- a/audacious/playlist.c	Tue Nov 28 12:06:18 2006 -0800
+++ b/audacious/playlist.c	Wed Nov 29 12:45:02 2006 -0800
@@ -1354,6 +1354,7 @@
 
     filename = g_strchug(g_strdup(filename_p));
 
+    if(cfg.convert_slash)
     while ((tmp = strchr(filename, '\\')) != NULL)
         *tmp = '/';
 
--- a/audacious/prefswin.c	Tue Nov 28 12:06:18 2006 -0800
+++ b/audacious/prefswin.c	Wed Nov 29 12:45:02 2006 -0800
@@ -1588,6 +1588,18 @@
     cfg.convert_twenty = gtk_toggle_button_get_active(button);
 }
 
+static void
+on_playlist_convert_slash_realize(GtkToggleButton * button, gpointer data)
+{
+    gtk_toggle_button_set_active(button, cfg.convert_slash);
+}
+
+static void
+on_playlist_convert_slash_toggled(GtkToggleButton * button, gpointer data)
+{
+    cfg.convert_slash = gtk_toggle_button_get_active(button);
+}
+
 #if 0
 static void
 on_playlist_update_clicked(GtkButton * button,
@@ -2169,6 +2181,8 @@
     FUNC_MAP_ENTRY(on_playlist_convert_twenty_toggled)
     FUNC_MAP_ENTRY(on_playlist_convert_underscore_realize)
     FUNC_MAP_ENTRY(on_playlist_convert_underscore_toggled)
+    FUNC_MAP_ENTRY(on_playlist_convert_slash_realize)
+    FUNC_MAP_ENTRY(on_playlist_convert_slash_toggled)
     FUNC_MAP_ENTRY(on_playlist_font_button_realize)
     FUNC_MAP_ENTRY(on_playlist_font_button_font_set)
     FUNC_MAP_ENTRY(on_playlist_no_advance_realize)
--- a/audacious/util.c	Tue Nov 28 12:06:18 2006 -0800
+++ b/audacious/util.c	Wed Nov 29 12:45:02 2006 -0800
@@ -1573,6 +1573,9 @@
 {
     g_return_val_if_fail(title != NULL, NULL);
 
+    if (cfg.convert_slash)
+	    str_replace_char(title, '\\', '/');
+    
     if (cfg.convert_underscore)
         str_replace_char(title, '_', ' ');