From 4ec06556f4bd459477a4468acb562a0333a8ec07 Mon Sep 17 00:00:00 2001 From: fahim Date: Wed, 6 May 2015 11:06:20 +0530 Subject: Subject: Modify Appconfig and Project Explorer Description: --- src/configuration/Appconfig.py | 2 +- src/configuration/Appconfig.pyc | Bin 1557 -> 1577 bytes src/configuration/__init__.pyc | Bin 144 -> 143 bytes src/frontEnd/Application.py | 19 ++++++++++--------- src/frontEnd/ProjectExplorer.py | 11 +---------- src/frontEnd/ProjectExplorer.pyc | Bin 10541 -> 10274 bytes src/frontEnd/ViewManagement.pyc | Bin 2875 -> 2869 bytes src/frontEnd/Workspace.pyc | Bin 3533 -> 3526 bytes src/frontEnd/__init__.pyc | Bin 139 -> 138 bytes src/projManagement/Kicad.pyc | Bin 4309 -> 4302 bytes src/projManagement/Validation.pyc | Bin 2404 -> 2397 bytes src/projManagement/Worker.pyc | Bin 1507 -> 1501 bytes src/projManagement/__init__.pyc | Bin 145 -> 144 bytes src/projManagement/newProject.pyc | Bin 2971 -> 2966 bytes src/projManagement/openProject.pyc | Bin 1771 -> 1767 bytes 15 files changed, 12 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index f00ac984..957634c2 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -36,7 +36,7 @@ class Appconfig(QtGui.QWidget): #Workspace detail workspace_text = '''eSim stores your project in a folder called a eSim-Workspace. You can choose a different workspace folder to use for this session.''' procThread_list = [] - dictPath = os.path.join(home, ".text.txt") + dictPath = os.path.join(os.path.expanduser("~"), ".projectExplorer.txt") try: project_explorer = json.load(open(dictPath)) except: diff --git a/src/configuration/Appconfig.pyc b/src/configuration/Appconfig.pyc index e08ffda4..23489e4b 100644 Binary files a/src/configuration/Appconfig.pyc and b/src/configuration/Appconfig.pyc differ diff --git a/src/configuration/__init__.pyc b/src/configuration/__init__.pyc index 58bf9549..4997c274 100644 Binary files a/src/configuration/__init__.pyc and b/src/configuration/__init__.pyc differ diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 56e3276b..296525c4 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -30,7 +30,7 @@ import sys import time import subprocess from frontEnd import ProjectExplorer - +import DockArea class Application(QtGui.QMainWindow): @@ -50,6 +50,9 @@ class Application(QtGui.QMainWindow): #Creating object of Kicad.py self.obj_kicad = Kicad() + #Creating object of DockArea + self.obj_dockarea = DockArea.DockArea() + #Creating Application configuration object self.obj_appconfig = Appconfig() self.setGeometry(self.obj_appconfig._app_xpos, @@ -77,7 +80,7 @@ class Application(QtGui.QMainWindow): self.projectExplorer = ProjectExplorer.ProjectExplorer() self.mainArea = QtGui.QTextEdit() self.noteArea = QtGui.QTextEdit() - self.browserArea = QtGui.QTextEdit() + self.mainLayout = QtGui.QVBoxLayout() @@ -85,9 +88,9 @@ class Application(QtGui.QMainWindow): self.middleContainer = QtGui.QWidget() self.middleContainerLayout = QtGui.QVBoxLayout() - #Adding content to middle Split whichis vertical + #Adding content to vertical middle Split. self.middleSplit.setOrientation(QtCore.Qt.Vertical) - self.middleSplit.addWidget(self.mainArea) + self.middleSplit.addWidget(self.obj_dockarea.createDockArea()) self.middleSplit.addWidget(self.noteArea) #Adding middle split to Middle Container Widget self.middleContainerLayout.addWidget(self.middleSplit) @@ -131,7 +134,7 @@ class Application(QtGui.QMainWindow): self.topToolbar.addAction(self.exitproj) self.topToolbar.addAction(self.helpfile) - #Left Tool bar Start + #Left Tool bar self.kicad = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Open Schematic',self) self.kicad.triggered.connect(self.obj_kicad.openSchematic) @@ -167,15 +170,13 @@ class Application(QtGui.QMainWindow): """ This function call New Project Info class. """ - print "New Project called" - text, ok = QtGui.QInputDialog.getText(self, 'Input Dialog', - 'Enter Project Name:') + 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()) + def open_project(self): """ diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index a95986b1..4b6e0c70 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -80,16 +80,7 @@ class SceneGraphModel(QtCore.QAbstractItemModel): else: return node.typeInfo() - if role == QtCore.Qt.DecorationRole: - if index.column() == 0: - typeInfo = node.typeInfo() - - if typeInfo == "DIRECTORY": - return QtGui.QIcon(QtGui.QPixmap("../images/default.png")) - - if typeInfo == "FILE": - return QtGui.QIcon(QtGui.QPixmap("../images/default.png")) - + """INPUTS: QModelIndex, QVariant, int (flag)""" def setData(self, index, value, role=QtCore.Qt.EditRole): diff --git a/src/frontEnd/ProjectExplorer.pyc b/src/frontEnd/ProjectExplorer.pyc index e87d977d..b7c470ad 100644 Binary files a/src/frontEnd/ProjectExplorer.pyc and b/src/frontEnd/ProjectExplorer.pyc differ diff --git a/src/frontEnd/ViewManagement.pyc b/src/frontEnd/ViewManagement.pyc index 93901e11..245aae44 100644 Binary files a/src/frontEnd/ViewManagement.pyc and b/src/frontEnd/ViewManagement.pyc differ diff --git a/src/frontEnd/Workspace.pyc b/src/frontEnd/Workspace.pyc index a60ebd37..935ed8d5 100644 Binary files a/src/frontEnd/Workspace.pyc and b/src/frontEnd/Workspace.pyc differ diff --git a/src/frontEnd/__init__.pyc b/src/frontEnd/__init__.pyc index d878c583..107c0b45 100644 Binary files a/src/frontEnd/__init__.pyc and b/src/frontEnd/__init__.pyc differ diff --git a/src/projManagement/Kicad.pyc b/src/projManagement/Kicad.pyc index 1a1c7183..3cb015de 100644 Binary files a/src/projManagement/Kicad.pyc and b/src/projManagement/Kicad.pyc differ diff --git a/src/projManagement/Validation.pyc b/src/projManagement/Validation.pyc index b66bd3af..a1bbf393 100644 Binary files a/src/projManagement/Validation.pyc and b/src/projManagement/Validation.pyc differ diff --git a/src/projManagement/Worker.pyc b/src/projManagement/Worker.pyc index 28b7afff..4f8652b7 100644 Binary files a/src/projManagement/Worker.pyc and b/src/projManagement/Worker.pyc differ diff --git a/src/projManagement/__init__.pyc b/src/projManagement/__init__.pyc index 87910074..2f39d337 100644 Binary files a/src/projManagement/__init__.pyc and b/src/projManagement/__init__.pyc differ diff --git a/src/projManagement/newProject.pyc b/src/projManagement/newProject.pyc index ad569488..2672dd49 100644 Binary files a/src/projManagement/newProject.pyc and b/src/projManagement/newProject.pyc differ diff --git a/src/projManagement/openProject.pyc b/src/projManagement/openProject.pyc index d9c25b77..49ac9b28 100644 Binary files a/src/projManagement/openProject.pyc and b/src/projManagement/openProject.pyc differ -- cgit From 37854e4e6e1dfd448bc7fb63e31d750843aa68bc Mon Sep 17 00:00:00 2001 From: fahim Date: Fri, 8 May 2015 17:22:19 +0530 Subject: Subject: Added DockArea Description: Added DockArea.py and modify Application.py to handle DockArea. --- src/frontEnd/Application.py | 123 +++++++++++++++++------------------ src/frontEnd/DockArea.py | 74 +++++++++++++++++++++ src/frontEnd/ProjectExplorer.py | 1 + src/frontEnd/ProjectExplorer.pyc | Bin 10274 -> 10311 bytes src/frontEnd/ViewManagement.py | 1 - src/frontEnd/ViewManagement.pyc | Bin 2869 -> 2841 bytes src/kicadtoNgspice/Analysis.pyc | Bin 11938 -> 11920 bytes src/kicadtoNgspice/Convert.pyc | Bin 11405 -> 11395 bytes src/kicadtoNgspice/DeviceModel.pyc | Bin 4836 -> 4832 bytes src/kicadtoNgspice/KicadtoNgspice.py | 1 + src/kicadtoNgspice/Model.pyc | Bin 1948 -> 1945 bytes src/kicadtoNgspice/Processing.pyc | Bin 8494 -> 8485 bytes src/kicadtoNgspice/Source.pyc | Bin 4004 -> 4000 bytes src/kicadtoNgspice/TrackWidget.pyc | Bin 889 -> 887 bytes 14 files changed, 136 insertions(+), 64 deletions(-) create mode 100644 src/frontEnd/DockArea.py (limited to 'src') 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'),'New Project',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'),'Open Project',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 Binary files a/src/frontEnd/ProjectExplorer.pyc and b/src/frontEnd/ProjectExplorer.pyc 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 Binary files a/src/frontEnd/ViewManagement.pyc and b/src/frontEnd/ViewManagement.pyc differ diff --git a/src/kicadtoNgspice/Analysis.pyc b/src/kicadtoNgspice/Analysis.pyc index b0487388..0c64313d 100644 Binary files a/src/kicadtoNgspice/Analysis.pyc and b/src/kicadtoNgspice/Analysis.pyc differ diff --git a/src/kicadtoNgspice/Convert.pyc b/src/kicadtoNgspice/Convert.pyc index 2a9197c4..59484751 100644 Binary files a/src/kicadtoNgspice/Convert.pyc and b/src/kicadtoNgspice/Convert.pyc differ diff --git a/src/kicadtoNgspice/DeviceModel.pyc b/src/kicadtoNgspice/DeviceModel.pyc index 716aebcc..becbe198 100644 Binary files a/src/kicadtoNgspice/DeviceModel.pyc and b/src/kicadtoNgspice/DeviceModel.pyc differ diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 9452e364..a320e1b2 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -82,6 +82,7 @@ class MainWindow(QtGui.QWidget): self.tabWidget = QtGui.QTabWidget() + #self.tabWidget.TabShape(QtGui.QTabWidget.Rounded) self.tabWidget.addTab(self.analysisTab,"Analysis") self.tabWidget.addTab(self.sourceTab,"Source Details") self.tabWidget.addTab(self.modelTab,"NgSpice Model") diff --git a/src/kicadtoNgspice/Model.pyc b/src/kicadtoNgspice/Model.pyc index 3081f9c6..dc8b5d45 100644 Binary files a/src/kicadtoNgspice/Model.pyc and b/src/kicadtoNgspice/Model.pyc differ diff --git a/src/kicadtoNgspice/Processing.pyc b/src/kicadtoNgspice/Processing.pyc index 6eada63c..14b281a3 100644 Binary files a/src/kicadtoNgspice/Processing.pyc and b/src/kicadtoNgspice/Processing.pyc differ diff --git a/src/kicadtoNgspice/Source.pyc b/src/kicadtoNgspice/Source.pyc index 88b52296..a2f61eca 100644 Binary files a/src/kicadtoNgspice/Source.pyc and b/src/kicadtoNgspice/Source.pyc differ diff --git a/src/kicadtoNgspice/TrackWidget.pyc b/src/kicadtoNgspice/TrackWidget.pyc index 6cf56b73..b583491c 100644 Binary files a/src/kicadtoNgspice/TrackWidget.pyc and b/src/kicadtoNgspice/TrackWidget.pyc differ -- cgit