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,31 +1,46 @@
#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());
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
@@ -6,19 +6,20 @@
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
@@ -2,25 +2,25 @@
<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>
@@ -56,89 +56,112 @@
<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>
@@ -182,43 +205,43 @@
</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>
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