diff --git a/app/src/main/java/com/gaurav/avnc/model/ServerProfile.kt b/app/src/main/java/com/gaurav/avnc/model/ServerProfile.kt index ecc3603..50ce780 100644 --- a/app/src/main/java/com/gaurav/avnc/model/ServerProfile.kt +++ b/app/src/main/java/com/gaurav/avnc/model/ServerProfile.kt @@ -36,7 +36,7 @@ data class ServerProfile( * Internet address of the server. This can be hostname or IP address. * It does not contain the port number. */ - var address: String = "", + var host: String = "", /** * Port number of the remote server. @@ -98,7 +98,7 @@ data class ServerProfile( /** * Whether UltraVNC Repeater is used for connections. - * When repeater is used, [address] & [port] identifies the repeater. + * When repeater is used, [host] & [port] identifies the repeater. */ var useRepeater: Boolean = false, diff --git a/app/src/main/java/com/gaurav/avnc/ui/home/adapter/ProfileViewHolder.kt b/app/src/main/java/com/gaurav/avnc/ui/home/adapter/ProfileViewHolder.kt index b51bddc..609a76a 100644 --- a/app/src/main/java/com/gaurav/avnc/ui/home/adapter/ProfileViewHolder.kt +++ b/app/src/main/java/com/gaurav/avnc/ui/home/adapter/ProfileViewHolder.kt @@ -57,7 +57,7 @@ open class ProfileViewHolder( R.id.edit -> homeViewModel.onEditProfile(profile) R.id.duplicate -> homeViewModel.onDuplicateProfile(profile) R.id.delete -> homeViewModel.deleteProfile(profile) - R.id.copy_address -> homeViewModel.setClipboardText(profile.address) + R.id.copy_host -> homeViewModel.setClipboardText(profile.host) R.id.copy_name -> homeViewModel.setClipboardText(profile.name) } diff --git a/app/src/main/java/com/gaurav/avnc/util/Experimental.kt b/app/src/main/java/com/gaurav/avnc/util/Experimental.kt index 8c5b772..c7b3632 100644 --- a/app/src/main/java/com/gaurav/avnc/util/Experimental.kt +++ b/app/src/main/java/com/gaurav/avnc/util/Experimental.kt @@ -124,7 +124,7 @@ class Experimental { } private fun isServerDiscovered(p: ServerProfile): Boolean { - return discoveredServers?.find { p.address == it.address && p.port == it.port } != null + return discoveredServers?.find { p.host == it.host && p.port == it.port } != null } private fun updateAnimator() { diff --git a/app/src/main/java/com/gaurav/avnc/viewmodel/SSH.kt b/app/src/main/java/com/gaurav/avnc/viewmodel/SSH.kt index 9d515cc..241bc17 100644 --- a/app/src/main/java/com/gaurav/avnc/viewmodel/SSH.kt +++ b/app/src/main/java/com/gaurav/avnc/viewmodel/SSH.kt @@ -106,7 +106,7 @@ class SshTunnel(private val viewModel: VncViewModel) { val ss = ServerSocket(0) ss.close() try { - connection.createLocalPortForwarder(ss.localPort, profile.address, profile.port) + connection.createLocalPortForwarder(ss.localPort, profile.host, profile.port) localPort = ss.localPort } catch (e: IOException) { //Retry diff --git a/app/src/main/java/com/gaurav/avnc/viewmodel/VncViewModel.kt b/app/src/main/java/com/gaurav/avnc/viewmodel/VncViewModel.kt index e0bd93f..4b466b1 100644 --- a/app/src/main/java/com/gaurav/avnc/viewmodel/VncViewModel.kt +++ b/app/src/main/java/com/gaurav/avnc/viewmodel/VncViewModel.kt @@ -187,7 +187,7 @@ class VncViewModel(app: Application) : BaseViewModel(app), VncClient.Observer { if (channel != ServerProfile.CHANNEL_TCP && channel != ServerProfile.CHANNEL_SSH_TUNNEL) throw IOException("Unsupported Channel: $channel") - var host = profile.address + var host = profile.host var port = profile.port if (channel == ServerProfile.CHANNEL_SSH_TUNNEL) { diff --git a/app/src/main/java/com/gaurav/avnc/vnc/Discovery.kt b/app/src/main/java/com/gaurav/avnc/vnc/Discovery.kt index dd2a7c8..29f81b6 100644 --- a/app/src/main/java/com/gaurav/avnc/vnc/Discovery.kt +++ b/app/src/main/java/com/gaurav/avnc/vnc/Discovery.kt @@ -104,7 +104,7 @@ class Discovery(private val context: Context) { private fun addProfile(name: String, host: String, port: Int) { val profile = ServerProfile().apply { this.name = name - this.address = host + this.host = host this.port = port } diff --git a/app/src/main/java/com/gaurav/avnc/vnc/VncUri.kt b/app/src/main/java/com/gaurav/avnc/vnc/VncUri.kt index 9cef928..75ddeaf 100644 --- a/app/src/main/java/com/gaurav/avnc/vnc/VncUri.kt +++ b/app/src/main/java/com/gaurav/avnc/vnc/VncUri.kt @@ -60,7 +60,7 @@ class VncUri(private val uri: Uri) { */ fun toServerProfile() = ServerProfile( name = connectionName, - address = host, + host = host, port = port, username = username, password = password, diff --git a/app/src/main/res/layout/fragment_profile_editor.xml b/app/src/main/res/layout/fragment_profile_editor.xml index bfd3bfd..190b13b 100644 --- a/app/src/main/res/layout/fragment_profile_editor.xml +++ b/app/src/main/res/layout/fragment_profile_editor.xml @@ -51,7 +51,7 @@ android:hint="@{profile.useRepeater ? @string/hint_repeater_host : @string/hint_host}" android:importantForAutofill="no" android:inputType="textUri" - android:text="@={profile.address}" /> + android:text="@={profile.host}" /> diff --git a/app/src/main/res/layout/server_profile.xml b/app/src/main/res/layout/server_profile.xml index c0523eb..e09d578 100644 --- a/app/src/main/res/layout/server_profile.xml +++ b/app/src/main/res/layout/server_profile.xml @@ -38,7 +38,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/margin_small" - android:text='@{profile.address + (profile.port == 5900 ? "" : " | " + profile.port) }' + android:text='@{profile.host + (profile.port == 5900 ? "" : " | " + profile.port) }' app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/profile_name" tools:text="192.168.1.1 | 5901" /> diff --git a/app/src/main/res/menu/discovered_server.xml b/app/src/main/res/menu/discovered_server.xml index b58c303..4392b96 100644 --- a/app/src/main/res/menu/discovered_server.xml +++ b/app/src/main/res/menu/discovered_server.xml @@ -11,6 +11,6 @@ android:id="@+id/copy_name" android:title="@string/title_copy_name" /> + android:id="@+id/copy_host" + android:title="@string/title_copy_host" /> \ No newline at end of file diff --git a/app/src/main/res/menu/server_profile.xml b/app/src/main/res/menu/server_profile.xml index 13e3d38..8242c47 100644 --- a/app/src/main/res/menu/server_profile.xml +++ b/app/src/main/res/menu/server_profile.xml @@ -14,8 +14,8 @@ android:id="@+id/duplicate" android:title="@string/title_duplicate" /> + android:id="@+id/copy_host" + android:title="@string/title_copy_host" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0a2ed1f..9dec465 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,7 +14,7 @@ Edit Delete Copy - Copy Address + Copy Host Copy Name Advanced Save