-rw-r--r-- | noncore/unsupported/mail2/accounteditor.cpp | 15 | ||||
-rw-r--r-- | noncore/unsupported/mail2/accounteditor.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/mail2/accounteditorbase.ui | 65 | ||||
-rw-r--r-- | pics/mail/showpasswd.png | bin | 0 -> 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 @@ | |||
1 | #include <qmultilineedit.h> | 1 | #include <qmultilineedit.h> |
2 | #include <qbuttongroup.h> | 2 | #include <qbuttongroup.h> |
3 | #include <qradiobutton.h> | 3 | #include <qradiobutton.h> |
4 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
5 | #include <qtoolbutton.h> | ||
5 | #include <qtabwidget.h> | 6 | #include <qtabwidget.h> |
6 | #include <qlineedit.h> | 7 | #include <qlineedit.h> |
7 | #include <qcheckbox.h> | 8 | #include <qcheckbox.h> |
8 | 9 | ||
10 | #include <qpe/resource.h> | ||
11 | |||
9 | #include "accounteditor.h" | 12 | #include "accounteditor.h" |
10 | #include "miscfunctions.h" | 13 | #include "miscfunctions.h" |
11 | 14 | ||
12 | AccountEditor::AccountEditor(Account account, QWidget *parent, const char *name, bool modal, WFlags fl) | 15 | AccountEditor::AccountEditor(Account account, QWidget *parent, const char *name, bool modal, WFlags fl) |
13 | : AccountEditorBase(parent, name, modal, fl), _account(account) | 16 | : AccountEditorBase(parent, name, modal, fl), _account(account) |
14 | { | 17 | { |
15 | TabWidget2->removePage(sslTab); | 18 | TabWidget2->removePage(sslTab); |
19 | showPasswd->setPixmap(Resource::loadPixmap("mail/showpasswd")); | ||
20 | |||
21 | connect(showPasswd, SIGNAL(toggled(bool)), | ||
22 | SLOT(showPasswdToggled(bool))); | ||
16 | 23 | ||
17 | fillValues(); | 24 | fillValues(); |
18 | } | 25 | } |
19 | 26 | ||
27 | void AccountEditor::showPasswdToggled(bool toggled) | ||
28 | { | ||
29 | if (toggled) | ||
30 | pass->setEchoMode(QLineEdit::Normal); | ||
31 | else | ||
32 | pass->setEchoMode(QLineEdit::Password); | ||
33 | } | ||
34 | |||
20 | void AccountEditor::accept() | 35 | void AccountEditor::accept() |
21 | { | 36 | { |
22 | int numLf = 0; | 37 | int numLf = 0; |
23 | for (unsigned int i = 0; i <= signature->text().length(); i++) { | 38 | for (unsigned int i = 0; i <= signature->text().length(); i++) { |
24 | if (signature->text()[i] == '\n') numLf++; | 39 | if (signature->text()[i] == '\n') numLf++; |
25 | } | 40 | } |
26 | if (numLf >= 4) { | 41 | if (numLf >= 4) { |
27 | 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")); | 42 | 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")); |
28 | if (ret == 0) return; | 43 | if (ret == 0) return; |
29 | } | 44 | } |
30 | 45 | ||
31 | _account.setAccountName(_account.accountName() ? _account.accountName() : MiscFunctions::uniqueString()); | 46 | _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 @@ | |||
6 | 6 | ||
7 | class AccountEditor : public AccountEditorBase | 7 | class AccountEditor : public AccountEditorBase |
8 | { | 8 | { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | public: | 11 | public: |
12 | AccountEditor(Account account = Account(), QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0); | 12 | AccountEditor(Account account = Account(), QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0); |
13 | 13 | ||
14 | Account _account; | 14 | Account _account; |
15 | 15 | ||
16 | protected slots: | 16 | protected slots: |
17 | void accept(); | 17 | void accept(); |
18 | void showPasswdToggled(bool toggled); | ||
18 | 19 | ||
19 | protected: | 20 | protected: |
20 | void fillValues(); | 21 | void fillValues(); |
21 | 22 | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | #endif | 25 | #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 @@ | |||
2 | <class>AccountEditorBase</class> | 2 | <class>AccountEditorBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>AccountEditorBase</cstring> | 7 | <cstring>AccountEditorBase</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>243</width> | 14 | <width>239</width> |
15 | <height>320</height> | 15 | <height>320</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Account Editor</string> | 20 | <string>Account Editor</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
@@ -56,89 +56,112 @@ | |||
56 | <name>title</name> | 56 | <name>title</name> |
57 | <string>Server</string> | 57 | <string>Server</string> |
58 | </attribute> | 58 | </attribute> |
59 | <grid> | 59 | <grid> |
60 | <property stdset="1"> | 60 | <property stdset="1"> |
61 | <name>margin</name> | 61 | <name>margin</name> |
62 | <number>4</number> | 62 | <number>4</number> |
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>3</number> | 66 | <number>3</number> |
67 | </property> | 67 | </property> |
68 | <widget row="0" column="0" > | 68 | <widget row="1" column="1" rowspan="1" colspan="2" > |
69 | <class>QLabel</class> | ||
70 | <property stdset="1"> | ||
71 | <name>name</name> | ||
72 | <cstring>TextLabel2</cstring> | ||
73 | </property> | ||
74 | <property stdset="1"> | ||
75 | <name>text</name> | ||
76 | <string><b>IMAP:</string> | ||
77 | </property> | ||
78 | </widget> | ||
79 | <widget row="0" column="1" > | ||
80 | <class>QLineEdit</class> | 69 | <class>QLineEdit</class> |
81 | <property stdset="1"> | 70 | <property stdset="1"> |
82 | <name>name</name> | 71 | <name>name</name> |
83 | <cstring>imapServer</cstring> | 72 | <cstring>imapPort</cstring> |
84 | </property> | 73 | </property> |
85 | </widget> | 74 | </widget> |
86 | <widget row="1" column="0" > | 75 | <widget row="1" column="0" > |
87 | <class>QLabel</class> | 76 | <class>QLabel</class> |
88 | <property stdset="1"> | 77 | <property stdset="1"> |
89 | <name>name</name> | 78 | <name>name</name> |
90 | <cstring>TextLabel3</cstring> | 79 | <cstring>TextLabel3</cstring> |
91 | </property> | 80 | </property> |
92 | <property stdset="1"> | 81 | <property stdset="1"> |
93 | <name>text</name> | 82 | <name>text</name> |
94 | <string><b>Port:</string> | 83 | <string><b>Port:</string> |
95 | </property> | 84 | </property> |
96 | </widget> | 85 | </widget> |
97 | <widget row="1" column="1" > | 86 | <widget row="0" column="0" > |
87 | <class>QLabel</class> | ||
88 | <property stdset="1"> | ||
89 | <name>name</name> | ||
90 | <cstring>TextLabel2</cstring> | ||
91 | </property> | ||
92 | <property stdset="1"> | ||
93 | <name>text</name> | ||
94 | <string><b>IMAP:</string> | ||
95 | </property> | ||
96 | </widget> | ||
97 | <widget row="0" column="1" rowspan="1" colspan="2" > | ||
98 | <class>QLineEdit</class> | 98 | <class>QLineEdit</class> |
99 | <property stdset="1"> | 99 | <property stdset="1"> |
100 | <name>name</name> | 100 | <name>name</name> |
101 | <cstring>imapPort</cstring> | 101 | <cstring>imapServer</cstring> |
102 | </property> | 102 | </property> |
103 | </widget> | 103 | </widget> |
104 | <spacer row="8" column="1" > | 104 | <spacer row="8" column="1" > |
105 | <property> | 105 | <property> |
106 | <name>name</name> | 106 | <name>name</name> |
107 | <cstring>Spacer2</cstring> | 107 | <cstring>Spacer2</cstring> |
108 | </property> | 108 | </property> |
109 | <property stdset="1"> | 109 | <property stdset="1"> |
110 | <name>orientation</name> | 110 | <name>orientation</name> |
111 | <enum>Vertical</enum> | 111 | <enum>Vertical</enum> |
112 | </property> | 112 | </property> |
113 | <property stdset="1"> | 113 | <property stdset="1"> |
114 | <name>sizeType</name> | 114 | <name>sizeType</name> |
115 | <enum>Expanding</enum> | 115 | <enum>Expanding</enum> |
116 | </property> | 116 | </property> |
117 | <property> | 117 | <property> |
118 | <name>sizeHint</name> | 118 | <name>sizeHint</name> |
119 | <size> | 119 | <size> |
120 | <width>20</width> | 120 | <width>20</width> |
121 | <height>20</height> | 121 | <height>20</height> |
122 | </size> | 122 | </size> |
123 | </property> | 123 | </property> |
124 | </spacer> | 124 | </spacer> |
125 | <widget row="7" column="1" > | 125 | <widget row="4" column="2" > |
126 | <class>QToolButton</class> | ||
127 | <property stdset="1"> | ||
128 | <name>name</name> | ||
129 | <cstring>showPasswd</cstring> | ||
130 | </property> | ||
131 | <property stdset="1"> | ||
132 | <name>text</name> | ||
133 | <string>[--]</string> | ||
134 | </property> | ||
135 | <property stdset="1"> | ||
136 | <name>pixmap</name> | ||
137 | <pixmap></pixmap> | ||
138 | </property> | ||
139 | <property stdset="1"> | ||
140 | <name>toggleButton</name> | ||
141 | <bool>true</bool> | ||
142 | </property> | ||
143 | <property stdset="1"> | ||
144 | <name>toggleButton</name> | ||
145 | <bool>true</bool> | ||
146 | </property> | ||
147 | </widget> | ||
148 | <widget row="7" column="1" rowspan="1" colspan="2" > | ||
126 | <class>QLineEdit</class> | 149 | <class>QLineEdit</class> |
127 | <property stdset="1"> | 150 | <property stdset="1"> |
128 | <name>name</name> | 151 | <name>name</name> |
129 | <cstring>smtpPort</cstring> | 152 | <cstring>smtpPort</cstring> |
130 | </property> | 153 | </property> |
131 | </widget> | 154 | </widget> |
132 | <widget row="6" column="1" > | 155 | <widget row="6" column="1" rowspan="1" colspan="2" > |
133 | <class>QLineEdit</class> | 156 | <class>QLineEdit</class> |
134 | <property stdset="1"> | 157 | <property stdset="1"> |
135 | <name>name</name> | 158 | <name>name</name> |
136 | <cstring>smtpServer</cstring> | 159 | <cstring>smtpServer</cstring> |
137 | </property> | 160 | </property> |
138 | </widget> | 161 | </widget> |
139 | <widget row="6" column="0" > | 162 | <widget row="6" column="0" > |
140 | <class>QLabel</class> | 163 | <class>QLabel</class> |
141 | <property stdset="1"> | 164 | <property stdset="1"> |
142 | <name>name</name> | 165 | <name>name</name> |
143 | <cstring>TextLabel6</cstring> | 166 | <cstring>TextLabel6</cstring> |
144 | </property> | 167 | </property> |
@@ -182,43 +205,43 @@ | |||
182 | </widget> | 205 | </widget> |
183 | <widget row="4" column="1" > | 206 | <widget row="4" column="1" > |
184 | <class>QLineEdit</class> | 207 | <class>QLineEdit</class> |
185 | <property stdset="1"> | 208 | <property stdset="1"> |
186 | <name>name</name> | 209 | <name>name</name> |
187 | <cstring>pass</cstring> | 210 | <cstring>pass</cstring> |
188 | </property> | 211 | </property> |
189 | <property stdset="1"> | 212 | <property stdset="1"> |
190 | <name>echoMode</name> | 213 | <name>echoMode</name> |
191 | <enum>Password</enum> | 214 | <enum>Password</enum> |
192 | </property> | 215 | </property> |
193 | </widget> | 216 | </widget> |
194 | <widget row="3" column="1" > | 217 | <widget row="3" column="1" rowspan="1" colspan="2" > |
195 | <class>QLineEdit</class> | 218 | <class>QLineEdit</class> |
196 | <property stdset="1"> | 219 | <property stdset="1"> |
197 | <name>name</name> | 220 | <name>name</name> |
198 | <cstring>user</cstring> | 221 | <cstring>user</cstring> |
199 | </property> | 222 | </property> |
200 | </widget> | 223 | </widget> |
201 | <widget row="2" column="0" rowspan="1" colspan="2" > | 224 | <widget row="2" column="0" rowspan="1" colspan="3" > |
202 | <class>Line</class> | 225 | <class>Line</class> |
203 | <property stdset="1"> | 226 | <property stdset="1"> |
204 | <name>name</name> | 227 | <name>name</name> |
205 | <cstring>Line1</cstring> | 228 | <cstring>Line1</cstring> |
206 | </property> | 229 | </property> |
207 | <property stdset="1"> | 230 | <property stdset="1"> |
208 | <name>orientation</name> | 231 | <name>orientation</name> |
209 | <enum>Horizontal</enum> | 232 | <enum>Horizontal</enum> |
210 | </property> | 233 | </property> |
211 | </widget> | 234 | </widget> |
212 | <widget row="5" column="0" rowspan="1" colspan="2" > | 235 | <widget row="5" column="0" rowspan="1" colspan="3" > |
213 | <class>Line</class> | 236 | <class>Line</class> |
214 | <property stdset="1"> | 237 | <property stdset="1"> |
215 | <name>name</name> | 238 | <name>name</name> |
216 | <cstring>Line2</cstring> | 239 | <cstring>Line2</cstring> |
217 | </property> | 240 | </property> |
218 | <property stdset="1"> | 241 | <property stdset="1"> |
219 | <name>orientation</name> | 242 | <name>orientation</name> |
220 | <enum>Horizontal</enum> | 243 | <enum>Horizontal</enum> |
221 | </property> | 244 | </property> |
222 | </widget> | 245 | </widget> |
223 | </grid> | 246 | </grid> |
224 | </widget> | 247 | </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 | |||