From bc4629d427d5bec02e8a87bd7b2b0db11916b050 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 27 Mar 2023 09:50:01 +0200 Subject: [PATCH] RemoteLinux: Add history completion to a few device property line edits Change-Id: If871ff31ebd33a055bdcae38438eb0b4b48b904b Reviewed-by: Marcus Tillmanns Reviewed-by: --- .../genericlinuxdeviceconfigurationwidget.cpp | 11 ++++++++--- .../genericlinuxdeviceconfigurationwidget.h | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index b7890bb610b..a0a53e4e1c5 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -41,8 +41,9 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( m_keyButton = new QRadioButton(Tr::tr("Specific &key")); - m_hostLineEdit = new QLineEdit(this); + m_hostLineEdit = new FancyLineEdit(this); m_hostLineEdit->setPlaceholderText(Tr::tr("IP or host name of the device")); + m_hostLineEdit->setHistoryCompleter("HostName"); m_sshPortSpinBox = new QSpinBox(this); m_sshPortSpinBox->setMinimum(0); @@ -51,8 +52,9 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( m_hostKeyCheckBox = new QCheckBox(Tr::tr("&Check host key")); - m_portsLineEdit = new QLineEdit(this); + m_portsLineEdit = new FancyLineEdit(this); m_portsLineEdit->setToolTip(Tr::tr("You can enter lists and ranges like this: '1024,1026-1028,1030'.")); + m_portsLineEdit->setHistoryCompleter("PortRange"); m_portsWarningLabel = new QLabel(this); @@ -62,7 +64,8 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( m_timeoutSpinBox->setValue(1000); m_timeoutSpinBox->setSuffix(Tr::tr("s")); - m_userLineEdit = new QLineEdit(this); + m_userLineEdit = new FancyLineEdit(this); + m_userLineEdit->setHistoryCompleter("UserName"); m_keyLabel = new QLabel(Tr::tr("Private key file:")); @@ -77,11 +80,13 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( m_gdbServerLineEdit->setExpectedKind(PathChooser::ExistingCommand); m_gdbServerLineEdit->setPlaceholderText(hint); m_gdbServerLineEdit->setToolTip(hint); + m_gdbServerLineEdit->setHistoryCompleter("GdbServer"); m_qmlRuntimeLineEdit = new PathChooser(this); m_qmlRuntimeLineEdit->setExpectedKind(PathChooser::ExistingCommand); m_qmlRuntimeLineEdit->setPlaceholderText(hint); m_qmlRuntimeLineEdit->setToolTip(hint); + m_qmlRuntimeLineEdit->setHistoryCompleter("QmlRuntime"); m_sourceProfileCheckBox = new QCheckBox(Tr::tr("Source %1 and %2").arg("/etc/profile").arg("$HOME/.profile")); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h index e9840c9a436..aba251b969e 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h @@ -9,12 +9,12 @@ QT_BEGIN_NAMESPACE class QCheckBox; class QComboBox; class QLabel; -class QLineEdit; class QRadioButton; class QSpinBox; QT_END_NAMESPACE namespace Utils { +class FancyLineEdit; class FilePath; class PathChooser; } // Utils @@ -53,12 +53,12 @@ private: QRadioButton *m_defaultAuthButton; QLabel *m_keyLabel; QRadioButton *m_keyButton; - QLineEdit *m_hostLineEdit; + Utils::FancyLineEdit *m_hostLineEdit; QSpinBox *m_sshPortSpinBox; QCheckBox *m_hostKeyCheckBox; - QLineEdit *m_portsLineEdit; + Utils::FancyLineEdit *m_portsLineEdit; QLabel *m_portsWarningLabel; - QLineEdit *m_userLineEdit; + Utils::FancyLineEdit *m_userLineEdit; QSpinBox *m_timeoutSpinBox; Utils::PathChooser *m_keyFileLineEdit; QLabel *m_machineTypeValueLabel;