summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/accounteditor.cpp15
-rw-r--r--noncore/unsupported/mail2/accounteditor.h1
-rw-r--r--noncore/unsupported/mail2/accounteditorbase.ui65
-rw-r--r--pics/mail/showpasswd.pngbin0 -> 217 bytes
4 files changed, 60 insertions, 21 deletions
diff --git a/noncore/unsupported/mail2/accounteditor.cpp b/noncore/unsupported/mail2/accounteditor.cpp
index 8230a69..5d80693 100644
--- a/noncore/unsupported/mail2/accounteditor.cpp
+++ b/noncore/unsupported/mail2/accounteditor.cpp
@@ -1,43 +1,58 @@
#include <qmultilineedit.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qmessagebox.h>
+#include <qtoolbutton.h>
#include <qtabwidget.h>
#include <qlineedit.h>
#include <qcheckbox.h>
+#include <qpe/resource.h>
+
#include "accounteditor.h"
#include "miscfunctions.h"
AccountEditor::AccountEditor(Account account, QWidget *parent, const char *name, bool modal, WFlags fl)
: AccountEditorBase(parent, name, modal, fl), _account(account)
{
TabWidget2->removePage(sslTab);
+ showPasswd->setPixmap(Resource::loadPixmap("mail/showpasswd"));
+
+ connect(showPasswd, SIGNAL(toggled(bool)),
+ SLOT(showPasswdToggled(bool)));
fillValues();
}
+void AccountEditor::showPasswdToggled(bool toggled)
+{
+ if (toggled)
+ pass->setEchoMode(QLineEdit::Normal);
+ else
+ pass->setEchoMode(QLineEdit::Password);
+}
+
void AccountEditor::accept()
{
int numLf = 0;
for (unsigned int i = 0; i <= signature->text().length(); i++) {
if (signature->text()[i] == '\n') numLf++;
}
if (numLf >= 4) {
int ret = QMessageBox::warning(this, tr("Warning"), tr("<p>Your signature is longer than 4 lines. This is considered inpolite by many people. You should shorten your signature.</p>"), tr("Change"), tr("Continue"));
if (ret == 0) return;
}
_account.setAccountName(_account.accountName() ? _account.accountName() : MiscFunctions::uniqueString());
_account.setRealName(realname->text());
_account.setEmail(email->text());
_account.setOrg(org->text());
_account.setImapServer(imapServer->text());
_account.setImapPort(imapPort->text());
_account.setSmtpServer(smtpServer->text());
_account.setSmtpPort(smtpPort->text());
_account.setUser(user->text());
_account.setPass(pass->text());
_account.setSmtpSsl(smtpssl->isChecked());
_account.setSmtpSslPort(smtpsPort->text());
_account.setImapSsl(imapssl->isChecked());
diff --git a/noncore/unsupported/mail2/accounteditor.h b/noncore/unsupported/mail2/accounteditor.h
index 4a2bda3..9acca2d 100644
--- a/noncore/unsupported/mail2/accounteditor.h
+++ b/noncore/unsupported/mail2/accounteditor.h
@@ -1,24 +1,25 @@
#ifndef ACCOUNTEDITOR_H
#define ACCOUNTEDITOR_H
#include "accounteditorbase.h"
#include "configfile.h"
class AccountEditor : public AccountEditorBase
{
Q_OBJECT
public:
AccountEditor(Account account = Account(), QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0);
Account _account;
protected slots:
void accept();
+ void showPasswdToggled(bool toggled);
protected:
void fillValues();
};
#endif
diff --git a/noncore/unsupported/mail2/accounteditorbase.ui b/noncore/unsupported/mail2/accounteditorbase.ui
index fe9f2a4..8341e72 100644
--- a/noncore/unsupported/mail2/accounteditorbase.ui
+++ b/noncore/unsupported/mail2/accounteditorbase.ui
@@ -1,38 +1,38 @@
<!DOCTYPE UI><UI>
<class>AccountEditorBase</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>AccountEditorBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>243</width>
+ <width>239</width>
<height>320</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Account Editor</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>0</number>
</property>
<widget row="0" column="0" >
<class>QTabWidget</class>
@@ -44,113 +44,136 @@
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tab</cstring>
</property>
<attribute>
<name>title</name>
<string>Server</string>
</attribute>
<grid>
<property stdset="1">
<name>margin</name>
<number>4</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>3</number>
</property>
- <widget row="0" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel2</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>&lt;b&gt;IMAP:</string>
- </property>
- </widget>
- <widget row="0" column="1" >
+ <widget row="1" column="1" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>imapServer</cstring>
+ <cstring>imapPort</cstring>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel3</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&lt;b&gt;Port:</string>
</property>
</widget>
- <widget row="1" column="1" >
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&lt;b&gt;IMAP:</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>imapPort</cstring>
+ <cstring>imapServer</cstring>
</property>
</widget>
<spacer row="8" column="1" >
<property>
<name>name</name>
<cstring>Spacer2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget row="7" column="1" >
+ <widget row="4" column="2" >
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>showPasswd</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>[--]</string>
+ </property>
+ <property stdset="1">
+ <name>pixmap</name>
+ <pixmap></pixmap>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget row="7" column="1" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>smtpPort</cstring>
</property>
</widget>
- <widget row="6" column="1" >
+ <widget row="6" column="1" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>smtpServer</cstring>
</property>
</widget>
<widget row="6" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel6</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&lt;b&gt;SMTP:</string>
</property>
</widget>
<widget row="7" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel7</cstring>
</property>
<property stdset="1">
@@ -170,67 +193,67 @@
</property>
</widget>
<widget row="4" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel5</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&lt;b&gt;Pass:</string>
</property>
</widget>
<widget row="4" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>pass</cstring>
</property>
<property stdset="1">
<name>echoMode</name>
<enum>Password</enum>
</property>
</widget>
- <widget row="3" column="1" >
+ <widget row="3" column="1" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>user</cstring>
</property>
</widget>
- <widget row="2" column="0" rowspan="1" colspan="2" >
+ <widget row="2" column="0" rowspan="1" colspan="3" >
<class>Line</class>
<property stdset="1">
<name>name</name>
<cstring>Line1</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
</widget>
- <widget row="5" column="0" rowspan="1" colspan="2" >
+ <widget row="5" column="0" rowspan="1" colspan="3" >
<class>Line</class>
<property stdset="1">
<name>name</name>
<cstring>Line2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
</widget>
</grid>
</widget>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tab</cstring>
</property>
<attribute>
<name>title</name>
<string>Identity</string>
</attribute>
<grid>
<property stdset="1">
diff --git a/pics/mail/showpasswd.png b/pics/mail/showpasswd.png
new file mode 100644
index 0000000..7d5c08b
--- a/dev/null
+++ b/pics/mail/showpasswd.png
Binary files differ