comparison easyhg.py @ 258:a574b89bfddd

* Attempt to pop input dialog to front instead of permitting it to open behind EasyMercurial window
author Chris Cannam
date Wed, 12 Jan 2011 15:46:24 +0000
parents 960b782f0a64
children 3b8501070c21
comparison
equal deleted inserted replaced
257:4adccef8964d 258:a574b89bfddd
53 if not self.interactive(): 53 if not self.interactive():
54 self.write(msg, ' ', default, "\n") 54 self.write(msg, ' ', default, "\n")
55 return default 55 return default
56 if msg == _('user:'): 56 if msg == _('user:'):
57 msg = _('User:') 57 msg = _('User:')
58 (r,ok) = QtGui.QInputDialog.getText(None, _('Information needed'), 58 d = QtGui.QInputDialog()
59 msg, QtGui.QLineEdit.Normal) 59 d.setInputMode(QtGui.QInputDialog.TextInput)
60 d.setTextEchoMode(QtGui.QLineEdit.Normal)
61 d.setLabelText(prompt)
62 d.setWindowTitle(_('EasyMercurial: Information'))
63 d.show()
64 d.raise_()
65 ok = d.exec_()
66 r = d.textValue()
60 if not ok: 67 if not ok:
61 raise util.Abort(_('response expected')) 68 raise util.Abort(_('response expected'))
62 if not r: 69 if not r:
63 return default 70 return default
64 return r 71 return r
66 def easyhg_getpass(self, prompt=None, default=None): 73 def easyhg_getpass(self, prompt=None, default=None):
67 if not self.interactive(): 74 if not self.interactive():
68 return default 75 return default
69 if not prompt or prompt == _('password:'): 76 if not prompt or prompt == _('password:'):
70 prompt = _('Password:'); 77 prompt = _('Password:');
71 (r,ok) = QtGui.QInputDialog.getText(None, _('Password'), prompt, 78 d = QtGui.QInputDialog()
72 QtGui.QLineEdit.Password) 79 d.setInputMode(QtGui.QInputDialog.TextInput)
80 d.setTextEchoMode(QtGui.QLineEdit.Password)
81 d.setLabelText(prompt)
82 d.setWindowTitle(_('EasyMercurial: Password'))
83 d.show()
84 d.raise_()
85 ok = d.exec_()
86 r = d.textValue()
73 if not ok: 87 if not ok:
74 raise util.Abort(_('response expected')) 88 raise util.Abort(_('response expected'))
75 if not r: 89 if not r:
76 return default 90 return default
77 return r 91 return r