Commit 20c5907f authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Fix KisDlgFilter to always show the name of the currently selected filter

REVIEW: 117949

Thanks boud for review
parent 034f6bee
......@@ -78,7 +78,7 @@ KisDlgFilter::KisDlgFilter(KisView2 *view, KisNodeSP node, KisFilterManager *fil
connect(d->uiFilterDialog.buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(d->uiFilterDialog.checkBoxPreview, SIGNAL(stateChanged(int)), SLOT(previewCheckBoxChange(int)));
connect(d->uiFilterDialog.filterSelection, SIGNAL(configurationChanged()), SLOT(updatePreview()));
connect(d->uiFilterDialog.filterSelection, SIGNAL(configurationChanged()), SLOT(filterSelectionChanged()));
connect(this, SIGNAL(finished(int)), SLOT(close()));
KConfigGroup group(KGlobal::config(), "filterdialog");
......@@ -93,12 +93,17 @@ KisDlgFilter::~KisDlgFilter()
void KisDlgFilter::setFilter(KisFilterSP f)
{
Q_ASSERT(f);
setWindowTitle(f->name());
setDialogTitle(f);
d->uiFilterDialog.filterSelection->setFilter(f);
d->uiFilterDialog.pushButtonCreateMaskEffect->setEnabled(f->supportsAdjustmentLayers());
updatePreview();
}
void KisDlgFilter::setDialogTitle(KisFilterSP filter)
{
setWindowTitle(filter.isNull() ? i18n("Filter") : i18n("Filter: %1", filter->name()));
}
void KisDlgFilter::startApplyingFilter(KisSafeFilterConfigurationSP config)
{
if (!d->uiFilterDialog.filterSelection->configuration()) return;
......@@ -175,6 +180,15 @@ void KisDlgFilter::previewCheckBoxChange(int state)
group.config()->sync();
}
void KisDlgFilter::filterSelectionChanged()
{
KisFilterSP filter = d->uiFilterDialog.filterSelection->currentFilter();
setDialogTitle(filter);
d->uiFilterDialog.pushButtonCreateMaskEffect->setEnabled(filter.isNull() ? false : filter->supportsAdjustmentLayers());
updatePreview();
}
void KisDlgFilter::resizeEvent(QResizeEvent* event)
{
QDialog::resizeEvent(event);
......
......@@ -42,10 +42,6 @@ public:
void setFilter(KisFilterSP f);
public slots:
void updatePreview();
protected slots:
void apply();
......@@ -56,10 +52,14 @@ protected slots:
void previewCheckBoxChange(int state);
void filterSelectionChanged();
virtual void resizeEvent(QResizeEvent* );
private:
void startApplyingFilter(KisSafeFilterConfigurationSP config);
void setDialogTitle(KisFilterSP f);
void updatePreview();
private:
struct Private;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment