diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-25 19:41:55 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-26 13:28:17 +0200 |
commit | 93710a53e75a0aaf86eb7e480c9f7496fcb32a20 (patch) | |
tree | 4a95b67fc1ac9bae321a0a4f6997f245070e2cea /ui/editdialog.go | |
parent | ui: bind shortcuts using new api (diff) | |
download | wireguard-windows-93710a53e75a0aaf86eb7e480c9f7496fcb32a20.tar.xz wireguard-windows-93710a53e75a0aaf86eb7e480c9f7496fcb32a20.zip |
ui: remove clone
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | ui/editdialog.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ui/editdialog.go b/ui/editdialog.go index f1d7fac5..f27ab60f 100644 --- a/ui/editdialog.go +++ b/ui/editdialog.go @@ -28,11 +28,11 @@ type EditDialog struct { blockUntunneledTraficCheckGuard bool } -func runTunnelEditDialog(owner walk.Form, tunnel *manager.Tunnel, clone bool) *conf.Config { +func runTunnelEditDialog(owner walk.Form, tunnel *manager.Tunnel) *conf.Config { dlg := &EditDialog{} var title string - if tunnel == nil || clone { + if tunnel == nil { title = "Create new tunnel" } else { title = "Edit tunnel" @@ -44,9 +44,6 @@ func runTunnelEditDialog(owner walk.Form, tunnel *manager.Tunnel, clone bool) *c dlg.config = conf.Config{Interface: conf.Interface{PrivateKey: *pk}} } else { dlg.config, _ = tunnel.StoredConfig() - if clone { - dlg.config.Name += "-copy" - } } layout := walk.NewGridLayout() @@ -113,11 +110,7 @@ func runTunnelEditDialog(owner walk.Form, tunnel *manager.Tunnel, clone bool) *c dlg.syntaxEdit.BlockUntunneledTrafficStateChanged().Attach(dlg.onBlockUntunneledTrafficStateChanged) dlg.syntaxEdit.SetText(dlg.config.ToWgQuick()) - if clone { - dlg.config.Name = "" - } - - if tunnel != nil && !clone { + if tunnel != nil { dlg.nameEdit.SetFocus() // TODO: This works around a walk issue with scrolling in weird ways <https://github.com/lxn/walk/issues/505>. We should fix this in walk instead of here. dlg.Starting().Attach(func() { |