From 06d27b14a75343a5d1bde5bd4da664c54b877139 Mon Sep 17 00:00:00 2001 From: LtWorf Date: Thu, 13 Oct 2011 16:24:01 +0000 Subject: [PATCH] - Still a stub, with handler module now git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@322 014f5005-505e-4b48-8d0a-63407b615a7c --- relational_gui/creator.py | 60 ++++++++++++++++++++++++++++++++++++ relational_gui/maingui.py | 2 +- relational_gui/rel_edit.ui | 63 +++++++++++++++++++++++++++++++++++--- relational_gui/survey.py | 2 +- 4 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 relational_gui/creator.py diff --git a/relational_gui/creator.py b/relational_gui/creator.py new file mode 100644 index 0000000..054974b --- /dev/null +++ b/relational_gui/creator.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Relational +# Copyright (C) 2008 Salvo "LtWorf" Tomaselli +# +# Relational is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# author Salvo "LtWorf" Tomaselli + +try: + from PyQt4 import QtCore, QtGui +except: + from PySide import QtCore, QtGui + +from relational import relation +import rel_edit + + +class creatorForm(QtGui.QDialog): + def __init__(self,ui,rel=None): + QtGui.QDialog.__init__(self) + self.setSizeGripEnabled(True) + self.result_relation=None + + + + def accept(self): + + QtGui.QDialog.accept(self) + pass + def reject(self): + pass + + + + +def editRelation(rel=None): + ui = rel_edit.Ui_Dialog() + Form = creatorForm(ui) + + + ui.setupUi(Form) + Form.exec_() + return Form.result_relation + + +if __name__ == '__main__': + import sys + app = QtGui.QApplication(sys.argv) + print editRelation() diff --git a/relational_gui/maingui.py b/relational_gui/maingui.py index 93a174a..0bb557f 100644 --- a/relational_gui/maingui.py +++ b/relational_gui/maingui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'relational_gui/maingui.ui' # -# Created: Sun Oct 9 00:27:00 2011 +# Created: Thu Oct 13 17:38:01 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! diff --git a/relational_gui/rel_edit.ui b/relational_gui/rel_edit.ui index 2d3d504..69b5eac 100644 --- a/relational_gui/rel_edit.ui +++ b/relational_gui/rel_edit.ui @@ -32,12 +32,65 @@ - 290 + 230 50 256 192 + + + a + + + + + A + + + + + + + 10 + 60 + 137 + 140 + + + + Edit + + + + + + Add column + + + + + + + Remove column + + + + + + + Add tuple + + + + + + + Remove tuple + + + + @@ -49,8 +102,8 @@ accept() - 248 - 254 + 328 + 354 157 @@ -65,8 +118,8 @@ reject() - 316 - 260 + 396 + 360 286 diff --git a/relational_gui/survey.py b/relational_gui/survey.py index 6f5565f..e75cc1d 100644 --- a/relational_gui/survey.py +++ b/relational_gui/survey.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'relational_gui/survey.ui' # -# Created: Sun Oct 9 00:27:00 2011 +# Created: Thu Oct 13 17:38:01 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost!