| 227 g_list_free(list); |
227 g_list_free(list); |
| 228 return FALSE; |
228 return FALSE; |
| 229 } |
229 } |
| 230 |
230 |
| 231 static gboolean |
231 static gboolean |
| 232 close_conv_cb(GtkWidget *w, GdkEventButton *dontuse, PidginConversation *gtkconv) |
232 close_conv_cb(GtkButton *button, PidginConversation *gtkconv) |
| 233 { |
233 { |
| 234 /* We are going to destroy the conversations immediately only if the 'close immediately' |
234 /* We are going to destroy the conversations immediately only if the 'close immediately' |
| 235 * preference is selected. Otherwise, close the conversation after a reasonable timeout |
235 * preference is selected. Otherwise, close the conversation after a reasonable timeout |
| 236 * (I am going to consider 10 minutes as a 'reasonable timeout' here. |
236 * (I am going to consider 10 minutes as a 'reasonable timeout' here. |
| 237 * For chats, close immediately if the chat is not in the buddylist, or if the chat is |
237 * For chats, close immediately if the chat is not in the buddylist, or if the chat is |
| 1323 static void |
1323 static void |
| 1324 menu_close_conv_cb(gpointer data, guint action, GtkWidget *widget) |
1324 menu_close_conv_cb(gpointer data, guint action, GtkWidget *widget) |
| 1325 { |
1325 { |
| 1326 PidginWindow *win = data; |
1326 PidginWindow *win = data; |
| 1327 |
1327 |
| 1328 close_conv_cb(NULL, NULL, PIDGIN_CONVERSATION(pidgin_conv_window_get_active_conversation(win))); |
1328 close_conv_cb(NULL, PIDGIN_CONVERSATION(pidgin_conv_window_get_active_conversation(win))); |
| 1329 } |
1329 } |
| 1330 |
1330 |
| 1331 static void |
1331 static void |
| 1332 menu_logging_cb(gpointer data, guint action, GtkWidget *widget) |
1332 menu_logging_cb(gpointer data, guint action, GtkWidget *widget) |
| 1333 { |
1333 { |
| 8675 |
8675 |
| 8676 if (tab_clicked == -1) |
8676 if (tab_clicked == -1) |
| 8677 return FALSE; |
8677 return FALSE; |
| 8678 |
8678 |
| 8679 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, tab_clicked); |
8679 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, tab_clicked); |
| 8680 close_conv_cb(NULL, NULL, gtkconv); |
8680 close_conv_cb(NULL, gtkconv); |
| 8681 return TRUE; |
8681 return TRUE; |
| 8682 } |
8682 } |
| 8683 |
8683 |
| 8684 |
8684 |
| 8685 if (e->button != 1 || e->type != GDK_BUTTON_PRESS) |
8685 if (e->button != 1 || e->type != GDK_BUTTON_PRESS) |
| 8955 PidginConversation *gtkconv; |
8955 PidginConversation *gtkconv; |
| 8956 |
8956 |
| 8957 gtkconv = g_object_get_data(menu, "clicked_tab"); |
8957 gtkconv = g_object_get_data(menu, "clicked_tab"); |
| 8958 |
8958 |
| 8959 if (gtkconv) |
8959 if (gtkconv) |
| 8960 close_conv_cb(NULL, NULL, gtkconv); |
8960 close_conv_cb(NULL, gtkconv); |
| 8961 } |
8961 } |
| 8962 |
8962 |
| 8963 static gboolean |
8963 static gboolean |
| 8964 right_click_menu_cb(GtkNotebook *notebook, GdkEventButton *event, PidginWindow *win) |
8964 right_click_menu_cb(GtkNotebook *notebook, GdkEventButton *event, PidginWindow *win) |
| 8965 { |
8965 { |
| 9419 gtk_widget_destroy(win->dialogs.search); |
9419 gtk_widget_destroy(win->dialogs.search); |
| 9420 |
9420 |
| 9421 if (win->gtkconvs) { |
9421 if (win->gtkconvs) { |
| 9422 while (win->gtkconvs) { |
9422 while (win->gtkconvs) { |
| 9423 gboolean last = (win->gtkconvs->next == NULL); |
9423 gboolean last = (win->gtkconvs->next == NULL); |
| 9424 close_conv_cb(NULL, NULL, win->gtkconvs->data); |
9424 close_conv_cb(NULL, win->gtkconvs->data); |
| 9425 if (last) |
9425 if (last) |
| 9426 break; |
9426 break; |
| 9427 } |
9427 } |
| 9428 return; |
9428 return; |
| 9429 } |
9429 } |
| 9493 PurpleConversation *conv = gtkconv->active_conv; |
9493 PurpleConversation *conv = gtkconv->active_conv; |
| 9494 PidginConversation *focus_gtkconv; |
9494 PidginConversation *focus_gtkconv; |
| 9495 GtkWidget *tab_cont = gtkconv->tab_cont; |
9495 GtkWidget *tab_cont = gtkconv->tab_cont; |
| 9496 PurpleConversationType conv_type; |
9496 PurpleConversationType conv_type; |
| 9497 const gchar *tmp_lab; |
9497 const gchar *tmp_lab; |
| |
9498 GtkWidget *close_image; |
| 9498 |
9499 |
| 9499 conv_type = purple_conversation_get_type(conv); |
9500 conv_type = purple_conversation_get_type(conv); |
| 9500 |
9501 |
| 9501 win->gtkconvs = g_list_append(win->gtkconvs, gtkconv); |
9502 win->gtkconvs = g_list_append(win->gtkconvs, gtkconv); |
| 9502 gtkconv->win = win; |
9503 gtkconv->win = win; |
| 9504 if (win->gtkconvs && win->gtkconvs->next && win->gtkconvs->next->next == NULL) |
9505 if (win->gtkconvs && win->gtkconvs->next && win->gtkconvs->next->next == NULL) |
| 9505 pidgin_conv_tab_pack(win, ((PidginConversation*)win->gtkconvs->data)); |
9506 pidgin_conv_tab_pack(win, ((PidginConversation*)win->gtkconvs->data)); |
| 9506 |
9507 |
| 9507 |
9508 |
| 9508 /* Close button. */ |
9509 /* Close button. */ |
| 9509 gtkconv->close = create_close_button(); |
9510 close_image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); |
| |
9511 gtkconv->close = pidgin_create_small_button(close_image); |
| 9510 gtk_tooltips_set_tip(gtkconv->tooltips, gtkconv->close, |
9512 gtk_tooltips_set_tip(gtkconv->tooltips, gtkconv->close, |
| 9511 _("Close conversation"), NULL); |
9513 _("Close conversation"), NULL); |
| 9512 |
9514 |
| 9513 g_signal_connect(G_OBJECT(gtkconv->close), "button-press-event", |
9515 g_signal_connect(gtkconv->close, "clicked", G_CALLBACK (close_conv_cb), gtkconv); |
| 9514 G_CALLBACK(close_conv_cb), gtkconv); |
|
| 9515 |
9516 |
| 9516 /* Status icon. */ |
9517 /* Status icon. */ |
| 9517 gtkconv->icon = gtk_image_new(); |
9518 gtkconv->icon = gtk_image_new(); |
| 9518 gtkconv->menu_icon = gtk_image_new(); |
9519 gtkconv->menu_icon = gtk_image_new(); |
| 9519 g_object_set(G_OBJECT(gtkconv->icon), |
9520 g_object_set(G_OBJECT(gtkconv->icon), |