mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-14 18:02:23 +12:00
Do not prompt "Save project?" when _Save on quit_ setting enabled
See PR #615 The Travis CI tests began failing after merging Pull Request #583. Log snippet: ---------------------------------------------------------------------- ... Ref not implemented PASSED manuskript/tests/ui/test_welcome.py::test_autoLoad QXcbConnection: XCB error: 8 (BadMatch), sequence: 613, resource id: 2097162, major code: 42 (SetInputFocus), minor code: 0 QXcbConnection: XCB error: 8 (BadMatch), sequence: 619, resource id: 2097168, major code: 42 (SetInputFocus), minor code: 0 QXcbConnection: XCB error: 8 (BadMatch), sequence: 625, resource id: 2097171, major code: 42 (SetInputFocus), minor code: 0 ---------------------------------------------------------------------- When running "pytest -vs" locally, which is a command used in our .travis.yml file, a dialog to "Save project?" is displayed. Because the test scripts use the "saveOnQuit" default setting of *enabled*, the "Save project?" dialog should not be displayed. In other words when a call is made to close the project, a "Save project?" dialog is incorrectly displayed because the dirtyProject flag is set, but so too is saveOnQuit set to True. What should happen is an automatic save with no prompt. This PR fixes this logic so that the Travis CI test suite completes successfully.
This commit is contained in:
parent
34f84126df
commit
f4c8108b28
|
@ -682,8 +682,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
|
||||
# Make sure data is saved.
|
||||
if not self.handleUnsavedChanges():
|
||||
return # user
|
||||
if (self.projectDirty and settings.saveOnQuit == True):
|
||||
self.saveDatas()
|
||||
elif not self.handleUnsavedChanges():
|
||||
return # user cancelled action
|
||||
|
||||
# Close open tabs in editor
|
||||
self.mainEditor.closeAllTabs()
|
||||
|
|
Loading…
Reference in a new issue