From 56d5f8878cb5abeec2159448113a374c78c9b4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kremla?= <155779787+lukaskremla@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:20:24 +0100 Subject: [PATCH 1/5] Suggested text adjustments and typo fixes --- .../com/jetbrains/micropython/nova/ConnectAction.kt | 4 ++-- .../jetbrains/micropython/nova/ConnectCredentials.kt | 2 +- .../micropython/nova/DownloadFromDeviceAction.kt | 2 +- .../com/jetbrains/micropython/nova/FileSystemWidget.kt | 8 ++++---- .../micropython/nova/MicroPythonToolWindow.kt | 2 +- .../jetbrains/micropython/nova/MpyWebSocketClient.kt | 2 +- .../kotlin/com/jetbrains/micropython/nova/actions.kt | 10 +++++----- .../run/MicroPythonRunConfigurationEditor.kt | 4 ++-- .../settings/MicroPythonModuleConfigurable.kt | 2 +- .../micropython/settings/MicroPythonSettingsPanel.kt | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt b/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt index 6e0ffde..2a36431 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt @@ -40,7 +40,7 @@ suspend fun doConnect(fileSystemWidget: FileSystemWidget) { if (facet.configuration.uart) { val portName = facet.configuration.portName if (portName.isBlank()) { - msg = "Port is not selected" + msg = "No port is selected" connectionParameters = null } else { connectionParameters = ConnectionParameters(portName) @@ -63,7 +63,7 @@ suspend fun doConnect(fileSystemWidget: FileSystemWidget) { val result = Messages.showIdeaMessageDialog( fileSystemWidget.project, msg, - "Cannot Connect", + "Can Not Connect", arrayOf("OK", "Settings..."), 1, AllIcons.General.ErrorDialog, diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/ConnectCredentials.kt b/src/main/kotlin/com/jetbrains/micropython/nova/ConnectCredentials.kt index 6e71673..1bf8d93 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/ConnectCredentials.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/ConnectCredentials.kt @@ -44,7 +44,7 @@ fun messageForBrokenUrl(url: String): @Nls String? { try { val uri = URI(url) if (uri.scheme !in arrayOf("ws", "wss")) { - return "URL format has to be ws://host:port or wss://host:port\n but was $url" + return "URL format has to be ws://host:port or wss://host:port\n but you have entered: $url" } return null } catch (_: URISyntaxException) { diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/DownloadFromDeviceAction.kt b/src/main/kotlin/com/jetbrains/micropython/nova/DownloadFromDeviceAction.kt index 749bb4b..6b9b9e2 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/DownloadFromDeviceAction.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/DownloadFromDeviceAction.kt @@ -47,7 +47,7 @@ class DownloadFromDeviceAction : ReplAction("Download File or Folder...", true) if (destination?.children?.isNotEmpty() == true) { if (Messages.showOkCancelDialog( fileSystemWidget.project, - "The destination folder is not empty.\nIt's content may be damaged.", + "The destination folder is not empty.\nIts contents may be damaged.", "Warning", "Continue", "Cancel", diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/FileSystemWidget.kt b/src/main/kotlin/com/jetbrains/micropython/nova/FileSystemWidget.kt index 61753b6..88f1f14 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/FileSystemWidget.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/FileSystemWidget.kt @@ -103,7 +103,7 @@ class FileSystemWidget(val project: Project, newDisposable: Disposable) : private fun newTreeModel() = DefaultTreeModel(DirNode("/", "/"), true) init { - tree.emptyText.appendText("Board is disconnected") + tree.emptyText.appendText("No board is connected") tree.emptyText.appendLine("Connect...", SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES) { performReplAction(project, false, "Connecting...") { doConnect(it) } } @@ -206,15 +206,15 @@ class FileSystemWidget(val project: Project, newDisposable: Disposable) : val fileName = fileSystemNodes[0].fullName if (fileSystemNodes[0] is DirNode) { title = "Delete folder $fileName" - message = "Are you sure to delete the folder and it's subtree?\n\r The operation can't be undone!" + message = "Are you sure you want to delete the folder and its subtree?\n\rThis operation cannot be undone!" } else { title = "Delete file $fileName" - message = "Are you sure to delete the file?\n\r The operation can't be undone!" + message = "Are you sure you want to delete this file?\n\rThis operation cannot be undone!" } } else { title = "Delete multiple objects" message = - "Are you sure to delete ${fileSystemNodes.size} items?\n\r The operation can't be undone!" + "Are you sure you want to delete ${fileSystemNodes.size} items?\n\rThis operation cannot be undone!" } val sure = MessageDialogBuilder.yesNo(title, message).ask(project) diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/MicroPythonToolWindow.kt b/src/main/kotlin/com/jetbrains/micropython/nova/MicroPythonToolWindow.kt index d9cda51..73a9e1d 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/MicroPythonToolWindow.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/MicroPythonToolWindow.kt @@ -61,7 +61,7 @@ class MicroPythonToolWindow : ToolWindowFactory, DumbAware { } -class AutoClearAction : CheckboxAction("Auto Clear REPL", "Automatically clear REPL window board data exchange", null), +class AutoClearAction : CheckboxAction("Auto Clear REPL", "Automatically clear REPL console on device reset/upload", null), DumbAware { override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/MpyWebSocketClient.kt b/src/main/kotlin/com/jetbrains/micropython/nova/MpyWebSocketClient.kt index ea14b27..eae54a6 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/MpyWebSocketClient.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/MpyWebSocketClient.kt @@ -81,7 +81,7 @@ open class MpyWebSocketClient(private val comm: MpyComm) : Client { time -= SHORT_DELAY.toInt() } if (!isConnected) { - throw ConnectException("Webrepl connection failed") + throw ConnectException("WebREPL connection failed") } } withTimeout(TIMEOUT) { diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt b/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt index c808ee9..74d0f09 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt @@ -81,12 +81,12 @@ fun performReplAction( ): T? { val fileSystemWidget = fileSystemWidget(project) ?: return null if (connectionRequired && fileSystemWidget.state != State.CONNECTED) { - if (!MessageDialogBuilder.yesNo("Device is not connected", "Connect now?").ask(project)) { + if (!MessageDialogBuilder.yesNo("No device is connected", "Connect now?").ask(project)) { return null } } var result: T? = null - runWithModalProgressBlocking(project, "Board data exchange...") { + runWithModalProgressBlocking(project, "Exchanging data with the board...") { var error: String? = null try { if (connectionRequired) { @@ -259,7 +259,7 @@ class OpenMpyFile : ReplAction("Open file", true) { } } -open class UploadFile() : DumbAwareAction("Upload File(s) to Micropython device") { +open class UploadFile() : DumbAwareAction("Upload File(s) to MicroPython Device") { override fun getActionUpdateThread(): ActionUpdateThread = BGT override fun update(e: AnActionEvent) { @@ -270,7 +270,7 @@ open class UploadFile() : DumbAwareAction("Upload File(s) to Micropython device" && ModuleUtil.findModuleForFile(file, project)?.microPythonFacet != null ) { e.presentation.text = - if (file.isDirectory) "Upload Directory to Micropython device" else "Upload File to Micropython device" + if (file.isDirectory) "Upload Directory to MicroPython Device" else "Upload File to MicroPython Device" } else { e.presentation.isEnabledAndVisible = false } @@ -326,7 +326,7 @@ class CreateDeviceFolderAction : ReplAction("New Folder", true) { } } - override val actionDescription: @NlsContexts.DialogMessage String = "New folder is created..." + override val actionDescription: @NlsContexts.DialogMessage String = "New folder is being created..." override suspend fun performAction(fileSystemWidget: FileSystemWidget) { diff --git a/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfigurationEditor.kt b/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfigurationEditor.kt index 66817be..c3e5db8 100644 --- a/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfigurationEditor.kt +++ b/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfigurationEditor.kt @@ -27,8 +27,8 @@ import javax.swing.JComponent class MicroPythonRunConfigurationEditor(config: MicroPythonRunConfiguration) : SettingsEditor() { private val pathField = TextFieldWithBrowseButton() - private val resetOnSuccess = CheckBox("Reset on success", selected = true) - private val runReplOnSuccess = CheckBox("Open MicroPython REPL on success", selected = true) + private val resetOnSuccess = CheckBox("Reset on Success", selected = true) + private val runReplOnSuccess = CheckBox("Open MicroPython REPL on Success", selected = true) init { val descriptor = FileChooserDescriptor(true, true, false, false, false, false).withTitle("Select Path") diff --git a/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonModuleConfigurable.kt b/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonModuleConfigurable.kt index 2be2c7e..1bc4d0d 100644 --- a/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonModuleConfigurable.kt +++ b/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonModuleConfigurable.kt @@ -44,7 +44,7 @@ class MicroPythonModuleConfigurable(private val module: Module) : Configurable { } private val enabledCheckbox by lazy { - val checkBox = JCheckBox("Enable MicroPython support") + val checkBox = JCheckBox("Enable MicroPython Support") checkBox.addActionListener { update() } diff --git a/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt b/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt index f0c3f4c..e6f65f6 100644 --- a/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt +++ b/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt @@ -100,7 +100,7 @@ class MicroPythonSettingsPanel(private val module: Module, disposable: Disposabl ) .validationInfo { comboBox -> val portName = comboBox.selectedItem.asSafely() - if (portName.isNullOrBlank()) ValidationInfo("No port name provided").withOKEnabled() + if (portName.isNullOrBlank()) ValidationInfo("No port name was provided").withOKEnabled() else if (!portSelectModel.contains(portName)) ValidationInfo("Unknown port name").asWarning() .withOKEnabled() else null @@ -124,7 +124,7 @@ class MicroPythonSettingsPanel(private val module: Module, disposable: Disposabl }.layout(RowLayout.LABEL_ALIGNED) row { passwordField().bindText(parameters::password).label("Password: ") - .comment("(4..9 symbols)") + .comment("(4-9 symbols)") .columns(40) .validationInfo { field -> if (field.password.size !in PASSWORD_LENGTH) error("Allowed password length is $PASSWORD_LENGTH").withOKEnabled() else null From 42ba73617af83c48f2076166a397c4e0f165b382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kremla?= <155779787+lukaskremla@users.noreply.github.com> Date: Sun, 24 Nov 2024 09:07:57 +0100 Subject: [PATCH 2/5] Fixed a cannot x can not typo --- src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt b/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt index 2a36431..ca61b39 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/ConnectAction.kt @@ -63,7 +63,7 @@ suspend fun doConnect(fileSystemWidget: FileSystemWidget) { val result = Messages.showIdeaMessageDialog( fileSystemWidget.project, msg, - "Can Not Connect", + "Cannot Connect", arrayOf("OK", "Settings..."), 1, AllIcons.General.ErrorDialog, From 4c715b635731b2c472e18760abbadb41e5266a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kremla?= <155779787+lukaskremla@users.noreply.github.com> Date: Mon, 25 Nov 2024 18:25:27 +0100 Subject: [PATCH 3/5] Some more messages that I feel could be improved with some re-wording. --- .../jetbrains/micropython/run/MicroPythonRunConfiguration.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfiguration.kt b/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfiguration.kt index 6a40b32..e4ac6e8 100644 --- a/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfiguration.kt +++ b/src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfiguration.kt @@ -92,7 +92,7 @@ class MicroPythonRunConfiguration(project: Project, factory: ConfigurationFactor override fun checkConfiguration() { super.checkConfiguration() - val m = module ?: throw RuntimeConfigurationError("Module for path is not found") + val m = module ?: throw RuntimeConfigurationError("Module for path was not found") val showSettings = Runnable { when { PlatformUtils.isPyCharm() -> @@ -114,7 +114,7 @@ class MicroPythonRunConfiguration(project: Project, factory: ConfigurationFactor } throw RuntimeConfigurationError(validationResult.errorMessage, runQuickFix) } - facet.pythonPath ?: throw RuntimeConfigurationError("Python interpreter is not found") + facet.pythonPath ?: throw RuntimeConfigurationError("Python interpreter was not found") } override fun suggestedName() = "Flash ${PathUtil.getFileName(path)}" From a4b4909b43ab9b8c305f948033527f13eca0ceae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kremla?= <155779787+lukaskremla@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:33:45 +0100 Subject: [PATCH 4/5] Changed to "No port name provided" --- .../jetbrains/micropython/settings/MicroPythonSettingsPanel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt b/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt index e6f65f6..2674702 100644 --- a/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt +++ b/src/main/kotlin/com/jetbrains/micropython/settings/MicroPythonSettingsPanel.kt @@ -100,7 +100,7 @@ class MicroPythonSettingsPanel(private val module: Module, disposable: Disposabl ) .validationInfo { comboBox -> val portName = comboBox.selectedItem.asSafely() - if (portName.isNullOrBlank()) ValidationInfo("No port name was provided").withOKEnabled() + if (portName.isNullOrBlank()) ValidationInfo("No port name provided").withOKEnabled() else if (!portSelectModel.contains(portName)) ValidationInfo("Unknown port name").asWarning() .withOKEnabled() else null From 05b14e1ba179580509bf76d957839d06e79c7865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kremla?= <155779787+lukaskremla@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:56:34 +0100 Subject: [PATCH 5/5] One more refactoring --- src/main/kotlin/com/jetbrains/micropython/nova/actions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt b/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt index 74d0f09..5353877 100644 --- a/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt +++ b/src/main/kotlin/com/jetbrains/micropython/nova/actions.kt @@ -326,7 +326,7 @@ class CreateDeviceFolderAction : ReplAction("New Folder", true) { } } - override val actionDescription: @NlsContexts.DialogMessage String = "New folder is being created..." + override val actionDescription: @NlsContexts.DialogMessage String = "Creating new folder..." override suspend fun performAction(fileSystemWidget: FileSystemWidget) {