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

Open
wants to merge 2 commits into
base: elmot/nova-243
Choose a base branch
from
Open
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/

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