Modified the template editing setup
[biaweb_qt.git] / templates_dialog.py
index 7d8fbf0..8a57482 100644 (file)
@@ -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))