diff options
author | Rahul P | 2020-08-08 19:16:28 +0530 |
---|---|---|
committer | GitHub | 2020-08-08 19:16:28 +0530 |
commit | 8255c72075ab3541e8b6cfa7facb4e016157a905 (patch) | |
tree | e86226cc6a609e54133b527ad71912996360722b /src/frontEnd/Workspace.py | |
parent | 175208c2553bde875968a9bc53176b6039ba9360 (diff) | |
parent | 7871e58975d75eb2b02928f7a48d29113bebeb2b (diff) | |
download | eSim-8255c72075ab3541e8b6cfa7facb4e016157a905.tar.gz eSim-8255c72075ab3541e8b6cfa7facb4e016157a905.tar.bz2 eSim-8255c72075ab3541e8b6cfa7facb4e016157a905.zip |
Merge pull request #156 from rahulp13/master
ported GUI to PyQt5; platform independent paths; launch ngspice through mintty on Win OS
Diffstat (limited to 'src/frontEnd/Workspace.py')
-rw-r--r-- | src/frontEnd/Workspace.py | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index 6940da59..58f56ce5 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -11,19 +11,19 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 05 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Saturday 25 July 2020 # ========================================================================= -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets from configuration.Appconfig import Appconfig import time import os import json -class Workspace(QtGui.QWidget): +class Workspace(QtWidgets.QWidget): """ This class creates UI for WorkSpace selection window. @@ -43,29 +43,30 @@ class Workspace(QtGui.QWidget): def initWorkspace(self): - self.mainwindow = QtGui.QVBoxLayout() - self.split = QtGui.QSplitter() + self.mainwindow = QtWidgets.QVBoxLayout() + self.split = QtWidgets.QSplitter() self.split.setOrientation(QtCore.Qt.Vertical) - self.grid = QtGui.QGridLayout() - self.note = QtGui.QTextEdit(self) - self.workspace_label = QtGui.QLabel(self) - self.workspace_loc = QtGui.QLineEdit(self) - + self.grid = QtWidgets.QGridLayout() + self.note = QtWidgets.QTextEdit(self) self.note.append(self.obj_appconfig.workspace_text) + self.note.setReadOnly(True) + + self.workspace_label = QtWidgets.QLabel(self) self.workspace_label.setText("Workspace:") + self.workspace_loc = QtWidgets.QLineEdit(self) self.workspace_loc.setText(self.obj_appconfig.home) # Buttons - self.browsebtn = QtGui.QPushButton('Browse') + self.browsebtn = QtWidgets.QPushButton('Browse') self.browsebtn.clicked.connect(self.browseLocation) - self.okbtn = QtGui.QPushButton('OK') + self.okbtn = QtWidgets.QPushButton('OK') self.okbtn.clicked.connect(self.createWorkspace) - self.cancelbtn = QtGui.QPushButton('Cancel') + self.cancelbtn = QtWidgets.QPushButton('Cancel') self.cancelbtn.clicked.connect(self.defaultWorkspace) # Checkbox - self.chkbox = QtGui.QCheckBox('Set Default', self) + self.chkbox = QtWidgets.QCheckBox('Set Default', self) self.chkbox.setCheckState(int(self.obj_appconfig.workspace_check)) # Layout @@ -81,8 +82,13 @@ class Workspace(QtGui.QWidget): self.setMaximumSize(4000, 200) self.setWindowTitle("eSim") self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) - self.note.setReadOnly(True) - self.setWindowIcon(QtGui.QIcon('images/logo.png')) + self.setWindowModality(2) + + init_path = '../../' + if os.name == 'nt': + init_path = '' + + self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.setLayout(self.grid) def defaultWorkspace(self): @@ -101,13 +107,13 @@ class Workspace(QtGui.QWidget): ) var_appView.show() - time.sleep(1) + time.sleep(1.5) var_appView.splash.close() def close(self, *args, **kwargs): self.window_open_close = 1 self.close_var = 1 - return QtGui.QWidget.close(self, *args, **kwargs) + return QtWidgets.QWidget.close(self, *args, **kwargs) def returnWhetherClickedOrNot(self, appView): global var_appView @@ -161,12 +167,12 @@ class Workspace(QtGui.QWidget): ) var_appView.show() - time.sleep(1) + time.sleep(1.5) var_appView.splash.close() def browseLocation(self): print("Function : Browse Location") - self.workspace_directory = QtGui.QFileDialog.getExistingDirectory( + self.workspace_directory = QtWidgets.QFileDialog.getExistingDirectory( self, "Browse Location", os.path.expanduser("~") ) self.workspace_loc.setText(self.workspace_directory) |