changeset 19139:2d0925800d72

Made the display of files for sound events cleaner
author Eric Polino <aluink@pidgin.im>
date Fri, 06 Jul 2007 23:28:24 +0000
parents dd115c8f0880
children 7a5025b8698c
files finch/gntsound.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntsound.c	Fri Jul 06 04:16:40 2007 +0000
+++ b/finch/gntsound.c	Fri Jul 06 23:28:24 2007 +0000
@@ -600,10 +600,13 @@
 {
 	GntFileSel *sel = GNT_FILE_SEL(data);
 	const char * file = gnt_file_sel_get_selected_file(sel);
-	FinchSoundEvent * event = &sounds[GPOINTER_TO_INT(gnt_tree_get_selection_data(GNT_TREE(pref_dialog->events)))];
+	gpointer key = gnt_tree_get_selection_data(GNT_TREE(pref_dialog->events));
+	FinchSoundEvent * event = &sounds[GPOINTER_TO_INT(key)];
 
 	g_free(event->file);
 	event->file = g_strdup(file);
+
+	gnt_tree_change_text(GNT_TREE(pref_dialog->events),key,1,g_path_get_basename(file));
 	
 	gnt_widget_destroy(GNT_WIDGET(data));
 }
@@ -639,7 +642,7 @@
 	FinchSoundEvent * event = &sounds[GPOINTER_TO_INT(key)];
 	g_free(event->file);
 	event->file = NULL;
-	gnt_tree_change_text(GNT_TREE(pref_dialog->events),key,1,"");
+	gnt_tree_change_text(GNT_TREE(pref_dialog->events),key,1,"(default)");
 }
 
 static void
@@ -782,7 +785,7 @@
 		}
 
 		gnt_tree_add_choice(GNT_TREE(tree), GINT_TO_POINTER(i),
-			gnt_tree_create_row(GNT_TREE(tree),event->label,event->file[0] ? g_path_get_basename(event->file) : ""),
+			gnt_tree_create_row(GNT_TREE(tree),event->label,event->file[0] ? g_path_get_basename(event->file) : "(default)"),
 			NULL, NULL);
 		gnt_tree_set_choice(GNT_TREE(tree),GINT_TO_POINTER(i),purple_prefs_get_bool(boolpref));
 		g_free(boolpref);