eric7/Plugins/VcsPlugins/vcsPySvn/SvnDialogMixin.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
8 the pysvn client. 8 the pysvn client.
9 """ 9 """
10 10
11 from PyQt6.QtWidgets import QApplication, QDialog, QWidget 11 from PyQt6.QtWidgets import QApplication, QDialog, QWidget
12 12
13 from E5Gui.E5OverrideCursor import E5OverridenCursor 13 from E5Gui.EricOverrideCursor import EricOverridenCursor
14 14
15 15
16 class SvnDialogMixin: 16 class SvnDialogMixin:
17 """ 17 """
18 Class implementing a dialog mixin providing common callback methods for 18 Class implementing a dialog mixin providing common callback methods for
62 as strings and save is a flag indicating, that username and 62 as strings and save is a flag indicating, that username and
63 password should be saved. 63 password should be saved.
64 """ 64 """
65 from .SvnLoginDialog import SvnLoginDialog 65 from .SvnLoginDialog import SvnLoginDialog
66 66
67 with E5OverridenCursor(): 67 with EricOverridenCursor():
68 parent = isinstance(self, QWidget) and self or None 68 parent = isinstance(self, QWidget) and self or None
69 dlg = SvnLoginDialog(realm, username, may_save, parent) 69 dlg = SvnLoginDialog(realm, username, may_save, parent)
70 res = dlg.exec() 70 res = dlg.exec()
71 71
72 if res == QDialog.DialogCode.Accepted: 72 if res == QDialog.DialogCode.Accepted:
84 @return tuple of three values (retcode, acceptedFailures, save). 84 @return tuple of three values (retcode, acceptedFailures, save).
85 Retcode should be true, if the certificate should be accepted, 85 Retcode should be true, if the certificate should be accepted,
86 acceptedFailures should indicate the accepted certificate failures 86 acceptedFailures should indicate the accepted certificate failures
87 and save should be True, if subversion should save the certificate. 87 and save should be True, if subversion should save the certificate.
88 """ 88 """
89 from E5Gui import E5MessageBox 89 from E5Gui import EricMessageBox
90 90
91 with E5OverridenCursor(): 91 with EricOverridenCursor():
92 parent = isinstance(self, QWidget) and self or None 92 parent = isinstance(self, QWidget) and self or None
93 msgBox = E5MessageBox.E5MessageBox( 93 msgBox = EricMessageBox.EricMessageBox(
94 E5MessageBox.Question, 94 EricMessageBox.Question,
95 self.tr("Subversion SSL Server Certificate"), 95 self.tr("Subversion SSL Server Certificate"),
96 self.tr("""<p>Accept the following SSL certificate?</p>""" 96 self.tr("""<p>Accept the following SSL certificate?</p>"""
97 """<table>""" 97 """<table>"""
98 """<tr><td>Realm:</td><td>{0}</td></tr>""" 98 """<tr><td>Realm:</td><td>{0}</td></tr>"""
99 """<tr><td>Hostname:</td><td>{1}</td></tr>""" 99 """<tr><td>Hostname:</td><td>{1}</td></tr>"""
108 trust_dict["valid_from"], 108 trust_dict["valid_from"],
109 trust_dict["valid_until"], 109 trust_dict["valid_until"],
110 trust_dict["issuer_dname"]), 110 trust_dict["issuer_dname"]),
111 modal=True, parent=parent) 111 modal=True, parent=parent)
112 permButton = msgBox.addButton(self.tr("&Permanent accept"), 112 permButton = msgBox.addButton(self.tr("&Permanent accept"),
113 E5MessageBox.AcceptRole) 113 EricMessageBox.AcceptRole)
114 tempButton = msgBox.addButton(self.tr("&Temporary accept"), 114 tempButton = msgBox.addButton(self.tr("&Temporary accept"),
115 E5MessageBox.AcceptRole) 115 EricMessageBox.AcceptRole)
116 msgBox.addButton(self.tr("&Reject"), E5MessageBox.RejectRole) 116 msgBox.addButton(self.tr("&Reject"), EricMessageBox.RejectRole)
117 msgBox.exec() 117 msgBox.exec()
118 118
119 if msgBox.clickedButton() == permButton: 119 if msgBox.clickedButton() == permButton:
120 return (True, trust_dict["failures"], True) 120 return (True, trust_dict["failures"], True)
121 elif msgBox.clickedButton() == tempButton: 121 elif msgBox.clickedButton() == tempButton:

eric ide

mercurial