From: Mark D. <the...@us...> - 2004-08-02 03:21:42
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19369/src Modified Files: dialogs.c ui.h gtkblist.c gtkconv.c Log Message: I warmenhoved patch 996233 from Jon Oberheide. Thanks Jon! From his description: The main purpose of this patch is to set the focus of a conversation when it is created. Currently, the focus is set when the conversation is created from: - double-clicking a buddy on the buddy list - right-clicking a buddy and clicking "IM" This patch sets the focus additionally for the following circumstances: - clicking "Buddies -> New Instant Message" - clicking "IM" buddy list button Index: dialogs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v retrieving revision 1.604 retrieving revision 1.605 diff -u -d -p -r1.604 -r1.605 --- dialogs.c 25 Jul 2004 22:13:02 -0000 1.604 +++ dialogs.c 2 Aug 2004 03:21:31 -0000 1.605 @@ -411,22 +411,33 @@ static gboolean show_ee_dialog(const cha return TRUE; } -static void -new_im_cb(gpointer data, GaimRequestFields *fields) +void +gaim_gtkdialogs_new_im(GaimAccount *account, const char *username) { - const char *username; - GaimAccount *account; GaimConversation *conv; - - username = gaim_request_fields_get_string(fields, "screenname"); - account = gaim_request_fields_get_account(fields, "account"); + GaimConvWindow *win; conv = gaim_find_conversation_with_account(username, account); if (conv == NULL) conv = gaim_conversation_new(GAIM_CONV_IM, account, username); - else - gaim_conv_window_raise(gaim_conversation_get_window(conv)); + + win = gaim_conversation_get_window(conv); + + gaim_conv_window_raise(win); + gaim_conv_window_switch_conversation(win, gaim_conversation_get_index(conv)); +} + +static void +new_im_cb(gpointer data, GaimRequestFields *fields) +{ + GaimAccount *account; + const char *username; + + account = gaim_request_fields_get_account(fields, "account"); + username = gaim_request_fields_get_string(fields, "screenname"); + + gaim_gtkdialogs_new_im(account, username); } void Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.157 retrieving revision 1.158 diff -u -d -p -r1.157 -r1.158 --- ui.h 23 May 2004 18:49:40 -0000 1.157 +++ ui.h 2 Aug 2004 03:21:32 -0000 1.158 @@ -118,6 +118,7 @@ extern void alias_dialog_bud(GaimBuddy * extern void alias_dialog_contact(GaimContact *); extern void alias_dialog_blist_chat(GaimChat *); extern void show_warn_dialog(GaimConnection *, const char *); +extern void gaim_gtkdialogs_new_im(GaimAccount *, const char *); extern void show_im_dialog(); extern void show_info_dialog(); extern void show_log_dialog(); Index: gtkblist.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkblist.c,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -p -r1.140 -r1.141 --- gtkblist.c 1 Aug 2004 13:04:50 -0000 1.140 +++ gtkblist.c 2 Aug 2004 03:21:32 -0000 1.141 @@ -512,20 +512,7 @@ static void gtk_blist_menu_info_cb(GtkWi static void gtk_blist_menu_im_cb(GtkWidget *w, GaimBuddy *b) { - GaimConversation *conv = gaim_conversation_new(GAIM_CONV_IM, b->account, - b->name); - - if(conv) { - GaimConvWindow *win = gaim_conversation_get_window(conv); - - gaim_conv_window_raise(win); - gaim_conv_window_switch_conversation( - gaim_conversation_get_window(conv), - gaim_conversation_get_index(conv)); - - if (GAIM_IS_GTK_WINDOW(win)) - gtk_window_present(GTK_WINDOW(GAIM_GTK_WINDOW(win)->window)); - } + gaim_gtkdialogs_new_im(b->account, b->name); } static void gtk_blist_menu_send_file_cb(GtkWidget *w, GaimBuddy *b) @@ -585,12 +572,12 @@ static void gtk_blist_button_im_cb(GtkWi gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); if (GAIM_BLIST_NODE_IS_BUDDY(node)) { - gaim_conversation_new(GAIM_CONV_IM, ((GaimBuddy*)node)->account, ((GaimBuddy*)node)->name); + gaim_gtkdialogs_new_im(((GaimBuddy*)node)->account, ((GaimBuddy*)node)->name); return; } else if(GAIM_BLIST_NODE_IS_CONTACT(node)) { GaimBuddy *buddy = gaim_contact_get_priority_buddy((GaimContact*)node); - gaim_conversation_new(GAIM_CONV_IM, buddy->account, buddy->name); + gaim_gtkdialogs_new_im(buddy->account, buddy->name); return; } } @@ -943,19 +930,7 @@ static void gtk_blist_row_activated_cb(G else buddy = (GaimBuddy*)node; - conv = gaim_conversation_new(GAIM_CONV_IM, buddy->account, buddy->name); - - if(conv) { - GaimConvWindow *win = gaim_conversation_get_window(conv); - - gaim_conv_window_raise(win); - gaim_conv_window_switch_conversation( - gaim_conversation_get_window(conv), - gaim_conversation_get_index(conv)); - - if (GAIM_IS_GTK_WINDOW(win)) - gtk_window_present(GTK_WINDOW(GAIM_GTK_WINDOW(win)->window)); - } + gaim_gtkdialogs_new_im(buddy->account, buddy->name); } else if (GAIM_BLIST_NODE_IS_CHAT(node)) { serv_join_chat(((GaimChat *)node)->account->gc, ((GaimChat *)node)->components); } else if (GAIM_BLIST_NODE_IS_GROUP(node)) { Index: gtkconv.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkconv.c,v retrieving revision 1.438 retrieving revision 1.439 diff -u -d -p -r1.438 -r1.439 --- gtkconv.c 1 Aug 2004 00:31:44 -0000 1.438 +++ gtkconv.c 2 Aug 2004 03:21:32 -0000 1.439 @@ -4542,9 +4542,7 @@ gaim_gtk_raise(GaimConvWindow *win) { GaimGtkWindow *gtkwin = GAIM_GTK_WINDOW(win); - gtk_widget_show(gtkwin->window); - gtk_window_deiconify(GTK_WINDOW(gtkwin->window)); - gdk_window_raise(gtkwin->window->window); + gtk_window_present(GTK_WINDOW(gtkwin->window)); } static void |