(browser, fields)
return field
Invoke field selection dialog and return field
Invoke field selection dialog and return field
Invoke field selection dialog and return field
def getField(browser, fields):
    """Invoke field selection dialog and return field"""
    d = QDialog(browser)
    l = QVBoxLayout(d)
    d.label = QLabel(
        "Please select the field you would like to convert to tags", d)
    d.fieldSel = QComboBox(d)
    d.fieldSel.addItems(fields)
    d.buttonBox = QDialogButtonBox(d)
    d.buttonBox.setOrientation(Qt.Horizontal)
    d.buttonBox.setStandardButtons(
        QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
    d.buttonBox.accepted.connect(d.accept)
    d.buttonBox.rejected.connect(d.reject)
    l.addWidget(d.label)
    l.addWidget(d.fieldSel)
    l.addWidget(d.buttonBox)
    d.setWindowModality(Qt.WindowModal)
    d.setWindowTitle("Field to Tags")
    restoreGeom(d, "fieldtotags")
    r = d.exec_()
    saveGeom(d, "fieldtotags")
    if not r:
        return None

    idx = d.fieldSel.currentIndex()
    field = fields[idx]

    return field
def getField ( browser , fields ) : d = QDialog ( browser ) l = QVBoxLayout ( d ) d . label = QLabel ( "Please select the field you would like to convert to tags" , d ) d . fieldSel = QComboBox ( d ) d . fieldSel . addItems ( fields ) d . buttonBox = QDialogButtonBox ( d ) d . buttonBox . setOrientation ( Qt . Horizontal ) d . buttonBox . setStandardButtons ( QDialogButtonBox . Cancel | QDialogButtonBox . Ok ) d . buttonBox . accepted . connect ( d . accept ) d . buttonBox . rejected . connect ( d . reject ) l . addWidget ( d . label ) l . addWidget ( d . fieldSel ) l . addWidget ( d . buttonBox ) d . setWindowModality ( Qt . WindowModal ) d . setWindowTitle ( "Field to Tags" ) restoreGeom ( d , "fieldtotags" ) r = d . exec_ ( ) saveGeom ( d , "fieldtotags" ) if not r : return None idx = d . fieldSel . currentIndex ( ) field = fields [ idx ] return field