Browse Source

show/hide passwords

master
Robin Thoni 10 years ago
parent
commit
b33e9e1db8
5 changed files with 142 additions and 38 deletions
  1. BIN
      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

BIN
Epimafia/eye.png View File


+ 2
- 1
Epimafia/rc.qrc View File

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

+ 20
- 0
usermgr/widget.cpp View File

77
 {
77
 {
78
     setUser(qvariant_cast<EpiUser>(ui->comboLogin->itemData(index)));
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 View File

26
 private slots:
26
 private slots:
27
     void on_comboLogin_currentIndexChanged(int index);
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
 private:
37
 private:
30
     Ui::Widget *ui;
38
     Ui::Widget *ui;
31
 };
39
 };

+ 112
- 37
usermgr/widget.ui View File

6
    <rect>
6
    <rect>
7
     <x>0</x>
7
     <x>0</x>
8
     <y>0</y>
8
     <y>0</y>
9
-    <width>238</width>
10
-    <height>327</height>
9
+    <width>307</width>
10
+    <height>315</height>
11
    </rect>
11
    </rect>
12
   </property>
12
   </property>
13
   <property name="windowTitle">
13
   <property name="windowTitle">
241
        </property>
241
        </property>
242
       </widget>
242
       </widget>
243
      </item>
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
      <item row="1" column="0">
244
      <item row="1" column="0">
252
       <widget class="QLabel" name="label_3">
245
       <widget class="QLabel" name="label_3">
253
        <property name="text">
246
        <property name="text">
255
        </property>
248
        </property>
256
       </widget>
249
       </widget>
257
      </item>
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
      <item row="2" column="0">
251
      <item row="2" column="0">
266
       <widget class="QLabel" name="label_4">
252
       <widget class="QLabel" name="label_4">
267
        <property name="text">
253
        <property name="text">
269
        </property>
255
        </property>
270
       </widget>
256
       </widget>
271
      </item>
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
      <item row="3" column="0">
258
      <item row="3" column="0">
280
       <widget class="QLabel" name="label_5">
259
       <widget class="QLabel" name="label_5">
281
        <property name="text">
260
        <property name="text">
283
        </property>
262
        </property>
284
       </widget>
263
       </widget>
285
      </item>
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
      <item row="4" column="0">
265
      <item row="4" column="0">
294
       <widget class="QLabel" name="label_6">
266
       <widget class="QLabel" name="label_6">
295
        <property name="text">
267
        <property name="text">
297
        </property>
269
        </property>
298
       </widget>
270
       </widget>
299
      </item>
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
      <item row="5" column="1">
272
      <item row="5" column="1">
308
       <layout class="QHBoxLayout" name="horizontalLayout_4">
273
       <layout class="QHBoxLayout" name="horizontalLayout_4">
309
        <item>
274
        <item>
340
        </item>
305
        </item>
341
       </layout>
306
       </layout>
342
      </item>
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
     </layout>
418
     </layout>
344
    </item>
419
    </item>
345
    <item>
420
    <item>

Loading…
Cancel
Save