Mercurial > pidgin
comparison finch/gntaccount.c @ 20469:9e5bb492fc18
propagate from branch 'im.pidgin.pidgin' (head d565f6901d390d091fab30d0bd923fa36c335da2)
to branch 'im.pidgin.cpw.khc.msnp14' (head aacb44d1de5f72f3c7d8d2e231432581f5c09dd7)
author | Carlos Silva <typ0@pidgin.im> |
---|---|
date | Sat, 14 Jul 2007 18:36:34 +0000 |
parents | 15f0c935e699 |
children | 7a594763c229 |
comparison
equal
deleted
inserted
replaced
20468:b888c2f15c79 | 20469:9e5bb492fc18 |
---|---|
29 #include <gntcombobox.h> | 29 #include <gntcombobox.h> |
30 #include <gntentry.h> | 30 #include <gntentry.h> |
31 #include <gntlabel.h> | 31 #include <gntlabel.h> |
32 #include <gntline.h> | 32 #include <gntline.h> |
33 #include <gnttree.h> | 33 #include <gnttree.h> |
34 #include <gntutils.h> | |
34 #include <gntwindow.h> | 35 #include <gntwindow.h> |
35 | 36 |
36 #include "finch.h" | 37 #include "finch.h" |
37 | 38 |
38 #include <account.h> | 39 #include <account.h> |
470 if (dlg->account == account) | 471 if (dlg->account == account) |
471 return; | 472 return; |
472 } | 473 } |
473 } | 474 } |
474 | 475 |
476 list = purple_plugins_get_protocols(); | |
477 if (list == NULL) { | |
478 purple_notify_error(NULL, _("Error"), | |
479 _("There's no protocol plugins installed."), | |
480 _("(You probably forgot to 'make install'.)")); | |
481 return; | |
482 } | |
483 | |
475 dialog = g_new0(AccountEditDialog, 1); | 484 dialog = g_new0(AccountEditDialog, 1); |
476 accountdialogs = g_list_prepend(accountdialogs, dialog); | 485 accountdialogs = g_list_prepend(accountdialogs, dialog); |
477 | 486 |
478 dialog->window = window = gnt_vbox_new(FALSE); | 487 dialog->window = window = gnt_vbox_new(FALSE); |
479 dialog->account = account; | 488 dialog->account = account; |
487 hbox = gnt_hbox_new(TRUE); | 496 hbox = gnt_hbox_new(TRUE); |
488 gnt_box_set_pad(GNT_BOX(hbox), 0); | 497 gnt_box_set_pad(GNT_BOX(hbox), 0); |
489 gnt_box_add_widget(GNT_BOX(window), hbox); | 498 gnt_box_add_widget(GNT_BOX(window), hbox); |
490 | 499 |
491 dialog->protocol = combo = gnt_combo_box_new(); | 500 dialog->protocol = combo = gnt_combo_box_new(); |
492 list = purple_plugins_get_protocols(); | |
493 for (iter = list; iter; iter = iter->next) | 501 for (iter = list; iter; iter = iter->next) |
494 { | 502 { |
495 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), iter->data, | 503 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), iter->data, |
496 ((PurplePlugin*)iter->data)->info->name); | 504 ((PurplePlugin*)iter->data)->info->name); |
497 } | 505 } |
643 void finch_accounts_show_all() | 651 void finch_accounts_show_all() |
644 { | 652 { |
645 GList *iter; | 653 GList *iter; |
646 GntWidget *box, *button; | 654 GntWidget *box, *button; |
647 | 655 |
648 if (accounts.window) | 656 if (accounts.window) { |
657 gnt_window_present(accounts.window); | |
649 return; | 658 return; |
659 } | |
650 | 660 |
651 accounts.window = gnt_vbox_new(FALSE); | 661 accounts.window = gnt_vbox_new(FALSE); |
652 gnt_box_set_toplevel(GNT_BOX(accounts.window), TRUE); | 662 gnt_box_set_toplevel(GNT_BOX(accounts.window), TRUE); |
653 gnt_box_set_title(GNT_BOX(accounts.window), _("Accounts")); | 663 gnt_box_set_title(GNT_BOX(accounts.window), _("Accounts")); |
654 gnt_box_set_pad(GNT_BOX(accounts.window), 0); | 664 gnt_box_set_pad(GNT_BOX(accounts.window), 0); |
679 | 689 |
680 box = gnt_hbox_new(FALSE); | 690 box = gnt_hbox_new(FALSE); |
681 | 691 |
682 button = gnt_button_new(_("Add")); | 692 button = gnt_button_new(_("Add")); |
683 gnt_box_add_widget(GNT_BOX(box), button); | 693 gnt_box_add_widget(GNT_BOX(box), button); |
694 gnt_util_set_trigger_widget(GNT_WIDGET(accounts.tree), GNT_KEY_INS, button); | |
684 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(add_account_cb), NULL); | 695 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(add_account_cb), NULL); |
685 | 696 |
686 button = gnt_button_new(_("Modify")); | 697 button = gnt_button_new(_("Modify")); |
687 gnt_box_add_widget(GNT_BOX(box), button); | 698 gnt_box_add_widget(GNT_BOX(box), button); |
688 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(modify_account_cb), accounts.tree); | 699 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(modify_account_cb), accounts.tree); |
689 | 700 |
690 button = gnt_button_new(_("Delete")); | 701 button = gnt_button_new(_("Delete")); |
691 gnt_box_add_widget(GNT_BOX(box), button); | 702 gnt_box_add_widget(GNT_BOX(box), button); |
703 gnt_util_set_trigger_widget(GNT_WIDGET(accounts.tree), GNT_KEY_DEL, button); | |
692 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(delete_account_cb), accounts.tree); | 704 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(delete_account_cb), accounts.tree); |
693 | 705 |
694 gnt_box_add_widget(GNT_BOX(accounts.window), box); | 706 gnt_box_add_widget(GNT_BOX(accounts.window), box); |
695 | 707 |
696 g_signal_connect(G_OBJECT(accounts.window), "destroy", G_CALLBACK(reset_accounts_win), NULL); | 708 g_signal_connect(G_OBJECT(accounts.window), "destroy", G_CALLBACK(reset_accounts_win), NULL); |