--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py Sat Oct 22 17:09:08 2016 +0200 @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2016 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a dialog to edit a host fingerprint. +""" + +from __future__ import unicode_literals + +from PyQt5.QtWidgets import QDialog + +from .Ui_HgUserConfigHostFingerprintDialog import \ + Ui_HgUserConfigHostFingerprintDialog + + +class HgUserConfigHostFingerprintDialog( + QDialog, Ui_HgUserConfigHostFingerprintDialog): + """ + Class implementing a dialog to edit a host fingerprint. + """ + def __init__(self, parent=None, host="", fingerprint=""): + """ + Constructor + + @param parent reference to the parent widget + @type QWidget + @param host host name + @type str + @param fingerprint fingerprint for the host + @type str + """ + super(HgUserConfigHostFingerprintDialog, self).__init__(parent) + self.setupUi(self) + + self.hostEdit.setText(host) + self.fingerprintEdit.setText(fingerprint) + + def getData(self): + """ + Public method to retrieve the data. + + @return tuple containig the host name and the fingerprint + @rtype tuple of two str + """ + return ( + self.hostEdit.text(), + self.fingerprintEdit.text(), + )