| 4325 } |
4325 } |
| 4326 gtk_tree_row_reference_free(gtknode->row); |
4326 gtk_tree_row_reference_free(gtknode->row); |
| 4327 gtknode->row = NULL; |
4327 gtknode->row = NULL; |
| 4328 } |
4328 } |
| 4329 |
4329 |
| 4330 static const char *require_connection[] = |
|
| 4331 { |
|
| 4332 "/BList/BuddiesMenu/JoinAChat", |
|
| 4333 }; |
|
| 4334 |
|
| 4335 static const int require_connection_size = sizeof(require_connection) |
|
| 4336 / sizeof(*require_connection); |
|
| 4337 |
|
| 4338 /* |
|
| 4339 * Rebuild dynamic menus and make menu items sensitive/insensitive |
|
| 4340 * where appropriate. |
|
| 4341 */ |
|
| 4342 static void |
|
| 4343 update_menu_bar(PidginBuddyList *gtkblist) |
|
| 4344 { |
|
| 4345 GtkAction *action; |
|
| 4346 gboolean sensitive; |
|
| 4347 int i; |
|
| 4348 |
|
| 4349 g_return_if_fail(gtkblist != NULL); |
|
| 4350 |
|
| 4351 sensitive = (purple_connections_get_all() != NULL); |
|
| 4352 |
|
| 4353 for (i = 0; i < require_connection_size; i++) |
|
| 4354 { |
|
| 4355 action = gtk_ui_manager_get_action(gtkblist->ui, require_connection[i]); |
|
| 4356 gtk_action_set_sensitive(action, sensitive); |
|
| 4357 } |
|
| 4358 |
|
| 4359 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/JoinAChat"); |
|
| 4360 gtk_action_set_sensitive(action, pidgin_blist_joinchat_is_showable()); |
|
| 4361 |
|
| 4362 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/AddChat"); |
|
| 4363 gtk_action_set_sensitive(action, pidgin_blist_joinchat_is_showable()); |
|
| 4364 |
|
| 4365 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/ToolsMenu/RoomList"); |
|
| 4366 gtk_action_set_sensitive(action, pidgin_roomlist_is_showable()); |
|
| 4367 } |
|
| 4368 |
|
| 4369 static void |
|
| 4370 sign_on_off_cb(PurpleConnection *gc, PurpleBuddyList *blist) |
|
| 4371 { |
|
| 4372 PidginBuddyList *gtkblist = PIDGIN_BUDDY_LIST(blist); |
|
| 4373 |
|
| 4374 update_menu_bar(gtkblist); |
|
| 4375 } |
|
| 4376 |
|
| 4377 static void |
4330 static void |
| 4378 unseen_conv_menu(GdkEvent *event) |
4331 unseen_conv_menu(GdkEvent *event) |
| 4379 { |
4332 { |
| 4380 static GtkWidget *menu = NULL; |
4333 static GtkWidget *menu = NULL; |
| 4381 GList *convs = NULL; |
4334 GList *convs = NULL; |
| 5744 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); |
5696 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); |
| 5745 gtk_widget_set_name(gtkblist->statusbox, "pidgin_blist_statusbox"); |
5697 gtk_widget_set_name(gtkblist->statusbox, "pidgin_blist_statusbox"); |
| 5746 gtk_widget_show(gtkblist->statusbox); |
5698 gtk_widget_show(gtkblist->statusbox); |
| 5747 |
5699 |
| 5748 /* Update some dynamic things */ |
5700 /* Update some dynamic things */ |
| 5749 update_menu_bar(gtkblist); |
|
| 5750 pidgin_blist_update_sort_methods(); |
5701 pidgin_blist_update_sort_methods(); |
| 5751 |
5702 |
| 5752 /* OK... let's show this bad boy. */ |
5703 /* OK... let's show this bad boy. */ |
| 5753 pidgin_blist_refresh(list); |
5704 pidgin_blist_refresh(list); |
| 5754 pidgin_blist_restore_window_state(); |
5705 pidgin_blist_restore_window_state(); |
| 5794 gtkblist); |
5745 gtkblist); |
| 5795 |
5746 |
| 5796 handle = pidgin_accounts_get_handle(); |
5747 handle = pidgin_accounts_get_handle(); |
| 5797 purple_signal_connect(handle, "account-modified", gtkblist, |
5748 purple_signal_connect(handle, "account-modified", gtkblist, |
| 5798 PURPLE_CALLBACK(account_modified), gtkblist); |
5749 PURPLE_CALLBACK(account_modified), gtkblist); |
| 5799 |
|
| 5800 handle = purple_connections_get_handle(); |
|
| 5801 purple_signal_connect(handle, "signed-on", gtkblist, |
|
| 5802 PURPLE_CALLBACK(sign_on_off_cb), list); |
|
| 5803 purple_signal_connect(handle, "signed-off", gtkblist, |
|
| 5804 PURPLE_CALLBACK(sign_on_off_cb), list); |
|
| 5805 |
5750 |
| 5806 handle = purple_conversations_get_handle(); |
5751 handle = purple_conversations_get_handle(); |
| 5807 purple_signal_connect(handle, "conversation-updated", gtkblist, |
5752 purple_signal_connect(handle, "conversation-updated", gtkblist, |
| 5808 PURPLE_CALLBACK(conversation_updated_cb), |
5753 PURPLE_CALLBACK(conversation_updated_cb), |
| 5809 gtkblist); |
5754 gtkblist); |