Small bug fixes - making some popups visible & ensuring that all file selection prompts start at the home directory.

This commit is contained in:
AccentuSoft
2022-01-18 22:16:05 +02:00
parent 8c7e5b0400
commit ff8c37e4a8
2 changed files with 13 additions and 4 deletions

View File

@@ -1658,11 +1658,17 @@ class ImportLinkEntitiesFromCSVFile(QtWidgets.QDialog):
def confirmThatPrimaryFieldIsMapped(self):
primaryField = self.parent().parent().RESOURCEHANDLER.getPrimaryFieldForEntityType(
self.entityTypeChoiceDropdown.currentText())
primaryFieldMapped = False
for comboBox in self.fieldMappingComboBoxes:
if comboBox.currentText() == primaryField:
self.accept()
self.parent().parent().MESSAGEHANDLER.warning('Primary field (' + primaryField +
') needs to be mapped before proceeding.')
# Just doing self.accept() here will not work.
primaryFieldMapped = True
break
if primaryFieldMapped:
self.accept()
else:
self.parent().parent().MESSAGEHANDLER.warning('Primary field (' + primaryField +
') needs to be mapped before proceeding.', popUp=True)
class ImportEntityFromCSVFile(QtWidgets.QDialog):
@@ -1781,7 +1787,7 @@ class ImportEntityFromCSVFile(QtWidgets.QDialog):
self.accept()
else:
self.parent().parent().MESSAGEHANDLER.warning('Primary field (' + primaryField +
') needs to be mapped before proceeding.')
') needs to be mapped before proceeding.', popUp=True)
class ImportFromFileDialog(QtWidgets.QDialog):

View File

@@ -118,6 +118,7 @@ class MainWindow(QtWidgets.QMainWindow):
saveAsDialog.setFileMode(QtWidgets.QFileDialog.AnyFile)
saveAsDialog.setAcceptMode(QtWidgets.QFileDialog.AcceptSave)
saveAsDialog.setStyleSheet(Stylesheets.MAIN_WINDOW_STYLESHEET)
saveAsDialog.setDirectory(str(Path.home()))
saveAsExec = saveAsDialog.exec()
if not saveAsExec:
@@ -1868,6 +1869,7 @@ class EntityPage(QtWidgets.QWizardPage):
def editPath(self):
selectedPath = QtWidgets.QFileDialog().getOpenFileName(parent=self, caption='Select New Icon',
dir=str(Path.home()),
options=QtWidgets.QFileDialog.DontUseNativeDialog,
filter="Image Files (*.png *.jpg)")[0]
if selectedPath != '':
@@ -1875,6 +1877,7 @@ class EntityPage(QtWidgets.QWizardPage):
def editAppendixPath(self):
selectedPath = QtWidgets.QFileDialog().getOpenFileName(parent=self, caption='Select New Icon',
dir=str(Path.home()),
options=QtWidgets.QFileDialog.DontUseNativeDialog,
filter="Image Files (*.png *.jpg)")[0]
if selectedPath != '':