diff --git a/src/AndroidTool.kt b/src/AndroidTool.kt index 25a2eca..7bbaa20 100644 --- a/src/AndroidTool.kt +++ b/src/AndroidTool.kt @@ -346,7 +346,7 @@ open class AndroidTool : Command() { AdbDevicesOutput.substring(AdbDevicesOutput.indexOf("192.168")).substringBefore(':') } catch (e: Exception) { } - if (tabbedpane.selectedIndex == 0 || tabbedpane.selectedIndex == 1 || tabbedpane.selectedIndex == 2) { + if (tabbedpane.selectedIndex == 0 || tabbedpane.selectedIndex == 1) { contents.setBounds(5, 5, 310, 375) deviceControlPanel.setBounds(5, 385, 310, 85) deviceConnection.setBounds(5, 475, 310, 100) @@ -356,7 +356,7 @@ open class AndroidTool : Command() { textFieldIP.isVisible = true labelConnect.isVisible = true labelIP.isVisible = true - } else if (tabbedpane.selectedIndex == 3) { + } else if (tabbedpane.selectedIndex == 2) { contents.setBounds(5, 5, 310, 425) deviceControlPanel.setBounds(5, 435, 310, 85) deviceConnection.setBounds(5, 525, 310, 50) @@ -366,7 +366,7 @@ open class AndroidTool : Command() { textFieldIP.isVisible = false labelConnect.isVisible = false labelIP.isVisible = false - } else if (tabbedpane.selectedIndex == 4) { + } else if (tabbedpane.selectedIndex == 3) { contents.setBounds(5, 5, 310, 425) deviceControlPanel.setBounds(5, 435, 310, 85) deviceConnection.setBounds(5, 525, 310, 50) @@ -376,7 +376,7 @@ open class AndroidTool : Command() { textFieldIP.isVisible = false labelConnect.isVisible = false labelIP.isVisible = false - } else if (tabbedpane.selectedIndex == 6) { + } else if (tabbedpane.selectedIndex == 4) { contents.setBounds(5, 5, 310, 375) deviceControlPanel.setBounds(5, 385, 310, 85) deviceConnection.setBounds(5, 475, 310, 100) @@ -411,6 +411,7 @@ open class AndroidTool : Command() { exec("adb", "install \'$path\'") } buttonInstallAll.isEnabled = true + labelSelectedAll.text = "Selected: -" } getListOfPackages() } @@ -422,6 +423,7 @@ open class AndroidTool : Command() { else exec("adb", "install \'$selectedFileAbsolutePath\'") buttonInstallOne.isEnabled = true + labelSelectedOne.text = "Selected: -" } getListOfPackages() } @@ -487,6 +489,7 @@ open class AndroidTool : Command() { selectedFileAbsolutePath = choseFile.selectedFile.absolutePath selectedFilePath = choseFile.selectedFile.path labelSelectedOne.text = "Selected: ${choseFile.selectedFile.name}" + buttonInstallOne.isEnabled = true } buttonChooseOne.isEnabled = true } @@ -500,6 +503,7 @@ open class AndroidTool : Command() { if (chooseDialog == JFileChooser.APPROVE_OPTION) { selectedDirectoryPath = choseDirectory.selectedFile.path labelSelectedAll.text = "Selected: ${choseDirectory.selectedFile.path}" + buttonInstallAll.isEnabled = true } buttonChoseAll.isEnabled = true } diff --git a/src/Command.kt b/src/Command.kt index ae1873d..80925ee 100644 --- a/src/Command.kt +++ b/src/Command.kt @@ -199,7 +199,7 @@ open class Command : AndroidToolUI() { val enableComponents: Array = adbPanel.components + consolePanel.components + logsPanel.components for (component in enableComponents) - if (component != buttonStop && component != buttonSave) + if (component != buttonStop && component != buttonSave && component != buttonInstallOne && component != buttonInstallAll) component.isEnabled = true } textAreaCommandOutput.isFocusable = true @@ -570,7 +570,6 @@ open class Command : AndroidToolUI() { for (component in components) if (component != buttonStop && component != buttonSave && component != openConsole) component.isEnabled = false - textAreaCommandOutput.isFocusable = false textAreaCommandInput.isFocusable = false listLogs.isFocusable = false diff --git a/src/UI.kt b/src/UI.kt index 4cf816d..8bbf5fb 100644 --- a/src/UI.kt +++ b/src/UI.kt @@ -1125,7 +1125,8 @@ open class AndroidToolUI { val components: Array = fastbootPanel.components + adbPanel.components + logsPanel.components + recoveryPanel.components + consolePanel.components for (component in components) - component.isEnabled = false + if (component != openConsole) + component.isEnabled = false frame.add(tabbedpane) }