# HG changeset patch # User Matti Hamalainen # Date 1188786421 0 # Node ID 547f4d35f56a2b8b4ad45e68e792f3fd6117d6f5 # Parent 0bf32fa002bf69a60ce6cf83dac79c1f47490a45 Unify xs_fileinfo with Aud-SID. diff -r 0bf32fa002bf -r 547f4d35f56a src/xs_fileinfo.c --- 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); diff -r 0bf32fa002bf -r 547f4d35f56a src/xs_fileinfo.h --- 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