diff options
Diffstat (limited to 'src/frontEnd')
-rw-r--r-- | src/frontEnd/DockArea.py | 66 | ||||
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 19 | ||||
-rw-r--r-- | src/frontEnd/Workspace.py | 4 |
3 files changed, 29 insertions, 60 deletions
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py index b44a87e6..2c605272 100644 --- a/src/frontEnd/DockArea.py +++ b/src/frontEnd/DockArea.py @@ -14,9 +14,9 @@ dockList = ['Welcome'] count = 1 dock = {} - +# class DockArea(QtGui.QMainWindow): - + """ """ def __init__(self): QtGui.QMainWindow.__init__(self) self.obj_appconfig = Appconfig() @@ -39,32 +39,10 @@ class DockArea(QtGui.QMainWindow): # self.tabifyDockWidget(dock['Notes'],dock['Blank']) self.show() - - ''' - def __init__(self): - QtGui.QMainWindow.__init__(self) - self.obj_appconfig = Appconfig() - - for dockName in dockList: - dock[dockName] = QtGui.QDockWidget(dockName) - self.welcome = QtGui.QTextEdit() - self.welcome.setReadOnly(True) - dock[dockName].setWidget(self.welcome) - #CSS - dock[dockName].setStyleSheet(" \ - QWidget { border-radius: 15px; border: 1px solid gray;\ - padding: 5px; width: 200px; height: 150px; } \ - ") - self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock[dockName]) - #self.tabifyDockWidget(dock['Notes'],dock['Blank']) - self.show() - ''' - + # This function create widget for Library Editor def createTestEditor(self): - """ - This function create widget for Library Editor - """ + """ """ global count self.testWidget = QtGui.QWidget() @@ -81,32 +59,19 @@ class DockArea(QtGui.QMainWindow): self.tabifyDockWidget( dock['Welcome'], dock['Tips-' + str(count)]) - """ - #CSS - dock['Tips-'+str(count)].setStyleSheet(" \ - .QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px;\ - width: 200px; height: 150px; } \ - ") - """ - dock['Tips-' + str(count)].setVisible(True) dock['Tips-' + str(count)].setFocus() - """ - dock['Tips-'+str(count)].setStyleSheet(" \ - :hover { background-color: yellow; } \ - ") - """ + dock['Tips-' + str(count)].raise_() temp = self.obj_appconfig.current_project['ProjectName'] self.obj_appconfig.dock_dict[temp].append( dock['Tips-' + str(count)]) count = count + 1 - + + # This function create widget for interactive PythonPlotting def plottingEditor(self): - """ - This function create widget for interactive PythonPlotting - """ + """ """ self.projDir = self.obj_appconfig.current_project["ProjectName"] self.projName = os.path.basename(self.projDir) # self.project = os.path.join(self.projDir,self.projName) @@ -126,13 +91,6 @@ class DockArea(QtGui.QMainWindow): dock['Plotting-' + str(count)]) self.tabifyDockWidget(dock['Welcome'], dock['Plotting-' + str(count)]) - """ - #CSS - dock['Plotting-'+str(count)].setStyleSheet(" \ - .QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px;\ - width: 200px; height: 150px; } \ - ") - """ dock['Plotting-' + str(count)].setVisible(True) dock['Plotting-' + str(count)].setFocus() dock['Plotting-' + str(count)].raise_() @@ -143,9 +101,7 @@ class DockArea(QtGui.QMainWindow): count = count + 1 def ngspiceEditor(self, projDir): - """ - This function creates widget for NgSpice window - """ + """This function creates widget for NgSpice window.""" self.projDir = projDir self.projName = os.path.basename(self.projDir) @@ -314,9 +270,7 @@ class DockArea(QtGui.QMainWindow): count = count + 1 def modelicaEditor(self, projDir): - """ - This function sets up the UI for ngspice to modelica conversion - """ + """This function sets up the UI for ngspice to modelica conversion.""" global count self.modelicaWidget = QtGui.QWidget() diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 3ee66cd3..02d4c54c 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -4,8 +4,16 @@ import json from configuration.Appconfig import Appconfig +# This is main class for Project Explorer Area. class ProjectExplorer(QtGui.QWidget): + """ """ + def __init__(self): + """ + This method is doing following tasks: + a)initializing objects used in full program. + b)view of project explorer area. + """ QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.treewidget = QtGui.QTreeWidget() @@ -37,7 +45,7 @@ class ProjectExplorer(QtGui.QWidget): os.path.join(parents) if os.path.exists(parents): pathlist = parents.split(os.sep) - parentnode = QtGui.QTreeWidgetItem( + parentnode = QtGui.QTreeWidgetItem(function self.treewidget, [pathlist[-1], parents]) for files in children: QtGui.QTreeWidgetItem( @@ -73,7 +81,6 @@ class ProjectExplorer(QtGui.QWidget): indexes = self.treewidget.selectedIndexes() if len(indexes) > 0: - level = 0 index = indexes[0] while index.parent().isValid(): @@ -146,16 +153,21 @@ class ProjectExplorer(QtGui.QWidget): self.obj_appconfig.current_project['ProjectName']] ) = [] + # This function is enabling save button option. def enable_save(self): self.save.setEnabled(True) + # This function is saving data before it closes the given file. def save_data(self): self.fopen = open(self.filePath, 'w') self.fopen.write(self.text.toPlainText()) self.fopen.close() self.textwindow.close() + # This function removes the project in explorer area by right + # clicking on project and selecting remove option. def removeProject(self): + """ """ self.indexItem = self.treewidget.currentIndex() self.filePath = str( self.indexItem.sibling( @@ -171,7 +183,10 @@ class ProjectExplorer(QtGui.QWidget): json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath, 'w')) + # This function refresh the project in explorer area by right + # clicking on project and selecting refresh option. def refreshProject(self): + """ """ self.indexItem = self.treewidget.currentIndex() self.filePath = str( self.indexItem.sibling( diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index 7bc74deb..62833064 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -20,10 +20,10 @@ from configuration.Appconfig import Appconfig import time import os - +# This class creates Workspace GUI. class Workspace(QtGui.QWidget): """ - This class creates Workspace GUI. + """ def __init__(self, parent=None): |