Remember background type in Tools->Save picture dialog

This commit is contained in:
Yorik van Havre
2018-05-18 10:46:21 -03:00
parent fca8034b18
commit 5e1e1260c8
3 changed files with 13 additions and 0 deletions

View File

@@ -1732,6 +1732,7 @@ void StdViewScreenShot::activated(int iMsg)
Base::Reference<ParameterGrp> hExt = App::GetApplication().GetUserParameter().GetGroup("BaseApp")
->GetGroup("Preferences")->GetGroup("General");
QString ext = QString::fromLatin1(hExt->GetASCII("OffscreenImageFormat").c_str());
int backtype = hExt->GetInt("OffscreenImageBackground",0);
QStringList filter;
QString selFilter;
@@ -1754,6 +1755,7 @@ void StdViewScreenShot::activated(int iMsg)
DlgSettingsImageImp* opt = new DlgSettingsImageImp(&fd);
SbVec2s sz = vp.getWindowSize();
opt->setImageSize((int)sz[0], (int)sz[1]);
opt->setBackgroundType(backtype);
fd.setOptionsWidget(FileOptionsDialog::ExtensionRight, opt);
fd.setConfirmOverwrite(true);
@@ -1794,6 +1796,7 @@ void StdViewScreenShot::activated(int iMsg)
case 3: background="Transparent"; break;
default: background="Current"; break;
}
hExt->SetInt("OffscreenImageBackground",opt->backgroundType());
QString comment = opt->comment();
if (!comment.isEmpty()) {

View File

@@ -139,6 +139,15 @@ int DlgSettingsImageImp::backgroundType() const
return comboBackground->currentIndex();
}
/**
* Sets the image size to (\a w, \a h).
*/
void DlgSettingsImageImp::setBackgroundType(int t)
{
if ( t < comboBackground->count() )
comboBackground->setCurrentIndex(t);
}
bool DlgSettingsImageImp::addWatermark() const
{
return checkWatermark->isChecked();

View File

@@ -57,6 +57,7 @@ public:
//@{
QString comment() const;
int backgroundType() const;
void setBackgroundType( int );
bool addWatermark() const;
//@}