diff options
Diffstat (limited to 'src/core/wee-secure-buffer.c')
-rw-r--r-- | src/core/wee-secure-buffer.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/core/wee-secure-buffer.c b/src/core/wee-secure-buffer.c index 86dab6a36..2fea6fcc3 100644 --- a/src/core/wee-secure-buffer.c +++ b/src/core/wee-secure-buffer.c @@ -204,20 +204,35 @@ secure_buffer_assign () void secure_buffer_open () { + struct t_hashtable *properties; + if (!secure_buffer) { - secure_buffer = gui_buffer_new (NULL, SECURE_BUFFER_NAME, - &secure_buffer_input_cb, NULL, NULL, - &secure_buffer_close_cb, NULL, NULL); - if (secure_buffer) + properties = hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, NULL); + if (properties) { - if (!secure_buffer->short_name) - secure_buffer->short_name = strdup (SECURE_BUFFER_NAME); - gui_buffer_set (secure_buffer, "type", "free"); - gui_buffer_set (secure_buffer, "localvar_set_no_log", "1"); - gui_buffer_set (secure_buffer, "key_bind_meta-v", "/secure toggle_values"); + hashtable_set (properties, "type", "free"); + hashtable_set (properties, "localvar_set_no_log", "1"); + hashtable_set (properties, + "key_bind_meta-v", "/secure toggle_values"); } + + secure_buffer = gui_buffer_new_props ( + NULL, SECURE_BUFFER_NAME, properties, + &secure_buffer_input_cb, NULL, NULL, + &secure_buffer_close_cb, NULL, NULL); + + if (secure_buffer && !secure_buffer->short_name) + secure_buffer->short_name = strdup (SECURE_BUFFER_NAME); + secure_buffer_display_values = 0; + + if (properties) + hashtable_free (properties); } if (!secure_buffer) |