From c59b3e1230a17e288a50fbe685601e83c8f99de3 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 8 Aug 2017 05:54:12 -0500 Subject: Profile: Make name modifiable Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/config/Profile.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com/wireguard') diff --git a/app/src/main/java/com/wireguard/config/Profile.java b/app/src/main/java/com/wireguard/config/Profile.java index 70781195..ab4d645b 100644 --- a/app/src/main/java/com/wireguard/config/Profile.java +++ b/app/src/main/java/com/wireguard/config/Profile.java @@ -22,7 +22,7 @@ import java.nio.charset.StandardCharsets; public class Profile extends BaseObservable implements Copyable, Observable { private final Interface iface = new Interface(); private boolean isConnected; - private final String name; + private String name; private final ObservableList peers = new ObservableArrayList<>(); public Profile(String name) { @@ -55,6 +55,7 @@ public class Profile extends BaseObservable implements Copyable, Observ return isConnected; } + @Bindable public String getName() { return name; } @@ -89,6 +90,11 @@ public class Profile extends BaseObservable implements Copyable, Observ notifyPropertyChanged(BR.isConnected); } + public void setName(String name) { + this.name = name; + notifyPropertyChanged(BR.name); + } + @Override public String toString() { StringBuilder sb = new StringBuilder().append(iface.toString()); -- cgit v1.2.3