Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested text adjustments and typo fixes #345

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -63,7 +63,7 @@ suspend fun doConnect(fileSystemWidget: FileSystemWidget) {
val result = Messages.showIdeaMessageDialog(
fileSystemWidget.project,
msg,
"Cannot Connect",
"Can Not Connect",
lukaskremla marked this conversation as resolved.
Show resolved Hide resolved
arrayOf("OK", "Settings..."),
1,
AllIcons.General.ErrorDialog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/com/jetbrains/micropython/nova/actions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ fun <T> 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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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
}
Expand Down Expand Up @@ -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) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import javax.swing.JComponent

class MicroPythonRunConfigurationEditor(config: MicroPythonRunConfiguration) : SettingsEditor<MicroPythonRunConfiguration>() {
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class MicroPythonSettingsPanel(private val module: Module, disposable: Disposabl
)
.validationInfo { comboBox ->
val portName = comboBox.selectedItem.asSafely<String>()
if (portName.isNullOrBlank()) ValidationInfo("No port name provided").withOKEnabled()
if (portName.isNullOrBlank()) ValidationInfo("No port name was provided").withOKEnabled()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is provided sounds better IMO

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it has to stay "was provided" as the action happened in the past, the user first had to provide a port name and if he did not, then it can be said that "No port name was provided".

https://textranch.com/c/is-provided-or-was-provided/

Copy link
Collaborator

@elmot elmot Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at your link:

"was provided" is used in the past tense to indicate something that was provided at a specific point in the past

We're not talking about any specific point in the past, but about the situation which takes place right now.
So either present simple passive "is provider" or present perfect passive "has been provided". Latter one is too long for a error message.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at your link:

"was provided" is used in the past tense to indicate something that was provided at a specific point in the past

We're not talking about any specific point in the past, but about the situation which takes place right now. So either present simple passive "is provider" or present perfect passive "has been provided". Latter one is too long for a error message.

Grammatically all three options are actually correct "was, is" or leaving it the way it was originally - all are valid grammatically.

The reason why I suggested using "was" is that this just sounds natural to me when dealing with error messages in general, to list some examples:
• “An unexpected error occurred.”
• “File not found.”
• “Connection was lost.”

Using "is" sounds more like an observation rather than an error message, to me at least.

Yes the situation is taking place right now, but looking at the menu, I first had to leave the port name field empty, the IDE had to evaluate it and tell me I have left it empty, meaning "no port name was provided". This is just my intuition, what I expect this kind of error message to look like.

But you have the final say, this is just my perception. Either "was provided" or actually even just "provided" sound fine to me. If you want I can change the commit to "is provided" as well. Thanks for your patience with my PRs!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<grammarnazi>
"File not found." is a syntactically incorrect statement, a couple of words is omitted for brevity. It should be "The file is not found", but in it is acceptable in error messages
</grammarnazi>

So, let it be "provided" or "is provided" - that's up to you.

Thanks for your patience with my PRs!

On the contrary, I'm glad that I'm not a lone wolf here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"File not found." is a syntactically incorrect statement, a couple of words is omitted for brevity. It should be "The file is not found", but in it is acceptable in error messages

I don't think that is correct. The system first searched for the file, it did not find it and then it is letting you know that "The file was not found". if I borrowed a book from the library, didn't return it in time, and then came in to borrow another without returning the first one, the librarian probably wouldn't let me borrow it saying "The first book was not returned", he wouldn't say "The first book is not returned", that would sound odd.

But I have changed the port error message back to "Port name not provided", it stays neutral that way.

else if (!portSelectModel.contains(portName)) ValidationInfo("Unknown port name").asWarning()
.withOKEnabled()
else null
Expand All @@ -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
Expand Down