+ # if editing is confirmed
+ if edlg.exec_ () == PyQt4.QtGui.QDialog.Accepted:
+ upd_tpl_str = str (edlg.text.toPlainText ()).strip ()
+
+ # update the template with the new template string
+ ret = biaweb_db.update_template (self.current_db, tpl_name, upd_tpl_str)
+ # if update failed
+ if ret == False:
+ PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in updating template")
+