Exemple #1
0
    def _getDialog(self):
        if not self._dialog:
            self._dialog = self.find_widget("dialogInsertBibtexEntry")

            # get BibTeX model
            self._model = BibTeXModel()

            # setup types combobox

            self._activeType = None
            self._mapping = {}  # this maps Gtk.Entry objects to field names
            self._fieldCache = {
            }  # this is used to restore field values after the type has changed

            self._storeTypes = Gtk.ListStore(str)
            for t in self._model.types:
                self._storeTypes.append([t.name])

            comboTypes = self.find_widget("comboTypes")
            comboTypes.set_model(self._storeTypes)
            cell = Gtk.CellRendererText()
            comboTypes.pack_start(cell, True)
            comboTypes.add_attribute(cell, "text", 0)

            self._boxRequired = self.find_widget("boxRequired")
            self._boxOptional = self.find_widget("boxOptional")

            self._entryIdent = self.find_widget("entryIdent")

            self._buttonOk = self.find_widget("buttonOk")

            self.connect_signals({
                "on_comboTypes_changed": self._comboTypesChanged,
                "on_entryIdent_changed": self._identChanged
            })

            comboTypes.set_active(0)

        return self._dialog
 def __init__(self):
     self._model = BibTeXModel()
Exemple #3
0
 def __init__(self):
     self._model = BibTeXModel()
     self._parser = BibTeXParser()
     self._issue_handler = MockIssueHandler()