changeset 32807:fb8263d936e5

Add a conversation theme with no timestamps.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 28 May 2012 22:34:59 +0000
parents 0dd2cbee5b80
children b8cbd52e26b1 3d6528f36877
files pidgin/gtkprefs.c pidgin/themes/Contents/Resources/Variants/Default.css pidgin/themes/Contents/Resources/Variants/No-Timestamps.css pidgin/themes/Makefile.am
diffstat 4 files changed, 36 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Mon May 28 22:33:46 2012 +0000
+++ b/pidgin/gtkprefs.c	Mon May 28 22:34:59 2012 +0000
@@ -1107,7 +1107,10 @@
 
 	if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(prefs_conv_themes_combo_box), &iter)) {
 		gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1);
-		theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
+		if (name && *name)
+			theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
+		else
+			theme = PIDGIN_CONV_THEME(pidgin_conversations_get_default_theme());
 		g_free(name);
 
 		if (gtk_combo_box_get_active_iter(combo_box, &iter)) {
@@ -1126,6 +1129,10 @@
 
 	if (gtk_combo_box_get_active_iter(combo_box, &iter)) {
 		gchar *name = NULL;
+		PidginConvTheme *theme;
+		const char *current_variant;
+		const GList *variants;
+		gboolean unset = TRUE;
 
 		gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1);
 
@@ -1137,30 +1144,27 @@
 		/* Update list of variants */
 		gtk_list_store_clear(prefs_conv_variants);
 
-		if (name && *name) {
-			PidginConvTheme *theme;
-			const char *current_variant;
-			const GList *variants;
-			gboolean unset = TRUE;
-
+		if (name && *name)
 			theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
-			current_variant = pidgin_conversation_theme_get_variant(theme);
-
-			variants = pidgin_conversation_theme_get_variants(theme);
-			for (; variants && current_variant; variants = g_list_next(variants)) {
-				gtk_list_store_append(prefs_conv_variants, &iter);
-				gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1);
+		else
+			theme = PIDGIN_CONV_THEME(pidgin_conversations_get_default_theme());
+
+		current_variant = pidgin_conversation_theme_get_variant(theme);
+
+		variants = pidgin_conversation_theme_get_variants(theme);
+		for (; variants && current_variant; variants = g_list_next(variants)) {
+			gtk_list_store_append(prefs_conv_variants, &iter);
+			gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1);
 	
-				if (g_str_equal(variants->data, current_variant)) {
-					gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter);
-					unset = FALSE;
-				}
+			if (g_str_equal(variants->data, current_variant)) {
+				gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter);
+				unset = FALSE;
 			}
-
-			if (unset)
-				gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0);
 		}
 
+		if (unset)
+			gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0);
+
 		g_signal_handlers_unblock_by_func(prefs_conv_variants_combo_box,
 		                                  prefs_set_conv_variant_cb, NULL);
 		g_free(name);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/themes/Contents/Resources/Variants/Default.css	Mon May 28 22:34:59 2012 +0000
@@ -0,0 +1,2 @@
+@import ../main.css;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/themes/Contents/Resources/Variants/No-Timestamps.css	Mon May 28 22:34:59 2012 +0000
@@ -0,0 +1,8 @@
+@import ../main.css;
+
+.x-container .x-time,
+.x-status_container .x-time
+{
+	display: none;
+}
+
--- a/pidgin/themes/Makefile.am	Mon May 28 22:33:46 2012 +0000
+++ b/pidgin/themes/Makefile.am	Mon May 28 22:34:59 2012 +0000
@@ -8,7 +8,8 @@
                       Contents/Resources/Status.html \
                       Contents/Resources/main.css
 themevariantsdir = $(themeresourcesdir)/Variants
-themevariants_DATA =
+themevariants_DATA = Contents/Resources/Variants/Default.css \
+                     Contents/Resources/Variants/No-Timestamps.css
 
 EXTRA_DIST = \
 	$(themetemplate_DATA) \