浏览代码

show/hide passwords

master
Robin Thoni 10 年前
父节点
当前提交
b33e9e1db8
共有 5 个文件被更改,包括 142 次插入38 次删除
  1. 二进制
      Epimafia/eye.png
  2. 2
    1
      Epimafia/rc.qrc
  3. 20
    0
      usermgr/widget.cpp
  4. 8
    0
      usermgr/widget.h
  5. 112
    37
      usermgr/widget.ui

二进制
Epimafia/eye.png 查看文件


+ 2
- 1
Epimafia/rc.qrc 查看文件

@@ -1,10 +1,11 @@
1 1
 <RCC>
2
-    <qresource prefix="/epimafia" lang="fr">
2
+    <qresource lang="fr" prefix="/epimafia">
3 3
         <file>icon.png</file>
4 4
         <file>epimafia.jpg</file>
5 5
         <file>icon.jpg</file>
6 6
         <file>icon_blue.jpg</file>
7 7
         <file>icon_green.jpg</file>
8 8
         <file>icon_red.jpg</file>
9
+        <file>eye.png</file>
9 10
     </qresource>
10 11
 </RCC>

+ 20
- 0
usermgr/widget.cpp 查看文件

@@ -77,3 +77,23 @@ void Widget::on_comboLogin_currentIndexChanged(int index)
77 77
 {
78 78
     setUser(qvariant_cast<EpiUser>(ui->comboLogin->itemData(index)));
79 79
 }
80
+
81
+void Widget::on_btnShowPass_toggled(bool checked)
82
+{
83
+	ui->linePass->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
84
+}
85
+
86
+void Widget::on_pushShowNum_toggled(bool checked)
87
+{
88
+	ui->linePwdNum->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
89
+}
90
+
91
+void Widget::on_btnShowPPP_toggled(bool checked)
92
+{
93
+	ui->linePwdPPP->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
94
+}
95
+
96
+void Widget::on_btnShowSocks_toggled(bool checked)
97
+{
98
+	ui->linePwdSocks->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
99
+}

+ 8
- 0
usermgr/widget.h 查看文件

@@ -26,6 +26,14 @@ public slots:
26 26
 private slots:
27 27
     void on_comboLogin_currentIndexChanged(int index);
28 28
 
29
+	void on_btnShowPass_toggled(bool checked);
30
+
31
+	void on_pushShowNum_toggled(bool checked);
32
+
33
+	void on_btnShowPPP_toggled(bool checked);
34
+
35
+	void on_btnShowSocks_toggled(bool checked);
36
+
29 37
 private:
30 38
     Ui::Widget *ui;
31 39
 };

+ 112
- 37
usermgr/widget.ui 查看文件

@@ -6,8 +6,8 @@
6 6
    <rect>
7 7
     <x>0</x>
8 8
     <y>0</y>
9
-    <width>238</width>
10
-    <height>327</height>
9
+    <width>307</width>
10
+    <height>315</height>
11 11
    </rect>
12 12
   </property>
13 13
   <property name="windowTitle">
@@ -241,13 +241,6 @@ color: white;
241 241
        </property>
242 242
       </widget>
243 243
      </item>
244
-     <item row="0" column="1">
245
-      <widget class="QLineEdit" name="lineLogin">
246
-       <property name="text">
247
-        <string/>
248
-       </property>
249
-      </widget>
250
-     </item>
251 244
      <item row="1" column="0">
252 245
       <widget class="QLabel" name="label_3">
253 246
        <property name="text">
@@ -255,13 +248,6 @@ color: white;
255 248
        </property>
256 249
       </widget>
257 250
      </item>
258
-     <item row="1" column="1">
259
-      <widget class="QLineEdit" name="linePass">
260
-       <property name="echoMode">
261
-        <enum>QLineEdit::Password</enum>
262
-       </property>
263
-      </widget>
264
-     </item>
265 251
      <item row="2" column="0">
266 252
       <widget class="QLabel" name="label_4">
267 253
        <property name="text">
@@ -269,13 +255,6 @@ color: white;
269 255
        </property>
270 256
       </widget>
271 257
      </item>
272
-     <item row="2" column="1">
273
-      <widget class="QLineEdit" name="linePwdNum">
274
-       <property name="echoMode">
275
-        <enum>QLineEdit::Password</enum>
276
-       </property>
277
-      </widget>
278
-     </item>
279 258
      <item row="3" column="0">
280 259
       <widget class="QLabel" name="label_5">
281 260
        <property name="text">
@@ -283,13 +262,6 @@ color: white;
283 262
        </property>
284 263
       </widget>
285 264
      </item>
286
-     <item row="3" column="1">
287
-      <widget class="QLineEdit" name="linePwdPPP">
288
-       <property name="echoMode">
289
-        <enum>QLineEdit::Password</enum>
290
-       </property>
291
-      </widget>
292
-     </item>
293 265
      <item row="4" column="0">
