summaryrefslogtreecommitdiff
path: root/src/frontEnd/Application.py
diff options
context:
space:
mode:
authorrahulp132020-02-16 22:56:59 +0530
committerrahulp132020-02-16 22:56:59 +0530
commit453c2dab78f81046fcbd42034a86c4e759a0ff68 (patch)
tree1e52dc08cfb0a86666372421d90502976715f35c /src/frontEnd/Application.py
parent3e27f0dcb8555e1708497b48ad251e93fed93b6e (diff)
downloadeSim-453c2dab78f81046fcbd42034a86c4e759a0ff68.tar.gz
eSim-453c2dab78f81046fcbd42034a86c4e759a0ff68.tar.bz2
eSim-453c2dab78f81046fcbd42034a86c4e759a0ff68.zip
workspace functionality
Diffstat (limited to 'src/frontEnd/Application.py')
-rw-r--r--src/frontEnd/Application.py34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index cd40214b..1b8a18c5 100644
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -103,6 +103,13 @@ class Application(QtGui.QMainWindow):
self.closeproj.setShortcut('Ctrl+X')
self.closeproj.triggered.connect(self.close_project)
+ self.wrkspce = QtGui.QAction(
+ QtGui.QIcon('../../images/workspace.ico'),
+ '<b>Change Workspace</b>', self
+ )
+ self.wrkspce.setShortcut('Ctrl+W')
+ self.wrkspce.triggered.connect(self.change_workspace)
+
self.switchmode = None
self.validate_mode()
if self.online_flag == True:
@@ -135,6 +142,7 @@ class Application(QtGui.QMainWindow):
self.topToolbar.addAction(self.newproj)
self.topToolbar.addAction(self.openproj)
self.topToolbar.addAction(self.closeproj)
+ self.topToolbar.addAction(self.wrkspce)
self.topToolbar.addAction(self.switchmode)
self.topToolbar.addAction(self.helpfile)
@@ -332,6 +340,15 @@ class Application(QtGui.QMainWindow):
os.path.basename(current_project) + ' is Closed.'
)
+ def change_workspace(self):
+ """
+ This function call changes Workspace
+ """
+ print("Function : Change Workspace")
+ self.obj_workspace.returnWhetherClickedOrNot(self)
+ self.hide()
+ self.obj_workspace.show()
+
def validate_mode(self):
"""
This functions checks whether proper fp-lib-table* files are \
@@ -789,8 +806,21 @@ def main(args):
appView = Application()
appView.splash = splash
appView.obj_workspace.returnWhetherClickedOrNot(appView)
- appView.hide()
- appView.obj_workspace.show()
+
+ try:
+ file = open(os.path.join(
+ os.path.expanduser("~"),".esim/workspace.txt"), 'r'
+ )
+ work = int(file.read(1))
+ file.close()
+ except IOError:
+ work = 0
+ if work is not 0:
+ appView.obj_workspace.defaultWorkspace()
+ else:
+ appView.hide()
+ appView.obj_workspace.show()
+
sys.exit(app.exec_())