diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-08 05:54:12 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-08 05:54:12 -0500 |
commit | c59b3e1230a17e288a50fbe685601e83c8f99de3 (patch) | |
tree | c48993b731f4e92e5d0aae8dc646cc63baa95401 /app | |
parent | 0685d4a1591cac4683e3c6e73024414fdb1739f0 (diff) |
Profile: Make name modifiable
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/com/wireguard/config/Profile.java | 8 |
1 files changed, 7 insertions, 1 deletions
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<Profile>, Observable { private final Interface iface = new Interface(); private boolean isConnected; - private final String name; + private String name; private final ObservableList<Peer> peers = new ObservableArrayList<>(); public Profile(String name) { @@ -55,6 +55,7 @@ public class Profile extends BaseObservable implements Copyable<Profile>, Observ return isConnected; } + @Bindable public String getName() { return name; } @@ -89,6 +90,11 @@ public class Profile extends BaseObservable implements Copyable<Profile>, 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()); |