comparison pidgin/gtkconv.c @ 17712:43a55528ff26

propagate from branch 'im.pidgin.pidgin' (head b5c55520ae8ff7186733fd82db23a6e4452976cc) to branch 'im.pidgin.soc.2007.finchfeat' (head 93037197c5356731d62e75b4050ca7d01b1017d6)
author Eric Polino <aluink@pidgin.im>
date Mon, 04 Jun 2007 15:12:50 +0000
parents a8e63ed98673
children 1873848dfddb f78b5aee202d fbebe15c91a7 295777a9e2a4
comparison
equal deleted inserted replaced
17543:223a4fca43a1 17712:43a55528ff26
230 230
231 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) 231 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
232 return FALSE; 232 return FALSE;
233 233
234 if (gtkconv->auto_resize) { 234 if (gtkconv->auto_resize) {
235 return FALSE;
236 }
237
238 if (gdk_window_get_state(gtkconv->win->window->window) & GDK_WINDOW_STATE_MAXIMIZED) {
235 return FALSE; 239 return FALSE;
236 } 240 }
237 241
238 /* I find that I resize the window when it has a bunch of conversations in it, mostly so that the 242 /* I find that I resize the window when it has a bunch of conversations in it, mostly so that the
239 * tab bar will fit, but then I don't want new windows taking up the entire screen. I check to see 243 * tab bar will fit, but then I don't want new windows taking up the entire screen. I check to see
1010 static void 1014 static void
1011 menu_save_as_cb(gpointer data, guint action, GtkWidget *widget) 1015 menu_save_as_cb(gpointer data, guint action, GtkWidget *widget)
1012 { 1016 {
1013 PidginWindow *win = data; 1017 PidginWindow *win = data;
1014 PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win); 1018 PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
1019 PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
1020 const char *name;
1015 gchar *buf; 1021 gchar *buf;
1016 1022 gchar *c;
1017 buf = g_strdup_printf("%s.html", purple_normalize(conv->account, conv->name)); 1023
1018 1024 if (buddy != NULL)
1025 name = purple_buddy_get_contact_alias(buddy);
1026 else
1027 name = purple_normalize(conv->account, conv->name);
1028
1029 buf = g_strdup_printf("%s.html", name);
1030 for (c = buf ; *c ; c++)
1031 {
1032 if (*c == '/' || *c == '\\')
1033 *c = ' ';
1034 }
1019 purple_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"), 1035 purple_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"),
1020 purple_escape_filename(buf), 1036 buf,
1021 TRUE, G_CALLBACK(savelog_writefile_cb), NULL, 1037 TRUE, G_CALLBACK(savelog_writefile_cb), NULL,
1022 NULL, NULL, conv, 1038 NULL, NULL, conv,
1023 conv); 1039 conv);
1024 1040
1025 g_free(buf); 1041 g_free(buf);
3166 gtkconv->u.im->typing_timer = g_timeout_add(250, typing_animation, gtkconv); 3182 gtkconv->u.im->typing_timer = g_timeout_add(250, typing_animation, gtkconv);
3167 } 3183 }
3168 stock_id = PIDGIN_STOCK_ANIMATION_TYPING1; 3184 stock_id = PIDGIN_STOCK_ANIMATION_TYPING1;
3169 tooltip = _("User is typing..."); 3185 tooltip = _("User is typing...");
3170 } else { 3186 } else {
3171 stock_id = PIDGIN_STOCK_ANIMATION_TYPING0; 3187 stock_id = PIDGIN_STOCK_ANIMATION_TYPING5;
3172 tooltip = _("User has typed something and stopped"); 3188 tooltip = _("User has typed something and stopped");
3173 g_source_remove(gtkconv->u.im->typing_timer); 3189 g_source_remove(gtkconv->u.im->typing_timer);
3174 gtkconv->u.im->typing_timer = 0; 3190 gtkconv->u.im->typing_timer = 0;
3175 } 3191 }
3176 3192
6936 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); 6952 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/font_face", "");
6937 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); 6953 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3);
6938 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/tabs", TRUE); 6954 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/tabs", TRUE);
6939 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/tab_side", GTK_POS_TOP); 6955 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/tab_side", GTK_POS_TOP);
6940 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/scrollback_lines", 4000); 6956 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/scrollback_lines", 4000);
6957
6958 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font", TRUE);
6959 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", "");
6941 6960
6942 /* Conversations -> Chat */ 6961 /* Conversations -> Chat */
6943 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/chat"); 6962 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/chat");
6944 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_width", 410); 6963 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_width", 410);
6945 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_height", 160); 6964 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/default_height", 160);
7700 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM) 7719 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM)
7701 return; 7720 return;
7702 7721
7703 gtkconv = PIDGIN_CONVERSATION(conv); 7722 gtkconv = PIDGIN_CONVERSATION(conv);
7704 7723
7724 if (gtkconv->u.im->typing_timer != 0) {
7725 g_source_remove(gtkconv->u.im->typing_timer);
7726 gtkconv->u.im->typing_timer = 0;
7727 }
7728
7705 stop_anim(NULL, gtkconv); 7729 stop_anim(NULL, gtkconv);
7706 } 7730 }
7707 static void 7731 static void
7708 close_window(GtkWidget *w, PidginWindow *win) 7732 close_window(GtkWidget *w, PidginWindow *win)
7709 { 7733 {
7900 7924
7901 /* alias label */ 7925 /* alias label */
7902 entry = gtk_entry_new(); 7926 entry = gtk_entry_new();
7903 gtk_entry_set_has_frame(GTK_ENTRY(entry), FALSE); 7927 gtk_entry_set_has_frame(GTK_ENTRY(entry), FALSE);
7904 gtk_entry_set_width_chars(GTK_ENTRY(entry), 10); 7928 gtk_entry_set_width_chars(GTK_ENTRY(entry), 10);
7929 #if GTK_CHECK_VERSION(2,4,0)
7905 gtk_entry_set_alignment(GTK_ENTRY(entry), 0.5); 7930 gtk_entry_set_alignment(GTK_ENTRY(entry), 0.5);
7931 #endif
7906 7932
7907 gtk_box_pack_start(GTK_BOX(gtkconv->tabby), entry, TRUE, TRUE, 0); 7933 gtk_box_pack_start(GTK_BOX(gtkconv->tabby), entry, TRUE, TRUE, 0);
7908 /* after the tab label */ 7934 /* after the tab label */
7909 gtk_box_reorder_child(GTK_BOX(gtkconv->tabby), entry, 2); 7935 gtk_box_reorder_child(GTK_BOX(gtkconv->tabby), entry, 2);
7910 7936
8307 first = gtkconv->icon; 8333 first = gtkconv->icon;
8308 third = gtkconv->close; 8334 third = gtkconv->close;
8309 } 8335 }
8310 8336
8311 ebox = gtk_event_box_new(); 8337 ebox = gtk_event_box_new();
8338 #if GTK_CHECK_VERSION(2,4,0)
8312 gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE); 8339 gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE);
8340 #endif
8313 gtk_container_add(GTK_CONTAINER(ebox), gtkconv->tabby); 8341 gtk_container_add(GTK_CONTAINER(ebox), gtkconv->tabby);
8314 g_signal_connect(G_OBJECT(ebox), "button-press-event", 8342 g_signal_connect(G_OBJECT(ebox), "button-press-event",
8315 G_CALLBACK(alias_double_click_cb), gtkconv); 8343 G_CALLBACK(alias_double_click_cb), gtkconv);
8316 8344
8317 if (gtkconv->tab_label->parent == NULL) { 8345 if (gtkconv->tab_label->parent == NULL) {