Bug 394261

Summary: API: Loading documents in batchmode still show dialogs.
Product: [Applications] krita Reporter: Jeroen Hoolmans <jhoolmans>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 4.0.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Proposed patch to set documents
Sample low alpha exr (16-bit float)

Description Jeroen Hoolmans 2018-05-14 20:51:25 UTC
Created attachment 112657 [details]
Proposed patch to set documents

Loading certain EXR files still show the alpha modified warning while opening.
It listens to the Documents fileBatchmode, but the api won't let you load a file through a Document object.

Tested with:

from krita import Krita
kt = Krita.instance()
kt.setBatchmode(True)
doc = kt.openDocument("file_with_low_alphas.exr")
kt.setBatchmode(False)


The supplied patch will set the Documents fileBatchmode to match active Krita batchmode() before loading, and sets it back to false when done.
Comment 1 Jeroen Hoolmans 2018-05-14 20:56:37 UTC
Created attachment 112658 [details]
Sample low alpha exr (16-bit float)
Comment 2 Halla Rempt 2018-05-15 08:14:18 UTC
Git commit 65074c27027e58fb61df8162b08aa56e5089e98c by Boudewijn Rempt.
Committed on 15/05/2018 at 08:12.
Pushed by rempt into branch 'master'.

Also obey batchmode when loading a document from libkis
Patch by Jeroen Hoolmans, thanks!

M  +2    -0    libs/libkis/Krita.cpp

https://commits.kde.org/krita/65074c27027e58fb61df8162b08aa56e5089e98c
Comment 3 Halla Rempt 2018-05-16 18:27:29 UTC
Git commit 8896a01c0f5d702113545991e5d02ab446903cce by Boudewijn Rempt.
Committed on 16/05/2018 at 18:19.
Pushed by rempt into branch 'krita/4.0'.

Also obey batchmode when loading a document from libkis
Patch by Jeroen Hoolmans, thanks!

(cherry picked from commit 65074c27027e58fb61df8162b08aa56e5089e98c)

M  +2    -0    libs/libkis/Krita.cpp

https://commits.kde.org/krita/8896a01c0f5d702113545991e5d02ab446903cce