Example #1
0
    def __init__(self, parent=None):
        # This changes to true when this attribute is being viewed/edited
        self.active = False
        self.ef = 0

        self.nodata = None
        self.nodata_content = (False, None)  # nodata checked, last nodata node

        WizardWidget.__init__(self, parent=parent)

        # an in memory record of all  the contents that were selected
        self._previous_index = -1
        cbo = self.ui.comboBox
        self._domain_content = dict.fromkeys(range(cbo.count()), None)

        self.parent_ui = parent
        self.series = None
        self.ui.nodata_section.hide()
        self.highlighter = Highlighter(self.ui.fgdc_attrdef.document())

        self.nodata_matches = [
            '#N/A', '#N/A N/A', '#NA', '-1.#IND', '-1.#QNAN', '-NaN', '-nan',
            '1.#IND', '1.#QNAN', 'N/A', 'NA', 'NULL', 'NaN', 'n/a', 'nan',
            'null', -9999, '-9999', '', 'Nan', '<< empty cell >>'
        ]
 def __init__(self, parent=None, include_lwork=True):
     self.origin_hint = 'Suggested format "FIRST M. LAST"'
     self.include_lwork = include_lwork
     self.schema = 'bdp'
     WizardWidget.__init__(self, parent=parent)
     self.doi_lookup = None
     self.highlighter = Highlighter(self.ui.fgdc_title.document())
Example #3
0
    def __init__(self, *args, **kwargs):
        super(GrowingTextEdit, self).__init__(*args, **kwargs)
        self.document().contentsChanged.connect(self.sizeChange)
        self.highlighter = Highlighter(self.document())
        self.heightMin = 45
        self.heightMax = 300

        self.setFixedHeight(self.heightMin)
Example #4
0
    def build_ui(self):
        """
        Build and modify this widget's GUI
        Returns
        -------
        None
        """
        self.ui = UI_EA.Ui_Form()
        self.ui.setupUi(self)

        self.detaileds = []
        detailed = self.add_detailed()

        self.setup_dragdrop(self)
        self.highlighter = Highlighter(self.ui.fgdc_eaover.document())
        self.highlighter2 = Highlighter(self.ui.fgdc_eadetcit.document())
        return None
Example #5
0
 def __init__(self, parent=None, include_lwork=True):
     self.origin_hint = 'Suggested format "FIRST M. LAST"'
     self.include_lwork = include_lwork
     self.schema = "bdp"
     WizardWidget.__init__(self, parent=parent)
     self.doi_lookup = None
     self.highlighter = Highlighter(self.ui.fgdc_title.document())
     self.ui.fgdc_title.textChanged.connect(self.remove_returns)
     self.ui.fgdc_title.mouseMoveEvent = self.mouse_move
Example #6
0
 def build_ui(self):
     """
     Build and modify this widget's GUI
     Returns
     -------
     None
     """
     self.ui = UI_udom.Ui_fgdc_attrdomv() # .Ui_USGSContactInfoWidgetMain()
     self.ui.setupUi(self)
     self.setup_dragdrop(self)
     self.highlighter = Highlighter(self.ui.fgdc_udom.document())
    def __init__(
        self,
        label="",
        line_name="na",
        required=False,
        placeholder_text=None,
        spellings=True,
        parent=None,
    ):
        """

        Parameters
        ----------
        label : str
            The label that appears next to the text edit
        line_name : str
            The name to use for the text edit
        required : boolean
            Whethere to display the little blue required asterix
        parent : QWidget

        """
        QWidget.__init__(self, parent=parent)
        self.layout = QHBoxLayout()
        self.qlbl = QLabel(label, self)
        self.added_line = QPlainTextEdit()
        max_line_height = self.added_line.fontMetrics().height() + 10
        self.added_line.setMaximumHeight(max_line_height)
        self.added_line.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.added_line.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.added_line.mouseMoveEvent = self.mouse_move
        self.added_line.setLineWrapMode(QPlainTextEdit.NoWrap)
        self.added_line.textChanged.connect(self.remove_returns)
        if spellings:
            self.highlighter = Highlighter(self.added_line.document())

        if not placeholder_text is None:
            self.added_line.setPlaceholderText(placeholder_text)
        self.added_line.setObjectName(line_name)
        self.layout.addWidget(self.qlbl)
        self.layout.addWidget(self.added_line)

        if required:
            self.required_label = QLabel(self)
            font = QFont()
            font.setFamily("Arial")
            font.setPointSize(9)
            font.setBold(False)
            font.setItalic(False)
            font.setWeight(50)
            self.required_label.setFont(font)
            self.required_label.setScaledContents(True)
            self.required_label.setAlignment(QtCore.Qt.AlignHCenter
                                             | QtCore.Qt.AlignVCenter)
            self.required_label.setIndent(0)

            self.required_label.setText(
                QtCore.QCoreApplication.translate(
                    "",
                    '<html><head/><body><p align="center">'
                    '<span style=" font-size:18pt; color:#55aaff;">*'
                    "</span></p></body></html>",
                ))
            self.layout.addWidget(self.required_label)

        self.layout.setContentsMargins(1, 1, 1, 1)
        self.layout.setSpacing(10)
        self.setLayout(self.layout)
Example #8
0
    def __init__(self,
                 label='',
                 line_name='na',
                 required=False,
                 placeholder_text=None,
                 spellings=True,
                 parent=None):
        """

        Parameters
        ----------
        label : str
            The label that appears next to the text edit
        line_name : str
            The name to use for the text edit
        required : boolean
            Whethere to display the little blue required asterix
        parent : QWidget

        """
        QWidget.__init__(self, parent=parent)
        self.layout = QHBoxLayout()
        self.qlbl = QLabel(label, self)
        self.added_line = QPlainTextEdit()
        self.added_line.setMaximumHeight(21)
        self.added_line.setMaximumBlockCount(1)
        self.added_line.setVerticalScrollBarPolicy(
            QtCore.Qt.ScrollBarAlwaysOff)
        self.added_line.setLineWrapMode(QPlainTextEdit.NoWrap)
        if spellings:
            self.highlighter = Highlighter(self.added_line.document())

        if not placeholder_text is None:
            self.added_line.setPlaceholderText(placeholder_text)
        self.added_line.setObjectName(line_name)
        self.layout.addWidget(self.qlbl)
        self.layout.addWidget(self.added_line)

        if required:
            self.required_label = QLabel(self)
            font = QFont()
            font.setFamily("Arial")
            font.setPointSize(9)
            font.setBold(False)
            font.setItalic(False)
            font.setWeight(50)
            self.required_label.setFont(font)
            self.required_label.setScaledContents(True)
            self.required_label.setAlignment(QtCore.Qt.AlignHCenter
                                             | QtCore.Qt.AlignVCenter)
            self.required_label.setIndent(0)

            self.required_label.setText(
                QtCore.QCoreApplication.translate(
                    "USGSContactInfoWidget",
                    "<html><head/><body><p align=\"center\"><span style=\" font-size:18pt; color:#55aaff;\">*</span></p></body></html>"
                ))
            self.layout.addWidget(self.required_label)

        self.layout.setContentsMargins(1, 1, 1, 1)
        self.layout.setSpacing(10)
        self.setLayout(self.layout)