diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt index cfb365c..d95a1f7 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -33,7 +33,7 @@ import java.util.regex.Pattern | |||
33 | * @author pacien | 33 | * @author pacien |
34 | */ | 34 | */ |
35 | abstract class ConfigurationToolDialogFragment : BaseDialogFragment() { | 35 | abstract class ConfigurationToolDialogFragment : BaseDialogFragment() { |
36 | private val networkNamePattern by lazy { Pattern.compile("^[^\\x00/]*$")!! } | 36 | private val networkNamePattern by lazy { Pattern.compile("^[^\\x00/]*$") } |
37 | 37 | ||
38 | protected fun makeDialog(@LayoutRes layout: Int, @StringRes title: Int, @StringRes applyButton: Int, applyAction: (View) -> Unit) = | 38 | protected fun makeDialog(@LayoutRes layout: Int, @StringRes title: Int, @StringRes applyButton: Int, applyAction: (View) -> Unit) = |
39 | makeDialog(inflate(layout), title, applyButton, applyAction) | 39 | makeDialog(inflate(layout), title, applyButton, applyAction) |
@@ -51,7 +51,7 @@ abstract class ConfigurationToolDialogFragment : BaseDialogFragment() { | |||
51 | action | 51 | action |
52 | .whenComplete { _, _ -> progressDialog.dismiss() } | 52 | .whenComplete { _, _ -> progressDialog.dismiss() } |
53 | .thenAccept { parentActivity.notify(R.string.configure_tools_message_network_configuration_written) } | 53 | .thenAccept { parentActivity.notify(R.string.configure_tools_message_network_configuration_written) } |
54 | .exceptionallyAccept { parentActivity.runOnUiThread { parentActivity.showErrorDialog(it.cause!!.localizedMessage) } } | 54 | .exceptionallyAccept { parentActivity.runOnUiThread { parentActivity.showErrorDialog(it.cause!!.localizedMessage!!) } } |
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||