soc.2009.webkitmessageview: 34c917ab: Show only the MessageStyle name and not ...

tdrhq at soc.pidgin.im tdrhq at soc.pidgin.im
Tue Aug 25 12:02:06 EDT 2009


-----------------------------------------------------------------
Revision: 34c917abd26400c0f1690206edc0c898923049c4
Ancestor: 6a5217c2b7f38eb25279ec56d99e3db2313da34a
Author: tdrhq at soc.pidgin.im
Date: 2009-08-10T23:51:12
Branch: im.pidgin.soc.2009.webkitmessageview
URL: http://d.pidgin.im/viewmtn/revision/info/34c917abd26400c0f1690206edc0c898923049c4

Modified files:
        pidgin/plugins/adiumthemes/webkit.c

ChangeLog: 

Show only the MessageStyle name and not the entire path.

-------------- next part --------------
============================================================
--- pidgin/plugins/adiumthemes/webkit.c	8b5d06bc7ebe273df678d1bb2c97a42a639c632d
+++ pidgin/plugins/adiumthemes/webkit.c	e0484b10ce64271b61c24479786d5afe7dbff105
@@ -810,9 +810,22 @@ style_changed (GtkWidget* combobox, gpoi
 {
 	char *name = gtk_combo_box_get_active_text (GTK_COMBO_BOX(combobox));
 	GtkWidget *dialog;
+	GList *styles = get_style_directory_list (), *iter;
 
+	/* find the full path for this name, I wish I could store this info in the combobox itself. :( */
+	for (iter = styles; iter; iter = g_list_next(iter)) {
+		char* basename = g_path_get_basename (iter->data);
+		if (g_str_equal (basename, name)) {
+			g_free (basename);
+			break;
+		}
+		g_free (basename);
+	}
+
+	g_assert (iter);
+	g_free (name);
 	g_free (cur_style_dir);
-	cur_style_dir = name;
+	cur_style_dir = g_strdup (iter->data);;
 
 	/* inform the user that existing conversations haven't changed */
 	dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "The style for existing conversations have not been changed. Please close and re-open the conversation for the changes to take effect.");
@@ -832,7 +845,10 @@ get_style_config_frame ()
 		PidginMessageStyle *style = pidgin_message_style_load (iter->data);
 		
 		if (style) {
-			gtk_combo_box_append_text (GTK_COMBO_BOX(combobox), iter->data);
+			char *text = g_path_get_basename (iter->data);
+			gtk_combo_box_append_text (GTK_COMBO_BOX(combobox), text);
+			g_free (text);
+
 			if (g_str_equal (iter->data, cur_style_dir))
 				selected = index;
 			index++;


More information about the Commits mailing list