diff --git a/relational_gui/compatibility.py b/relational_gui/compatibility.py index cf39ccb..9cce55e 100644 --- a/relational_gui/compatibility.py +++ b/relational_gui/compatibility.py @@ -21,17 +21,21 @@ from PyQt5 import QtCore, QtWidgets + def get_py_str(a): '''Returns a python string out of a QString''' return a + def set_utf8_text(component, text): component.setText(text) + def get_filename(filename): print (filename) return str(filename.toUtf8()) + def add_list_item(l, item): hitem = QtWidgets.QListWidgetItem(None, 0) hitem.setText(item) diff --git a/relational_gui/creator.py b/relational_gui/creator.py index 621e4f9..5c1daad 100644 --- a/relational_gui/creator.py +++ b/relational_gui/creator.py @@ -23,6 +23,7 @@ from relational_gui import compatibility from relational_gui import rel_edit from relational import relation + class creatorForm(QtWidgets.QDialog): def __init__(self, rel=None): diff --git a/relational_gui/guihandler.py b/relational_gui/guihandler.py index 7a93a23..eccbde7 100644 --- a/relational_gui/guihandler.py +++ b/relational_gui/guihandler.py @@ -79,7 +79,7 @@ class relForm(QtWidgets.QMainWindow): compatibility.set_utf8_text(self.ui.txtQuery, result) except Exception as e: QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" % - (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__())) + (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__())) def resumeHistory(self, item): itm = compatibility.get_py_str(item.text()).split(' = ', 1) @@ -113,7 +113,7 @@ class relForm(QtWidgets.QMainWindow): except Exception as e: print (str(e)) QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), u"%s\n%s" % - (QtWidgets.QApplication.translate("Form", "Check your query!"), str(e))) + (QtWidgets.QApplication.translate("Form", "Check your query!"), str(e))) return # Adds to history @@ -221,7 +221,7 @@ class relForm(QtWidgets.QMainWindow): except Exception as e: print (e) QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" % - (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__())) + (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__())) return self.updateRelations() @@ -296,7 +296,7 @@ class relForm(QtWidgets.QMainWindow): except Exception as e: print (e) QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" % - (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__())) + (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__())) return self.updateRelations()