changeset 625:547f4d35f56a

Unify xs_fileinfo with Aud-SID.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Sep 2007 02:27:01 +0000
parents 0bf32fa002bf
children 248aa59cb6a3
files src/xs_fileinfo.c src/xs_fileinfo.h
diffstat 2 files changed, 28 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/xs_fileinfo.c	Mon Sep 03 00:47:02 2007 +0000
+++ b/src/xs_fileinfo.c	Mon Sep 03 02:27:01 2007 +0000
@@ -130,9 +130,11 @@
 
 	/* Freeze text-widget and delete the old text */
 	tmpText = LUW("fileinfo_sub_info");
+#ifndef AUDACIOUS_PLUGIN
 	gtk_text_freeze(GTK_TEXT(tmpText));
 	gtk_text_set_point(GTK_TEXT(tmpText), 0);
 	gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText)));
+#endif
 
 	/* Get subtune information */
 	tmpIndex = g_list_index(GTK_MENU_SHELL(data)->children, gtk_menu_get_active(GTK_MENU(data)));
@@ -155,11 +157,17 @@
 	/* Get and set subtune information */
 	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? subName : "");
 	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? subAuthor : "");
+
+#ifdef AUDACIOUS_PLUGIN
+	gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))),
+		subInfo ? subInfo : "", -1);
+#else
 	gtk_text_insert(GTK_TEXT(tmpText), NULL, NULL, NULL,
 		subInfo ? subInfo : "", -1);
 
 	/* Un-freeze the widget */
 	gtk_text_thaw(GTK_TEXT(tmpText));
+#endif
 }
 
 
@@ -167,7 +175,7 @@
 {
 	GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu;
 	t_xs_tuneinfo *tmpInfo;
-	gchar tmpStr[256];
+	gchar tmpStr[256], *tmpFilename;
 	gint n;
 
 	/* Current implementation leaves old fileinfo window untouched if
@@ -191,9 +199,11 @@
 		gdk_window_raise(xs_fileinfowin->window);
 	else {
 		xs_fileinfowin = create_xs_fileinfowin();
+#ifndef AUDACIOUS_PLUGIN
 		gtk_signal_connect(GTK_OBJECT(
-			gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))), "value_changed",
-			GTK_SIGNAL_FUNC(xs_fileinfo_setsong), NULL);
+			gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))),
+			"value_changed", GTK_SIGNAL_FUNC(xs_fileinfo_setsong), NULL);
+#endif
 	}
 
 	/* Delete current items */
@@ -205,7 +215,9 @@
 
 
 	/* Set the generic song information */
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), pcFilename);
+	tmpFilename = XS_CS_FILENAME(pcFilename);
+	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename);
+	g_free(tmpFilename);
 	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName);
 	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer);
 	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright);
@@ -215,8 +227,13 @@
 	tmpMenuItem = gtk_menu_item_new_with_label(_("General info"));
 	gtk_widget_show(tmpMenuItem);
 	gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
+#ifdef AUDACIOUS_PLUGIN
+	g_signal_connect(G_OBJECT(tmpMenuItem), "activate",
+		G_CALLBACK(xs_fileinfo_subtune), tmpMenu);
+#else
 	gtk_signal_connect(GTK_OBJECT(tmpMenuItem), "activate",
 		GTK_SIGNAL_FUNC(xs_fileinfo_subtune), tmpMenu);
+#endif
 
 	/* Other menu items */
 	for (n = 1; n <= tmpInfo->nsubTunes; n++) {
@@ -240,8 +257,13 @@
 		tmpMenuItem = gtk_menu_item_new_with_label(tmpStr);
 		gtk_widget_show(tmpMenuItem);
 		gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
+#ifdef AUDACIOUS_PLUGIN
+		g_signal_connect(G_OBJECT(tmpMenuItem), "activate",
+			G_CALLBACK(xs_fileinfo_subtune), tmpMenu);
+#else
 		gtk_signal_connect(GTK_OBJECT(tmpMenuItem), "activate",
 			GTK_SIGNAL_FUNC(xs_fileinfo_subtune), tmpMenu);
+#endif
 	}
 
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(tmpOptionMenu), tmpMenu);
--- a/src/xs_fileinfo.h	Mon Sep 03 00:47:02 2007 +0000
+++ b/src/xs_fileinfo.h	Mon Sep 03 02:27:01 2007 +0000
@@ -9,7 +9,9 @@
 
 gint	xs_stil_init(void);
 void	xs_stil_close(void);
+#ifndef AUDACIOUS_PLUGIN
 void	xs_fileinfo_update(void);
+#endif
 void	xs_fileinfo(gchar *);
 
 #ifdef __cplusplus