Mercurial > pidgin.yaz
comparison pidgin/gtkconv.c @ 25508:e0add2aafeaf
- merge nosuke's tab width patch.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 11 Jun 2007 13:08:55 +0000 |
parents | e556eb2f38d2 |
children | cf708cbcbc04 |
comparison
equal
deleted
inserted
replaced
25507:abc46fd562bd | 25508:e0add2aafeaf |
---|---|
6178 pidgin_themes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); | 6178 pidgin_themes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); |
6179 | 6179 |
6180 if ((fields & PIDGIN_CONV_COLORIZE_TITLE) || | 6180 if ((fields & PIDGIN_CONV_COLORIZE_TITLE) || |
6181 (fields & PIDGIN_CONV_SET_TITLE)) | 6181 (fields & PIDGIN_CONV_SET_TITLE)) |
6182 { | 6182 { |
6183 char *title; | 6183 char *title, *title_tmp; |
6184 PurpleConvIm *im = NULL; | 6184 PurpleConvIm *im = NULL; |
6185 PurpleAccount *account = purple_conversation_get_account(conv); | 6185 PurpleAccount *account = purple_conversation_get_account(conv); |
6186 AtkObject *accessibility_obj; | 6186 AtkObject *accessibility_obj; |
6187 gboolean ellipsis = FALSE; | |
6187 /* I think this is a little longer than it needs to be but I'm lazy. */ | 6188 /* I think this is a little longer than it needs to be but I'm lazy. */ |
6188 char style[51]; | 6189 char style[51]; |
6189 | 6190 |
6190 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) | 6191 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) |
6191 im = PURPLE_CONV_IM(conv); | 6192 im = PURPLE_CONV_IM(conv); |
6230 { | 6231 { |
6231 atk_object_set_description(accessibility_obj, _("New Event")); | 6232 atk_object_set_description(accessibility_obj, _("New Event")); |
6232 strncpy(style, "color=\"#888a85\" style=\"italic\"", sizeof(style)); | 6233 strncpy(style, "color=\"#888a85\" style=\"italic\"", sizeof(style)); |
6233 } | 6234 } |
6234 | 6235 |
6236 // nosuke's tab width patch | |
6237 if ((purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == (GTK_POS_LEFT|8) | |
6238 || purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/tab_side") == (GTK_POS_RIGHT|8)) | |
6239 && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/trim_vertical_tabs")) | |
6240 ellipsis = TRUE; | |
6241 | |
6242 if (ellipsis) | |
6243 title_tmp = pidgin_gtk_ellipsis_text(gtkconv->tab_label, title, 60, "..."); | |
6244 else | |
6245 title_tmp = title; | |
6246 | |
6247 | |
6235 if (*style != '\0') | 6248 if (*style != '\0') |
6236 { | 6249 { |
6237 char *html_title,*label; | 6250 char *html_title,*label; |
6238 | 6251 |
6239 html_title = g_markup_escape_text(title, -1); | 6252 html_title = g_markup_escape_text(title_tmp, -1); |
6240 | 6253 |
6241 label = g_strdup_printf("<span %s>%s</span>", | 6254 label = g_strdup_printf("<span %s>%s</span>", |
6242 style, html_title); | 6255 style, html_title); |
6243 g_free(html_title); | 6256 g_free(html_title); |
6244 gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label); | 6257 gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label); |
6245 g_free(label); | 6258 g_free(label); |
6246 } | 6259 } |
6247 else | 6260 else |
6248 gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), title); | 6261 gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), title_tmp); |
6249 | 6262 |
6250 if (pidgin_conv_window_is_active_conversation(conv)) | 6263 if (pidgin_conv_window_is_active_conversation(conv)) |
6251 update_typing_icon(gtkconv); | 6264 update_typing_icon(gtkconv); |
6252 | 6265 |
6253 gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title); | 6266 gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title); |
6594 } | 6607 } |
6595 | 6608 |
6596 return page_num; | 6609 return page_num; |
6597 } | 6610 } |
6598 | 6611 |
6612 //nosuke | |
6613 static void | |
6614 trim_vertical_tabs_pref_cb(const char *name, PurplePrefType type, | |
6615 gconstpointer value, gpointer data) | |
6616 { | |
6617 GList *l; | |
6618 PurpleConversation *conv; | |
6619 | |
6620 for (l = purple_get_conversations(); l != NULL; l = l->next) { | |
6621 conv = (PurpleConversation *)l->data; | |
6622 | |
6623 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) | |
6624 continue; | |
6625 | |
6626 pidgin_conv_update_fields(conv, PIDGIN_CONV_SET_TITLE); | |
6627 } | |
6628 } | |
6629 | |
6599 static void | 6630 static void |
6600 close_on_tabs_pref_cb(const char *name, PurplePrefType type, | 6631 close_on_tabs_pref_cb(const char *name, PurplePrefType type, |
6601 gconstpointer value, gpointer data) | 6632 gconstpointer value, gpointer data) |
6602 { | 6633 { |
6603 GList *l; | 6634 GList *l; |
6663 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(gtkwin->notebook), pos&~8); | 6694 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(gtkwin->notebook), pos&~8); |
6664 for (gtkconvs = gtkwin->gtkconvs; gtkconvs != NULL; gtkconvs = gtkconvs->next) { | 6695 for (gtkconvs = gtkwin->gtkconvs; gtkconvs != NULL; gtkconvs = gtkconvs->next) { |
6665 pidgin_conv_tab_pack(gtkwin, gtkconvs->data); | 6696 pidgin_conv_tab_pack(gtkwin, gtkconvs->data); |
6666 } | 6697 } |
6667 } | 6698 } |
6699 trim_vertical_tabs_pref_cb(name, type, value, data); | |
6668 } | 6700 } |
6669 | 6701 |
6670 static void | 6702 static void |
6671 show_timestamps_pref_cb(const char *name, PurplePrefType type, | 6703 show_timestamps_pref_cb(const char *name, PurplePrefType type, |
6672 gconstpointer value, gpointer data) | 6704 gconstpointer value, gpointer data) |
7032 | 7064 |
7033 /* Conversations */ | 7065 /* Conversations */ |
7034 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); | 7066 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); |
7035 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE); | 7067 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE); |
7036 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", TRUE); | 7068 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", TRUE); |
7069 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/trim_vertical_tabs", FALSE); | |
7037 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); | 7070 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
7038 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); | 7071 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
7039 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); | 7072 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
7040 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck", TRUE); | 7073 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck", TRUE); |
7041 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE); | 7074 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE); |
7075 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "never"); | 7108 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "never"); |
7076 | 7109 |
7077 /* Connect callbacks. */ | 7110 /* Connect callbacks. */ |
7078 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", | 7111 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", |
7079 close_on_tabs_pref_cb, NULL); | 7112 close_on_tabs_pref_cb, NULL); |
7113 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/trim_vertical_tabs", | |
7114 trim_vertical_tabs_pref_cb, NULL); | |
7080 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_timestamps", | 7115 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_timestamps", |
7081 show_timestamps_pref_cb, NULL); | 7116 show_timestamps_pref_cb, NULL); |
7082 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", | 7117 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
7083 show_formatting_toolbar_pref_cb, NULL); | 7118 show_formatting_toolbar_pref_cb, NULL); |
7084 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck", | 7119 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck", |