Initial Qt5/Python3 switch

This converts the GUI code to use Qt5 and Python3

The GUI is still somewhat buggy, and it can't open files yet,
but seems to be mostly working, extensive testing will
be needed before this can be released.
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2015-02-19 14:00:47 +01:00
parent 98da6fa7f6
commit cf377eca46
11 changed files with 526 additions and 574 deletions

View File

@ -42,7 +42,7 @@ To launch the application, run
``` ```
If it needs some dependencies: If it needs some dependencies:
Qt4, Python 2.7, either PyQT4 or Pyside. Qt5, Python 3.4 or greater, PyQt5
It can run on osx but this is not supported. It can run on osx but this is not supported.

View File

@ -19,9 +19,10 @@
# #
# Stuff non-related to relational algebra, but used for maintenance. # Stuff non-related to relational algebra, but used for maintenance.
import httplib import http.client
import urllib import urllib.parse
import relation
from relational import relation
def send_survey(data): def send_survey(data):
@ -33,10 +34,10 @@ def send_survey(data):
post += '%s: %s\n' % (i, data[i]) post += '%s: %s\n' % (i, data[i])
# sends the string # sends the string
params = urllib.urlencode({'survey': post}) params = urllib.parse.urlencode({'survey': post})
headers = {"Content-type": headers = {"Content-type":
"application/x-www-form-urlencoded", "Accept": "text/plain"} "application/x-www-form-urlencoded", "Accept": "text/plain"}
connection = httplib.HTTPConnection('feedback-ltworf.appspot.com') connection = http.client.HTTPConnection('feedback-ltworf.appspot.com')
connection.request("POST", "/feedback/relational", params, headers) connection.request("POST", "/feedback/relational", params, headers)
return connection.getresponse() return connection.getresponse()
@ -46,7 +47,7 @@ def check_latest_version():
'''Returns the latest version available. '''Returns the latest version available.
Heavely dependent on server and server configurations Heavely dependent on server and server configurations
not granted to work forever.''' not granted to work forever.'''
connection = httplib.HTTPConnection('feedback-ltworf.appspot.com') connection = http.client.HTTPConnection('feedback-ltworf.appspot.com')
connection.request("GET", "/version/relational") connection.request("GET", "/version/relational")
r = connection.getresponse() r = connection.getresponse()
@ -54,7 +55,7 @@ def check_latest_version():
s = r.read() s = r.read()
if len(s) == 0: if len(s) == 0:
return None return None
return s.strip() return str(s.strip())
class interface (object): class interface (object):

View File

@ -84,18 +84,20 @@ if __name__ == "__main__":
if x11: if x11:
import sip # needed on windows import sip # needed on windows
from PyQt4 import QtGui from PyQt5 import QtGui, QtWidgets
#FIXME remove this
from relational_gui import maingui, guihandler, about, surveyForm
try: try:
from relational_gui import maingui, guihandler, about, surveyForm from relational_gui import maingui, guihandler, about, surveyForm
except: except:
print >> sys.stderr, "Module relational_gui is missing.\nPlease install relational package." print ("Module relational_gui is missing.\nPlease install relational package.",file=sys.stderr)
sys.exit(3) sys.exit(3)
about.version = version about.version = version
surveyForm.version = version surveyForm.version = version
guihandler.version = version guihandler.version = version
app = QtGui.QApplication(sys.argv) app = QtWidgets.QApplication(sys.argv)
app.setOrganizationName('None') app.setOrganizationName('None')
app.setApplicationName('relational') app.setApplicationName('relational')
@ -110,7 +112,7 @@ if __name__ == "__main__":
for i in range(len(files)): for i in range(len(files)):
if not os.path.isfile(files[i]): if not os.path.isfile(files[i]):
print >> sys.stderr, "%s is not a file" % files[i] print ("%s is not a file" % files[i],file=sys.stderr)
printhelp(12) printhelp(12)
f = files[i].split('/') f = files[i].split('/')
defname = f[len(f) - 1].lower() defname = f[len(f) - 1].lower()
@ -126,7 +128,7 @@ if __name__ == "__main__":
try: try:
import relational_readline.linegui import relational_readline.linegui
except: except:
print >> sys.stderr, "Module relational_readline is missing.\nPlease install relational-cli package." print ("Module relational_readline is missing.\nPlease install relational-cli package.",file=sys.stderr)
sys.exit(3) sys.exit(3)
relational_readline.linegui.version = version relational_readline.linegui.version = version
relational_readline.linegui.main(files) relational_readline.linegui.main(files)

View File

