def _create_libdmtx(self, settings):
        radio = QRadioButton('My objects are labelled with Data Matrix barcodes')
        radio.setChecked('libdmtx' == settings['engine'])
        radio.setEnabled(libdmtx_available())
        self._layout.addWidget(radio)

        prompt = QLabel(HTML_LINK_TEMPLATE.format(
            'Barcodes will be decoded using the open-source '
            '<a href="http://libdmtx.sourceforge.net/">libdmtx</a> library'
        ))
        prompt.setOpenExternalLinks(True)
        prompt.setStyleSheet(self.STYLESHEET)
        self._layout.addWidget(prompt)

        self._layout.addWidget(HorizontalLine())
        return radio
    def _create_inlite(self, settings):
        radio = QRadioButton(
            'Either my objects are labelled with a barcode not listed above '
            'or I would like the performance and reliability of a commercial '
            'library')
        radio.setChecked('inlite' == settings['engine'])
        radio.setEnabled(inlite_available())
        self._layout.addWidget(radio)

        prompt = QLabel(HTML_LINK_TEMPLATE.format(
            'Only available on Windows. '
            'Visit <a href="http://www.inliteresearch.com/">Inlite Research</a> '
            'to download and install Inlite Research\'s ClearImage library.'
        ))
        prompt.setWordWrap(True)
        prompt.setOpenExternalLinks(True)
        prompt.setStyleSheet(self.STYLESHEET)
        self._layout.addWidget(prompt)

        prompt = QLabel('My objects are labelled with:')
        format = settings['inlite-format']
        radio_1d = QRadioButton('1D barcodes')
        radio_1d.setChecked('1d' == format)
        radio_datamatrix = QRadioButton('Data Matrix barcodes')
        radio_datamatrix.setChecked('datamatrix' == format)
        radio_pdf417 = QRadioButton('PDF 417 barcodes')
        radio_pdf417.setChecked('pdf417' == format)
        radio_qr = QRadioButton('QR codes')
        radio_qr.setChecked('qrcode' == format)

        layout = QVBoxLayout()
        layout.addWidget(prompt)
        layout.addWidget(radio_1d)
        layout.addWidget(radio_datamatrix)
        layout.addWidget(radio_pdf417)
        layout.addWidget(radio_qr)

        group = QWidget()
        group.setLayout(layout)
        group.setStyleSheet(self.STYLESHEET)
        radio.toggled.connect(group.setEnabled)
        group.setEnabled(inlite_available() and 'inlite' == settings['engine'])

        self._layout.addWidget(group)

        return radio, radio_1d, radio_datamatrix, radio_pdf417, radio_qr
Example #3
0
 def __init__(self, url, label, parent=None, f=Qt.WindowFlags(0)):
     html = HTML_LINK_TEMPLATE.format('<a href="{0}">{1}</a>'.format(
         url, label))
     super(URLLabel, self).__init__(html, parent, f)
     self.setOpenExternalLinks(True)
 def __init__(self, url, label, parent=None, f=Qt.WindowFlags(0)):
     html = HTML_LINK_TEMPLATE.format(
         '<a href="{0}">{1}</a>'.format(url, label)
     )
     super(URLLabel, self).__init__(html, parent, f)
     self.setOpenExternalLinks(True)
Example #5
0
def show_about_box(parent=None):
    """Shows a modal about box
    """
    body = """<h1>{application} {version}</h1>

       <p>
         Segmentation, validation and annotation of images of museum objects.

         See the <a href="https://naturalhistorymuseum.github.io/inselect/">
           {application} home page
          </a> for documentation and news. The source code is hosted in a
         <a href="https://github.com/NaturalHistoryMuseum/inselect/">
            github
         </a> repo.
         Please use our
         <a href="https://github.com/NaturalHistoryMuseum/inselect/issues">
           issues page
         </a>
         to report problems and provide suggestions.
       </p>

       <p>
         Copyright (c) 2014-2017, The Trustees of the Natural History
         Museum, London and licensed under the
         <a href="https://github.com/NaturalHistoryMuseum/inselect/blob/master/LICENSE.md">
           Modified BSD License
         </a>.
         {application} was developed by Alice Heaton, Lawrence Hudson, Pieter
         Holtzhausen and Stéfan van der Walt.
       </p>

       <h2>Acknowledgements</h2>
       <p>
        This research received support from the SYNTHESYS Project,
        <a href="http://www.synthesys.info/">www.synthesys.info</a>,
        which is financed by European Community Research Infrastructure Action
        under the FP7 Integrating Activities Programme (Grant agreement number
        312253), and from the U.K. Natural Environment Research Council.
       </p>

       <h2>Environment</h2>
       <p>
         {environment}
       </p>
    """

    # TODO LH Button to copy to clipboard
    body = body.format(application=QtWidgets.qApp.applicationName(),
                       version=QtWidgets.qApp.applicationVersion(),
                       environment=_environment())
    box = QDialog(parent)
    box.setWindowTitle('About {0}'.format(QtWidgets.qApp.applicationName()))

    vlayout = QVBoxLayout()

    label = QLabel(HTML_LINK_TEMPLATE.format(body))
    label.setWordWrap(True)
    label.setTextFormat(Qt.RichText)
    label.setTextInteractionFlags(Qt.TextBrowserInteraction)
    label.setOpenExternalLinks(True)
    vlayout.addWidget(label)

    close = QPushButton('OK')
    close.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
    close.setDefault(True)
    close.clicked.connect(box.close)
    vlayout.addWidget(close, alignment=QtCore.Qt.AlignHCenter)

    box.setLayout(vlayout)

    box.exec_()
Example #6
0
def show_about_box(parent=None):
    """Shows a modal about box
    """
    body = """<h1>{application} {version}</h1>

       <p>
         Segmentation, validation and annotation of images of museum objects.

         See the <a href="https://naturalhistorymuseum.github.io/inselect/">
           {application} home page
          </a> for documentation and news. The source code is hosted in a
         <a href="https://github.com/NaturalHistoryMuseum/inselect/">
            github
         </a> repo.
         Please use our
         <a href="https://github.com/NaturalHistoryMuseum/inselect/issues">
           issues page
         </a>
         to report problems and provide suggestions.
       </p>

       <p>
         Copyright (c) 2014-2017, The Trustees of the Natural History
         Museum, London and licensed under the
         <a href="https://github.com/NaturalHistoryMuseum/inselect/blob/master/LICENSE.md">
           Modified BSD License
         </a>.
         {application} was developed by Alice Heaton, Lawrence Hudson, Pieter
         Holtzhausen and Stéfan van der Walt.
       </p>

       <h2>Acknowledgements</h2>
       <p>
        This research received support from the SYNTHESYS Project,
        <a href="http://www.synthesys.info/">www.synthesys.info</a>,
        which is financed by European Community Research Infrastructure Action
        under the FP7 Integrating Activities Programme (Grant agreement number
        312253), and from the U.K. Natural Environment Research Council.
       </p>

       <h2>Environment</h2>
       <p>
         {environment}
       </p>
    """

    # TODO LH Button to copy to clipboard
    body = body.format(
        application=QtWidgets.qApp.applicationName(),
        version=QtWidgets.qApp.applicationVersion(),
        environment=_environment()
    )
    box = QDialog(parent)
    box.setWindowTitle('About {0}'.format(QtWidgets.qApp.applicationName()))

    vlayout = QVBoxLayout()

    label = QLabel(HTML_LINK_TEMPLATE.format(body))
    label.setWordWrap(True)
    label.setTextFormat(Qt.RichText)
    label.setTextInteractionFlags(Qt.TextBrowserInteraction)
    label.setOpenExternalLinks(True)
    vlayout.addWidget(label)

    close = QPushButton('OK')
    close.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
    close.setDefault(True)
    close.clicked.connect(box.close)
    vlayout.addWidget(close, alignment=QtCore.Qt.AlignHCenter)

    box.setLayout(vlayout)

    box.exec_()