Commit 4aee005a authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use KPasswordLineEdit for all password edit fields

Enables to see existing passwords/input on demand
parent 4808d1dc
......@@ -27,7 +27,7 @@ ConnectionBehavior_Config::ConnectionBehavior_Config(QWidget* parent)
kcfg_ReconnectDelay->setSuffix(ki18np(" second", " seconds"));
connect(m_ProxyPassword, &KLineEdit::textChanged, this, [this]() { setPasswordChanged(); });
connect(m_ProxyPassword, &KPasswordLineEdit::passwordChanged, this, [this]() { setPasswordChanged(); });
}
void ConnectionBehavior_Config::restorePageToDefaults()
......@@ -41,7 +41,7 @@ void ConnectionBehavior_Config::saveSettings()
{
if(Application::instance()->wallet())
{
int ret = Application::instance()->wallet()->writePassword(QStringLiteral("ProxyPassword"), m_ProxyPassword->text());
int ret = Application::instance()->wallet()->writePassword(QStringLiteral("ProxyPassword"), m_ProxyPassword->password());
if(ret != 0)
{
......@@ -70,7 +70,7 @@ void ConnectionBehavior_Config::loadSettings()
}
}
m_ProxyPassword->setText(password);
m_ProxyPassword->setPassword(password);
setPasswordChanged(false);
}
......
......@@ -224,13 +224,10 @@ CBC or Cipher Block Chaining mode is not supported by FiSH but is supported by M
</widget>
</item>
<item row="4" column="1">
<widget class="KLineEdit" name="m_ProxyPassword">
<widget class="KPasswordLineEdit" name="m_ProxyPassword">
<property name="enabled">
<bool>true</bool>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
......@@ -257,6 +254,11 @@ CBC or Cipher Block Chaining mode is not supported by FiSH but is supported by M
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KPasswordLineEdit</class>
<extends>QWidget</extends>
<header>kpasswordlineedit.h</header>
</customwidget>
<customwidget>
<class>KPluralHandlingSpinBox</class>
<extends>QSpinBox</extends>
......
......@@ -161,7 +161,7 @@ namespace Konversation
m_nicknameLBox->insertStringList(m_currentIdentity->getNicknameList());
m_authTypeCombo->setCurrentIndex(m_authTypeCombo->findData(m_currentIdentity->getAuthType()));
m_authPasswordEdit->setText(m_currentIdentity->getAuthPassword());
m_authPasswordEdit->setPassword(m_currentIdentity->getAuthPassword());
m_nickservNicknameEdit->setText(m_currentIdentity->getNickservNickname());
m_nickservCommandEdit->setText(m_currentIdentity->getNickservCommand());
m_saslAccountEdit->setText(m_currentIdentity->getSaslAccount());
......@@ -208,7 +208,7 @@ namespace Konversation
m_currentIdentity->setNicknameList(nicks);
m_currentIdentity->setAuthType(m_authTypeCombo->itemData(m_authTypeCombo->currentIndex()).toString());
m_currentIdentity->setAuthPassword(m_authPasswordEdit->text());
m_currentIdentity->setAuthPassword(m_authPasswordEdit->password());
m_currentIdentity->setNickservNickname(m_nickservNicknameEdit->text());
m_currentIdentity->setNickservCommand(m_nickservCommandEdit->text());
m_currentIdentity->setSaslAccount(m_saslAccountEdit->text());
......
......@@ -304,10 +304,7 @@
</widget>
</item>
<item row="5" column="1">
<widget class="KLineEdit" name="m_authPasswordEdit">
<property name="passwordMode">
<bool>true</bool>
</property>
<widget class="KPasswordLineEdit" name="m_authPasswordEdit">
</widget>
</item>
<item row="6" column="0">
......@@ -698,6 +695,11 @@
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KPasswordLineEdit</class>
<extends>QWidget</extends>
<header>kpasswordlineedit.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
......
......@@ -15,13 +15,7 @@
<number>0</number>
</property>
<item row="1" column="1">
<widget class="KLineEdit" name="m_passwordEdit">
<property name="text">
<string/>
</property>
<property name="passwordMode">
<bool>true</bool>
</property>
<widget class="KPasswordLineEdit" name="m_passwordEdit">
</widget>
</item>
<item row="0" column="1">
......@@ -69,6 +63,11 @@
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KPasswordLineEdit</class>
<extends>QWidget</extends>
<header>kpasswordlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
......@@ -98,7 +98,7 @@ namespace Konversation
QString JoinChannelDialog::password() const
{
return m_ui.passwordEdit->text();
return m_ui.passwordEdit->password();
}
void JoinChannelDialog::slotOk()
......
......@@ -122,19 +122,16 @@ the Free Software Foundation; either version 2 of the License, or
<widget class="KComboBox" name="networkNameCombo"/>
</item>
<item row="2" column="2" colspan="2">
<widget class="KLineEdit" name="passwordEdit">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<widget class="KPasswordLineEdit" name="passwordEdit">
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
<class>KPasswordLineEdit</class>
<extends>QWidget</extends>
<header>kpasswordlineedit.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
......
......@@ -86,10 +86,7 @@
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="KLineEdit" name="m_passwordEdit">
<property name="passwordMode">
<bool>true</bool>
</property>
<widget class="KPasswordLineEdit" name="m_passwordEdit">
</widget>
</item>
<item row="2" column="0" colspan="4">
......@@ -123,6 +120,11 @@
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KPasswordLineEdit</class>
<extends>QWidget</extends>
<header>kpasswordlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
......@@ -465,7 +465,7 @@ namespace Konversation
{
m_mainWidget->m_serverEdit->setText(server.host());
m_mainWidget->m_portSBox->setValue(server.port());
m_mainWidget->m_passwordEdit->setText(server.password());
m_mainWidget->m_passwordEdit->setPassword(server.password());
m_mainWidget->m_sslChBox->setChecked(server.SSLEnabled());
m_mainWidget->m_proxyChBox->setChecked(!server.bypassProxy());
}
......@@ -475,7 +475,7 @@ namespace Konversation
ServerSettings server;
server.setHost(m_mainWidget->m_serverEdit->text());
server.setPort(m_mainWidget->m_portSBox->value());
server.setPassword(m_mainWidget->m_passwordEdit->text());
server.setPassword(m_mainWidget->m_passwordEdit->password());
server.setSSLEnabled(m_mainWidget->m_sslChBox->isChecked());
server.setBypassProxy(!m_mainWidget->m_proxyChBox->isChecked());
......@@ -530,14 +530,14 @@ namespace Konversation
void ChannelDialog::setChannelSettings(const ChannelSettings& channel)
{
m_mainWidget->m_channelEdit->setText(channel.name());
m_mainWidget->m_passwordEdit->setText(channel.password());
m_mainWidget->m_passwordEdit->setPassword(channel.password());
}
ChannelSettings ChannelDialog::channelSettings() const
{
ChannelSettings channel;
channel.setName(m_mainWidget->m_channelEdit->text());
channel.setPassword(m_mainWidget->m_passwordEdit->text());
channel.setPassword(m_mainWidget->m_passwordEdit->password());
return channel;
}
......
......@@ -7,9 +7,10 @@
#include "quickconnectdialog.h"
#include "application.h"
#include <QCheckBox>
#include <KLineEdit>
#include <KPasswordLineEdit>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QPushButton>
#include <KGuiItem>
......@@ -66,8 +67,7 @@ QuickConnectDialog::QuickConnectDialog(QWidget *parent)
QLabel* passwordLabel = new QLabel(i18n("P&assword:"), page);
QString passwordWT = i18n("If the IRC server requires a password, enter it here (most servers do not require a password.)");
passwordLabel->setWhatsThis(passwordWT);
passwordInput = new KLineEdit(page);
passwordInput->setPasswordMode(true);
passwordInput = new KPasswordLineEdit(page);
passwordInput->setWhatsThis(passwordWT);
passwordLabel->setBuddy(passwordInput);
passwordLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
......@@ -115,7 +115,7 @@ void QuickConnectDialog::slotOk()
emit connectClicked(Konversation::PromptToReuseConnection,
hostNameInput->text().trimmed(),
portInput->text(),
passwordInput->text(),
passwordInput->password(),
nickInput->text(),
QString(),
sslCheckBox->isChecked());
......
......@@ -11,7 +11,7 @@
#include <QDialog>
class KPasswordLineEdit;
class QCheckBox;
class KLineEdit;
class QPushButton;
......@@ -47,7 +47,7 @@ class QuickConnectDialog : public QDialog
private:
KLineEdit* hostNameInput;
KLineEdit* portInput;
KLineEdit* passwordInput;
KPasswordLineEdit* passwordInput;
KLineEdit* nickInput;
QCheckBox* sslCheckBox;
QPushButton* mOkButton;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment