From 6e14b4b4c7cb1d340305092aab49f0b284e84aa5 Mon Sep 17 00:00:00 2001 From: LtWorf Date: Tue, 10 Feb 2009 17:25:04 +0000 Subject: [PATCH] implemented inserting of tuples in GUI git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@84 014f5005-505e-4b48-8d0a-63407b615a7c --- maingui.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/maingui.py b/maingui.py index c49f711..d56ff4e 100644 --- a/maingui.py +++ b/maingui.py @@ -163,7 +163,18 @@ class Ui_Form(object): return def deleteTuple(self): - pass + '''Shows an input dialog and removes the tuples corresponding to the condition.''' + res=QtGui.QInputDialog.getText(self.Form, QtGui.QApplication.translate("Form", "New relation"),QtGui.QApplication.translate("Form", "Remove tuples: insert where condition"), + QtGui.QLineEdit.Normal,"") + if res[1]==False: + return + + for i in self.lstRelations.selectedItems(): + rel=self.relations[str(i.text().toUtf8())] + if rel.delete(str(res[0].toUtf8())) > 0: + self.showRelation(rel) + + return def addProduct(self): self.txtQuery.insert(u"*") self.txtQuery.setFocus()