about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-10-14 00:46:16 +0100
committerJames Booth <boothj5@gmail.com>2015-10-14 00:48:11 +0100
commitef832ce5263cd90ec0458264769f40fad85b877c (patch)
tree53336401cd71da84601cfc7b034b7f21d30aa346 /src/command
parentc9165ef9d20d1cc96f7edada2a875bc4835b63fb (diff)
downloadprofani-tty-ef832ce5263cd90ec0458264769f40fad85b877c.tar.gz
Add preference for showing TLS indicator in titlebar
Issue #616
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c12
-rw-r--r--src/command/commands.c2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/command/command.c b/src/command/command.c
index f1432d90..e6e518fe 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -200,7 +200,8 @@ static struct cmd_t command_defs[] =
             "/tls revoke <fingerprint>",
             "/tls certpath",
             "/tls certpath set <path>",
-            "/tls certpath clear")
+            "/tls certpath clear",
+            "/tls show on|off")
         CMD_DESC(
             "Handle TLS certificates. ")
         CMD_ARGS(
@@ -211,7 +212,8 @@ static struct cmd_t command_defs[] =
             { "revoke <fingerprint>", "Remove a manually trusted certificate." },
             { "certpath",             "Show the trusted certificate path." },
             { "certpath set <path>",  "Specify filesystem path containing trusted certificates." },
-            { "certpath clear",       "Clear the trusted certificate path." })
+            { "certpath clear",       "Clear the trusted certificate path." },
+            { "show on|off",          "Show or hide the TLS indicator in the titlebar." })
         CMD_NOEXAMPLES
     },
 
@@ -2158,6 +2160,7 @@ cmd_init(void)
     autocomplete_add(tls_ac, "trusted");
     autocomplete_add(tls_ac, "revoke");
     autocomplete_add(tls_ac, "certpath");
+    autocomplete_add(tls_ac, "show");
 
     tls_certpath_ac = autocomplete_new();
     autocomplete_add(tls_certpath_ac, "set");
@@ -3628,6 +3631,11 @@ _tls_autocomplete(ProfWin *window, const char * const input)
         return result;
     }
 
+    result = autocomplete_param_with_func(input, "/tls show", prefs_autocomplete_boolean_choice);
+    if (result) {
+        return result;
+    }
+
     result = autocomplete_param_with_ac(input, "/tls", tls_ac, TRUE);
     if (result) {
         return result;
diff --git a/src/command/commands.c b/src/command/commands.c
index c34c7cc3..94e768db 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -237,6 +237,8 @@ cmd_tls(ProfWin *window, const char * const command, gchar **args)
             }
         }
         return TRUE;
+    } else if (g_strcmp0(args[0], "show") == 0) {
+        return _cmd_set_boolean_preference(args[1], command, "TLS titlebar indicator", PREF_TLS_SHOW);
     } else {
         cons_bad_cmd_usage(command);
         return TRUE;