disable vignetting or distortion correction checkboxes if the selected lensfun profile doesn't support them
Patch by heckflosse
This commit is contained in:
parent
fea0fbe776
commit
2d1cca8cbb
@ -215,6 +215,24 @@ float LFLens::getCropFactor() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LFLens::hasVignettingCorrection() const
|
||||||
|
{
|
||||||
|
if (data_) {
|
||||||
|
return data_->CalibVignetting;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LFLens::hasDistortionCorrection() const
|
||||||
|
{
|
||||||
|
if (data_) {
|
||||||
|
return data_->CalibDistortion;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LFDatabase
|
// LFDatabase
|
||||||
|
@ -76,6 +76,8 @@ public:
|
|||||||
Glib::ustring getLens() const;
|
Glib::ustring getLens() const;
|
||||||
Glib::ustring getDisplayString() const { return getLens(); }
|
Glib::ustring getDisplayString() const { return getLens(); }
|
||||||
float getCropFactor() const;
|
float getCropFactor() const;
|
||||||
|
bool hasVignettingCorrection() const;
|
||||||
|
bool hasDistortionCorrection() const;
|
||||||
private:
|
private:
|
||||||
friend class LFDatabase;
|
friend class LFDatabase;
|
||||||
const lfLens *data_;
|
const lfLens *data_;
|
||||||
|
@ -250,6 +250,8 @@ void LensProfilePanel::updateLensfunWarning()
|
|||||||
if (l.getCropFactor() - c.getCropFactor() >= 0.01) {
|
if (l.getCropFactor() - c.getCropFactor() >= 0.01) {
|
||||||
warning->show();
|
warning->show();
|
||||||
}
|
}
|
||||||
|
ckbUseVign->set_sensitive(l.hasVignettingCorrection());
|
||||||
|
ckbUseDist->set_sensitive(l.hasDistortionCorrection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user