# HG changeset patch # User Chris Cannam # Date 1308859465 -3600 # Node ID a47eac9c7feab3c433419930b37789b92be69895 # Parent 8edf76b57bd9745dabd06793d85b97a8e126b534 Small tidy to login dialog diff -r 8edf76b57bd9 -r a47eac9c7fea easyhg2.py --- a/easyhg2.py Thu Jun 23 20:36:23 2011 +0100 +++ b/easyhg2.py Thu Jun 23 21:04:25 2011 +0100 @@ -115,7 +115,7 @@ layout = QtGui.QGridLayout() dialog.setLayout(layout) - layout.addWidget(QtGui.QLabel(_('Please supply your user name and password for\n%s:') % uri), 0, 0, 1, 2) + layout.addWidget(QtGui.QLabel(_('

Login required

Please provide your user name and password for the repository at
%s:') % uri), 0, 0, 1, 2) userfield = QtGui.QLineEdit() if user: @@ -126,7 +126,7 @@ passfield = QtGui.QLineEdit() passfield.setEchoMode(QtGui.QLineEdit.Password) if passwd: - userfield.setText(passwd) + passfield.setText(passwd) layout.addWidget(QtGui.QLabel(_('Password:')), 2, 0) layout.addWidget(passfield, 2, 1) @@ -140,8 +140,14 @@ bb.connect(cancel, Qt.SIGNAL("clicked()"), dialog, Qt.SLOT("reject()")) layout.addWidget(bb, 3, 0, 1, 2) - dialog.setWindowTitle(_('EasyMercurial: Password')) + dialog.setWindowTitle(_('EasyMercurial: Login')) dialog.show() + + if not user: + userfield.setFocus(True) + elif not passwd: + passfield.setFocus(True) + dialog.raise_() ok = dialog.exec_() if ok: @@ -150,7 +156,7 @@ passwd = passfield.text() if passwd and keyring_key != '' and not from_keyring: keyring_key = '%s@@%s' % (uri, user) - keyring.set_password('Mercurial', keyring_key, passwd) +# keyring.set_password('Mercurial', keyring_key, passwd) self.add_password(realm, authuri, user, passwd) else: raise util.Abort(_('password entry cancelled'))