fix password widget, fix bug

master3.3
Denis Spiridonov 12 years ago
parent 3ef5c53a12
commit 0bed63694b

@ -1012,7 +1012,8 @@ class MainFrame(QtGui.QWidget):
self.label_dict[field.name] = LabelWordWrap(field.label, self)
self.grid.addWidget(self.label_dict[field.name], x, y)
self.view_dict[field.name] = PasswordWidget(self, field.value)
self.view_dict[field.name] = PasswordWidget(self, field.value,
field.label)
# advanced settings (expert)
if self.expert:
@ -1514,8 +1515,11 @@ class MainFrame(QtGui.QWidget):
ChoiceValue = table.values.ChoiceValue[column]
for row in range (len(table.body.stringArray)):
choice = ChoiceValue.values.string
default = table.body.stringArray[row].string[column].\
if table.body.stringArray[row].string[column]:
default = table.body.stringArray[row].string[column].\
split(',')
else:
default = []
if ChoiceValue.comments and hasattr \
(ChoiceValue.comments, 'string'):

@ -2027,6 +2027,9 @@ class PasswordWgt(QtGui.QWidget):
super(PasswordWgt, self).__init__()
self._parent = parent
self.text = text
if parent.label:
self.setWindowTitle(parent.label)
self.layout = QtGui.QGridLayout(self)
self.pass_edit = QtGui.QLineEdit(self)
@ -2053,6 +2056,8 @@ class PasswordWgt(QtGui.QWidget):
(QtCore.Qt.Key_Escape))
self.cancel_button.clicked.connect(self.close)
self.layout.addWidget(self.cancel_button,2,1)
self.resize(self.sizeHint() + QtCore.QSize(40,0))
self.setFixedHeight(self.sizeHint().height())
self.move(QtGui.QCursor.pos())
def send_password(self):
@ -2071,10 +2076,11 @@ class PasswordWgt(QtGui.QWidget):
self.ok_button.setEnabled(True)
class PasswordWidget(QtGui.QLineEdit):
def __init__(self, parent, text = ''):
def __init__(self, parent, text = '', label = ''):
QtGui.QLineEdit.__init__(self)
self.text = text
self.label = label
self.setEchoMode(self.Password)
self.set_text(text)

Loading…
Cancel
Save