Mercurial > pidgin.yaz
comparison pidgin/gtkblist.c @ 21069:fdefa5eb46e2
propagate from branch 'im.pidgin.pidgin' (head 1757e82b3ed17d8ad45db9d2c62f0187a8bee93d)
to branch 'org.maemo.garage.pidgin.pidgin.dialog-transience' (head a7af6ce1e8f29eb0eb1bffc0ebb72813c4c5fdbf)
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 06 Oct 2007 15:55:47 +0000 |
parents | 16d372f412e3 b93d1ad9cf02 |
children | b84655373d7b |
comparison
equal
deleted
inserted
replaced
20794:366204358e93 | 21069:fdefa5eb46e2 |
---|---|
520 g_free(a); | 520 g_free(a); |
521 | 521 |
522 if (i > 1) | 522 if (i > 1) |
523 { | 523 { |
524 char *msg = g_strdup_printf(ngettext("You have %d contact named %s. Would you like to merge them?", "You currently have %d contacts named %s. Would you like to merge them?", i), i, alias); | 524 char *msg = g_strdup_printf(ngettext("You have %d contact named %s. Would you like to merge them?", "You currently have %d contacts named %s. Would you like to merge them?", i), i, alias); |
525 purple_request_action(NULL, NULL, msg, _("Merging these contacts will cause them to share a single entry on the buddy list and use a single conversation window. " | 525 purple_request_action_with_hint(NULL, NULL, msg, _("Merging these contacts will cause them to share a single entry on the buddy list and use a single conversation window. " |
526 "You can separate them again by choosing 'Expand' from the contact's context menu"), 0, NULL, NULL, NULL, | 526 "You can separate them again by choosing 'Expand' from the contact's context menu"), 0, NULL, NULL, NULL, |
527 merges, 2, _("_Merge"), PURPLE_CALLBACK(gtk_blist_do_personize), _("_Cancel"), PURPLE_CALLBACK(g_list_free)); | 527 "blist", merges, 2, _("_Merge"), PURPLE_CALLBACK(gtk_blist_do_personize), _("_Cancel"), PURPLE_CALLBACK(g_list_free)); |
528 g_free(msg); | 528 g_free(msg); |
529 } else | 529 } else |
530 g_list_free(merges); | 530 g_list_free(merges); |
531 } | 531 } |
532 | 532 |
615 gtk_tree_path_free(path); | 615 gtk_tree_path_free(path); |
616 } | 616 } |
617 | 617 |
618 static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b) | 618 static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b) |
619 { | 619 { |
620 pidgin_pounce_editor_show(b->account, b->name, NULL); | 620 pidgin_pounce_editor_show_with_parent(GTK_WINDOW(gtkblist->window), b->account, b->name, NULL); |
621 } | 621 } |
622 | 622 |
623 static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node) | 623 static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node) |
624 { | 624 { |
625 PurpleLogType type; | 625 PurpleLogType type; |
641 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account))); | 641 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account))); |
642 if (prpl_info && prpl_info->get_chat_name) { | 642 if (prpl_info && prpl_info->get_chat_name) { |
643 name = prpl_info->get_chat_name(c->components); | 643 name = prpl_info->get_chat_name(c->components); |
644 } | 644 } |
645 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { | 645 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
646 pidgin_log_show_contact((PurpleContact *)node); | 646 pidgin_log_show_contact_with_parent(GTK_WINDOW(gtkblist->window), (PurpleContact *)node); |
647 pidgin_clear_cursor(gtkblist->window); | 647 pidgin_clear_cursor(gtkblist->window); |
648 return; | 648 return; |
649 } else { | 649 } else { |
650 pidgin_clear_cursor(gtkblist->window); | 650 pidgin_clear_cursor(gtkblist->window); |
651 | 651 |
653 * that doesn't match the type of one of the blocks above. */ | 653 * that doesn't match the type of one of the blocks above. */ |
654 g_return_if_reached(); | 654 g_return_if_reached(); |
655 } | 655 } |
656 | 656 |
657 if (name && account) { | 657 if (name && account) { |
658 pidgin_log_show(type, name, account); | 658 pidgin_log_show_with_parent(GTK_WINDOW(gtkblist->window), type, name, account); |
659 g_free(name); | 659 g_free(name); |
660 | 660 |
661 pidgin_clear_cursor(gtkblist->window); | 661 pidgin_clear_cursor(gtkblist->window); |
662 } | 662 } |
663 } | 663 } |
678 for (bnode = node->child; bnode != NULL; bnode = bnode->next) { | 678 for (bnode = node->child; bnode != NULL; bnode = bnode->next) { |
679 purple_blist_node_set_bool(bnode, "show_offline", setting); | 679 purple_blist_node_set_bool(bnode, "show_offline", setting); |
680 } | 680 } |
681 } | 681 } |
682 pidgin_blist_update(purple_get_blist(), node); | 682 pidgin_blist_update(purple_get_blist(), node); |
683 } | |
684 | |
685 static void gtk_blist_show_systemlog_cb() | |
686 { | |
687 pidgin_syslog_show(); | |
688 } | 683 } |
689 | 684 |
690 static void gtk_blist_show_onlinehelp_cb() | 685 static void gtk_blist_show_onlinehelp_cb() |
691 { | 686 { |
692 purple_notify_uri(NULL, PURPLE_WEBSITE "documentation"); | 687 purple_notify_uri(NULL, PURPLE_WEBSITE "documentation"); |
3055 { | 3050 { |
3056 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", | 3051 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", |
3057 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); | 3052 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); |
3058 } | 3053 } |
3059 | 3054 |
3055 static void | |
3056 pidgin_blist_show_with_parent(gpointer data1, void (*callback)(GtkWindow *parent), gpointer data3) | |
3057 { | |
3058 callback(GTK_WINDOW(gtkblist->window)); | |
3059 } | |
3060 | 3060 |
3061 /*************************************************** | 3061 /*************************************************** |
3062 * Crap * | 3062 * Crap * |
3063 ***************************************************/ | 3063 ***************************************************/ |
3064 static GtkItemFactoryEntry blist_menu[] = | 3064 static GtkItemFactoryEntry blist_menu[] = |
3088 { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL }, | 3088 { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL }, |
3089 { N_("/Accounts/Manage"), "<CTL>A", pidgin_accounts_window_show, 0, "<Item>", NULL }, | 3089 { N_("/Accounts/Manage"), "<CTL>A", pidgin_accounts_window_show, 0, "<Item>", NULL }, |
3090 | 3090 |
3091 /* Tools */ | 3091 /* Tools */ |
3092 { N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL }, | 3092 { N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL }, |
3093 { N_("/Tools/Buddy _Pounces"), NULL, pidgin_pounces_manager_show, 0, "<Item>", NULL }, | 3093 { N_("/Tools/Buddy _Pounces"), NULL, pidgin_blist_show_with_parent, (int)pidgin_pounces_manager_show_with_parent, "<Item>", NULL }, |
3094 { N_("/Tools/_Certificates"), NULL, pidgin_certmgr_show, 0, "<Item>", NULL }, | 3094 { N_("/Tools/_Certificates"), NULL, pidgin_certmgr_show, 0, "<Item>", NULL }, |
3095 { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_plugin_dialog_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS }, | 3095 { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_blist_show_with_parent, (int)pidgin_plugin_dialog_show_with_parent, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS }, |
3096 { N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, | 3096 { N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, |
3097 { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL }, | 3097 { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL }, |
3098 { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL }, | 3098 { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL }, |
3099 { N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<Item>", NULL }, | 3099 { N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<Item>", NULL }, |
3100 { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL }, | 3100 { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL }, |
3101 { N_("/Tools/System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, "<Item>", NULL }, | 3101 { N_("/Tools/System _Log"), NULL, pidgin_blist_show_with_parent, (int)pidgin_syslog_show_with_parent, "<Item>", NULL }, |
3102 { "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL }, | 3102 { "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL }, |
3103 { N_("/Tools/Mute _Sounds"), "<CTL>S", pidgin_blist_mute_sounds_cb, 0, "<CheckItem>", NULL }, | 3103 { N_("/Tools/Mute _Sounds"), "<CTL>S", pidgin_blist_mute_sounds_cb, 0, "<CheckItem>", NULL }, |
3104 /* Help */ | 3104 /* Help */ |
3105 { N_("/_Help"), NULL, NULL, 0, "<Branch>", NULL }, | 3105 { N_("/_Help"), NULL, NULL, 0, "<Branch>", NULL }, |
3106 { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP }, | 3106 { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP }, |
3107 { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL }, | 3107 { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL }, |
3108 #if GTK_CHECK_VERSION(2,6,0) | 3108 #if GTK_CHECK_VERSION(2,6,0) |
3109 { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "<StockItem>", GTK_STOCK_ABOUT }, | 3109 { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, (int)pidgin_dialogs_about_with_parent, "<StockItem>", GTK_STOCK_ABOUT }, |
3110 #else | 3110 #else |
3111 { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "<Item>", NULL }, | 3111 { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, (int)pidgin_dialogs_about_with_parent, "<Item>", NULL }, |
3112 #endif | 3112 #endif |
3113 }; | 3113 }; |
3114 | 3114 |
3115 /********************************************************* | 3115 /********************************************************* |
3116 * Private Utility functions * | 3116 * Private Utility functions * |
4321 primary = g_strdup_printf(_("%s disconnected"), | 4321 primary = g_strdup_printf(_("%s disconnected"), |
4322 purple_account_get_username(account)); | 4322 purple_account_get_username(account)); |
4323 text = g_hash_table_lookup(gtkblist->connection_errors, account); | 4323 text = g_hash_table_lookup(gtkblist->connection_errors, account); |
4324 | 4324 |
4325 enabled = purple_account_get_enabled(account, purple_core_get_ui()); | 4325 enabled = purple_account_get_enabled(account, purple_core_get_ui()); |
4326 purple_request_action(account, _("Connection Error"), primary, text, 2, | 4326 purple_request_action_with_hint(account, _("Connection Error"), primary, text, 2, |
4327 account, NULL, NULL, | 4327 account, NULL, NULL, |
4328 account, 3, | 4328 "account", account, 3, |
4329 _("OK"), NULL, | 4329 _("OK"), NULL, |
4330 _("Modify Account"), PURPLE_CALLBACK(ce_modify_account_cb), | 4330 _("Modify Account"), PURPLE_CALLBACK(ce_modify_account_cb), |
4331 enabled ? _("Connect") : _("Re-enable Account"), | 4331 enabled ? _("Connect") : _("Re-enable Account"), |
4332 enabled ? PURPLE_CALLBACK(purple_account_connect) : | 4332 enabled ? PURPLE_CALLBACK(purple_account_connect) : |
4333 PURPLE_CALLBACK(ce_enable_account_cb)); | 4333 PURPLE_CALLBACK(ce_enable_account_cb)); |
6266 } | 6266 } |
6267 | 6267 |
6268 static void | 6268 static void |
6269 pidgin_blist_request_add_group(void) | 6269 pidgin_blist_request_add_group(void) |
6270 { | 6270 { |
6271 purple_request_input(NULL, _("Add Group"), NULL, | 6271 purple_request_input_with_hint(NULL, _("Add Group"), NULL, |
6272 _("Please enter the name of the group to be added."), | 6272 _("Please enter the name of the group to be added."), |
6273 NULL, FALSE, FALSE, NULL, | 6273 NULL, FALSE, FALSE, NULL, |
6274 _("Add"), G_CALLBACK(add_group_cb), | 6274 _("Add"), G_CALLBACK(add_group_cb), |
6275 _("Cancel"), NULL, | 6275 _("Cancel"), NULL, |
6276 NULL, NULL, NULL, | 6276 NULL, NULL, NULL, |
6277 NULL); | 6277 "blist", NULL); |
6278 } | 6278 } |
6279 | 6279 |
6280 void | 6280 void |
6281 pidgin_blist_toggle_visibility() | 6281 pidgin_blist_toggle_visibility() |
6282 { | 6282 { |