Mercurial > pidgin
comparison console/gntconv.c @ 14024:7109e6397a31
[gaim-migrate @ 16622]
Add commands /accounts, /buddylist, /debugwin and /plugins. It allows
the user to close those windows, and pop them back up when necessary --
provided a conversation window is open -- which I am assuming would be
the case most of the time. Until there's some better way of accessing
these dialogs (eg. menus), this is the only way.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Thu, 03 Aug 2006 07:16:35 +0000 |
parents | 735c4e927eb8 |
children | 0e70bb6d32fd |
comparison
equal
deleted
inserted
replaced
14023:07d645986c79 | 14024:7109e6397a31 |
---|---|
3 #include <cmds.h> | 3 #include <cmds.h> |
4 #include <prefs.h> | 4 #include <prefs.h> |
5 #include <util.h> | 5 #include <util.h> |
6 | 6 |
7 #include "gntgaim.h" | 7 #include "gntgaim.h" |
8 #include "gntaccount.h" | |
8 #include "gntblist.h" | 9 #include "gntblist.h" |
9 #include "gntconv.h" | 10 #include "gntconv.h" |
11 #include "gntdebug.h" | |
12 #include "gntplugin.h" | |
10 | 13 |
11 #include "gnt.h" | 14 #include "gnt.h" |
12 #include "gntbox.h" | 15 #include "gntbox.h" |
13 #include "gntentry.h" | 16 #include "gntentry.h" |
14 #include "gnttextview.h" | 17 #include "gnttextview.h" |
476 g_string_free(s, TRUE); | 479 g_string_free(s, TRUE); |
477 | 480 |
478 return GAIM_CMD_STATUS_OK; | 481 return GAIM_CMD_STATUS_OK; |
479 } | 482 } |
480 | 483 |
484 static GaimCmdRet | |
485 cmd_show_window(GaimConversation *conv, const char *cmd, char **args, char **error, gpointer data) | |
486 { | |
487 void (*callback)() = data; | |
488 callback(); | |
489 return GAIM_CMD_STATUS_OK; | |
490 } | |
481 | 491 |
482 void gg_conversation_init() | 492 void gg_conversation_init() |
483 { | 493 { |
484 ggconvs = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_ggconv); | 494 ggconvs = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_ggconv); |
485 | 495 |
505 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, | 515 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, |
506 clear_command_cb, _("clear: Clears the conversation scrollback."), NULL); | 516 clear_command_cb, _("clear: Clears the conversation scrollback."), NULL); |
507 gaim_cmd_register("help", "w", GAIM_CMD_P_DEFAULT, | 517 gaim_cmd_register("help", "w", GAIM_CMD_P_DEFAULT, |
508 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, NULL, | 518 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, NULL, |
509 help_command_cb, _("help <command>: Help on a specific command."), NULL); | 519 help_command_cb, _("help <command>: Help on a specific command."), NULL); |
520 | |
521 /* Now some commands to bring up some other windows */ | |
522 gaim_cmd_register("plugins", "", GAIM_CMD_P_DEFAULT, | |
523 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, | |
524 cmd_show_window, _("plugins: Show the plugins window."), gg_plugins_show_all); | |
525 gaim_cmd_register("buddylist", "", GAIM_CMD_P_DEFAULT, | |
526 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, | |
527 cmd_show_window, _("buddylist: Show the buddylist."), gg_blist_show); | |
528 gaim_cmd_register("accounts", "", GAIM_CMD_P_DEFAULT, | |
529 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, | |
530 cmd_show_window, _("accounts: Show the accounts window."), gg_accounts_show_all); | |
531 gaim_cmd_register("debugwin", "", GAIM_CMD_P_DEFAULT, | |
532 GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, | |
533 cmd_show_window, _("debugwin: Show the debug window."), gg_debug_window_show); | |
510 } | 534 } |
511 | 535 |
512 void gg_conversation_uninit() | 536 void gg_conversation_uninit() |
513 { | 537 { |
514 g_hash_table_destroy(ggconvs); | 538 g_hash_table_destroy(ggconvs); |