@ -18,10 +18,10 @@
# author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it> # author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
import os import os
from PyQt4 import QtCore, QtGui from PyQt5 import QtCore, QtGui, QtWidgets
try: # If QtWebKit is available, uses it try: # If QtWebKit is available, uses it
from PyQt4 import QtWebKit from PyQt5 import QtWebKit
webk = True webk = True
except: except:
webk = False webk = False
@ -34,58 +34,58 @@ class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(510, 453) Dialog.resize(510, 453)
self.verticalLayout_2 = QtGui.QVBoxLayout(Dialog) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_2.setObjectName("verticalLayout_2")
self.tabWidget = QtGui.QTabWidget(Dialog) self.tabWidget = QtWidgets.QTabWidget(Dialog)
self.tabWidget.setObjectName("tabWidget") self.tabWidget.setObjectName("tabWidget")
self.tab = QtGui.QWidget() self.tab = QtWidgets.QWidget()
self.tab.setGeometry(QtCore.QRect(0, 0, 494, 377)) self.tab.setGeometry(QtCore.QRect(0, 0, 494, 377))
self.tab.setObjectName("tab") self.tab.setObjectName("tab")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.tab) self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab)
self.verticalLayout_3.setObjectName("verticalLayout_3") self.verticalLayout_3.setObjectName("verticalLayout_3")
self.groupBox = QtGui.QGroupBox(self.tab) self.groupBox = QtWidgets.QGroupBox(self.tab)
self.groupBox.setObjectName("groupBox") self.groupBox.setObjectName("groupBox")
self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox) self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox)
self.verticalLayout_5.setObjectName("verticalLayout_5") self.verticalLayout_5.setObjectName("verticalLayout_5")
self.label = QtGui.QLabel(self.groupBox) self.label = QtWidgets.QLabel(self.groupBox)
font = QtGui.QFont() font = QtGui.QFont()
font.setPointSize(15) font.setPointSize(15)
self.label.setFont(font) self.label.setFont(font)
self.label.setObjectName("label") self.label.setObjectName("label")
self.verticalLayout_5.addWidget(self.label) self.verticalLayout_5.addWidget(self.label)
self.label_3 = QtGui.QLabel(self.groupBox) self.label_3 = QtWidgets.QLabel(self.groupBox)
self.label_3.setObjectName("label_3") self.label_3.setObjectName("label_3")
self.verticalLayout_5.addWidget(self.label_3) self.verticalLayout_5.addWidget(self.label_3)
self.verticalLayout_3.addWidget(self.groupBox) self.verticalLayout_3.addWidget(self.groupBox)
self.groupBox_3 = QtGui.QGroupBox(self.tab) self.groupBox_3 = QtWidgets.QGroupBox(self.tab)
self.groupBox_3.setObjectName("groupBox_3") self.groupBox_3.setObjectName("groupBox_3")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.groupBox_3) self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_3)
self.verticalLayout_4.setObjectName("verticalLayout_4") self.verticalLayout_4.setObjectName("verticalLayout_4")
self.label_2 = QtGui.QLabel(self.groupBox_3) self.label_2 = QtWidgets.QLabel(self.groupBox_3)
self.label_2.setObjectName("label_2") self.label_2.setObjectName("label_2")
self.verticalLayout_4.addWidget(self.label_2) self.verticalLayout_4.addWidget(self.label_2)
self.verticalLayout_3.addWidget(self.groupBox_3) self.verticalLayout_3.addWidget(self.groupBox_3)
self.groupBox_2 = QtGui.QGroupBox(self.tab) self.groupBox_2 = QtWidgets.QGroupBox(self.tab)
self.groupBox_2.setObjectName("groupBox_2") self.groupBox_2.setObjectName("groupBox_2")
self.verticalLayout_6 = QtGui.QVBoxLayout(self.groupBox_2) self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.groupBox_2)
self.verticalLayout_6.setObjectName("verticalLayout_6") self.verticalLayout_6.setObjectName("verticalLayout_6")
self.label_4 = QtGui.QLabel(self.groupBox_2) self.label_4 = QtWidgets.QLabel(self.groupBox_2)
self.label_4.setObjectName("label_4") self.label_4.setObjectName("label_4")
self.verticalLayout_6.addWidget(self.label_4) self.verticalLayout_6.addWidget(self.label_4)
self.verticalLayout_3.addWidget(self.groupBox_2) self.verticalLayout_3.addWidget(self.groupBox_2)
self.tabWidget.addTab(self.tab, "") self.tabWidget.addTab(self.tab, "")
self.License = QtGui.QWidget() self.License = QtWidgets.QWidget()
self.License.setGeometry(QtCore.QRect(0, 0, 494, 377)) self.License.setGeometry(QtCore.QRect(0, 0, 494, 377))
self.License.setObjectName("License") self.License.setObjectName("License")
self.verticalLayout = QtGui.QVBoxLayout(self.License) self.verticalLayout = QtWidgets.QVBoxLayout(self.License)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.textEdit = QtGui.QTextEdit(self.License) self.textEdit = QtWidgets.QTextEdit(self.License)
self.textEdit.setObjectName("textEdit") self.textEdit.setObjectName("textEdit")
self.verticalLayout.addWidget(self.textEdit) self.verticalLayout.addWidget(self.textEdit)
self.tabWidget.addTab(self.License, "") self.tabWidget.addTab(self.License, "")
self.tab_2 = QtGui.QWidget() self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2") self.tab_2.setObjectName("tab_2")
self.verticalLayout_7 = QtGui.QVBoxLayout(self.tab_2) self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tab_2)
self.verticalLayout_7.setObjectName("verticalLayout_7") self.verticalLayout_7.setObjectName("verticalLayout_7")
if (webk): if (webk):
self.webView = QtWebKit.QWebView(self.tab_2) self.webView = QtWebKit.QWebView(self.tab_2)
@ -94,10 +94,10 @@ class Ui_Dialog(object):
self.webView.setObjectName("webView") self.webView.setObjectName("webView")
self.verticalLayout_7.addWidget(self.webView) self.verticalLayout_7.addWidget(self.webView)
else: else:
self.webLink = QtGui.QLabel(self.groupBox) self.webLink = QtWidgets.QLabel(self.groupBox)
self.webLink.setFont(font) self.webLink.setFont(font)
self.webLink.setObjectName("lblLink") self.webLink.setObjectName("lblLink")
self.webLink.setText(QtGui.QApplication.translate( self.webLink.setText(QtWidgets.QApplication.translate(
"Dialog", "<a href=\"http://ltworf.github.io/relational/\">Relational's website</a>", None,)) "Dialog", "<a href=\"http://ltworf.github.io/relational/\">Relational's website</a>", None,))
self.webLink.setOpenExternalLinks(True) self.webLink.setOpenExternalLinks(True)
self.webLink.setTextFormat(QtCore.Qt.AutoText) self.webLink.setTextFormat(QtCore.Qt.AutoText)
@ -113,48 +113,46 @@ class Ui_Dialog(object):
self.tabWidget.addTab(self.tab_2, "") self.tabWidget.addTab(self.tab_2, "")
self.verticalLayout_2.addWidget(self.tabWidget) self.verticalLayout_2.addWidget(self.tabWidget)
self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox") self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_2.addWidget(self.buttonBox) self.verticalLayout_2.addWidget(self.buttonBox)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
self.tabWidget.setCurrentIndex(0) self.tabWidget.setCurrentIndex(0)
QtCore.QObject.connect(
self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept) self.buttonBox.accepted.connect(Dialog.accept)
QtCore.QObject.connect( self.buttonBox.rejected.connect(Dialog.reject)
self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog): def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate( Dialog.setWindowTitle(QtWidgets.QApplication.translate(
"Dialog", "Documentation", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Documentation", None))
self.groupBox.setTitle(QtGui.QApplication.translate( self.groupBox.setTitle(QtWidgets.QApplication.translate(
"Dialog", "Relational", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Relational", None))
self.label.setText(QtGui.QApplication.translate( self.label.setText(QtWidgets.QApplication.translate(
"Dialog", "Relational", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Relational", None))
self.label_3.setText(QtGui.QApplication.translate( self.label_3.setText(QtWidgets.QApplication.translate(
"Dialog", "Version " + version, None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Version " + version, None))
self.label_3.setTextInteractionFlags( self.label_3.setTextInteractionFlags(
QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse) QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
self.groupBox_3.setTitle(QtGui.QApplication.translate( self.groupBox_3.setTitle(QtWidgets.QApplication.translate(
"Dialog", "Author", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Author", None))
self.label_2.setText(QtGui.QApplication.translate( self.label_2.setText(QtWidgets.QApplication.translate(
"Dialog", "Salvo \"LtWorf\" Tomaselli &lt;<a href=\"mailto:tiposchi@tiscali.it\">tiposchi@tiscali.it</a>&gt;<br>Emilio Di Prima &lt;emiliodiprima[at]msn[dot]com&gt; (For the windows setup)", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Salvo \"LtWorf\" Tomaselli &lt;<a href=\"mailto:tiposchi@tiscali.it\">tiposchi@tiscali.it</a>&gt;<br>Emilio Di Prima &lt;emiliodiprima[at]msn[dot]com&gt; (For the windows setup)", None))
self.label_2.setOpenExternalLinks(True) self.label_2.setOpenExternalLinks(True)
self.label_2.setTextInteractionFlags( self.label_2.setTextInteractionFlags(
QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse) QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
self.groupBox_2.setTitle(QtGui.QApplication.translate( self.groupBox_2.setTitle(QtWidgets.QApplication.translate(
"Dialog", "Links", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Links", None))
self.label_4.setText(QtGui.QApplication.translate( self.label_4.setText(QtWidgets.QApplication.translate(
"Dialog", "<a href=\"http://ltworf.github.io/relational/\">http://ltworf.github.io/relational/</a>", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "<a href=\"http://ltworf.github.io/relational/\">http://ltworf.github.io/relational/</a>", None))
self.label_4.setOpenExternalLinks(True) self.label_4.setOpenExternalLinks(True)
self.label_4.setTextInteractionFlags( self.label_4.setTextInteractionFlags(
QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse) QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate( self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtWidgets.QApplication.translate(
"Dialog", "About", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "About", None))
self.textEdit.setHtml(QtGui.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" self.textEdit.setHtml(QtWidgets.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><title>GNU General Public License - GNU Project - Free Software Foundation (FSF)</title><style type=\"text/css\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><title>GNU General Public License - GNU Project - Free Software Foundation (FSF)</title><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n" "p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'DejaVu Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n" "</style></head><body style=\" font-family:\'DejaVu Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
@ -295,17 +293,17 @@ class Ui_Dialog(object):
"<pre style=\" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Courier New,courier\';\"> under certain conditions; type `show c\' for details. </pre>\n" "<pre style=\" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Courier New,courier\';\"> under certain conditions; type `show c\' for details. </pre>\n"
"<p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">The hypothetical commands `show w\' and `show c\' should show the appropriate parts of the General Public License. Of course, your program\'s commands might be different; for a GUI interface, you would use an “about box”. </p>\n" "<p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">The hypothetical commands `show w\' and `show c\' should show the appropriate parts of the General Public License. Of course, your program\'s commands might be different; for a GUI interface, you would use an “about box”. </p>\n"
"<p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see &lt;http://www.gnu.org/licenses/&gt;. </p>\n" "<p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see &lt;http://www.gnu.org/licenses/&gt;. </p>\n"
"<p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read &lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;. </p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) "<p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read &lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;. </p></body></html>", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.License), QtGui.QApplication.translate( self.tabWidget.setTabText(self.tabWidget.indexOf(self.License), QtWidgets.QApplication.translate(
"Dialog", "License", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "License", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate( self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtWidgets.QApplication.translate(
"Dialog", "Docs", None, QtGui.QApplication.UnicodeUTF8)) "Dialog", "Docs", None))
if __name__ == "__main__": if __name__ == "__main__":
import sys import sys
app = QtGui.QApplication(sys.argv) app = QtWidgets.QApplication(sys.argv)
Dialog = QtGui.QDialog() Dialog = QtWidgets.QDialog()
ui = Ui_Dialog() ui = Ui_Dialog()
ui.setupUi(Dialog) ui.setupUi(Dialog)
Dialog.show() Dialog.show()

View File

@ -19,22 +19,21 @@
# #
# Module to unify the use of both pyqt and pyside # Module to unify the use of both pyqt and pyside
from PyQt4 import QtCore, QtGui from PyQt5 import QtCore, QtWidgets
def get_py_str(a): def get_py_str(a):
'''Returns a python string out of a QString''' '''Returns a python string out of a QString'''
return unicode(a.toUtf8(), 'utf-8') return a
def set_utf8_text(component, text): def set_utf8_text(component, text):
component.setText(QtCore.QString.fromUtf8(text)) component.setText(text)
def get_filename(filename): def get_filename(filename):
print (filename)
return str(filename.toUtf8()) return str(filename.toUtf8())
def add_list_item(l, item): def add_list_item(l, item):
history_item = QtCore.QString() hitem = QtWidgets.QListWidgetItem(None, 0)
history_item.append(item) hitem.setText(item)
hitem = QtGui.QListWidgetItem(None, 0)
hitem.setText(history_item)
l.addItem(hitem) l.addItem(hitem)
l.setCurrentItem(hitem) l.setCurrentItem(hitem)

View File

@ -17,20 +17,16 @@
# #
# author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it> # author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
try: from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt4 import QtCore, QtGui
except:
from PySide import QtCore, QtGui
import compatibility from relational_gui import compatibility
from relational_gui import rel_edit
from relational import relation from relational import relation
import rel_edit
class creatorForm(QtWidgets.QDialog):
class creatorForm(QtGui.QDialog):
def __init__(self, rel=None): def __init__(self, rel=None):
QtGui.QDialog.__init__(self) QtWidgets.QDialog.__init__(self)
self.setSizeGripEnabled(True) self.setSizeGripEnabled(True)
self.result_relation = None self.result_relation = None
@ -50,7 +46,7 @@ class creatorForm(QtGui.QDialog):
self.table.insertRow(0) self.table.insertRow(0)
for i in rel.header.attributes: for i in rel.header.attributes:
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
item.setText(i) item.setText(i)
self.table.insertColumn(self.table.columnCount()) self.table.insertColumn(self.table.columnCount())
self.table.setItem(0, self.table.columnCount() - 1, item) self.table.setItem(0, self.table.columnCount() - 1, item)
@ -58,7 +54,7 @@ class creatorForm(QtGui.QDialog):
for i in rel.content: for i in rel.content:
self.table.insertRow(self.table.rowCount()) self.table.insertRow(self.table.rowCount())
for j in range(len(i)): for j in range(len(i)):
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
item.setText(i[j]) item.setText(i[j])
self.table.setItem(self.table.rowCount() - 1, j, item) self.table.setItem(self.table.rowCount() - 1, j, item)
@ -70,10 +66,10 @@ class creatorForm(QtGui.QDialog):
self.table.insertRow(0) self.table.insertRow(0)
self.table.insertRow(0) self.table.insertRow(0)
i00 = QtGui.QTableWidgetItem() i00 = QtWidgets.QTableWidgetItem()
i01 = QtGui.QTableWidgetItem() i01 = QtWidgets.QTableWidgetItem()
i10 = QtGui.QTableWidgetItem() i10 = QtWidgets.QTableWidgetItem()
i11 = QtGui.QTableWidgetItem() i11 = QtWidgets.QTableWidgetItem()
i00.setText('Field name 1') i00.setText('Field name 1')
i01.setText('Field name 2') i01.setText('Field name 2')
i10.setText('Value 1') i10.setText('Value 1')
@ -92,9 +88,9 @@ class creatorForm(QtGui.QDialog):
compatibility.get_py_str(self.table.item(0, i).text())) compatibility.get_py_str(self.table.item(0, i).text()))
try: try:
header = relation.header(hlist) header = relation.header(hlist)
except Exception, e: except Exception as e:
QtGui.QMessageBox.information(None, QtGui.QApplication.translate("Form", "Error"), "%s\n%s" % ( QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" % (
QtGui.QApplication.translate("Form", "Header error!"), e.__str__())) QtWidgets.QApplication.translate("Form", "Header error!"), e.__str__()))
return None return None
r = relation.relation() r = relation.relation()
r.header = header r.header = header
@ -106,8 +102,8 @@ class creatorForm(QtGui.QDialog):
hlist.append( hlist.append(
compatibility.get_py_str(self.table.item(i, j).text())) compatibility.get_py_str(self.table.item(i, j).text()))
except: except:
QtGui.QMessageBox.information(None, QtGui.QApplication.translate( QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
"Form", "Error"), QtGui.QApplication.translate("Form", "Unset value in %d,%d!" % (i + 1, j + 1))) "Form", "Error"), QtWidgets.QApplication.translate("Form", "Unset value in %d,%d!" % (i + 1, j + 1)))
return None return None
r.content.add(tuple(hlist)) r.content.add(tuple(hlist))
return r return r
@ -118,31 +114,25 @@ class creatorForm(QtGui.QDialog):
# Doesn't close the window in case of errors # Doesn't close the window in case of errors
if self.result_relation != None: if self.result_relation != None:
QtGui.QDialog.accept(self) QtWidgets.QDialog.accept(self)
pass
def reject(self): def reject(self):
self.result_relation = None self.result_relation = None
QtGui.QDialog.reject(self) QtWidgets.QDialog.reject(self)
pass
def addColumn(self): def addColumn(self):
self.table.insertColumn(self.table.columnCount()) self.table.insertColumn(self.table.columnCount())
pass
def addRow(self): def addRow(self):
self.table.insertRow(1) self.table.insertRow(1)
pass
def deleteColumn(self): def deleteColumn(self):
if self.table.columnCount() > 1: if self.table.columnCount() > 1:
self.table.removeColumn(self.table.currentColumn()) self.table.removeColumn(self.table.currentColumn())
pass
def deleteRow(self): def deleteRow(self):
if self.table.rowCount() > 2: if self.table.rowCount() > 2:
self.table.removeRow(self.table.currentRow()) self.table.removeRow(self.table.currentRow())
pass
def edit_relation(rel=None): def edit_relation(rel=None):
@ -165,4 +155,4 @@ if __name__ == '__main__':
app = QtGui.QApplication(sys.argv) app = QtGui.QApplication(sys.argv)
r = relation.relation( r = relation.relation(
"/home/salvo/dev/relational/trunk/samples/people.csv") "/home/salvo/dev/relational/trunk/samples/people.csv")
print edit_relation(r) print (edit_relation(r))

View File

@ -19,21 +19,21 @@
import sys import sys
import os import os
from PyQt4 import QtCore, QtGui from PyQt5 import QtCore, QtWidgets, QtWidgets
from relational import relation, parser, optimizer, rtypes from relational import relation, parser, optimizer, rtypes
import about from relational_gui import about
import survey from relational_gui import survey
import surveyForm from relational_gui import surveyForm
import maingui from relational_gui import maingui
import compatibility from relational_gui import compatibility
class relForm(QtGui.QMainWindow): class relForm(QtWidgets.QMainWindow):
def __init__(self, ui): def __init__(self, ui):
QtGui.QMainWindow.__init__(self) QtWidgets.QMainWindow.__init__(self)
self.About = None self.About = None
self.Survey = None self.Survey = None
self.relations = {} # Dictionary for relations self.relations = {} # Dictionary for relations
@ -49,17 +49,17 @@ class relForm(QtGui.QMainWindow):
online = maintenance.check_latest_version() online = maintenance.check_latest_version()
if online > version: if online > version:
r = QtGui.QApplication.translate( r = QtWidgets.QApplication.translate(
"Form", "New version available online: %s." % online) "Form", "New version available online: %s." % online)
elif online == version: elif online == version:
r = QtGui.QApplication.translate( r = QtWidgets.QApplication.translate(
"Form", "Latest version installed.") "Form", "Latest version installed.")
else: else:
r = QtGui.QApplication.translate( r = QtWidgets.QApplication.translate(
"Form", "You are using an unstable version.") "Form", "You are using an unstable version.")
QtGui.QMessageBox.information( QtWidgets.QMessageBox.information(
self, QtGui.QApplication.translate("Form", "Version"), r) self, QtWidgets.QApplication.translate("Form", "Version"), r)
def load_query(self, *index): def load_query(self, *index):
self.ui.txtQuery.setText(self.savedQ.itemData(index[0]).toString()) self.ui.txtQuery.setText(self.savedQ.itemData(index[0]).toString())
@ -77,9 +77,9 @@ class relForm(QtGui.QMainWindow):
try: try:
result = optimizer.optimize_all(query, self.relations) result = optimizer.optimize_all(query, self.relations)
compatibility.set_utf8_text(self.ui.txtQuery, result) compatibility.set_utf8_text(self.ui.txtQuery, result)
except Exception, e: except Exception as e:
QtGui.QMessageBox.information(None, QtGui.QApplication.translate("Form", "Error"), "%s\n%s" % QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" %
(QtGui.QApplication.translate("Form", "Check your query!"), e.__str__())) (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__()))
def resumeHistory(self, item): def resumeHistory(self, item):
itm = compatibility.get_py_str(item.text()).split(' = ', 1) itm = compatibility.get_py_str(item.text()).split(' = ', 1)
@ -94,14 +94,14 @@ class relForm(QtGui.QMainWindow):
self.ui.txtResult.text()) # result relation's name self.ui.txtResult.text()) # result relation's name
if not rtypes.is_valid_relation_name(res_rel): if not rtypes.is_valid_relation_name(res_rel):
QtGui.QMessageBox.information(self, QtGui.QApplication.translate( QtWidgets.QMessageBox.information(self, QtWidgets.QApplication.translate(
"Form", "Error"), QtGui.QApplication.translate("Form", "Wrong name for destination relation.")) "Form", "Error"), QtWidgets.QApplication.translate("Form", "Wrong name for destination relation."))
return return
try: try:
# Converting string to utf8 and then from qstring to normal string # Converting string to utf8 and then from qstring to normal string
expr = parser.parse(query) # Converting expression to python code expr = parser.parse(query) # Converting expression to python code
print query, "-->", expr # Printing debug print (query, "-->", expr) # Printing debug
result = eval(expr, self.relations) # Evaluating the expression result = eval(expr, self.relations) # Evaluating the expression
self.relations[ self.relations[
@ -110,10 +110,10 @@ class relForm(QtGui.QMainWindow):
self.selectedRelation = result self.selectedRelation = result
self.showRelation(self.selectedRelation) self.showRelation(self.selectedRelation)
# Show the result in the table # Show the result in the table
except Exception, e: except Exception as e:
print e.__unicode__() print (str(e))
QtGui.QMessageBox.information(None, QtGui.QApplication.translate("Form", "Error"), u"%s\n%s" % QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), u"%s\n%s" %
(QtGui.QApplication.translate("Form", "Check your query!"), e.__unicode__())) (QtWidgets.QApplication.translate("Form", "Check your query!"), str(e)))
return return
# Adds to history # Adds to history
@ -138,7 +138,7 @@ class relForm(QtGui.QMainWindow):
# Set content # Set content
for i in rel.content: for i in rel.content:
item = QtGui.QTreeWidgetItem() item = QtWidgets.QTreeWidgetItem()
for j in range(len(i)): for j in range(len(i)):
item.setText(j, i[j]) item.setText(j, i[j])
self.ui.table.addTopLevelItem(item) self.ui.table.addTopLevelItem(item)
@ -168,8 +168,8 @@ class relForm(QtGui.QMainWindow):
self.ui.lstRelations.addItem(i) self.ui.lstRelations.addItem(i)
def saveRelation(self): def saveRelation(self):
filename = QtGui.QFileDialog.getSaveFileName(self, QtGui.QApplication.translate( filename = QtWidgets.QFileDialog.getSaveFileName(self, QtWidgets.QApplication.translate(
"Form", "Save Relation"), "", QtGui.QApplication.translate("Form", "Relations (*.csv)")) "Form", "Save Relation"), "", QtWidgets.QApplication.translate("Form", "Relations (*.csv)"))
filename = compatibility.get_filename(filename) filename = compatibility.get_filename(filename)
if (len(filename) == 0): # Returns if no file was selected if (len(filename) == 0): # Returns if no file was selected
@ -183,7 +183,7 @@ class relForm(QtGui.QMainWindow):
self.updateRelations() self.updateRelations()
def editRelation(self): def editRelation(self):
import creator from relational_gui import creator
for i in self.ui.lstRelations.selectedItems(): for i in self.ui.lstRelations.selectedItems():
result = creator.edit_relation( result = creator.edit_relation(
self.relations[compatibility.get_py_str(i.text())]) self.relations[compatibility.get_py_str(i.text())])
@ -192,17 +192,17 @@ class relForm(QtGui.QMainWindow):
self.updateRelations() self.updateRelations()
def newRelation(self): def newRelation(self):
import creator from relational_gui import creator
result = creator.edit_relation() result = creator.edit_relation()
if result == None: if result == None:
return return
res = QtGui.QInputDialog.getText( res = QtWidgets.QInputDialog.getText(
self, self,
QtGui.QApplication.translate("Form", "New relation"), QtWidgets.QApplication.translate("Form", "New relation"),
QtGui.QApplication.translate( QtWidgets.QApplication.translate(
"Form", "Insert the name for the new relation"), "Form", "Insert the name for the new relation"),
QtGui.QLineEdit.Normal, '') QtWidgets.QLineEdit.Normal, '')
if res[1] == False or len(res[0]) == 0: if res[1] == False or len(res[0]) == 0:
return return
@ -210,18 +210,18 @@ class relForm(QtGui.QMainWindow):
name = compatibility.get_py_str(res[0]) name = compatibility.get_py_str(res[0])
if not rtypes.is_valid_relation_name(name): if not rtypes.is_valid_relation_name(name):
r = QtGui.QApplication.translate( r = QtWidgets.QApplication.translate(
"Form", str("Wrong name for destination relation: %s." % name)) "Form", str("Wrong name for destination relation: %s." % name))
QtGui.QMessageBox.information( QtWidgets.QMessageBox.information(
self, QtGui.QApplication.translate("Form", "Error"), r) self, QtWidgets.QApplication.translate("Form", "Error"), r)
return return
try: try:
self.relations[name] = result self.relations[name] = result
except Exception, e: except Exception as e:
print e print (e)
QtGui.QMessageBox.information(None, QtGui.QApplication.translate("Form", "Error"), "%s\n%s" % QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" %
(QtGui.QApplication.translate("Form", "Check your query!"), e.__str__())) (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__()))
return return
self.updateRelations() self.updateRelations()
@ -249,7 +249,7 @@ class relForm(QtGui.QMainWindow):
def showAbout(self): def showAbout(self):
if self.About == None: if self.About == None:
self.About = QtGui.QDialog() self.About = QtWidgets.QDialog()
ui = about.Ui_Dialog() ui = about.Ui_Dialog()
ui.setupUi(self.About) ui.setupUi(self.About)
self.About.show() self.About.show()
@ -260,8 +260,8 @@ class relForm(QtGui.QMainWindow):
It shouldn't be called giving filename but not giving name.''' It shouldn't be called giving filename but not giving name.'''
# Asking for file to load # Asking for file to load
if filename == None: if filename == None:
filename = QtGui.QFileDialog.getOpenFileName(self, QtGui.QApplication.translate( filename = QtWidgets.QFileDialog.getOpenFileName(self, QtWidgets.QApplication.translate(
"Form", "Load Relation"), "", QtGui.QApplication.translate("Form", "Relations (*.csv);;Text Files (*.txt);;All Files (*)")) "Form", "Load Relation"), "", QtWidgets.QApplication.translate("Form", "Relations (*.csv);;Text Files (*.txt);;All Files (*)"))
filename = compatibility.get_filename(filename) filename = compatibility.get_filename(filename)
# Default relation's name # Default relation's name
@ -275,29 +275,28 @@ class relForm(QtGui.QMainWindow):
defname = defname[:-4] defname = defname[:-4]
if name == None: # Prompt dialog to insert name for the relation if name == None: # Prompt dialog to insert name for the relation
res = QtGui.QInputDialog.getText( res = QtWidgets.QInputDialog.getText(
self, QtGui.QApplication.translate("Form", "New relation"), QtGui.QApplication.translate( self, QtWidgets.QApplication.translate("Form", "New relation"), QtWidgets.QApplication.translate(
"Form", "Insert the name for the new relation"), "Form", "Insert the name for the new relation"),
QtGui.QLineEdit.Normal, defname) QtWidgets.QLineEdit.Normal, defname)
if res[1] == False or len(res[0]) == 0: if res[1] == False or len(res[0]) == 0:
return return
# Patch provided by Angelo 'Havoc' Puglisi
name = compatibility.get_py_str(res[0]) name = compatibility.get_py_str(res[0])
if not rtypes.is_valid_relation_name(name): if not rtypes.is_valid_relation_name(name):
r = QtGui.QApplication.translate( r = QtWidgets.QApplication.translate(
"Form", str("Wrong name for destination relation: %s." % name)) "Form", str("Wrong name for destination relation: %s." % name))
QtGui.QMessageBox.information( QtWidgets.QMessageBox.information(
self, QtGui.QApplication.translate("Form", "Error"), r) self, QtWidgets.QApplication.translate("Form", "Error"), r)
return return
try: try:
self.relations[name] = relation.relation(filename) self.relations[name] = relation.relation(filename)
except Exception, e: except Exception as e:
print e print (e)
QtGui.QMessageBox.information(None, QtGui.QApplication.translate("Form", "Error"), "%s\n%s" % QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" %
(QtGui.QApplication.translate("Form", "Check your query!"), e.__str__())) (QtWidgets.QApplication.translate("Form", "Check your query!"), e.__str__()))
return return
self.updateRelations() self.updateRelations()

View File

@ -2,120 +2,106 @@
# Form implementation generated from reading ui file 'relational_gui/maingui.ui' # Form implementation generated from reading ui file 'relational_gui/maingui.ui'
# #
# Created: Fri Dec 27 00:23:51 2013 # Created: Thu Feb 19 13:07:47 2015
# by: PyQt4 UI code generator 4.10.3 # by: PyQt5 UI code generator 5.3.2
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui from PyQt5 import QtCore, QtGui, QtWidgets
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object): class Ui_MainWindow(object):
def setupUi(self, MainWindow): def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 612) MainWindow.resize(800, 612)
self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.centralwidget.setObjectName("centralwidget")
self.verticalLayout_7 = QtGui.QVBoxLayout(self.centralwidget) self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7")) self.verticalLayout_7.setObjectName("verticalLayout_7")
self.splitter_4 = QtGui.QSplitter(self.centralwidget) self.splitter_4 = QtWidgets.QSplitter(self.centralwidget)
self.splitter_4.setOrientation(QtCore.Qt.Horizontal) self.splitter_4.setOrientation(QtCore.Qt.Horizontal)
self.splitter_4.setObjectName(_fromUtf8("splitter_4")) self.splitter_4.setObjectName("splitter_4")
self.layoutWidget = QtGui.QWidget(self.splitter_4) self.layoutWidget = QtWidgets.QWidget(self.splitter_4)
self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) self.layoutWidget.setObjectName("layoutWidget")
self.verticalLayout_11 = QtGui.QVBoxLayout(self.layoutWidget) self.verticalLayout_11 = QtWidgets.QVBoxLayout(self.layoutWidget)
self.verticalLayout_11.setMargin(0) self.verticalLayout_11.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_11.setObjectName(_fromUtf8("verticalLayout_11")) self.verticalLayout_11.setObjectName("verticalLayout_11")
self.groupBox_3 = QtGui.QGroupBox(self.layoutWidget) self.groupBox_3 = QtWidgets.QGroupBox(self.layoutWidget)
self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) self.groupBox_3.setObjectName("groupBox_3")
self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox_3) self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox_3)
self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) self.verticalLayout_5.setObjectName("verticalLayout_5")
self.cmdAbout = QtGui.QPushButton(self.groupBox_3) self.cmdAbout = QtWidgets.QPushButton(self.groupBox_3)
self.cmdAbout.setObjectName(_fromUtf8("cmdAbout")) self.cmdAbout.setObjectName("cmdAbout")
self.verticalLayout_5.addWidget(self.cmdAbout) self.verticalLayout_5.addWidget(self.cmdAbout)
self.cmdSurvey = QtGui.QPushButton(self.groupBox_3) self.cmdSurvey = QtWidgets.QPushButton(self.groupBox_3)
self.cmdSurvey.setObjectName(_fromUtf8("cmdSurvey")) self.cmdSurvey.setObjectName("cmdSurvey")
self.verticalLayout_5.addWidget(self.cmdSurvey) self.verticalLayout_5.addWidget(self.cmdSurvey)
self.verticalLayout_11.addWidget(self.groupBox_3) self.verticalLayout_11.addWidget(self.groupBox_3)
self.groupBox_4 = QtGui.QGroupBox(self.layoutWidget) self.groupBox_4 = QtWidgets.QGroupBox(self.layoutWidget)
self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) self.groupBox_4.setObjectName("groupBox_4")
self.verticalLayout_10 = QtGui.QVBoxLayout(self.groupBox_4) self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.groupBox_4)
self.verticalLayout_10.setObjectName(_fromUtf8("verticalLayout_10")) self.verticalLayout_10.setObjectName("verticalLayout_10")
self.cmdProduct = QtGui.QPushButton(self.groupBox_4) self.cmdProduct = QtWidgets.QPushButton(self.groupBox_4)
self.cmdProduct.setObjectName(_fromUtf8("cmdProduct")) self.cmdProduct.setObjectName("cmdProduct")
self.verticalLayout_10.addWidget(self.cmdProduct) self.verticalLayout_10.addWidget(self.cmdProduct)
self.cmdDifference = QtGui.QPushButton(self.groupBox_4) self.cmdDifference = QtWidgets.QPushButton(self.groupBox_4)
self.cmdDifference.setObjectName(_fromUtf8("cmdDifference")) self.cmdDifference.setObjectName("cmdDifference")
self.verticalLayout_10.addWidget(self.cmdDifference) self.verticalLayout_10.addWidget(self.cmdDifference)
self.cmdUnion = QtGui.QPushButton(self.groupBox_4) self.cmdUnion = QtWidgets.QPushButton(self.groupBox_4)
self.cmdUnion.setObjectName(_fromUtf8("cmdUnion")) self.cmdUnion.setObjectName("cmdUnion")
self.verticalLayout_10.addWidget(self.cmdUnion) self.verticalLayout_10.addWidget(self.cmdUnion)
self.cmdIntersection = QtGui.QPushButton(self.groupBox_4) self.cmdIntersection = QtWidgets.QPushButton(self.groupBox_4)
self.cmdIntersection.setObjectName(_fromUtf8("cmdIntersection")) self.cmdIntersection.setObjectName("cmdIntersection")
self.verticalLayout_10.addWidget(self.cmdIntersection) self.verticalLayout_10.addWidget(self.cmdIntersection)
self.cmdDivision = QtGui.QPushButton(self.groupBox_4) self.cmdDivision = QtWidgets.QPushButton(self.groupBox_4)
self.cmdDivision.setObjectName(_fromUtf8("cmdDivision")) self.cmdDivision.setObjectName("cmdDivision")
self.verticalLayout_10.addWidget(self.cmdDivision) self.verticalLayout_10.addWidget(self.cmdDivision)
self.cmdJoin = QtGui.QPushButton(self.groupBox_4) self.cmdJoin = QtWidgets.QPushButton(self.groupBox_4)
self.cmdJoin.setObjectName(_fromUtf8("cmdJoin")) self.cmdJoin.setObjectName("cmdJoin")
self.verticalLayout_10.addWidget(self.cmdJoin) self.verticalLayout_10.addWidget(self.cmdJoin)
self.cmdOuterLeft = QtGui.QPushButton(self.groupBox_4) self.cmdOuterLeft = QtWidgets.QPushButton(self.groupBox_4)
self.cmdOuterLeft.setObjectName(_fromUtf8("cmdOuterLeft")) self.cmdOuterLeft.setObjectName("cmdOuterLeft")
self.verticalLayout_10.addWidget(self.cmdOuterLeft) self.verticalLayout_10.addWidget(self.cmdOuterLeft)
self.cmdOuterRight = QtGui.QPushButton(self.groupBox_4) self.cmdOuterRight = QtWidgets.QPushButton(self.groupBox_4)
self.cmdOuterRight.setObjectName(_fromUtf8("cmdOuterRight")) self.cmdOuterRight.setObjectName("cmdOuterRight")
self.verticalLayout_10.addWidget(self.cmdOuterRight) self.verticalLayout_10.addWidget(self.cmdOuterRight)
self.cmdOuter = QtGui.QPushButton(self.groupBox_4) self.cmdOuter = QtWidgets.QPushButton(self.groupBox_4)
self.cmdOuter.setObjectName(_fromUtf8("cmdOuter")) self.cmdOuter.setObjectName("cmdOuter")
self.verticalLayout_10.addWidget(self.cmdOuter) self.verticalLayout_10.addWidget(self.cmdOuter)
self.cmdProjection = QtGui.QPushButton(self.groupBox_4) self.cmdProjection = QtWidgets.QPushButton(self.groupBox_4)
self.cmdProjection.setObjectName(_fromUtf8("cmdProjection")) self.cmdProjection.setObjectName("cmdProjection")
self.verticalLayout_10.addWidget(self.cmdProjection) self.verticalLayout_10.addWidget(self.cmdProjection)
self.cmdSelection = QtGui.QPushButton(self.groupBox_4) self.cmdSelection = QtWidgets.QPushButton(self.groupBox_4)
self.cmdSelection.setObjectName(_fromUtf8("cmdSelection")) self.cmdSelection.setObjectName("cmdSelection")
self.verticalLayout_10.addWidget(self.cmdSelection) self.verticalLayout_10.addWidget(self.cmdSelection)
self.cmdRename = QtGui.QPushButton(self.groupBox_4) self.cmdRename = QtWidgets.QPushButton(self.groupBox_4)
self.cmdRename.setObjectName(_fromUtf8("cmdRename")) self.cmdRename.setObjectName("cmdRename")
self.verticalLayout_10.addWidget(self.cmdRename) self.verticalLayout_10.addWidget(self.cmdRename)
self.cmdArrow = QtGui.QPushButton(self.groupBox_4) self.cmdArrow = QtWidgets.QPushButton(self.groupBox_4)
self.cmdArrow.setObjectName(_fromUtf8("cmdArrow")) self.cmdArrow.setObjectName("cmdArrow")
self.verticalLayout_10.addWidget(self.cmdArrow) self.verticalLayout_10.addWidget(self.cmdArrow)
spacerItem = QtGui.QSpacerItem(20, 25, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) spacerItem = QtWidgets.QSpacerItem(20, 25, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_10.addItem(spacerItem) self.verticalLayout_10.addItem(spacerItem)
self.verticalLayout_11.addWidget(self.groupBox_4) self.verticalLayout_11.addWidget(self.groupBox_4)
self.splitter_3 = QtGui.QSplitter(self.splitter_4) self.splitter_3 = QtWidgets.QSplitter(self.splitter_4)
self.splitter_3.setOrientation(QtCore.Qt.Horizontal) self.splitter_3.setOrientation(QtCore.Qt.Horizontal)
self.splitter_3.setObjectName(_fromUtf8("splitter_3")) self.splitter_3.setObjectName("splitter_3")
self.splitter_2 = QtGui.QSplitter(self.splitter_3) self.splitter_2 = QtWidgets.QSplitter(self.splitter_3)
self.splitter_2.setOrientation(QtCore.Qt.Vertical) self.splitter_2.setOrientation(QtCore.Qt.Vertical)
self.splitter_2.setObjectName(_fromUtf8("splitter_2")) self.splitter_2.setObjectName("splitter_2")
self.table = QtGui.QTreeWidget(self.splitter_2) self.table = QtWidgets.QTreeWidget(self.splitter_2)
self.table.setMinimumSize(QtCore.QSize(450, 400)) self.table.setMinimumSize(QtCore.QSize(450, 400))
self.table.setSizeIncrement(QtCore.QSize(0, 0)) self.table.setSizeIncrement(QtCore.QSize(0, 0))
self.table.setRootIsDecorated(False) self.table.setRootIsDecorated(False)
self.table.setObjectName(_fromUtf8("table")) self.table.setObjectName("table")
self.table.headerItem().setText(0, _fromUtf8("Empty relation")) self.table.headerItem().setText(0, "Empty relation")
self.layoutWidget1 = QtGui.QWidget(self.splitter_2) self.layoutWidget1 = QtWidgets.QWidget(self.splitter_2)
self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1")) self.layoutWidget1.setObjectName("layoutWidget1")
self.verticalLayout_6 = QtGui.QVBoxLayout(self.layoutWidget1) self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.layoutWidget1)
self.verticalLayout_6.setSizeConstraint(QtGui.QLayout.SetMinimumSize) self.verticalLayout_6.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
self.verticalLayout_6.setMargin(0) self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6")) self.verticalLayout_6.setObjectName("verticalLayout_6")
self.lstHistory = QtGui.QListWidget(self.layoutWidget1) self.lstHistory = QtWidgets.QListWidget(self.layoutWidget1)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lstHistory.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.lstHistory.sizePolicy().hasHeightForWidth())
@ -125,129 +111,129 @@ class Ui_MainWindow(object):
font = QtGui.QFont() font = QtGui.QFont()
font.setStrikeOut(False) font.setStrikeOut(False)
self.lstHistory.setFont(font) self.lstHistory.setFont(font)
self.lstHistory.setObjectName(_fromUtf8("lstHistory")) self.lstHistory.setObjectName("lstHistory")
self.verticalLayout_6.addWidget(self.lstHistory) self.verticalLayout_6.addWidget(self.lstHistory)
self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.cmdOptimize = QtGui.QPushButton(self.layoutWidget1) self.cmdOptimize = QtWidgets.QPushButton(self.layoutWidget1)
self.cmdOptimize.setObjectName(_fromUtf8("cmdOptimize")) self.cmdOptimize.setObjectName("cmdOptimize")
self.horizontalLayout_3.addWidget(self.cmdOptimize) self.horizontalLayout_3.addWidget(self.cmdOptimize)
self.cmdUndoOptimize = QtGui.QPushButton(self.layoutWidget1) self.cmdUndoOptimize = QtWidgets.QPushButton(self.layoutWidget1)
self.cmdUndoOptimize.setObjectName(_fromUtf8("cmdUndoOptimize")) self.cmdUndoOptimize.setObjectName("cmdUndoOptimize")
self.horizontalLayout_3.addWidget(self.cmdUndoOptimize) self.horizontalLayout_3.addWidget(self.cmdUndoOptimize)
self.cmdClearHistory = QtGui.QPushButton(self.layoutWidget1) self.cmdClearHistory = QtWidgets.QPushButton(self.layoutWidget1)
self.cmdClearHistory.setObjectName(_fromUtf8("cmdClearHistory")) self.cmdClearHistory.setObjectName("cmdClearHistory")
self.horizontalLayout_3.addWidget(self.cmdClearHistory) self.horizontalLayout_3.addWidget(self.cmdClearHistory)
self.verticalLayout_6.addLayout(self.horizontalLayout_3) self.verticalLayout_6.addLayout(self.horizontalLayout_3)
self.splitter = QtGui.QSplitter(self.splitter_3) self.splitter = QtWidgets.QSplitter(self.splitter_3)
self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName(_fromUtf8("splitter")) self.splitter.setObjectName("splitter")
self.groupBox = QtGui.QGroupBox(self.splitter) self.groupBox = QtWidgets.QGroupBox(self.splitter)
self.groupBox.setMinimumSize(QtCore.QSize(0, 0)) self.groupBox.setMinimumSize(QtCore.QSize(0, 0))
self.groupBox.setMaximumSize(QtCore.QSize(300, 16777215)) self.groupBox.setMaximumSize(QtCore.QSize(300, 16777215))
self.groupBox.setObjectName(_fromUtf8("groupBox")) self.groupBox.setObjectName("groupBox")
self.verticalLayout = QtGui.QVBoxLayout(self.groupBox) self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.verticalLayout.setObjectName("verticalLayout")
self.lstRelations = QtGui.QListWidget(self.groupBox) self.lstRelations = QtWidgets.QListWidget(self.groupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lstRelations.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.lstRelations.sizePolicy().hasHeightForWidth())
self.lstRelations.setSizePolicy(sizePolicy) self.lstRelations.setSizePolicy(sizePolicy)
self.lstRelations.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.lstRelations.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.lstRelations.setObjectName(_fromUtf8("lstRelations")) self.lstRelations.setObjectName("lstRelations")
self.verticalLayout.addWidget(self.lstRelations) self.verticalLayout.addWidget(self.lstRelations)
self.cmdNew = QtGui.QPushButton(self.groupBox) self.cmdNew = QtWidgets.QPushButton(self.groupBox)
self.cmdNew.setObjectName(_fromUtf8("cmdNew")) self.cmdNew.setObjectName("cmdNew")
self.verticalLayout.addWidget(self.cmdNew) self.verticalLayout.addWidget(self.cmdNew)
self.cmdLoad = QtGui.QPushButton(self.groupBox) self.cmdLoad = QtWidgets.QPushButton(self.groupBox)
self.cmdLoad.setObjectName(_fromUtf8("cmdLoad")) self.cmdLoad.setObjectName("cmdLoad")
self.verticalLayout.addWidget(self.cmdLoad) self.verticalLayout.addWidget(self.cmdLoad)
self.cmdSave = QtGui.QPushButton(self.groupBox) self.cmdSave = QtWidgets.QPushButton(self.groupBox)
self.cmdSave.setObjectName(_fromUtf8("cmdSave")) self.cmdSave.setObjectName("cmdSave")
self.verticalLayout.addWidget(self.cmdSave) self.verticalLayout.addWidget(self.cmdSave)
self.cmdEdit = QtGui.QPushButton(self.groupBox) self.cmdEdit = QtWidgets.QPushButton(self.groupBox)
self.cmdEdit.setObjectName(_fromUtf8("cmdEdit")) self.cmdEdit.setObjectName("cmdEdit")
self.verticalLayout.addWidget(self.cmdEdit) self.verticalLayout.addWidget(self.cmdEdit)
self.cmdUnload = QtGui.QPushButton(self.groupBox) self.cmdUnload = QtWidgets.QPushButton(self.groupBox)
self.cmdUnload.setObjectName(_fromUtf8("cmdUnload")) self.cmdUnload.setObjectName("cmdUnload")
self.verticalLayout.addWidget(self.cmdUnload) self.verticalLayout.addWidget(self.cmdUnload)
self.groupBox_2 = QtGui.QGroupBox(self.splitter) self.groupBox_2 = QtWidgets.QGroupBox(self.splitter)
self.groupBox_2.setMinimumSize(QtCore.QSize(0, 0)) self.groupBox_2.setMinimumSize(QtCore.QSize(0, 0))
self.groupBox_2.setMaximumSize(QtCore.QSize(300, 16777215)) self.groupBox_2.setMaximumSize(QtCore.QSize(300, 16777215))
self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.groupBox_2.setObjectName("groupBox_2")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.groupBox_2) self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox_2)
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.verticalLayout_3.setObjectName("verticalLayout_3")
self.lstAttributes = QtGui.QListWidget(self.groupBox_2) self.lstAttributes = QtWidgets.QListWidget(self.groupBox_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lstAttributes.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.lstAttributes.sizePolicy().hasHeightForWidth())
self.lstAttributes.setSizePolicy(sizePolicy) self.lstAttributes.setSizePolicy(sizePolicy)
self.lstAttributes.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.lstAttributes.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.lstAttributes.setObjectName(_fromUtf8("lstAttributes")) self.lstAttributes.setObjectName("lstAttributes")
self.verticalLayout_3.addWidget(self.lstAttributes) self.verticalLayout_3.addWidget(self.lstAttributes)
self.verticalLayout_7.addWidget(self.splitter_4) self.verticalLayout_7.addWidget(self.splitter_4)
self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.txtResult = QtGui.QLineEdit(self.centralwidget) self.txtResult = QtWidgets.QLineEdit(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.txtResult.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.txtResult.sizePolicy().hasHeightForWidth())
self.txtResult.setSizePolicy(sizePolicy) self.txtResult.setSizePolicy(sizePolicy)
self.txtResult.setObjectName(_fromUtf8("txtResult")) self.txtResult.setObjectName("txtResult")
self.horizontalLayout_2.addWidget(self.txtResult) self.horizontalLayout_2.addWidget(self.txtResult)
self.label = QtGui.QLabel(self.centralwidget) self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName("label")
self.horizontalLayout_2.addWidget(self.label) self.horizontalLayout_2.addWidget(self.label)
self.txtQuery = QtGui.QLineEdit(self.centralwidget) self.txtQuery = QtWidgets.QLineEdit(self.centralwidget)
self.txtQuery.setObjectName(_fromUtf8("txtQuery")) self.txtQuery.setObjectName("txtQuery")
self.horizontalLayout_2.addWidget(self.txtQuery) self.horizontalLayout_2.addWidget(self.txtQuery)
self.cmdClearQuery = QtGui.QPushButton(self.centralwidget) self.cmdClearQuery = QtWidgets.QPushButton(self.centralwidget)
self.cmdClearQuery.setObjectName(_fromUtf8("cmdClearQuery")) self.cmdClearQuery.setObjectName("cmdClearQuery")
self.horizontalLayout_2.addWidget(self.cmdClearQuery) self.horizontalLayout_2.addWidget(self.cmdClearQuery)
self.cmdExecute = QtGui.QPushButton(self.centralwidget) self.cmdExecute = QtWidgets.QPushButton(self.centralwidget)
self.cmdExecute.setObjectName(_fromUtf8("cmdExecute")) self.cmdExecute.setObjectName("cmdExecute")
self.horizontalLayout_2.addWidget(self.cmdExecute) self.horizontalLayout_2.addWidget(self.cmdExecute)
self.verticalLayout_7.addLayout(self.horizontalLayout_2) self.verticalLayout_7.addLayout(self.horizontalLayout_2)
MainWindow.setCentralWidget(self.centralwidget) MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow) self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 19)) self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 19))
self.menubar.setObjectName(_fromUtf8("menubar")) self.menubar.setObjectName("menubar")
self.menuFile = QtGui.QMenu(self.menubar) self.menuFile = QtWidgets.QMenu(self.menubar)
self.menuFile.setObjectName(_fromUtf8("menuFile")) self.menuFile.setObjectName("menuFile")
self.menuAbout = QtGui.QMenu(self.menubar) self.menuAbout = QtWidgets.QMenu(self.menubar)
self.menuAbout.setObjectName(_fromUtf8("menuAbout")) self.menuAbout.setObjectName("menuAbout")
self.action = QtGui.QAction(MainWindow) self.action = QtWidgets.QAction(MainWindow)
self.action.setObjectName(_fromUtf8("action")) self.action.setObjectName("action")
self.menuRelations = QtGui.QMenu(self.menubar) self.menuRelations = QtWidgets.QMenu(self.menubar)
self.menuRelations.setObjectName(_fromUtf8("menuRelations")) self.menuRelations.setObjectName("menuRelations")
MainWindow.setMenuBar(self.menubar) MainWindow.setMenuBar(self.menubar)
self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout = QtWidgets.QAction(MainWindow)
self.actionAbout.setMenuRole(QtGui.QAction.AboutRole) self.actionAbout.setMenuRole(QtWidgets.QAction.AboutRole)
self.actionAbout.setObjectName(_fromUtf8("actionAbout")) self.actionAbout.setObjectName("actionAbout")
self.action_Load_relation = QtGui.QAction(MainWindow) self.action_Load_relation = QtWidgets.QAction(MainWindow)
self.action_Load_relation.setObjectName(_fromUtf8("action_Load_relation")) self.action_Load_relation.setObjectName("action_Load_relation")
self.action_Save_relation = QtGui.QAction(MainWindow) self.action_Save_relation = QtWidgets.QAction(MainWindow)
self.action_Save_relation.setObjectName(_fromUtf8("action_Save_relation")) self.action_Save_relation.setObjectName("action_Save_relation")
self.action_Quit = QtGui.QAction(MainWindow) self.action_Quit = QtWidgets.QAction(MainWindow)
self.action_Quit.setMenuRole(QtGui.QAction.QuitRole) self.action_Quit.setMenuRole(QtWidgets.QAction.QuitRole)
self.action_Quit.setObjectName(_fromUtf8("action_Quit")) self.action_Quit.setObjectName("action_Quit")
self.actionCheck_for_new_versions = QtGui.QAction(MainWindow) self.actionCheck_for_new_versions = QtWidgets.QAction(MainWindow)
self.actionCheck_for_new_versions.setObjectName(_fromUtf8("actionCheck_for_new_versions")) self.actionCheck_for_new_versions.setObjectName("actionCheck_for_new_versions")
self.actionNew_relation = QtGui.QAction(MainWindow) self.actionNew_relation = QtWidgets.QAction(MainWindow)
self.actionNew_relation.setObjectName(_fromUtf8("actionNew_relation")) self.actionNew_relation.setObjectName("actionNew_relation")
self.actionEdit_relation = QtGui.QAction(MainWindow) self.actionEdit_relation = QtWidgets.QAction(MainWindow)
self.actionEdit_relation.setObjectName(_fromUtf8("actionEdit_relation")) self.actionEdit_relation.setObjectName("actionEdit_relation")
self.actionNew_session = QtGui.QAction(MainWindow) self.actionNew_session = QtWidgets.QAction(MainWindow)
self.actionNew_session.setObjectName(_fromUtf8("actionNew_session")) self.actionNew_session.setObjectName("actionNew_session")
self.actionSave_session_as = QtGui.QAction(MainWindow) self.actionSave_session_as = QtWidgets.QAction(MainWindow)
self.actionSave_session_as.setObjectName(_fromUtf8("actionSave_session_as")) self.actionSave_session_as.setObjectName("actionSave_session_as")
self.actionManage_sessions = QtGui.QAction(MainWindow) self.actionManage_sessions = QtWidgets.QAction(MainWindow)
self.actionManage_sessions.setObjectName(_fromUtf8("actionManage_sessions")) self.actionManage_sessions.setObjectName("actionManage_sessions")
self.actionUnload_relation = QtGui.QAction(MainWindow) self.actionUnload_relation = QtWidgets.QAction(MainWindow)
self.actionUnload_relation.setObjectName(_fromUtf8("actionUnload_relation")) self.actionUnload_relation.setObjectName("actionUnload_relation")
self.menuFile.addSeparator() self.menuFile.addSeparator()
self.menuFile.addAction(self.action_Quit) self.menuFile.addAction(self.action_Quit)
self.menuAbout.addAction(self.actionAbout) self.menuAbout.addAction(self.actionAbout)
@ -263,45 +249,45 @@ class Ui_MainWindow(object):
self.label.setBuddy(self.txtQuery) self.label.setBuddy(self.txtQuery)
self.retranslateUi(MainWindow) self.retranslateUi(MainWindow)
QtCore.QObject.connect(self.cmdClearQuery, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtQuery.clear) self.cmdClearQuery.clicked.connect(self.txtQuery.clear)
QtCore.QObject.connect(self.cmdClearHistory, QtCore.SIGNAL(_fromUtf8("clicked()")), self.lstHistory.clear) self.cmdClearHistory.clicked.connect(self.lstHistory.clear)
QtCore.QObject.connect(self.txtQuery, QtCore.SIGNAL(_fromUtf8("returnPressed()")), MainWindow.execute) self.txtQuery.returnPressed.connect(MainWindow.execute)
QtCore.QObject.connect(self.cmdExecute, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.execute) self.cmdExecute.clicked.connect(MainWindow.execute)
QtCore.QObject.connect(self.cmdAbout, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.showAbout) self.cmdAbout.clicked.connect(MainWindow.showAbout)
QtCore.QObject.connect(self.cmdSurvey, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.showSurvey) self.cmdSurvey.clicked.connect(MainWindow.showSurvey)
QtCore.QObject.connect(self.cmdProduct, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addProduct) self.cmdProduct.clicked.connect(MainWindow.addProduct)
QtCore.QObject.connect(self.cmdDifference, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addDifference) self.cmdDifference.clicked.connect(MainWindow.addDifference)
QtCore.QObject.connect(self.cmdArrow, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addArrow) self.cmdArrow.clicked.connect(MainWindow.addArrow)
QtCore.QObject.connect(self.cmdRename, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addRename) self.cmdRename.clicked.connect(MainWindow.addRename)
QtCore.QObject.connect(self.cmdSelection, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addSelection) self.cmdSelection.clicked.connect(MainWindow.addSelection)
QtCore.QObject.connect(self.cmdProjection, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addProjection) self.cmdProjection.clicked.connect(MainWindow.addProjection)
QtCore.QObject.connect(self.cmdUnload, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.unloadRelation) self.cmdUnload.clicked.connect(MainWindow.unloadRelation)
QtCore.QObject.connect(self.cmdSave, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.saveRelation) self.cmdSave.clicked.connect(MainWindow.saveRelation)
QtCore.QObject.connect(self.cmdLoad, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.loadRelation) self.cmdLoad.clicked.connect(MainWindow.loadRelation)
QtCore.QObject.connect(self.cmdOptimize, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.optimize) self.cmdOptimize.clicked.connect(MainWindow.optimize)
QtCore.QObject.connect(self.cmdUndoOptimize, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.undoOptimize) self.cmdUndoOptimize.clicked.connect(MainWindow.undoOptimize)
QtCore.QObject.connect(self.txtResult, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtQuery.setFocus) self.txtResult.returnPressed.connect(self.txtQuery.setFocus)
QtCore.QObject.connect(self.cmdOuterRight, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addORight) self.cmdOuterRight.clicked.connect(MainWindow.addORight)
QtCore.QObject.connect(self.cmdOuter, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addOuter) self.cmdOuter.clicked.connect(MainWindow.addOuter)
QtCore.QObject.connect(self.cmdOuterLeft, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addOLeft) self.cmdOuterLeft.clicked.connect(MainWindow.addOLeft)
QtCore.QObject.connect(self.cmdJoin, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addJoin) self.cmdJoin.clicked.connect(MainWindow.addJoin)
QtCore.QObject.connect(self.cmdDivision, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addDivision) self.cmdDivision.clicked.connect(MainWindow.addDivision)
QtCore.QObject.connect(self.cmdIntersection, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addIntersection) self.cmdIntersection.clicked.connect(MainWindow.addIntersection)
QtCore.QObject.connect(self.cmdUnion, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.addUnion) self.cmdUnion.clicked.connect(MainWindow.addUnion)
QtCore.QObject.connect(self.lstRelations, QtCore.SIGNAL(_fromUtf8("itemDoubleClicked(QListWidgetItem*)")), MainWindow.printRelation) self.lstRelations.itemDoubleClicked['QListWidgetItem*'].connect(MainWindow.printRelation)
QtCore.QObject.connect(self.lstRelations, QtCore.SIGNAL(_fromUtf8("itemClicked(QListWidgetItem*)")), MainWindow.showAttributes) self.lstRelations.itemClicked['QListWidgetItem*'].connect(MainWindow.showAttributes)
QtCore.QObject.connect(self.cmdClearQuery, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtQuery.setFocus) self.cmdClearQuery.clicked.connect(self.txtQuery.setFocus)
QtCore.QObject.connect(self.lstHistory, QtCore.SIGNAL(_fromUtf8("itemDoubleClicked(QListWidgetItem*)")), MainWindow.resumeHistory) self.lstHistory.itemDoubleClicked['QListWidgetItem*'].connect(MainWindow.resumeHistory)
QtCore.QObject.connect(self.actionAbout, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.showAbout) self.actionAbout.triggered.connect(MainWindow.showAbout)
QtCore.QObject.connect(self.action_Load_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.loadRelation) self.action_Load_relation.triggered.connect(MainWindow.loadRelation)
QtCore.QObject.connect(self.action_Save_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.saveRelation) self.action_Save_relation.triggered.connect(MainWindow.saveRelation)
QtCore.QObject.connect(self.action_Quit, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.close) self.action_Quit.triggered.connect(MainWindow.close)
QtCore.QObject.connect(self.actionCheck_for_new_versions, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.checkVersion) self.actionCheck_for_new_versions.triggered.connect(MainWindow.checkVersion)
QtCore.QObject.connect(self.cmdEdit, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.editRelation) self.cmdEdit.clicked.connect(MainWindow.editRelation)
QtCore.QObject.connect(self.actionEdit_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.editRelation) self.actionEdit_relation.triggered.connect(MainWindow.editRelation)
QtCore.QObject.connect(self.cmdNew, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.newRelation) self.cmdNew.clicked.connect(MainWindow.newRelation)
QtCore.QObject.connect(self.actionNew_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.newRelation) self.actionNew_relation.triggered.connect(MainWindow.newRelation)
QtCore.QObject.connect(self.actionUnload_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.unloadRelation) self.actionUnload_relation.triggered.connect(MainWindow.unloadRelation)
QtCore.QMetaObject.connectSlotsByName(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.cmdAbout, self.cmdSurvey) MainWindow.setTabOrder(self.cmdAbout, self.cmdSurvey)
MainWindow.setTabOrder(self.cmdSurvey, self.cmdProduct) MainWindow.setTabOrder(self.cmdSurvey, self.cmdProduct)
@ -333,69 +319,70 @@ class Ui_MainWindow(object):
MainWindow.setTabOrder(self.cmdClearQuery, self.cmdExecute) MainWindow.setTabOrder(self.cmdClearQuery, self.cmdExecute)
def retranslateUi(self, MainWindow): def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "Relational", None)) _translate = QtCore.QCoreApplication.translate
self.groupBox_3.setTitle(_translate("MainWindow", "Menu", None)) MainWindow.setWindowTitle(_translate("MainWindow", "Relational"))
self.cmdAbout.setText(_translate("MainWindow", "About", None)) self.groupBox_3.setTitle(_translate("MainWindow", "Menu"))
self.cmdSurvey.setText(_translate("MainWindow", "Survey", None)) self.cmdAbout.setText(_translate("MainWindow", "About"))
self.groupBox_4.setTitle(_translate("MainWindow", "Operators", None)) self.cmdSurvey.setText(_translate("MainWindow", "Survey"))
self.cmdProduct.setToolTip(_translate("MainWindow", "Product", None)) self.groupBox_4.setTitle(_translate("MainWindow", "Operators"))
self.cmdProduct.setText(_translate("MainWindow", "*", None)) self.cmdProduct.setToolTip(_translate("MainWindow", "Product"))
self.cmdDifference.setToolTip(_translate("MainWindow", "Difference", None)) self.cmdProduct.setText(_translate("MainWindow", "*"))
self.cmdDifference.setText(_translate("MainWindow", "-", None)) self.cmdDifference.setToolTip(_translate("MainWindow", "Difference"))
self.cmdUnion.setToolTip(_translate("MainWindow", "Union", None)) self.cmdDifference.setText(_translate("MainWindow", "-"))
self.cmdUnion.setText(_translate("MainWindow", "", None)) self.cmdUnion.setToolTip(_translate("MainWindow", "Union"))
self.cmdIntersection.setToolTip(_translate("MainWindow", "Intersection", None)) self.cmdUnion.setText(_translate("MainWindow", ""))
self.cmdIntersection.setText(_translate("MainWindow", "", None)) self.cmdIntersection.setToolTip(_translate("MainWindow", "Intersection"))
self.cmdDivision.setToolTip(_translate("MainWindow", "Division", None)) self.cmdIntersection.setText(_translate("MainWindow", ""))
self.cmdDivision.setText(_translate("MainWindow", "÷", None)) self.cmdDivision.setToolTip(_translate("MainWindow", "Division"))
self.cmdJoin.setToolTip(_translate("MainWindow", "Natural join", None)) self.cmdDivision.setText(_translate("MainWindow", "÷"))
self.cmdJoin.setText(_translate("MainWindow", "ᐅᐊ", None)) self.cmdJoin.setToolTip(_translate("MainWindow", "Natural join"))
self.cmdOuterLeft.setToolTip(_translate("MainWindow", "Left outer join", None)) self.cmdJoin.setText(_translate("MainWindow", "ᐅᐊ"))
self.cmdOuterLeft.setText(_translate("MainWindow", "ᐅLEFTᐊ", None)) self.cmdOuterLeft.setToolTip(_translate("MainWindow", "Left outer join"))
self.cmdOuterRight.setToolTip(_translate("MainWindow", "Right outer join", None)) self.cmdOuterLeft.setText(_translate("MainWindow", "ᐅLEFTᐊ"))
self.cmdOuterRight.setText(_translate("MainWindow", "ᐅRIGHTᐊ", None)) self.cmdOuterRight.setToolTip(_translate("MainWindow", "Right outer join"))
self.cmdOuter.setToolTip(_translate("MainWindow", "Full outer join", None)) self.cmdOuterRight.setText(_translate("MainWindow", "ᐅRIGHTᐊ"))
self.cmdOuter.setText(_translate("MainWindow", "ᐅFULLᐊ", None)) self.cmdOuter.setToolTip(_translate("MainWindow", "Full outer join"))
self.cmdProjection.setToolTip(_translate("MainWindow", "Projection", None)) self.cmdOuter.setText(_translate("MainWindow", "ᐅFULLᐊ"))
self.cmdProjection.setText(_translate("MainWindow", "π", None)) self.cmdProjection.setToolTip(_translate("MainWindow", "Projection"))
self.cmdSelection.setToolTip(_translate("MainWindow", "Selection", None)) self.cmdProjection.setText(_translate("MainWindow", "π"))
self.cmdSelection.setText(_translate("MainWindow", "σ", None)) self.cmdSelection.setToolTip(_translate("MainWindow", "Selection"))
self.cmdRename.setToolTip(_translate("MainWindow", "Rename", None)) self.cmdSelection.setText(_translate("MainWindow", "σ"))
self.cmdRename.setText(_translate("MainWindow", "ρ", None)) self.cmdRename.setToolTip(_translate("MainWindow", "Rename"))
self.cmdArrow.setText(_translate("MainWindow", "", None)) self.cmdRename.setText(_translate("MainWindow", "ρ"))
self.cmdOptimize.setText(_translate("MainWindow", "Optimize", None)) self.cmdArrow.setText(_translate("MainWindow", ""))
self.cmdUndoOptimize.setText(_translate("MainWindow", "Undo optimize", None)) self.cmdOptimize.setText(_translate("MainWindow", "Optimize"))
self.cmdClearHistory.setText(_translate("MainWindow", "Clear history", None)) self.cmdUndoOptimize.setText(_translate("MainWindow", "Undo optimize"))
self.groupBox.setTitle(_translate("MainWindow", "Relations", None)) self.cmdClearHistory.setText(_translate("MainWindow", "Clear history"))
self.groupBox.setTitle(_translate("MainWindow", "Relations"))
self.lstRelations.setSortingEnabled(True) self.lstRelations.setSortingEnabled(True)
self.cmdNew.setText(_translate("MainWindow", "New relation", None)) self.cmdNew.setText(_translate("MainWindow", "New relation"))
self.cmdLoad.setText(_translate("MainWindow", "Load relation", None)) self.cmdLoad.setText(_translate("MainWindow", "Load relation"))
self.cmdSave.setText(_translate("MainWindow", "Save relation", None)) self.cmdSave.setText(_translate("MainWindow", "Save relation"))
self.cmdEdit.setText(_translate("MainWindow", "Edit relation", None)) self.cmdEdit.setText(_translate("MainWindow", "Edit relation"))
self.cmdUnload.setText(_translate("MainWindow", "Unload relation", None)) self.cmdUnload.setText(_translate("MainWindow", "Unload relation"))
self.groupBox_2.setTitle(_translate("MainWindow", "Attributes", None)) self.groupBox_2.setTitle(_translate("MainWindow", "Attributes"))
self.txtResult.setText(_translate("MainWindow", "_last1", None)) self.txtResult.setText(_translate("MainWindow", "_last1"))
self.label.setText(_translate("MainWindow", "=", None)) self.label.setText(_translate("MainWindow", "="))
self.cmdClearQuery.setText(_translate("MainWindow", "", None)) self.cmdClearQuery.setText(_translate("MainWindow", ""))
self.cmdExecute.setText(_translate("MainWindow", "Execute", None)) self.cmdExecute.setText(_translate("MainWindow", "Execute"))
self.menuFile.setTitle(_translate("MainWindow", "&File", None)) self.menuFile.setTitle(_translate("MainWindow", "&File"))
self.menuAbout.setTitle(_translate("MainWindow", "&Help", None)) self.menuAbout.setTitle(_translate("MainWindow", "&Help"))
self.menuRelations.setTitle(_translate("MainWindow", "Relations", None)) self.menuRelations.setTitle(_translate("MainWindow", "Relations"))
self.actionAbout.setText(_translate("MainWindow", "&About", None)) self.actionAbout.setText(_translate("MainWindow", "&About"))
self.action_Load_relation.setText(_translate("MainWindow", "&Load relation", None)) self.action_Load_relation.setText(_translate("MainWindow", "&Load relation"))
self.action_Load_relation.setShortcut(_translate("MainWindow", "Ctrl+O", None)) self.action_Load_relation.setShortcut(_translate("MainWindow", "Ctrl+O"))
self.action_Save_relation.setText(_translate("MainWindow", "&Save relation", None)) self.action_Save_relation.setText(_translate("MainWindow", "&Save relation"))
self.action_Save_relation.setShortcut(_translate("MainWindow", "Ctrl+S", None)) self.action_Save_relation.setShortcut(_translate("MainWindow", "Ctrl+S"))
self.action_Quit.setText(_translate("MainWindow", "&Quit", None)) self.action_Quit.setText(_translate("MainWindow", "&Quit"))
self.action_Quit.setShortcut(_translate("MainWindow", "Ctrl+Q", None)) self.action_Quit.setShortcut(_translate("MainWindow", "Ctrl+Q"))
self.actionCheck_for_new_versions.setText(_translate("MainWindow", "Check for new versions", None)) self.actionCheck_for_new_versions.setText(_translate("MainWindow", "Check for new versions"))
self.actionNew_relation.setText(_translate("MainWindow", "New relation", None)) self.actionNew_relation.setText(_translate("MainWindow", "New relation"))
self.actionNew_relation.setShortcut(_translate("MainWindow", "Ctrl+N", None)) self.actionNew_relation.setShortcut(_translate("MainWindow", "Ctrl+N"))
self.actionEdit_relation.setText(_translate("MainWindow", "Edit relation", None)) self.actionEdit_relation.setText(_translate("MainWindow", "Edit relation"))
self.actionEdit_relation.setShortcut(_translate("MainWindow", "Ctrl+E", None)) self.actionEdit_relation.setShortcut(_translate("MainWindow", "Ctrl+E"))
self.actionNew_session.setText(_translate("MainWindow", "New session", None)) self.actionNew_session.setText(_translate("MainWindow", "New session"))
self.actionSave_session_as.setText(_translate("MainWindow", "Save session as", None)) self.actionSave_session_as.setText(_translate("MainWindow", "Save session as"))
self.actionSave_session_as.setToolTip(_translate("MainWindow", "Save session as", None)) self.actionSave_session_as.setToolTip(_translate("MainWindow", "Save session as"))
self.actionManage_sessions.setText(_translate("MainWindow", "Manage sessions", None)) self.actionManage_sessions.setText(_translate("MainWindow", "Manage sessions"))
self.actionUnload_relation.setText(_translate("MainWindow", "Unload relation", None)) self.actionUnload_relation.setText(_translate("MainWindow", "Unload relation"))

