'This method shows a configuration dialog for this plugin. It returns
True if the user clicks OK, False otherwise. The changes are
automatically applied.'

def do_user_config(self, parent=None):

    from PyQt5.Qt import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, Qt, QLineEdit, QCheckBox
    config_dialog = QDialog(parent)
    button_box = QDialogButtonBox((QDialogButtonBox.Ok | QDialogButtonBox.Cancel))
    v = QVBoxLayout(config_dialog)
    def size_dialog():
        config_dialog.resize(config_dialog.sizeHint())
    button_box.accepted.connect(config_dialog.accept)
    button_box.rejected.connect(config_dialog.reject)
    config_dialog.setWindowTitle(((_(u'Customize') + u'    ') + self.name))
    from calibre.customize.ui import plugin_customization, customize_plugin
    help_text = self.customization_help(gui=True)
    help_text = QLabel(help_text, config_dialog)
    help_text.setWordWrap(True)
    help_text.setTextInteractionFlags((Qt.LinksAccessibleByMouse | Qt.LinksAccessibleByKeyboard))
    help_text.setOpenExternalLinks(True)
    v.addWidget(help_text)
    bf = QCheckBox(_(u'Add    linked    files    in    breadth    first    order'))
    bf.setToolTip(_(u'Normally,    when    following    links    in    HTML    files    calibre    does    it    depth    first,    i.e.    if    file    A    links    to    B    and        C,    but    B    links    to    D,    the    files    are    added    in    the    order    A,    B,    D,    C.        With    this    option,    they    will    instead    be    added    as    A,    B,    C,    D'))
    sc = plugin_customization(self)
    if (not sc):
        sc = u''
    sc = sc.strip()
    enc = sc.partition(u'|')[0]
    bfs = sc.partition(u'|')[(-1)]
    bf.setChecked((bfs == u'bf'))
    sc = QLineEdit(enc, config_dialog)
    v.addWidget(sc)
    v.addWidget(bf)
    v.addWidget(button_box)
    size_dialog()
    config_dialog.exec_()
    if (config_dialog.result() == QDialog.Accepted):
        sc = unicode(sc.text()).strip()
        if bf.isChecked():
            sc += u'|bf'
        customize_plugin(self, sc)
    return config_dialog.result()
