summaryrefslogtreecommitdiff
path: root/src/frontEnd
diff options
context:
space:
mode:
authorfahim2015-05-08 17:22:19 +0530
committerfahim2015-05-08 17:22:19 +0530
commit37854e4e6e1dfd448bc7fb63e31d750843aa68bc (patch)
tree6e05791ab65b9084c34c0d32f01dde2f0d3962e1 /src/frontEnd
parent4ec06556f4bd459477a4468acb562a0333a8ec07 (diff)
downloadeSim-37854e4e6e1dfd448bc7fb63e31d750843aa68bc.tar.gz
eSim-37854e4e6e1dfd448bc7fb63e31d750843aa68bc.tar.bz2
eSim-37854e4e6e1dfd448bc7fb63e31d750843aa68bc.zip
Subject: Added DockArea
Description: Added DockArea.py and modify Application.py to handle DockArea.
Diffstat (limited to 'src/frontEnd')
-rwxr-xr-xsrc/frontEnd/Application.py123
-rw-r--r--src/frontEnd/DockArea.py74
-rw-r--r--src/frontEnd/ProjectExplorer.py1
-rw-r--r--src/frontEnd/ProjectExplorer.pycbin10274 -> 10311 bytes
-rwxr-xr-xsrc/frontEnd/ViewManagement.py1
-rw-r--r--src/frontEnd/ViewManagement.pycbin2869 -> 2841 bytes
6 files changed, 135 insertions, 64 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 296525c4..a1560c9b 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -44,70 +44,24 @@ class Application(QtGui.QMainWindow):
#Calling __init__ of super class
QtGui.QMainWindow.__init__(self,*args)
- #Init Workspace
+ #Creating require Object
self.obj_workspace = Workspace.Workspace()
-
- #Creating object of Kicad.py
self.obj_kicad = Kicad()
+ self.obj_Mainview = MainView()
+ self.obj_appconfig = Appconfig()
- #Creating object of DockArea
- self.obj_dockarea = DockArea.DockArea()
- #Creating Application configuration object
- self.obj_appconfig = Appconfig()
+ #Initialize all widget
+ self.setCentralWidget(self.obj_Mainview)
+ self.initToolBar()
+
self.setGeometry(self.obj_appconfig._app_xpos,
self.obj_appconfig._app_ypos,
self.obj_appconfig._app_width,
self.obj_appconfig._app_heigth)
self.setWindowTitle(self.obj_appconfig._APPLICATION)
-
-
- #Init necessary components in sequence
- self.initToolBar()
- #self.initView()
- self.setCentralWidget(self.initMainView())
-
-
-
- def initMainView(self):
-
- self.mainWidget = QtGui.QWidget()
-
- self.leftSplit = QtGui.QSplitter()
- self.middleSplit = QtGui.QSplitter()
- self.rightSplit = QtGui.QSplitter() #Will be use in future for Browser
-
- self.projectExplorer = ProjectExplorer.ProjectExplorer()
- self.mainArea = QtGui.QTextEdit()
- self.noteArea = QtGui.QTextEdit()
-
-
- self.mainLayout = QtGui.QVBoxLayout()
-
- #Intermediate Widget
- self.middleContainer = QtGui.QWidget()
- self.middleContainerLayout = QtGui.QVBoxLayout()
-
- #Adding content to vertical middle Split.
- self.middleSplit.setOrientation(QtCore.Qt.Vertical)
- self.middleSplit.addWidget(self.obj_dockarea.createDockArea())
- self.middleSplit.addWidget(self.noteArea)
- #Adding middle split to Middle Container Widget
- self.middleContainerLayout.addWidget(self.middleSplit)
- self.middleContainer.setLayout(self.middleContainerLayout)
-
- #Adding content ot left split
- self.leftSplit.addWidget(self.projectExplorer.maketree())
- self.leftSplit.addWidget(self.middleContainer)
-
-
- #Adding to main Layout
- self.mainLayout.addWidget(self.leftSplit)
- self.mainWidget.setLayout(self.mainLayout)
-
- return self.mainWidget
-
-
+ self.show()
+
def initToolBar(self):
@@ -115,6 +69,7 @@ class Application(QtGui.QMainWindow):
self.newproj = QtGui.QAction(QtGui.QIcon('../images/newProject.png'),'<b>New Project</b>',self)
self.newproj.setShortcut('Ctrl+N')
self.newproj.triggered.connect(self.new_project)
+ #self.newproj.connect(self.newproj,QtCore.SIGNAL('triggered()'),self,QtCore.SLOT(self.new_project()))
self.openproj = QtGui.QAction(QtGui.QIcon('../images/openProject.png'),'<b>Open Project</b>',self)
self.openproj.setShortcut('Ctrl+O')
@@ -173,11 +128,13 @@ class Application(QtGui.QMainWindow):
text, ok = QtGui.QInputDialog.getText(self, 'New Project Info','Enter Project Name:')
if ok:
self.projname = (str(text))
- self.project = NewProjectInfo()
- self.project.createProject(self.projname)
- self.setCentralWidget(self.initMainView())
-
-
+ self.project = NewProjectInfo()
+ self.project.createProject(self.projname)
+ #self.setCentralWidget(self.obj_Mainview)
+ else:
+ print "No project created"
+
+
def open_project(self):
"""
This project call Open Project Info class
@@ -186,9 +143,8 @@ class Application(QtGui.QMainWindow):
self.project = OpenProjectInfo()
self.project.body()
print "init main view in open proj"
+ #self.setCentralWidget(self.obj_Mainview)
- self.setCentralWidget(self.initMainView())
-
def exit_project(self):
print "Exit Project called"
@@ -208,10 +164,51 @@ class Application(QtGui.QMainWindow):
def help_project(self):
print "Help is called"
print "Current Project : ",self.obj_appconfig.current_project
+ self.obj_Mainview.obj_dockarea.createTestEditor()
+
+
def testing(self):
print "Success hit kicad button"
-
+
+
+class MainView(QtGui.QWidget):
+ def __init__(self, *args):
+ # call init method of superclass
+ QtGui.QWidget.__init__(self, *args)
+
+ self.leftSplit = QtGui.QSplitter()
+ self.middleSplit = QtGui.QSplitter()
+
+ self.mainLayout = QtGui.QVBoxLayout()
+ #Intermediate Widget
+ self.middleContainer = QtGui.QWidget()
+ self.middleContainerLayout = QtGui.QVBoxLayout()
+
+ #Area to be included in MainView
+ self.noteArea = QtGui.QTextEdit()
+ self.obj_dockarea = DockArea.DockArea()
+ self.obj_projectExplorer = ProjectExplorer.ProjectExplorer()
+ self.projectExplorer = self.obj_projectExplorer.maketree()
+
+ #Adding content to vertical middle Split.
+ self.middleSplit.setOrientation(QtCore.Qt.Vertical)
+ self.middleSplit.addWidget(self.obj_dockarea)
+ self.middleSplit.addWidget(self.noteArea)
+
+ #Adding middle split to Middle Container Widget
+ self.middleContainerLayout.addWidget(self.middleSplit)
+ self.middleContainer.setLayout(self.middleContainerLayout)
+
+ #Adding content of left split
+ self.leftSplit.addWidget(self.projectExplorer)
+ self.leftSplit.addWidget(self.middleContainer)
+
+
+ #Adding to main Layout
+ self.mainLayout.addWidget(self.leftSplit)
+ self.setLayout(self.mainLayout)
+
def main(args):
"""
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
new file mode 100644
index 00000000..a34d1cda
--- /dev/null
+++ b/src/frontEnd/DockArea.py
@@ -0,0 +1,74 @@
+from PyQt4 import QtGui,QtCore
+#from configuration.Appconfig import Appconfig
+
+dockList = ['Blank','Notes']
+dock = {}
+
+class DockArea(QtGui.QMainWindow):
+
+ def __init__(self):
+ QtGui.QMainWindow.__init__(self)
+
+ for dockName in dockList:
+ dock[dockName] = QtGui.QDockWidget(dockName)
+ dock[dockName].setWidget(QtGui.QTextEdit())
+
+ self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock[dockName])
+
+ self.tabifyDockWidget(dock['Notes'],dock['Blank'])
+ self.show()
+
+ def createDockArea(self):
+ """
+ This function creates Dock Area
+ """
+ self.mainWindow = QtGui.QMainWindow()
+
+
+ for dockName in dockList:
+ dock[dockName] = QtGui.QDockWidget(dockName)
+ dock[dockName].setWidget(QtGui.QTextEdit())
+
+ self.mainWindow.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock[dockName])
+
+
+
+ self.mainWindow.tabifyDockWidget(dock['Notes'],dock['Blank'])
+ self.mainWindow.tabifyDockWidget(dock['Blank'],dock['Tips'])
+
+ """
+ if len(dockList) > 1:
+ for index in range(0, len(dockList) - 1):
+ self.mainWindow.tabifiedDockWidgets(dockList[index]),dockList[index + 1])
+ """
+
+
+
+ self.mainWindow.show()
+
+
+ return self.mainWindow
+
+
+ def createTestEditor(self):
+ """
+ This function create widget for Library Editor
+ """
+
+ self.testWidget = QtGui.QWidget()
+ self.testArea = QtGui.QTextEdit()
+ self.testLayout = QtGui.QVBoxLayout()
+ self.testLayout.addWidget(self.testArea)
+
+ #Adding to main Layout
+ self.testWidget.setLayout(self.testLayout)
+
+ dock['Tips'] = QtGui.QDockWidget('Tips')
+ dock['Tips'].setWidget(self.testWidget)
+
+
+ self.tabifyDockWidget(dock['Blank'],dock['Tips'])
+
+
+
+ \ No newline at end of file
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index 4b6e0c70..282133cb 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -234,6 +234,7 @@ class ProjectExplorer(QtGui.QWidget):
self.textwindow = QtGui.QWidget()
self.textwindow.setMinimumSize(600, 500)
+ self.textwindow.setWindowTitle(filename)
self.text = QtGui.QTextEdit()
#self.text.setMaximumSize(580, 450)
self.save = QtGui.QPushButton('Save and Exit')
diff --git a/src/frontEnd/ProjectExplorer.pyc b/src/frontEnd/ProjectExplorer.pyc
index b7c470ad..da647370 100644
--- a/src/frontEnd/ProjectExplorer.pyc
+++ b/src/frontEnd/ProjectExplorer.pyc
Binary files differ
diff --git a/src/frontEnd/ViewManagement.py b/src/frontEnd/ViewManagement.py
index d3269a93..2b770387 100755
--- a/src/frontEnd/ViewManagement.py
+++ b/src/frontEnd/ViewManagement.py
@@ -49,7 +49,6 @@ class ViewManagement(QtGui.QSplitter):
#Adding view into views dictionary
self.addView(ProjectExplorer, 'ProjectExplorer')
self.addView(QtGui.QTextEdit, 'MainArea')
- self.addView(Plotting, 'Plotting')
self.addView(QtGui.QTextEdit, 'Browser')
diff --git a/src/frontEnd/ViewManagement.pyc b/src/frontEnd/ViewManagement.pyc
index 245aae44..3a562d99 100644
--- a/src/frontEnd/ViewManagement.pyc
+++ b/src/frontEnd/ViewManagement.pyc
Binary files differ