View File

@ -2,82 +2,69 @@
# Form implementation generated from reading ui file 'relational_gui/rel_edit.ui' # Form implementation generated from reading ui file 'relational_gui/rel_edit.ui'
# #
# Created: Fri Dec 27 00:23:51 2013 # Created: Thu Feb 19 13:07:47 2015
# by: PyQt4 UI code generator 4.10.3 # by: PyQt5 UI code generator 5.3.2
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui from PyQt5 import QtCore, QtGui, QtWidgets
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_Dialog(object): class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.setObjectName("Dialog")
Dialog.resize(594, 444) Dialog.resize(594, 444)
self.verticalLayout_2 = QtGui.QVBoxLayout(Dialog) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.horizontalLayout.setObjectName("horizontalLayout")
self.groupBox = QtGui.QGroupBox(Dialog) self.groupBox = QtWidgets.QGroupBox(Dialog)
self.groupBox.setObjectName(_fromUtf8("groupBox")) self.groupBox.setObjectName("groupBox")
self.verticalLayout = QtGui.QVBoxLayout(self.groupBox) self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.verticalLayout.setObjectName("verticalLayout")
self.cmdAddTuple = QtGui.QPushButton(self.groupBox) self.cmdAddTuple = QtWidgets.QPushButton(self.groupBox)
self.cmdAddTuple.setObjectName(_fromUtf8("cmdAddTuple")) self.cmdAddTuple.setObjectName("cmdAddTuple")
self.verticalLayout.addWidget(self.cmdAddTuple) self.verticalLayout.addWidget(self.cmdAddTuple)
self.cmdRemoveTuple = QtGui.QPushButton(self.groupBox) self.cmdRemoveTuple = QtWidgets.QPushButton(self.groupBox)
self.cmdRemoveTuple.setObjectName(_fromUtf8("cmdRemoveTuple")) self.cmdRemoveTuple.setObjectName("cmdRemoveTuple")
self.verticalLayout.addWidget(self.cmdRemoveTuple) self.verticalLayout.addWidget(self.cmdRemoveTuple)
self.cmdAddColumn = QtGui.QPushButton(self.groupBox) self.cmdAddColumn = QtWidgets.QPushButton(self.groupBox)
self.cmdAddColumn.setObjectName(_fromUtf8("cmdAddColumn")) self.cmdAddColumn.setObjectName("cmdAddColumn")
self.verticalLayout.addWidget(self.cmdAddColumn) self.verticalLayout.addWidget(self.cmdAddColumn)
self.cmdRemoveColumn = QtGui.QPushButton(self.groupBox) self.cmdRemoveColumn = QtWidgets.QPushButton(self.groupBox)
self.cmdRemoveColumn.setObjectName(_fromUtf8("cmdRemoveColumn")) self.cmdRemoveColumn.setObjectName("cmdRemoveColumn")
self.verticalLayout.addWidget(self.cmdRemoveColumn) self.verticalLayout.addWidget(self.cmdRemoveColumn)
self.horizontalLayout.addWidget(self.groupBox) self.horizontalLayout.addWidget(self.groupBox)
self.table = QtGui.QTableWidget(Dialog) self.table = QtWidgets.QTableWidget(Dialog)
self.table.setObjectName(_fromUtf8("table")) self.table.setObjectName("table")
self.table.setColumnCount(0) self.table.setColumnCount(0)
self.table.setRowCount(0) self.table.setRowCount(0)
self.horizontalLayout.addWidget(self.table) self.horizontalLayout.addWidget(self.table)
self.verticalLayout_2.addLayout(self.horizontalLayout) self.verticalLayout_2.addLayout(self.horizontalLayout)
self.label = QtGui.QLabel(Dialog) self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName("label")
self.verticalLayout_2.addWidget(self.label) self.verticalLayout_2.addWidget(self.label)
self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_2.addWidget(self.buttonBox) self.verticalLayout_2.addWidget(self.buttonBox)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) self.buttonBox.accepted.connect(Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) self.buttonBox.rejected.connect(Dialog.reject)
QtCore.QObject.connect(self.cmdAddColumn, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.addColumn) self.cmdAddColumn.clicked.connect(Dialog.addColumn)
QtCore.QObject.connect(self.cmdRemoveColumn, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.deleteColumn) self.cmdRemoveColumn.clicked.connect(Dialog.deleteColumn)
QtCore.QObject.connect(self.cmdAddTuple, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.addRow) self.cmdAddTuple.clicked.connect(Dialog.addRow)
QtCore.QObject.connect(self.cmdRemoveTuple, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.deleteRow) self.cmdRemoveTuple.clicked.connect(Dialog.deleteRow)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog): def retranslateUi(self, Dialog):
Dialog.setWindowTitle(_translate("Dialog", "Relation editor", None)) _translate = QtCore.QCoreApplication.translate
self.groupBox.setTitle(_translate("Dialog", "Edit", None)) Dialog.setWindowTitle(_translate("Dialog", "Relation editor"))
self.cmdAddTuple.setText(_translate("Dialog", "Add tuple", None)) self.groupBox.setTitle(_translate("Dialog", "Edit"))
self.cmdRemoveTuple.setText(_translate("Dialog", "Remove tuple", None)) self.cmdAddTuple.setText(_translate("Dialog", "Add tuple"))
self.cmdAddColumn.setText(_translate("Dialog", "Add column", None)) self.cmdRemoveTuple.setText(_translate("Dialog", "Remove tuple"))
self.cmdRemoveColumn.setText(_translate("Dialog", "Remove column", None)) self.cmdAddColumn.setText(_translate("Dialog", "Add column"))
self.label.setText(_translate("Dialog", "Remember that new relations and modified relations are not automatically saved", None)) self.cmdRemoveColumn.setText(_translate("Dialog", "Remove column"))
self.label.setText(_translate("Dialog", "Remember that new relations and modified relations are not automatically saved"))

