diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-09-23 15:19:41 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-09-23 17:01:26 +0100 |
commit | c6939cec58fe158574f4206a780dffdf74264db4 (patch) | |
tree | b077a07e6688c106a4122170d5d5f96fb9889710 | |
parent | af96bbe41f468f6301819b455713359d25efb5d7 (diff) |
mc-tool: add a 'reconnect' command
-rw-r--r-- | util/mc-tool.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/util/mc-tool.c b/util/mc-tool.c index f6b5eca1..f83f3981 100644 --- a/util/mc-tool.c +++ b/util/mc-tool.c @@ -569,7 +569,11 @@ callback_for_update_parameters (GObject *source, if (reconnect_required[0] != NULL) { gchar *r = g_strjoinv (", ", reconnect_required); - printf ("Reconnect required to update these parameters: %s\n", r); + printf ("To apply changes to these parameters:\n"); + printf (" %s\n", r); + printf ("run:\n"); + printf (" %s reconnect %s\n", app_name, + skip_prefix (command.common.account)); g_free (r); g_strfreev (reconnect_required); } @@ -836,6 +840,15 @@ command_auto_connect (TpAccount *account) } static gboolean +command_reconnect (TpAccount *account) +{ + tp_account_reconnect_async (account, callback_for_async, + tp_account_reconnect_finish); + + return TRUE; +} + +static gboolean command_update (TpAccount *account) { tp_account_update_parameters_async (account, @@ -1144,6 +1157,13 @@ parse (int argc, char **argv) else show_help ("Invalid auto-connect command."); } + else if (strcmp (argv[1], "reconnect") == 0) { + if (argc != 3) + show_help ("Invalid reconnect command."); + + command.ready.account = command_reconnect; + command.common.account = argv[2]; + } else if (strcmp (argv[1], "help") == 0 || strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) { |