From d422756ed2ffa4f815c5778c5ac9811a9a4c64c4 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sun, 30 Jun 2013 11:47:26 +0200 Subject: [PATCH] sessions support --- relational_gui/maingui.py | 168 +++++++++++++++++++++++--------------- relational_gui/maingui.ui | 114 +++++++++++++++++++++++++- 2 files changed, 213 insertions(+), 69 deletions(-) diff --git a/relational_gui/maingui.py b/relational_gui/maingui.py index 412d4c9..0d2aac4 100644 --- a/relational_gui/maingui.py +++ b/relational_gui/maingui.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'relational_gui/maingui.ui' # -# Created: Mon Feb 13 13:21:56 2012 -# by: PyQt4 UI code generator 4.9.1 +# Created: Sun Jun 30 11:47:05 2013 +# by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! @@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: - _fromUtf8 = lambda s: s + 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): def setupUi(self, MainWindow): @@ -212,6 +221,10 @@ class Ui_MainWindow(object): self.menuAbout.setObjectName(_fromUtf8("menuAbout")) self.action = QtGui.QAction(MainWindow) self.action.setObjectName(_fromUtf8("action")) + self.menuSession = QtGui.QMenu(self.menubar) + self.menuSession.setObjectName(_fromUtf8("menuSession")) + self.menuRelations = QtGui.QMenu(self.menubar) + self.menuRelations.setObjectName(_fromUtf8("menuRelations")) MainWindow.setMenuBar(self.menubar) self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout.setMenuRole(QtGui.QAction.AboutRole) @@ -229,15 +242,29 @@ class Ui_MainWindow(object): self.actionNew_relation.setObjectName(_fromUtf8("actionNew_relation")) self.actionEdit_relation = QtGui.QAction(MainWindow) self.actionEdit_relation.setObjectName(_fromUtf8("actionEdit_relation")) - self.menuFile.addAction(self.actionNew_relation) - self.menuFile.addAction(self.action_Load_relation) - self.menuFile.addAction(self.action_Save_relation) - self.menuFile.addAction(self.actionEdit_relation) + self.actionNew_session = QtGui.QAction(MainWindow) + self.actionNew_session.setObjectName(_fromUtf8("actionNew_session")) + self.actionSave_session_as = QtGui.QAction(MainWindow) + self.actionSave_session_as.setObjectName(_fromUtf8("actionSave_session_as")) + self.actionManage_sessions = QtGui.QAction(MainWindow) + self.actionManage_sessions.setObjectName(_fromUtf8("actionManage_sessions")) + self.actionUnload_relation = QtGui.QAction(MainWindow) + self.actionUnload_relation.setObjectName(_fromUtf8("actionUnload_relation")) self.menuFile.addSeparator() self.menuFile.addAction(self.action_Quit) self.menuAbout.addAction(self.actionAbout) self.menuAbout.addAction(self.actionCheck_for_new_versions) + self.menuSession.addAction(self.actionNew_session) + self.menuSession.addAction(self.actionSave_session_as) + self.menuSession.addAction(self.actionManage_sessions) + self.menuRelations.addAction(self.actionNew_relation) + self.menuRelations.addAction(self.action_Load_relation) + self.menuRelations.addAction(self.action_Save_relation) + self.menuRelations.addAction(self.actionEdit_relation) + self.menuRelations.addAction(self.actionUnload_relation) self.menubar.addAction(self.menuFile.menuAction()) + self.menubar.addAction(self.menuRelations.menuAction()) + self.menubar.addAction(self.menuSession.menuAction()) self.menubar.addAction(self.menuAbout.menuAction()) self.label.setBuddy(self.txtQuery) @@ -280,6 +307,10 @@ class Ui_MainWindow(object): QtCore.QObject.connect(self.actionEdit_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.editRelation) QtCore.QObject.connect(self.cmdNew, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.newRelation) QtCore.QObject.connect(self.actionNew_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.newRelation) + QtCore.QObject.connect(self.actionManage_sessions, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.manageSessions) + QtCore.QObject.connect(self.actionNew_session, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.newSession) + QtCore.QObject.connect(self.actionSave_session_as, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.saveSessionAs) + QtCore.QObject.connect(self.actionUnload_relation, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.unloadRelation) QtCore.QMetaObject.connectSlotsByName(MainWindow) MainWindow.setTabOrder(self.cmdAbout, self.cmdSurvey) MainWindow.setTabOrder(self.cmdSurvey, self.cmdProduct) @@ -311,63 +342,70 @@ class Ui_MainWindow(object): MainWindow.setTabOrder(self.cmdClearQuery, self.cmdExecute) def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Relational", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_3.setTitle(QtGui.QApplication.translate("MainWindow", "Menu", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdSurvey.setText(QtGui.QApplication.translate("MainWindow", "Survey", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_4.setTitle(QtGui.QApplication.translate("MainWindow", "Operators", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdProduct.setToolTip(QtGui.QApplication.translate("MainWindow", "Product", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdProduct.setText(QtGui.QApplication.translate("MainWindow", "*", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdDifference.setToolTip(QtGui.QApplication.translate("MainWindow", "Difference", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdDifference.setText(QtGui.QApplication.translate("MainWindow", "-", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdUnion.setToolTip(QtGui.QApplication.translate("MainWindow", "Union", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdUnion.setText(QtGui.QApplication.translate("MainWindow", "ᑌ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdIntersection.setToolTip(QtGui.QApplication.translate("MainWindow", "Intersection", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdIntersection.setText(QtGui.QApplication.translate("MainWindow", "ᑎ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdDivision.setToolTip(QtGui.QApplication.translate("MainWindow", "Division", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdDivision.setText(QtGui.QApplication.translate("MainWindow", "÷", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdJoin.setToolTip(QtGui.QApplication.translate("MainWindow", "Natural join", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdJoin.setText(QtGui.QApplication.translate("MainWindow", "ᐅᐊ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOuterLeft.setToolTip(QtGui.QApplication.translate("MainWindow", "Left outer join", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOuterLeft.setText(QtGui.QApplication.translate("MainWindow", "ᐅLEFTᐊ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOuterRight.setToolTip(QtGui.QApplication.translate("MainWindow", "Right outer join", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOuterRight.setText(QtGui.QApplication.translate("MainWindow", "ᐅRIGHTᐊ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOuter.setToolTip(QtGui.QApplication.translate("MainWindow", "Full outer join", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOuter.setText(QtGui.QApplication.translate("MainWindow", "ᐅFULLᐊ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdProjection.setToolTip(QtGui.QApplication.translate("MainWindow", "Projection", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdProjection.setText(QtGui.QApplication.translate("MainWindow", "π", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdSelection.setToolTip(QtGui.QApplication.translate("MainWindow", "Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdSelection.setText(QtGui.QApplication.translate("MainWindow", "σ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdRename.setToolTip(QtGui.QApplication.translate("MainWindow", "Rename", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdRename.setText(QtGui.QApplication.translate("MainWindow", "ρ", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdArrow.setText(QtGui.QApplication.translate("MainWindow", "➡", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdOptimize.setText(QtGui.QApplication.translate("MainWindow", "Optimize", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdUndoOptimize.setText(QtGui.QApplication.translate("MainWindow", "Undo optimize", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdClearHistory.setText(QtGui.QApplication.translate("MainWindow", "Clear history", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Relations", None, QtGui.QApplication.UnicodeUTF8)) + MainWindow.setWindowTitle(_translate("MainWindow", "Relational", None)) + self.groupBox_3.setTitle(_translate("MainWindow", "Menu", None)) + self.cmdAbout.setText(_translate("MainWindow", "About", None)) + self.cmdSurvey.setText(_translate("MainWindow", "Survey", None)) + self.groupBox_4.setTitle(_translate("MainWindow", "Operators", None)) + self.cmdProduct.setToolTip(_translate("MainWindow", "Product", None)) + self.cmdProduct.setText(_translate("MainWindow", "*", None)) + self.cmdDifference.setToolTip(_translate("MainWindow", "Difference", None)) + self.cmdDifference.setText(_translate("MainWindow", "-", None)) + self.cmdUnion.setToolTip(_translate("MainWindow", "Union", None)) + self.cmdUnion.setText(_translate("MainWindow", "ᑌ", None)) + self.cmdIntersection.setToolTip(_translate("MainWindow", "Intersection", None)) + self.cmdIntersection.setText(_translate("MainWindow", "ᑎ", None)) + self.cmdDivision.setToolTip(_translate("MainWindow", "Division", None)) + self.cmdDivision.setText(_translate("MainWindow", "÷", None)) + self.cmdJoin.setToolTip(_translate("MainWindow", "Natural join", None)) + self.cmdJoin.setText(_translate("MainWindow", "ᐅᐊ", None)) + self.cmdOuterLeft.setToolTip(_translate("MainWindow", "Left outer join", None)) + self.cmdOuterLeft.setText(_translate("MainWindow", "ᐅLEFTᐊ", None)) + self.cmdOuterRight.setToolTip(_translate("MainWindow", "Right outer join", None)) + self.cmdOuterRight.setText(_translate("MainWindow", "ᐅRIGHTᐊ", None)) + self.cmdOuter.setToolTip(_translate("MainWindow", "Full outer join", None)) + self.cmdOuter.setText(_translate("MainWindow", "ᐅFULLᐊ", None)) + self.cmdProjection.setToolTip(_translate("MainWindow", "Projection", None)) + self.cmdProjection.setText(_translate("MainWindow", "π", None)) + self.cmdSelection.setToolTip(_translate("MainWindow", "Selection", None)) + self.cmdSelection.setText(_translate("MainWindow", "σ", None)) + self.cmdRename.setToolTip(_translate("MainWindow", "Rename", None)) + self.cmdRename.setText(_translate("MainWindow", "ρ", None)) + self.cmdArrow.setText(_translate("MainWindow", "➡", None)) + self.cmdOptimize.setText(_translate("MainWindow", "Optimize", None)) + self.cmdUndoOptimize.setText(_translate("MainWindow", "Undo optimize", None)) + self.cmdClearHistory.setText(_translate("MainWindow", "Clear history", None)) + self.groupBox.setTitle(_translate("MainWindow", "Relations", None)) self.lstRelations.setSortingEnabled(True) - self.cmdNew.setText(QtGui.QApplication.translate("MainWindow", "New relation", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdLoad.setText(QtGui.QApplication.translate("MainWindow", "Load relation", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdSave.setText(QtGui.QApplication.translate("MainWindow", "Save relation", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdEdit.setText(QtGui.QApplication.translate("MainWindow", "Edit relation", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdUnload.setText(QtGui.QApplication.translate("MainWindow", "Unload relation", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "Attributes", None, QtGui.QApplication.UnicodeUTF8)) - self.txtResult.setText(QtGui.QApplication.translate("MainWindow", "_last1", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("MainWindow", "=", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdClearQuery.setText(QtGui.QApplication.translate("MainWindow", "⌫", None, QtGui.QApplication.UnicodeUTF8)) - self.cmdExecute.setText(QtGui.QApplication.translate("MainWindow", "Execute", None, QtGui.QApplication.UnicodeUTF8)) - self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8)) - self.menuAbout.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8)) - self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "&About", None, QtGui.QApplication.UnicodeUTF8)) - self.action_Load_relation.setText(QtGui.QApplication.translate("MainWindow", "&Load relation", None, QtGui.QApplication.UnicodeUTF8)) - self.action_Load_relation.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) - self.action_Save_relation.setText(QtGui.QApplication.translate("MainWindow", "&Save relation", None, QtGui.QApplication.UnicodeUTF8)) - self.action_Save_relation.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8)) - self.action_Quit.setText(QtGui.QApplication.translate("MainWindow", "&Quit", None, QtGui.QApplication.UnicodeUTF8)) - self.action_Quit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8)) - self.actionCheck_for_new_versions.setText(QtGui.QApplication.translate("MainWindow", "Check for new versions", None, QtGui.QApplication.UnicodeUTF8)) - self.actionNew_relation.setText(QtGui.QApplication.translate("MainWindow", "New relation", None, QtGui.QApplication.UnicodeUTF8)) - self.actionNew_relation.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8)) - self.actionEdit_relation.setText(QtGui.QApplication.translate("MainWindow", "Edit relation", None, QtGui.QApplication.UnicodeUTF8)) - self.actionEdit_relation.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+E", None, QtGui.QApplication.UnicodeUTF8)) + self.cmdNew.setText(_translate("MainWindow", "New relation", None)) + self.cmdLoad.setText(_translate("MainWindow", "Load relation", None)) + self.cmdSave.setText(_translate("MainWindow", "Save relation", None)) + self.cmdEdit.setText(_translate("MainWindow", "Edit relation", None)) + self.cmdUnload.setText(_translate("MainWindow", "Unload relation", None)) + self.groupBox_2.setTitle(_translate("MainWindow", "Attributes", None)) + self.txtResult.setText(_translate("MainWindow", "_last1", None)) + self.label.setText(_translate("MainWindow", "=", None)) + self.cmdClearQuery.setText(_translate("MainWindow", "⌫", None)) + self.cmdExecute.setText(_translate("MainWindow", "Execute", None)) + self.menuFile.setTitle(_translate("MainWindow", "&File", None)) + self.menuAbout.setTitle(_translate("MainWindow", "&Help", None)) + self.menuSession.setTitle(_translate("MainWindow", "Session", None)) + self.menuRelations.setTitle(_translate("MainWindow", "Relations", None)) + self.actionAbout.setText(_translate("MainWindow", "&About", None)) + self.action_Load_relation.setText(_translate("MainWindow", "&Load relation", None)) + self.action_Load_relation.setShortcut(_translate("MainWindow", "Ctrl+O", None)) + self.action_Save_relation.setText(_translate("MainWindow", "&Save relation", None)) + self.action_Save_relation.setShortcut(_translate("MainWindow", "Ctrl+S", None)) + self.action_Quit.setText(_translate("MainWindow", "&Quit", None)) + self.action_Quit.setShortcut(_translate("MainWindow", "Ctrl+Q", None)) + self.actionCheck_for_new_versions.setText(_translate("MainWindow", "Check for new versions", None)) + self.actionNew_relation.setText(_translate("MainWindow", "New relation", None)) + self.actionNew_relation.setShortcut(_translate("MainWindow", "Ctrl+N", None)) + self.actionEdit_relation.setText(_translate("MainWindow", "Edit relation", None)) + self.actionEdit_relation.setShortcut(_translate("MainWindow", "Ctrl+E", None)) + self.actionNew_session.setText(_translate("MainWindow", "New session", None)) + self.actionSave_session_as.setText(_translate("MainWindow", "Save session as", None)) + self.actionSave_session_as.setToolTip(_translate("MainWindow", "Save session as", None)) + self.actionManage_sessions.setText(_translate("MainWindow", "Manage sessions", None)) + self.actionUnload_relation.setText(_translate("MainWindow", "Unload relation", None)) diff --git a/relational_gui/maingui.ui b/relational_gui/maingui.ui index c61d486..6afdbfb 100644 --- a/relational_gui/maingui.ui +++ b/relational_gui/maingui.ui @@ -462,10 +462,6 @@ &File - - - - @@ -477,7 +473,27 @@ + + + Session + + + + + + + + Relations + + + + + + + + + @@ -536,6 +552,29 @@ Ctrl+E + + + New session + + + + + Save session as + + + Save session as + + + + + Manage sessions + + + + + Unload relation + + cmdAbout @@ -1178,6 +1217,70 @@ + + actionManage_sessions + triggered() + MainWindow + manageSessions() + + + -1 + -1 + + + 399 + 305 + + + + + actionNew_session + triggered() + MainWindow + newSession() + + + -1 + -1 + + + 399 + 305 + + + + + actionSave_session_as + triggered() + MainWindow + saveSessionAs() + + + -1 + -1 + + + 399 + 305 + + + + + actionUnload_relation + triggered() + MainWindow + unloadRelation() + + + -1 + -1 + + + 399 + 305 + + + execute() @@ -1210,5 +1313,8 @@ resumeHistory(QListWidgetItem*) editRelation() newRelation() + newSession() + saveSessionAs() + manageSessions()