comparison easyhg.py @ 457:b09d0e6214d8

Add security warning about password remember feature
author Chris Cannam
date Wed, 29 Jun 2011 16:40:14 +0100
parents 2f25cc7b81fa
children c22cef015d73
comparison
equal deleted inserted replaced
456:2f25cc7b81fa 457:b09d0e6214d8
42 # succeeded or not, so we need to ensure that Mercurial itself returns 42 # succeeded or not, so we need to ensure that Mercurial itself returns
43 # failure if it didn't. 43 # failure if it didn't.
44 # 44 #
45 easyhg_pyqt_ok = True 45 easyhg_pyqt_ok = True
46 try: 46 try:
47 from PyQt4 import Qt, QtGui 47 from PyQt4 import Qt, QtCore, QtGui
48 except ImportError: 48 except ImportError:
49 easyhg_pyqt_ok = False 49 easyhg_pyqt_ok = False
50 easyhg_qtapp = None 50 easyhg_qtapp = None
51 51
52 # These imports are optional, we just can't use the authfile (i.e. 52 # These imports are optional, we just can't use the authfile (i.e.
267 if self.auth_store.use_auth_file: 267 if self.auth_store.use_auth_file:
268 remember_field = QtGui.QCheckBox() 268 remember_field = QtGui.QCheckBox()
269 remember_field.setChecked(self.auth_store.remember) 269 remember_field.setChecked(self.auth_store.remember)
270 remember_field.setText(_('Remember these details while EasyMercurial is running')) 270 remember_field.setText(_('Remember these details while EasyMercurial is running'))
271 layout.addWidget(remember_field, 3, 1) 271 layout.addWidget(remember_field, 3, 1)
272 warning_field = QtGui.QLabel()
273 warning_field.setText(_('<qt><i><small>Note: Do not select this if anyone else has access to this machine!</small></i><br></qt>'))
274 warning_field.hide()
275 remember_field.connect(remember_field, Qt.SIGNAL("clicked()"),
276 warning_field, Qt.SLOT("show()"))
277 layout.addWidget(warning_field, 4, 1, QtCore.Qt.AlignRight)
272 278
273 bb = QtGui.QDialogButtonBox() 279 bb = QtGui.QDialogButtonBox()
274 ok = bb.addButton(bb.Ok) 280 ok = bb.addButton(bb.Ok)
275 cancel = bb.addButton(bb.Cancel) 281 cancel = bb.addButton(bb.Cancel)
276 cancel.setDefault(False) 282 cancel.setDefault(False)
277 cancel.setAutoDefault(False) 283 cancel.setAutoDefault(False)
278 ok.setDefault(True) 284 ok.setDefault(True)
279 bb.connect(ok, Qt.SIGNAL("clicked()"), dialog, Qt.SLOT("accept()")) 285 bb.connect(ok, Qt.SIGNAL("clicked()"), dialog, Qt.SLOT("accept()"))
280 bb.connect(cancel, Qt.SIGNAL("clicked()"), dialog, Qt.SLOT("reject()")) 286 bb.connect(cancel, Qt.SIGNAL("clicked()"), dialog, Qt.SLOT("reject()"))
281 layout.addWidget(bb, 4, 0, 1, 2) 287 layout.addWidget(bb, 5, 0, 1, 2)
282 288
283 dialog.setWindowTitle(_('EasyMercurial: Login')) 289 dialog.setWindowTitle(_('EasyMercurial: Login'))
284 dialog.show() 290 dialog.show()
285 291
286 if not self.auth_store.user: 292 if not self.auth_store.user: