X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=templates_dialog.py;fp=templates_dialog.py;h=8a57482cd183e06be0d9f49e38574799da4cebb4;hp=7d8fbf0e114eea5fba2b449ebd020cdcd0535857;hb=2687a3c3b18c3a267ca60ecdd3759ed0856471e0;hpb=c78ebaf4ae0e486c54907edf51159615f2b4f81e diff --git a/templates_dialog.py b/templates_dialog.py index 7d8fbf0..8a57482 100644 --- a/templates_dialog.py +++ b/templates_dialog.py @@ -3,10 +3,17 @@ import PyQt4 import ui_templates_dialog -import highlighter +import biaweb_db class TemplatesDialog (PyQt4.QtGui.QDialog, ui_templates_dialog.Ui_TemplatesDialog): - def __init__ (self, master): + def __init__ (self, master, currentdb): PyQt4.QtGui.QDialog.__init__ (self, master) self.setupUi (self) - self.setWindowFlags (PyQt4.QtCore.Qt.Window) + + # set the current database + self.current_db = currentdb + + # populate the templates + tpls = biaweb_db.get_templates (self.current_db) + for tpl_name, tpl_content in tpls: + self.templates.addItem (str (tpl_name))