From 779eac4d604c082442ba9ca72a7c23509a78e5f5 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 14 Dec 2020 21:08:43 +0530 Subject: changed QFileDialog separator and handled crash exception for all input fields --- src/projManagement/newProject.py | 3 +++ src/projManagement/openProject.py | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/projManagement') diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index ad29dc76..278cfbe3 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -124,6 +124,7 @@ class NewProjectInfo(QtWidgets.QWidget): ' existing project' ) self.msg.exec_() + return None, None elif self.reply == "CHECKNAME": self.msg = QtWidgets.QErrorMessage(self) @@ -132,6 +133,7 @@ class NewProjectInfo(QtWidgets.QWidget): self.msg.showMessage( 'The project name should not contain space between them') self.msg.exec_() + return None, None elif self.reply == "NONE": self.msg = QtWidgets.QErrorMessage(self) @@ -139,6 +141,7 @@ class NewProjectInfo(QtWidgets.QWidget): self.msg.setWindowTitle("Error Message") self.msg.showMessage('The project name cannot be empty') self.msg.exec_() + return None, None def cancelProject(self): self.close() diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py index 04944d29..c5bc2dec 100644 --- a/src/projManagement/openProject.py +++ b/src/projManagement/openProject.py @@ -16,7 +16,7 @@ # REVISION: Sunday 26 July 2020 # ========================================================================= -from PyQt5 import QtWidgets +from PyQt5 import QtWidgets, QtCore from .Validation import Validation from configuration.Appconfig import Appconfig import os @@ -45,8 +45,11 @@ class OpenProjectInfo(QtWidgets.QWidget): """ self.obj_Appconfig = Appconfig() self.openDir = self.obj_Appconfig.default_workspace["workspace"] - self.projDir = QtWidgets.QFileDialog.getExistingDirectory( - self, "open", self.openDir) + self.projDir = QtCore.QDir.toNativeSeparators( + QtWidgets.QFileDialog.getExistingDirectory( + self, "open", self.openDir + ) + ) if self.obj_validation.validateOpenproj(self.projDir): self.obj_Appconfig.current_project['ProjectName'] = str( -- cgit