diff options
author | fahim | 2015-02-10 14:51:07 +0530 |
---|---|---|
committer | fahim | 2015-02-10 14:51:07 +0530 |
commit | 775f9c18568ad2f7c480fad271e281dbc235e796 (patch) | |
tree | 3c6875f7323162c4e61653393e179941fa9b0061 /src/frontEnd | |
parent | e91a76c90a2ee829c337251e9adc33767c808b51 (diff) | |
download | eSim-775f9c18568ad2f7c480fad271e281dbc235e796.tar.gz eSim-775f9c18568ad2f7c480fad271e281dbc235e796.tar.bz2 eSim-775f9c18568ad2f7c480fad271e281dbc235e796.zip |
Subject: Added few more gui component
Description: Kicad button,converter button and Ngspice button.
Diffstat (limited to 'src/frontEnd')
-rwxr-xr-x | src/frontEnd/Application.py | 34 | ||||
-rw-r--r-- | src/frontEnd/Application.pyc | bin | 0 -> 3277 bytes | |||
-rwxr-xr-x | src/frontEnd/ViewManagement.py | 45 | ||||
-rw-r--r-- | src/frontEnd/ViewManagement.pyc | bin | 1638 -> 2287 bytes | |||
-rw-r--r-- | src/frontEnd/Workspace.py | 36 | ||||
-rw-r--r-- | src/frontEnd/Workspace.pyc | bin | 2916 -> 3433 bytes | |||
-rw-r--r-- | src/frontEnd/__init__.pyc | bin | 0 -> 139 bytes |
7 files changed, 88 insertions, 27 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index b77651be..7f783ff3 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -47,10 +47,8 @@ class Application(QtGui.QMainWindow): self.confObj.app_width, self.confObj.app_heigth) self.setWindowTitle(self.confObj._APPLICATION) - #Init Workspace self.work_space = Workspace.Workspace() - @@ -63,19 +61,19 @@ class Application(QtGui.QMainWindow): self.newproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'New Project',self) self.newproj.setShortcut('Ctrl+N') - self.newproj.triggered.connect(self.testfn) + self.newproj.triggered.connect(self.new_project) self.openproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Open Project',self) self.openproj.setShortcut('Ctrl+O') - self.openproj.triggered.connect(self.testfn) + self.openproj.triggered.connect(self.open_project) self.exitproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Exit',self) self.exitproj.setShortcut('Ctrl+X') - self.exitproj.triggered.connect(self.testfn) + self.exitproj.triggered.connect(self.exit_project) self.helpfile = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Help',self) self.helpfile.setShortcut('Ctrl+H') - self.helpfile.triggered.connect(self.testfn) + self.helpfile.triggered.connect(self.help_project) self.mainToolbar = self.addToolBar('Top Navigation') self.mainToolbar.addAction(self.newproj) @@ -97,7 +95,16 @@ class Application(QtGui.QMainWindow): def new_project(self): print "New Project called" + + def open_project(self): + print "Open Project called" + + def exit_project(self): + print "Exit Project called" + def help_project(self): + print "Help is called" + def main(args): @@ -105,11 +112,20 @@ 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_()) - + sys.exit(app.exec_()) + """ + while 1: + print work_space.status_label.text() + if work_space.status_label.text() == 'OK': + print "OK" + appView.show() + break + else: + pass + + """ diff --git a/src/frontEnd/Application.pyc b/src/frontEnd/Application.pyc Binary files differnew file mode 100644 index 00000000..52649138 --- /dev/null +++ b/src/frontEnd/Application.pyc diff --git a/src/frontEnd/ViewManagement.py b/src/frontEnd/ViewManagement.py index dd24d13b..fac383bc 100755 --- a/src/frontEnd/ViewManagement.py +++ b/src/frontEnd/ViewManagement.py @@ -38,26 +38,51 @@ class ViewManagement(QtGui.QSplitter): def createView(self): #Adding view into views dictionary - self.addView(QtGui.QTextEdit, 'test1') + self.addView(QtGui.QTextEdit, 'Project Explorer') self.addView(QtGui.QTextEdit, 'test2') self.addView(QtGui.QTextEdit, 'test3') def setupView(self): - #setup views to define various areas, such as placement of individual views - # the right segment also is a splitter, but with vertical orientation - right = QtGui.QSplitter() - right.setOrientation(QtCore.Qt.Vertical) + self.right = QtGui.QSplitter() + self.right.setOrientation(QtCore.Qt.Vertical) + + #Layout + self.grid = QtGui.QGridLayout() + + + #Button for QFrame + self.kicad_btn = QtGui.QPushButton() + self.kicad_btn.setIcon(QtGui.QIcon('../images/default.png')) + self.kicad_btn.setIconSize(QtCore.QSize(50,50)) + self.grid.addWidget(self.kicad_btn,0,0) + + self.conversion_btn = QtGui.QPushButton() + self.conversion_btn.setIcon(QtGui.QIcon('../images/default.png')) + self.conversion_btn.setIconSize(QtCore.QSize(50,50)) + self.grid.addWidget(self.conversion_btn,0,1) + + + self.ngspice_btn = QtGui.QPushButton() + self.ngspice_btn.setIcon(QtGui.QIcon('../images/default.png')) + self.ngspice_btn.setIconSize(QtCore.QSize(50,50)) + self.grid.addWidget(self.ngspice_btn,0,2) + + + # bind the top level views into the framework - self.views['test1'].setParent(self) + self.views['Project Explorer'].setParent(self) + + self.views['test2'].setParent(self.right) + self.views['test2'].setLayout(self.grid) + self.views['test2'].setReadOnly(True) - right.setParent(self) + self.views['test3'].setParent(self.right) - self.views['test2'].setParent(right) - self.views['test3'].setParent(right) - right.setSizes([20, 5]) + self.right.setParent(self) + self.right.setSizes([20, 5]) self.setSizes([5, 20]) def addView(self, settype, name): diff --git a/src/frontEnd/ViewManagement.pyc b/src/frontEnd/ViewManagement.pyc Binary files differindex 5cd5dee7..b7023ebd 100644 --- a/src/frontEnd/ViewManagement.pyc +++ b/src/frontEnd/ViewManagement.pyc diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index e1cb365b..95c19942 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -15,9 +15,10 @@ # CREATED: Wednesday 05 February 2015 # REVISION: --- #=============================================================================== +from PyQt4 import QtCore, QtGui +from configuration.Appconfig import Appconfig + import os -from PyQt4 import QtGui -from PyQt4 import QtCore class Workspace(QtGui.QWidget): @@ -26,9 +27,12 @@ class Workspace(QtGui.QWidget): """ def __init__(self): super(Workspace, self).__init__() - #Home directory - self.home = os.path.expanduser("~")+"/Workspace" + #Button status lable + #self.status_label = QtGui.QLabel('NO') + + self.obj = Appconfig() + #Initializing Workspace directory for project self.initWorkspace() @@ -40,9 +44,9 @@ class Workspace(QtGui.QWidget): self.ledit = QtGui.QLineEdit(self) #Add text to text edit,label and line edit - self.tedit.append("Sample Text") + self.tedit.append(self.obj.workspace_text) self.label.setText("Workspace:") - self.ledit.setText(self.home) + self.ledit.setText(self.obj.home) #Buttons self.browsebtn = QtGui.QPushButton('Browse') @@ -80,17 +84,33 @@ class Workspace(QtGui.QWidget): self.setGeometry(QtCore.QRect(200,200,400,400)) self.setWindowTitle("Workspace Launcher") #self.setWindowIcon(QtGui.QIcon('logo.png')) + self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.tedit.setReadOnly(True) self.show() def defaultWorkspace(self): print "Default location selected" - + self.close() + def createWorkspace(self): - print "Create workspace is called" + print "Create workspace is called" + self.create_workspace = str(self.ledit.text()) + + if os.path.isdir(self.create_workspace): + pass + print "Already present" + self.obj.default_workspace["workspace"] = self.create_workspace + + else: + os.mkdir(self.create_workspace) + self.obj.default_workspace["workspace"] = self.create_workspace + def browseLocation(self): print "Browse Location called" + self.workspace_directory = QtGui.QFileDialog.getExistingDirectory() + print "Path file :", self.workspace_directory + self.ledit.setText(self.workspace_directory)
\ No newline at end of file diff --git a/src/frontEnd/Workspace.pyc b/src/frontEnd/Workspace.pyc Binary files differindex eb470612..7492f39a 100644 --- a/src/frontEnd/Workspace.pyc +++ b/src/frontEnd/Workspace.pyc diff --git a/src/frontEnd/__init__.pyc b/src/frontEnd/__init__.pyc Binary files differnew file mode 100644 index 00000000..bc735777 --- /dev/null +++ b/src/frontEnd/__init__.pyc |