|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2016 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to edit a host fingerprint. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from PyQt5.QtWidgets import QDialog |
|
13 |
|
14 from .Ui_HgUserConfigHostFingerprintDialog import \ |
|
15 Ui_HgUserConfigHostFingerprintDialog |
|
16 |
|
17 |
|
18 class HgUserConfigHostFingerprintDialog( |
|
19 QDialog, Ui_HgUserConfigHostFingerprintDialog): |
|
20 """ |
|
21 Class implementing a dialog to edit a host fingerprint. |
|
22 """ |
|
23 def __init__(self, parent=None, host="", fingerprint=""): |
|
24 """ |
|
25 Constructor |
|
26 |
|
27 @param parent reference to the parent widget |
|
28 @type QWidget |
|
29 @param host host name |
|
30 @type str |
|
31 @param fingerprint fingerprint for the host |
|
32 @type str |
|
33 """ |
|
34 super(HgUserConfigHostFingerprintDialog, self).__init__(parent) |
|
35 self.setupUi(self) |
|
36 |
|
37 self.hostEdit.setText(host) |
|
38 self.fingerprintEdit.setText(fingerprint) |
|
39 |
|
40 def getData(self): |
|
41 """ |
|
42 Public method to retrieve the data. |
|
43 |
|
44 @return tuple containig the host name and the fingerprint |
|
45 @rtype tuple of two str |
|
46 """ |
|
47 return ( |
|
48 self.hostEdit.text(), |
|
49 self.fingerprintEdit.text(), |
|
50 ) |