294 266
       <widget class="QLabel" name="label_6">
295 267
        <property name="text">
@@ -297,13 +269,6 @@ color: white;
297 269
        </property>
298 270
       </widget>
299 271
      </item>
300
-     <item row="4" column="1">
301
-      <widget class="QLineEdit" name="linePwdSocks">
302
-       <property name="echoMode">
303
-        <enum>QLineEdit::Password</enum>
304
-       </property>
305
-      </widget>
306
-     </item>
307 272
      <item row="5" column="1">
308 273
       <layout class="QHBoxLayout" name="horizontalLayout_4">
309 274
        <item>
@@ -340,6 +305,116 @@ color: white;
340 305
        </item>
341 306
       </layout>
342 307
      </item>
308
+     <item row="1" column="1">
309
+      <layout class="QHBoxLayout" name="horizontalLayout_6">
310
+       <item>
311
+        <widget class="QLineEdit" name="linePass">
312
+         <property name="echoMode">
313
+          <enum>QLineEdit::Password</enum>
314
+         </property>
315
+        </widget>
316
+       </item>
317
+       <item>
318
+        <widget class="QPushButton" name="btnShowPass">
319
+         <property name="text">
320
+          <string/>
321
+         </property>
322
+         <property name="icon">
323
+          <iconset resource="../Epimafia/rc.qrc">
324
+           <normaloff>:/epimafia/eye.png</normaloff>:/epimafia/eye.png</iconset>
325
+         </property>
326
+         <property name="checkable">
327
+          <bool>true</bool>
328
+         </property>
329
+        </widget>
330
+       </item>
331
+      </layout>
332
+     </item>
333
+     <item row="0" column="1">
334
+      <widget class="QLineEdit" name="lineLogin">
335
+       <property name="text">
336
+        <string/>
337
+       </property>
338
+      </widget>
339
+     </item>
340
+     <item row="2" column="1">
341
+      <layout class="QHBoxLayout" name="horizontalLayout_5">
342
+       <item>
343
+        <widget class="QLineEdit" name="linePwdNum">
344
+         <property name="echoMode">
345
+          <enum>QLineEdit::Password</enum>
346
+         </property>
347
+        </widget>
348
+       </item>
349
+       <item>
350
+        <widget class="QPushButton" name="pushShowNum">
351
+         <property name="text">
352
+          <string/>
353
+         </property>
354
+         <property name="icon">
355
+          <iconset resource="../Epimafia/rc.qrc">
356
+           <normaloff>:/epimafia/eye.png</normaloff>:/epimafia/eye.png</iconset>
357
+         </property>
358
+         <property name="checkable">
359
+          <bool>true</bool>
360
+         </property>
361
+        </widget>
362
+       </item>
363
+      </layout>
364
+     </item>
365
+     <item row="3" column="1">
366
+      <layout class="QHBoxLayout" name="horizontalLayout_7">
367
+       <item>
368
+        <widget class="QLineEdit" name="linePwdPPP">
369
+         <property name="echoMode">
370
+          <enum>QLineEdit::Password</enum>
371
+         </property>
372
+        </widget>
373
+       </item>
374
+       <item>
375
+        <widget class="QPushButton" name="btnShowPPP">
376
+         <property name="text">
377
+          <string/>
378
+         </property>
379
+         <property name="icon">
380
+          <iconset resource="../Epimafia/rc.qrc">
381
+           <normaloff>:/epimafia/eye.png</normaloff>:/epimafia/eye.png</iconset>
382
+         </property>
383
+         <property name="checkable">
384
+          <bool>true</bool>
385
+         </property>
386
+         <property name="checked">
387
+          <bool>false</bool>
388
+         </property>
389
+        </widget>
390
+       </item>
391
+      </layout>
392
+     </item>
393
+     <item row="4" column="1">
394
+      <layout class="QHBoxLayout" name="horizontalLayout_8">
395
+       <item>
396
+        <widget class="QLineEdit" name="linePwdSocks">
397
+         <property name="echoMode">
398
+          <enum>QLineEdit::Password</enum>
399
+         </property>
400
+        </widget>
401
+       </item>
402
+       <item>
403
+        <widget class="QPushButton" name="btnShowSocks">
404
+         <property name="text">
405
+          <string/>
406
+         </property>
407
+         <property name="icon">
408
+          <iconset resource="../Epimafia/rc.qrc">
409
+           <normaloff>:/epimafia/eye.png</normaloff>:/epimafia/eye.png</iconset>
410
+         </property>
411
+         <property name="checkable">
412
+          <bool>true</bool>
413
+         </property>
414
+        </widget>
415
+       </item>
416
+      </layout>
417
+     </item>
343 418
     </layout>
344 419
    </item>
345 420
    <item>

正在加载...
取消
保存