implemented inserting of tuples in GUI
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@83 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
parent
f956757956
commit
479cad96dc
20
maingui.py
20
maingui.py
@ -145,7 +145,23 @@ class Ui_Form(object):
|
|||||||
self.relations[str(res[0].toUtf8())]=relation.relation(filename,use_csv)
|
self.relations[str(res[0].toUtf8())]=relation.relation(filename,use_csv)
|
||||||
self.updateRelations()
|
self.updateRelations()
|
||||||
def insertTuple(self):
|
def insertTuple(self):
|
||||||
pass
|
'''Shows an input dialog and inserts the inserted tuple into the selected relation'''
|
||||||
|
res=QtGui.QInputDialog.getText(self.Form, QtGui.QApplication.translate("Form", "New relation"),QtGui.QApplication.translate("Form", "Insert the values, comma separated"),
|
||||||
|
QtGui.QLineEdit.Normal,"")
|
||||||
|
if res[1]==False:
|
||||||
|
return
|
||||||
|
|
||||||
|
t=[]
|
||||||
|
for i in str(res[0].toUtf8()).split(","):
|
||||||
|
t.append(i.strip())
|
||||||
|
|
||||||
|
|
||||||
|
for i in self.lstRelations.selectedItems():
|
||||||
|
rel=self.relations[str(i.text().toUtf8())]
|
||||||
|
if rel.insert(t) > 0:
|
||||||
|
self.showRelation(rel)
|
||||||
|
|
||||||
|
return
|
||||||
def deleteTuple(self):
|
def deleteTuple(self):
|
||||||
pass
|
pass
|
||||||
def addProduct(self):
|
def addProduct(self):
|
||||||
@ -279,8 +295,6 @@ class Ui_Form(object):
|
|||||||
self.showRelation(None)
|
self.showRelation(None)
|
||||||
self.centerLayout.addWidget(self.table)
|
self.centerLayout.addWidget(self.table)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.cmdInsert = QtGui.QPushButton(self.groupBox)
|
self.cmdInsert = QtGui.QPushButton(self.groupBox)
|
||||||
self.cmdInsert.setMaximumSize(QtCore.QSize(16777215,16777215))
|
self.cmdInsert.setMaximumSize(QtCore.QSize(16777215,16777215))
|
||||||
self.cmdInsert.setObjectName("cmdInsert")
|
self.cmdInsert.setObjectName("cmdInsert")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user