added removal of spaces when inserting ip addresses

- fixed server sharing when sharing a server available only for connection when choosing a server with full access
- removed the notification about an empty backup file when the user closes the file dialog without selecting anything
This commit is contained in:
vladimir.kuznetsov 2023-08-02 21:46:02 +09:00
parent ebcca0c3b8
commit 2c429fd406
3 changed files with 5 additions and 13 deletions

View file

@ -85,7 +85,6 @@ void SettingsController::restoreAppConfig()
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.backup"); QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.backup");
if (fileName.isEmpty()) { if (fileName.isEmpty()) {
emit changeSettingsErrorOccurred(tr("Backup file is empty"));
return; return;
} }

View file

@ -53,11 +53,9 @@ PageType {
textField.validator: RegularExpressionValidator { textField.validator: RegularExpressionValidator {
regularExpression: InstallController.ipAddressPortRegExp() regularExpression: InstallController.ipAddressPortRegExp()
} }
buttonText: qsTr("Insert")
clickedFunc: function() { onTextFieldTextChanged: {
textField.text = "" textField.text = textField.text.replace(/^\s+|\s+$/g, '');
textField.paste()
} }
} }
@ -67,12 +65,6 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
headerText: qsTr("Login to connect via SSH") headerText: qsTr("Login to connect via SSH")
textFieldPlaceholderText: "root" textFieldPlaceholderText: "root"
buttonText: qsTr("Insert")
clickedFunc: function() {
textField.text = ""
textField.paste()
}
} }
TextFieldWithHeaderType { TextFieldWithHeaderType {
@ -83,7 +75,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
headerText: qsTr("Password / SSH private key") headerText: qsTr("Password / SSH private key")
textField.echoMode: hidePassword ? TextInput.Password : TextInput.Normal textField.echoMode: hidePassword ? TextInput.Password : TextInput.Normal
buttonImageSource: hidePassword ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg" buttonImageSource: textFieldText !== "" ? (hidePassword ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg")
: ""
clickedFunc: function() { clickedFunc: function() {
hidePassword = !hidePassword hidePassword = !hidePassword

View file

@ -208,7 +208,7 @@ PageType {
serverSelector.text = selectedText serverSelector.text = selectedText
root.fullConfigServerSelectorText = selectedText root.fullConfigServerSelectorText = selectedText
root.connectionServerSelectorText = selectedText root.connectionServerSelectorText = selectedText
ServersModel.currentlyProcessedIndex = currentIndex ServersModel.currentlyProcessedIndex = proxyServersModel.mapToSource(currentIndex)
} }
} }