From 08a5088c16ae0bd69adc42ac6489adde3a9ad13f Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 2 Aug 2019 03:15:12 +0200 Subject: Rework encryption enabling logic + UI --- libdino/src/plugin/interfaces.vala | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'libdino') diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala index ed48fc02..41929ac0 100644 --- a/libdino/src/plugin/interfaces.vala +++ b/libdino/src/plugin/interfaces.vala @@ -25,7 +25,7 @@ public interface EncryptionListEntry : Object { public abstract Entities.Encryption encryption { get; } public abstract string name { get; } - public abstract bool can_encrypt(Conversation conversation); + public abstract void encryption_activated(Entities.Conversation conversation, Plugins.SetInputFieldStatus callback); } public abstract class AccountSettingsEntry : Object { @@ -123,4 +123,29 @@ public interface NotificationCollection : Object { public signal void remove_meta_notification(MetaConversationNotification item); } +public delegate void SetInputFieldStatus(InputFieldStatus field_status); +public class InputFieldStatus : Object { + public enum MessageType { + NONE, + INFO, + WARNING, + ERROR + } + public enum InputState { + NORMAL, + DISABLED, + NO_SEND + } + + public string? message; + public MessageType message_type; + public InputState input_state; + + public InputFieldStatus(string? message, MessageType message_type, InputState input_state) { + this.message = message; + this.message_type = message_type; + this.input_state = input_state; + } +} + } -- cgit v1.2.3-70-g09d2