summaryrefslogtreecommitdiff
path: root/src/frontEnd/Application.py
diff options
context:
space:
mode:
authorfahim2015-02-05 15:44:25 +0530
committerfahim2015-02-05 15:44:25 +0530
commite91a76c90a2ee829c337251e9adc33767c808b51 (patch)
treedba2698c0ff969a45778ab93332da38971c91f8b /src/frontEnd/Application.py
downloadeSim-e91a76c90a2ee829c337251e9adc33767c808b51.tar.gz
eSim-e91a76c90a2ee829c337251e9adc33767c808b51.tar.bz2
eSim-e91a76c90a2ee829c337251e9adc33767c808b51.zip
Subject: First commit
Description: It incluse initial gui to be used in new flow of FreeEDA.
Diffstat (limited to 'src/frontEnd/Application.py')
-rwxr-xr-xsrc/frontEnd/Application.py121
1 files changed, 121 insertions, 0 deletions
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)
+
+
+