Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • attachment:pidgin_single_color.diff di InternetRete/Messaggistica/Pidgin/NickColorati

Allegato "pidgin_single_color.diff"

Scarica

   1 diff -urBb pidgin-2.6.6/pidgin/gtkconv.c pidgin-2.6.6-single-color/pidgin/gtkconv.c
   2 --- pidgin-2.6.6/pidgin/gtkconv.c	2010-02-16 10:34:06.000000000 +0100
   3 +++ pidgin-2.6.6-single-color/pidgin/gtkconv.c	2010-03-21 19:20:09.000000000 +0100
   4 @@ -4074,6 +4074,7 @@
   5  	gchar *tmp, *alias_key, *name, *alias;
   6  	int flags;
   7  	GdkColor *color = NULL;
   8 +    gboolean single_color = FALSE;
   9  
  10  	alias = cb->alias;
  11  	name  = cb->name;
  12 @@ -4083,6 +4084,7 @@
  13  	gtkconv = PIDGIN_CONVERSATION(conv);
  14  	gtkchat = gtkconv->u.chat;
  15  	gc      = purple_conversation_get_gc(conv);
  16 +    single_color = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/chat/single_color_receive_name");
  17  
  18  	if (!gc || !(prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)))
  19  		return;
  20 @@ -4104,15 +4106,19 @@
  21  		GtkTextTag *tag = gtk_text_tag_table_lookup(
  22  				gtk_text_buffer_get_tag_table(GTK_IMHTML(gtkconv->imhtml)->text_buffer),
  23  				"send-name");
  24 +        if (!single_color) {
  25  		g_object_get(tag, "foreground-gdk", &color, NULL);
  26 +        }
  27  	} else {
  28  		GtkTextTag *tag;
  29  		if ((tag = get_buddy_tag(conv, name, 0, FALSE)))
  30  			g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_NORMAL, NULL);
  31  		if ((tag = get_buddy_tag(conv, name, PURPLE_MESSAGE_NICK, FALSE)))
  32  			g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_NORMAL, NULL);
  33 +        if (!single_color) {
  34  		color = (GdkColor*)get_nick_color(gtkconv, name);
  35  	}
  36 +	}
  37  
  38  #if GTK_CHECK_VERSION(2,6,0)
  39  	gtk_list_store_insert_with_values(ls, &iter,
  40 @@ -4145,7 +4151,7 @@
  41  			-1);
  42  #endif
  43  
  44 -	if (is_me && color)
  45 +    if (!single_color && is_me && color)
  46  		gdk_color_free(color);
  47  	g_free(alias_key);
  48  }
  49 @@ -5687,6 +5693,7 @@
  50  	gchar *str;
  51  	gboolean highlight = (flag & PURPLE_MESSAGE_NICK);
  52  	GtkTextBuffer *buffer = GTK_IMHTML(gtkconv->imhtml)->text_buffer;
  53 +    gboolean single_color = FALSE;
  54  
  55  	str = g_strdup_printf(highlight ? "HILIT %s" : "BUDDY %s", who);
  56  
  57 @@ -5694,19 +5701,29 @@
  58  			gtk_text_buffer_get_tag_table(buffer), str);
  59  
  60  	if (buddytag == NULL && create) {
  61 -		if (highlight)
  62 +		if (highlight) {
  63  			buddytag = gtk_text_buffer_create_tag(buffer, str,
  64  					"foreground", get_text_tag_color(gtk_text_tag_table_lookup(
  65  							gtk_text_buffer_get_tag_table(buffer), "highlight-name")),
  66  					"weight", PANGO_WEIGHT_BOLD,
  67  					NULL);
  68 -		else
  69 +        } else {
  70 +            single_color = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/chat/single_color_receive_name");
  71 +            if (single_color) {
  72 +			buddytag = gtk_text_buffer_create_tag(
  73 +                    buffer, str,
  74 +                    "foreground", get_text_tag_color(gtk_text_tag_table_lookup(
  75 +                            gtk_text_buffer_get_tag_table(buffer), "receive-name")),
  76 +                    "weight", purple_find_buddy(purple_conversation_get_account(conv), who) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
  77 +                    NULL);
  78 +            } else {
  79  			buddytag = gtk_text_buffer_create_tag(
  80  					buffer, str,
  81  					"foreground-gdk", get_nick_color(gtkconv, who),
  82  					"weight", purple_find_buddy(purple_conversation_get_account(conv), who) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
  83  					NULL);
  84 -
  85 +            }
  86 +        }
  87  		g_object_set_data(G_OBJECT(buddytag), "cursor", "");
  88  		g_signal_connect(G_OBJECT(buddytag), "event",
  89  				G_CALLBACK(buddytag_event), conv);
  90 @@ -7990,6 +8007,7 @@
  91  	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/y", 0);
  92  	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/width", 340);
  93  	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/height", 390);
  94 +    purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/chat/single_color_receive_name", FALSE);
  95  
  96  	/* Conversations -> IM */
  97  	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/im");
  98 diff -urBb pidgin-2.6.6/pidgin/gtkprefs.c pidgin-2.6.6-single-color/pidgin/gtkprefs.c
  99 --- pidgin-2.6.6/pidgin/gtkprefs.c	2010-02-16 10:34:06.000000000 +0100
 100 +++ pidgin-2.6.6-single-color/pidgin/gtkprefs.c	2010-03-21 19:13:54.000000000 +0100
 101 @@ -1487,6 +1487,8 @@
 102  
 103  	pidgin_prefs_checkbox(_("Show _formatting on incoming messages"),
 104  				PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox);
 105 +    pidgin_prefs_checkbox(_("Use same colors for all nicks in group chat"),
 106 +                PIDGIN_PREFS_ROOT "/conversations/chat/single_color_receive_name", vbox);
 107  	pidgin_prefs_checkbox(_("Close IMs immediately when the tab is closed"),
 108  				PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox);
 109  

Allegati

Per riferirsi agli allegati di una pagina, usare attachment:NOME_FILE, come mostrato qui sotto nell'elenco degli allegati. NON usare l'URL che si trova in corrispondenza del collegamento [scarica], potrebbe cambiare in futuro.
  • [scarica | mostra] (05/12/2010 13.39.00, 4.4 KB) [[attachment:pidgin_single_color.diff]]
 All files | Selected Files: delete move to page copy to page

Non รจ consentito inserire allegati su questa pagina.