View File

@ -2,98 +2,84 @@
# Form implementation generated from reading ui file 'relational_gui/survey.ui' # Form implementation generated from reading ui file 'relational_gui/survey.ui'
# #
# Created: Fri Dec 27 00:23:51 2013 # Created: Thu Feb 19 13:07:47 2015
# by: PyQt4 UI code generator 4.10.3 # by: PyQt5 UI code generator 5.3.2
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui from PyQt5 import QtCore, QtGui, QtWidgets
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object): class Ui_Form(object):
def setupUi(self, Form): def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form")) Form.setObjectName("Form")
Form.resize(422, 313) Form.resize(422, 313)
Form.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) Form.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtGui.QGridLayout() self.formLayout = QtWidgets.QGridLayout()
self.formLayout.setObjectName(_fromUtf8("formLayout")) self.formLayout.setObjectName("formLayout")
self.txtSystem = QtGui.QLineEdit(Form) self.txtSystem = QtWidgets.QLineEdit(Form)
self.txtSystem.setObjectName(_fromUtf8("txtSystem")) self.txtSystem.setObjectName("txtSystem")
self.formLayout.addWidget(self.txtSystem, 0, 1, 1, 1) self.formLayout.addWidget(self.txtSystem, 0, 1, 1, 1)
self.label = QtGui.QLabel(Form) self.label = QtWidgets.QLabel(Form)
self.label.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.label.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName("label")
self.formLayout.addWidget(self.label, 1, 0, 1, 1) self.formLayout.addWidget(self.label, 1, 0, 1, 1)
self.txtCountry = QtGui.QLineEdit(Form) self.txtCountry = QtWidgets.QLineEdit(Form)
self.txtCountry.setObjectName(_fromUtf8("txtCountry")) self.txtCountry.setObjectName("txtCountry")
self.formLayout.addWidget(self.txtCountry, 1, 1, 1, 1) self.formLayout.addWidget(self.txtCountry, 1, 1, 1, 1)
self.label_2 = QtGui.QLabel(Form) self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.label_2.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName("label_2")
self.formLayout.addWidget(self.label_2, 2, 0, 1, 1) self.formLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.txtSchool = QtGui.QLineEdit(Form) self.txtSchool = QtWidgets.QLineEdit(Form)
self.txtSchool.setObjectName(_fromUtf8("txtSchool")) self.txtSchool.setObjectName("txtSchool")
self.formLayout.addWidget(self.txtSchool, 2, 1, 1, 1) self.formLayout.addWidget(self.txtSchool, 2, 1, 1, 1)
self.label_3 = QtGui.QLabel(Form) self.label_3 = QtWidgets.QLabel(Form)
self.label_3.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.label_3.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.label_3.setObjectName(_fromUtf8("label_3")) self.label_3.setObjectName("label_3")
self.formLayout.addWidget(self.label_3, 3, 0, 1, 1) self.formLayout.addWidget(self.label_3, 3, 0, 1, 1)
self.txtAge = QtGui.QLineEdit(Form) self.txtAge = QtWidgets.QLineEdit(Form)
self.txtAge.setObjectName(_fromUtf8("txtAge")) self.txtAge.setObjectName("txtAge")
self.formLayout.addWidget(self.txtAge, 3, 1, 1, 1) self.formLayout.addWidget(self.txtAge, 3, 1, 1, 1)
self.label_4 = QtGui.QLabel(Form) self.label_4 = QtWidgets.QLabel(Form)
self.label_4.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.label_4.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.label_4.setObjectName(_fromUtf8("label_4")) self.label_4.setObjectName("label_4")
self.formLayout.addWidget(self.label_4, 4, 0, 1, 1) self.formLayout.addWidget(self.label_4, 4, 0, 1, 1)
self.txtFind = QtGui.QLineEdit(Form) self.txtFind = QtWidgets.QLineEdit(Form)
self.txtFind.setObjectName(_fromUtf8("txtFind")) self.txtFind.setObjectName("txtFind")
self.formLayout.addWidget(self.txtFind, 4, 1, 1, 1) self.formLayout.addWidget(self.txtFind, 4, 1, 1, 1)
self.label_5 = QtGui.QLabel(Form) self.label_5 = QtWidgets.QLabel(Form)
self.label_5.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.label_5.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.label_5.setObjectName(_fromUtf8("label_5")) self.label_5.setObjectName("label_5")
self.formLayout.addWidget(self.label_5, 0, 0, 1, 1) self.formLayout.addWidget(self.label_5, 0, 0, 1, 1)
self.label_6 = QtGui.QLabel(Form) self.label_6 = QtWidgets.QLabel(Form)
self.label_6.setObjectName(_fromUtf8("label_6")) self.label_6.setObjectName("label_6")
self.formLayout.addWidget(self.label_6, 6, 0, 1, 1) self.formLayout.addWidget(self.label_6, 6, 0, 1, 1)
self.txtComments = QtGui.QTextEdit(Form) self.txtComments = QtWidgets.QTextEdit(Form)
self.txtComments.setTabChangesFocus(True) self.txtComments.setTabChangesFocus(True)
self.txtComments.setObjectName(_fromUtf8("txtComments")) self.txtComments.setObjectName("txtComments")
self.formLayout.addWidget(self.txtComments, 6, 1, 1, 1) self.formLayout.addWidget(self.txtComments, 6, 1, 1, 1)
self.label_7 = QtGui.QLabel(Form) self.label_7 = QtWidgets.QLabel(Form)
self.label_7.setObjectName(_fromUtf8("label_7")) self.label_7.setObjectName("label_7")
self.formLayout.addWidget(self.label_7, 5, 0, 1, 1) self.formLayout.addWidget(self.label_7, 5, 0, 1, 1)
self.txtEmail = QtGui.QLineEdit(Form) self.txtEmail = QtWidgets.QLineEdit(Form)
self.txtEmail.setObjectName(_fromUtf8("txtEmail")) self.txtEmail.setObjectName("txtEmail")
self.formLayout.addWidget(self.txtEmail, 5, 1, 1, 1) self.formLayout.addWidget(self.txtEmail, 5, 1, 1, 1)
self.verticalLayout.addLayout(self.formLayout) self.verticalLayout.addLayout(self.formLayout)
self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem) self.horizontalLayout.addItem(spacerItem)
self.cmdCancel = QtGui.QPushButton(Form) self.cmdCancel = QtWidgets.QPushButton(Form)
self.cmdCancel.setObjectName(_fromUtf8("cmdCancel")) self.cmdCancel.setObjectName("cmdCancel")
self.horizontalLayout.addWidget(self.cmdCancel) self.horizontalLayout.addWidget(self.cmdCancel)
self.cmdClear = QtGui.QPushButton(Form) self.cmdClear = QtWidgets.QPushButton(Form)
self.cmdClear.setObjectName(_fromUtf8("cmdClear")) self.cmdClear.setObjectName("cmdClear")
self.horizontalLayout.addWidget(self.cmdClear) self.horizontalLayout.addWidget(self.cmdClear)
self.cmdSend = QtGui.QPushButton(Form) self.cmdSend = QtWidgets.QPushButton(Form)
self.cmdSend.setDefault(True) self.cmdSend.setDefault(True)
self.cmdSend.setObjectName(_fromUtf8("cmdSend")) self.cmdSend.setObjectName("cmdSend")
self.horizontalLayout.addWidget(self.cmdSend) self.horizontalLayout.addWidget(self.cmdSend)
self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.addLayout(self.horizontalLayout)
self.label.setBuddy(self.txtCountry) self.label.setBuddy(self.txtCountry)
@ -105,21 +91,21 @@ class Ui_Form(object):
self.label_7.setBuddy(self.txtEmail) self.label_7.setBuddy(self.txtEmail)
self.retranslateUi(Form) self.retranslateUi(Form)
QtCore.QObject.connect(self.cmdCancel, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.close) self.cmdCancel.clicked.connect(Form.close)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtComments.clear) self.cmdClear.clicked.connect(self.txtComments.clear)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtFind.clear) self.cmdClear.clicked.connect(self.txtFind.clear)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtAge.clear) self.cmdClear.clicked.connect(self.txtAge.clear)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtSchool.clear) self.cmdClear.clicked.connect(self.txtSchool.clear)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtCountry.clear) self.cmdClear.clicked.connect(self.txtCountry.clear)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtSystem.clear) self.cmdClear.clicked.connect(self.txtSystem.clear)
QtCore.QObject.connect(self.txtSystem, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtCountry.setFocus) self.txtSystem.returnPressed.connect(self.txtCountry.setFocus)
QtCore.QObject.connect(self.txtCountry, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtSchool.setFocus) self.txtCountry.returnPressed.connect(self.txtSchool.setFocus)
QtCore.QObject.connect(self.txtSchool, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtAge.setFocus) self.txtSchool.returnPressed.connect(self.txtAge.setFocus)
QtCore.QObject.connect(self.txtAge, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtFind.setFocus) self.txtAge.returnPressed.connect(self.txtFind.setFocus)
QtCore.QObject.connect(self.cmdSend, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.send) self.cmdSend.clicked.connect(Form.send)
QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtEmail.clear) self.cmdClear.clicked.connect(self.txtEmail.clear)
QtCore.QObject.connect(self.txtFind, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtEmail.setFocus) self.txtFind.returnPressed.connect(self.txtEmail.setFocus)
QtCore.QObject.connect(self.txtEmail, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtComments.setFocus) self.txtEmail.returnPressed.connect(self.txtComments.setFocus)
QtCore.QMetaObject.connectSlotsByName(Form) QtCore.QMetaObject.connectSlotsByName(Form)
Form.setTabOrder(self.txtSystem, self.txtCountry) Form.setTabOrder(self.txtSystem, self.txtCountry)
Form.setTabOrder(self.txtCountry, self.txtSchool) Form.setTabOrder(self.txtCountry, self.txtSchool)
@ -132,15 +118,16 @@ class Ui_Form(object):
Form.setTabOrder(self.cmdClear, self.cmdCancel) Form.setTabOrder(self.cmdClear, self.cmdCancel)
def retranslateUi(self, Form): def retranslateUi(self, Form):
Form.setWindowTitle(_translate("Form", "Survey", None)) _translate = QtCore.QCoreApplication.translate
self.label.setText(_translate("Form", "Country", None)) Form.setWindowTitle(_translate("Form", "Survey"))
self.label_2.setText(_translate("Form", "School", None)) self.label.setText(_translate("Form", "Country"))
self.label_3.setText(_translate("Form", "Age", None)) self.label_2.setText(_translate("Form", "School"))
self.label_4.setText(_translate("Form", "How did you find relational", None)) self.label_3.setText(_translate("Form", "Age"))
self.label_5.setText(_translate("Form", "System", None)) self.label_4.setText(_translate("Form", "How did you find relational"))
self.label_6.setText(_translate("Form", "Comments", None)) self.label_5.setText(_translate("Form", "System"))
self.label_7.setText(_translate("Form", "Email (only if you want a reply)", None)) self.label_6.setText(_translate("Form", "Comments"))
self.cmdCancel.setText(_translate("Form", "Cancel", None)) self.label_7.setText(_translate("Form", "Email (only if you want a reply)"))
self.cmdClear.setText(_translate("Form", "Clear", None)) self.cmdCancel.setText(_translate("Form", "Cancel"))
self.cmdSend.setText(_translate("Form", "Send", None)) self.cmdClear.setText(_translate("Form", "Clear"))
self.cmdSend.setText(_translate("Form", "Send"))

