summaryrefslogtreecommitdiff
path: root/src/subcircuit/newSub.py
diff options
context:
space:
mode:
authorRahul P2020-08-08 19:16:28 +0530
committerGitHub2020-08-08 19:16:28 +0530
commit8255c72075ab3541e8b6cfa7facb4e016157a905 (patch)
treee86226cc6a609e54133b527ad71912996360722b /src/subcircuit/newSub.py
parent175208c2553bde875968a9bc53176b6039ba9360 (diff)
parent7871e58975d75eb2b02928f7a48d29113bebeb2b (diff)
downloadeSim-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/subcircuit/newSub.py')
-rw-r--r--src/subcircuit/newSub.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py
index 5e98d24a..92dc1d29 100644
--- a/src/subcircuit/newSub.py
+++ b/src/subcircuit/newSub.py
@@ -1,4 +1,4 @@
-from PyQt4 import QtGui
+from PyQt5 import QtWidgets
from projManagement.Validation import Validation
from configuration.Appconfig import Appconfig
from projManagement import Worker
@@ -6,7 +6,7 @@ import os
# This class is called when User creates new Project.
-class NewSub(QtGui.QWidget):
+class NewSub(QtWidgets.QWidget):
"""
Contains functions to check :
- Name of project should not be blank.
@@ -27,11 +27,16 @@ class NewSub(QtGui.QWidget):
- Name can not be empty.
- File name already exists.
"""
+
+ init_path = '../../'
+ if os.name == 'nt':
+ init_path = ''
+
self.create_schematic = subName
# Checking if Workspace already exist or not
self.schematic_path = (
os.path.join(
- os.path.abspath('library'),
+ os.path.abspath(init_path + 'library'),
'SubcircuitLibrary',
self.create_schematic))
@@ -54,7 +59,7 @@ class NewSub(QtGui.QWidget):
self.obj_workThread.start()
self.close()
except BaseException:
- self.msg = QtGui.QErrorMessage(self)
+ self.msg = QtWidgets.QErrorMessage(self)
self.msg.setModal(True)
self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
@@ -67,7 +72,7 @@ class NewSub(QtGui.QWidget):
= self.schematic_path
elif self.reply == "CHECKEXIST":
- self.msg = QtGui.QErrorMessage(self)
+ self.msg = QtWidgets.QErrorMessage(self)
self.msg.setModal(True)
self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
@@ -78,7 +83,7 @@ class NewSub(QtGui.QWidget):
self.msg.exec_()
elif self.reply == "CHECKNAME":
- self.msg = QtGui.QErrorMessage(self)
+ self.msg = QtWidgets.QErrorMessage(self)
self.msg.setModal(True)
self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
@@ -87,7 +92,7 @@ class NewSub(QtGui.QWidget):
self.msg.exec_()
elif self.reply == "NONE":
- self.msg = QtGui.QErrorMessage(self)
+ self.msg = QtWidgets.QErrorMessage(self)
self.msg.setModal(True)
self.msg.setWindowTitle("Error Message")
self.msg.showMessage('The subcircuit name cannot be empty')