Esempio n. 1
0
    def set_filtering(self):
        '''Adds a line edit for a search query filter from the taxonomy'''

        label = widgets.Label("Filter Query: ")
        self.layout.addWidget(label, 2, 0, 1, 3)

        storage = updating.Storage('taxonomy_filter')
        searchquery = updating.LineEdit(
            self, storage, tooltip="String filter for download queries.")
        self.layout.addWidget(searchquery, 2, 3, 1, 7)
Esempio n. 2
0
    def __set_replace(self):
        '''Set replace bar and QLineEdit form'''

        label = widgets.Label("Replace With:")
        self.layout.addWidget(label, 12, 0, 6, 2)

        storage = updating.Storage('replace_form')
        self.replaceform = updating.LineEdit(self,
                                             storage,
                                             tooltip="Search query.")
        self.layout.addWidget(self.replaceform, 12, 2, 6, 4)
Esempio n. 3
0
    def __set_search(self):
        '''Set search bar and QLineEdit form'''

        label = widgets.Label("Search For:")
        self.layout.addWidget(label, 0, 0, 6, 2)

        storage = updating.Storage('search_form')
        self.searchform = updating.LineEdit(self,
                                            storage,
                                            tooltip="Search query.")
        self.layout.addWidget(self.searchform, 0, 2, 6, 4)
Esempio n. 4
0
    def set_taxon(self):
        '''Adds a line edit for the taxonomy download'''

        label = widgets.Label("Taxonomy: ")
        self.layout.addWidget(label, 0, 0, 1, 3)

        storage = updating.Storage('taxonomy')
        taxonomy = updating.LineEdit(
            self,
            storage,
            tooltip="Taxonomy ID for the UniProt KB database query.",
            validator=QtGui.QIntValidator())
        self.layout.addWidget(taxonomy, 0, 3, 1, 7)
Esempio n. 5
0
    def default_label(self):
        '''Whether to add isotope labels to the crosslinker'''

        hlayout = self.add_layout(QtGui.QHBoxLayout)

        label = widgets.Label("Default Isotope Label")
        hlayout.addWidget(label)

        storage = updating.Storage('default_isotopic_label')
        default = updating.LineEdit(self, storage,
            tooltip="Default isotope label for the crosslinker (if no "
                "isotope-labeled modifications exist on the peptide).")
        hlayout.addWidget(default)
Esempio n. 6
0
    def image(self, regex=r"[0-9a-zA-Z]{2,4}"):
        '''Sets the default image extension for XL Discoverer'''

        label = widgets.Label("Image")
        self.layout.addWidget(label, 3, 0)

        storage = updating.Storage('image_extension', qt_config.TRANSITIONS)
        validator = QtGui.QRegExpValidator(QtCore.QRegExp(regex))
        image = updating.LineEdit(self, storage,
            tooltip="Default extension for exported images.",
            validator=validator,
            width=75,
            attr='extension')
        self.layout.addWidget(image, 3, 1)
Esempio n. 7
0
    def document(self, regex=r"[0-9a-zA-Z]{2,4}"):
        '''Sets the default document extension for XL Discoverer'''

        label = widgets.Label("Document")
        self.layout.addWidget(label, 2, 0)

        storage = updating.Storage('document_extension', qt_config.TRANSITIONS)
        validator = QtGui.QRegExpValidator(QtCore.QRegExp(regex))
        document = updating.LineEdit(self, storage,
            tooltip="Default extension for the transitions docuyment.",
            validator=validator,
            width=75,
            attr='extension')
        self.layout.addWidget(document, 2, 1)
Esempio n. 8
0
    def __set_loadfile(self):
        '''Adds a QLineEdit to toggle the currently open database'''

        layout = self.add_layout(QtGui.QHBoxLayout)

        label = widgets.Label("Current Database ")
        layout.addWidget(label)

        storage = updating.Storage('current_proteins', paths.DYNAMIC)
        self.database = updating.LineEdit(self, storage,
            tooltip="Path to current database.")
        self.database.value_about_to_change.connect(self.set_dbpath)
        self.database.value_changed.connect(self.is_valid_file)
        layout.addWidget(self.database)

        item = dbwidgets.DatabaseItem("Get Database", self.database, self)
        layout.addWidget(item)
Esempio n. 9
0
    def excel(self, regex=r"[0-9a-zA-Z]{2,4}"):
        '''Sets the default excel extension for XL Discoverer'''

        label = widgets.Label("OpenOffice")
        self.layout.addWidget(label, 1, 0)

        storage = updating.Storage('excel_extension', qt_config.TRANSITIONS)
        validator = QtGui.QRegExpValidator(QtCore.QRegExp(regex))
        excel = updating.LineEdit(self, storage,
            tooltip="Default extension for OpenOffice spreadsheets.",
            validator=validator,
            width=75,
            attr='extension')
        self.layout.addWidget(excel, 1, 1)

        # stretch factors
        self.add_spacer(args=(1, 2))
        self.layout.setColumnStretch(2, 1)