View File

@ -17,15 +17,17 @@
# #
# author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it> # author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
from PyQt4 import QtCore, QtGui
import compatibility
from relational import maintenance
import platform import platform
import locale import locale
from PyQt5 import QtCore, QtGui, QtWidgets
class surveyForm (QtGui.QWidget): from relational_gui import compatibility
from relational import maintenance
class surveyForm (QtWidgets.QWidget):
'''This class is the form used for the survey, needed to intercept the events. '''This class is the form used for the survey, needed to intercept the events.
It also sends the data with http POST to a page''' It also sends the data with http POST to a page'''
@ -85,10 +87,10 @@ class surveyForm (QtGui.QWidget):
response = maintenance.send_survey(post) response = maintenance.send_survey(post)
if response.status != 200: if response.status != 200:
QtGui.QMessageBox.information(None, QtGui.QApplication.translate( QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
"Form", "Error"), QtGui.QApplication.translate("Form", "Unable to send the data!")) "Form", "Error"), QtWidgets.QApplication.translate("Form", "Unable to send the data!"))
else: else:
QtGui.QMessageBox.information(None, QtGui.QApplication.translate( QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
"Form", "Thanks"), QtGui.QApplication.translate("Form", "Thanks for sending!")) "Form", "Thanks"), QtWidgets.QApplication.translate("Form", "Thanks for sending!"))
self.hide() self.hide()