Gui: set image creation method in settings dialog

This commit is contained in:
wmayer
2020-01-08 12:49:56 +01:00
parent 31e2bbe3a9
commit 8e5151002b
4 changed files with 279 additions and 166 deletions

View File

@@ -1730,6 +1730,10 @@ void StdViewScreenShot::activated(int iMsg)
QString ext = QString::fromLatin1(hExt->GetASCII("OffscreenImageFormat").c_str());
int backtype = hExt->GetInt("OffscreenImageBackground",0);
Base::Reference<ParameterGrp> methodGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View");
QByteArray method = methodGrp->GetASCII("SavePicture").c_str();
QStringList filter;
QString selFilter;
for (QStringList::Iterator it = formats.begin(); it != formats.end(); ++it) {
@@ -1752,6 +1756,7 @@ void StdViewScreenShot::activated(int iMsg)
SbVec2s sz = vp.getWindowSize();
opt->setImageSize((int)sz[0], (int)sz[1]);
opt->setBackgroundType(backtype);
opt->setMethod(method);
fd.setOptionsWidget(FileOptionsDialog::ExtensionRight, opt);
fd.setConfirmOverwrite(true);
@@ -1783,6 +1788,9 @@ void StdViewScreenShot::activated(int iMsg)
hExt->SetASCII("OffscreenImageFormat", (const char*)format.toLatin1());
method = opt->method();
methodGrp->SetASCII("SavePicture", method.constData());
// which background chosen
const char* background;
switch(opt->backgroundType()){