From e91a76c90a2ee829c337251e9adc33767c808b51 Mon Sep 17 00:00:00 2001 From: fahim Date: Thu, 5 Feb 2015 15:44:25 +0530 Subject: Subject: First commit Description: It incluse initial gui to be used in new flow of FreeEDA. --- src/frontEnd/Application.py | 121 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100755 src/frontEnd/Application.py (limited to 'src/frontEnd/Application.py') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py new file mode 100755 index 00000000..b77651be --- /dev/null +++ b/src/frontEnd/Application.py @@ -0,0 +1,121 @@ + +#=============================================================================== +# +# FILE: Application.py +# +# USAGE: --- +# +# DESCRIPTION: This main file use to start the Application +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Fahim Khan, fahim.elex@gmail.com +# ORGANIZATION: ecSim team at FOSSEE, IIT Bombay. +# CREATED: Wednesday 21 January 2015 +# REVISION: --- +#=============================================================================== + + +from PyQt4 import QtGui +from configuration.Appconfig import Appconfig +import ViewManagement +import Workspace +import sys + + +class Application(QtGui.QMainWindow): + """ + Its our main window of application + """ + + def __init__(self,*args): + """ + Initialize main Application window + """ + #Calling __init__ of super class + QtGui.QMainWindow.__init__(self,*args) + + + #Creating Application configuration object + + self.confObj = Appconfig() + + self.setGeometry(self.confObj.app_xpos, + self.confObj.app_ypos, + self.confObj.app_width, + self.confObj.app_heigth) + self.setWindowTitle(self.confObj._APPLICATION) + + #Init Workspace + self.work_space = Workspace.Workspace() + + + + + #Init necessary components in sequence + self.initActions() + self.initView() + + + def initActions(self): + + self.newproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'New Project',self) + self.newproj.setShortcut('Ctrl+N') + self.newproj.triggered.connect(self.testfn) + + self.openproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Open Project',self) + self.openproj.setShortcut('Ctrl+O') + self.openproj.triggered.connect(self.testfn) + + self.exitproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Exit',self) + self.exitproj.setShortcut('Ctrl+X') + self.exitproj.triggered.connect(self.testfn) + + self.helpfile = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Help',self) + self.helpfile.setShortcut('Ctrl+H') + self.helpfile.triggered.connect(self.testfn) + + self.mainToolbar = self.addToolBar('Top Navigation') + self.mainToolbar.addAction(self.newproj) + self.mainToolbar.addAction(self.openproj) + self.mainToolbar.addAction(self.exitproj) + self.mainToolbar.addAction(self.helpfile) + + + def initView(self): + """ + Create gui from the class Views and initialize it + """ + self.view = ViewManagement.ViewManagement() + self.setCentralWidget(self.view) + + + def testfn(self): + print "Success hit :" + + def new_project(self): + print "New Project called" + + + +def main(args): + """ + It is main function of the module.It starts the application + """ + app = QtGui.QApplication(args) + + appView = Application() + appView.show() + sys.exit(app.exec_()) + + + + +# Call main function +if __name__ == '__main__': + main(sys.argv) + + + -- cgit