Commit 5bbc507b authored by Dmitry Kazakov's avatar Dmitry Kazakov

Remove the loop in updating the paintop editor

The bug is fixed now, but it needs extensive testing

Ref T3578
parent ee3a2e09
......@@ -102,7 +102,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
, m_dirtyPresetsEnabled(false)
, m_eraserBrushSizeEnabled(false)
, m_eraserBrushOpacityEnabled(false)
, m_presetUpdateCompressor(200, KisSignalCompressor::FIRST_ACTIVE)
{
Q_ASSERT(view != 0);
......@@ -433,7 +432,7 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
m_presetsPopup = new KisPaintOpPresetsPopup(m_resourceProvider);
m_brushEditorPopupButton->setPopupWidget(m_presetsPopup);
m_presetsPopup->switchDetached(false);
connect(m_presetsPopup, SIGNAL(brushEditorShown()), SLOT(slotUpdateOptionsWidget()));
connect(m_presetsPopup, SIGNAL(brushEditorShown()), SLOT(slotUpdateOptionsWidgetPopup()));
connect(m_viewManager->mainWindow(), SIGNAL(themeChanged()), m_presetsPopup, SLOT(updateThemedIcons()));
m_presetsChooserPopup = new KisPaintOpPresetsChooserPopup();
......@@ -614,7 +613,6 @@ void KisPaintopBox::setCurrentPaintop(const KoID& paintop, KisPaintOpPresetSP pr
Q_ASSERT(m_optionWidget && m_presetSelectorPopupButton);
m_presetConnections.addConnection(m_optionWidget, SIGNAL(sigConfigurationUpdated()), this, SLOT(slotGuiChangedCurrentPreset()));
m_presetConnections.addConnection(&m_presetUpdateCompressor, SIGNAL(timeout()), this, SLOT(slotUpdateOptionsWidget()));
m_presetConnections.addConnection(m_optionWidget, SIGNAL(sigSaveLockedConfig(KisPropertiesConfigurationSP)), this, SLOT(slotSaveLockedOptionToPreset(KisPropertiesConfigurationSP)));
m_presetConnections.addConnection(m_optionWidget, SIGNAL(sigDropLockedConfig(KisPropertiesConfigurationSP)), this, SLOT(slotDropLockedOption(KisPropertiesConfigurationSP)));
......@@ -631,27 +629,18 @@ void KisPaintopBox::setCurrentPaintop(const KoID& paintop, KisPaintOpPresetSP pr
// by the new colorspace.
dbgKrita << "current paintop " << paintop.name() << " was not set, not supported by colorspace";
}
// preset -> compressor
m_presetConnections.addConnection(
preset->updateProxy(), SIGNAL(sigSettingsChanged()),
&m_presetUpdateCompressor, SLOT(start()));
}
void KisPaintopBox::slotUpdateOptionsWidget()
void KisPaintopBox::slotUpdateOptionsWidgetPopup()
{
KisPaintOpPresetSP preset = m_resourceProvider->currentPreset();
KIS_SAFE_ASSERT_RECOVER_RETURN(preset);
KIS_SAFE_ASSERT_RECOVER_RETURN(m_optionWidget);
if (m_optionWidget->isVisible()) {
m_optionWidget->setConfigurationSafe(preset->settings().data());
}
m_optionWidget->setConfigurationSafe(preset->settings());
m_presetsPopup->resourceSelected(preset.data());
m_presetsPopup->updateViewSettings();
}
KisPaintOpPresetSP KisPaintopBox::defaultPreset(const KoID& paintOp)
......
......@@ -171,7 +171,7 @@ private Q_SLOTS:
void slotHideDecorationMirrorX(bool);
void slotHideDecorationMirrorY(bool);
void slotUpdateOptionsWidget();
void slotUpdateOptionsWidgetPopup();
private:
KisCanvasResourceProvider* m_resourceProvider;
......@@ -248,7 +248,6 @@ private:
bool m_eraserBrushOpacityEnabled;
KisSignalAutoConnectionsStore m_presetConnections;
KisSignalCompressor m_presetUpdateCompressor;
};
#endif //KIS_PAINTOP_BOX_H_
......@@ -91,12 +91,10 @@ QWidget* KisDynamicSensorDrawingAngle::createConfigurationWidget(QWidget* parent
connect(m_chkLockedMode, SIGNAL(stateChanged(int)), SLOT(setLockedAngleMode(int)));
connect(m_chkLockedMode, SIGNAL(stateChanged(int)), SLOT(updateGUI()));
connect(m_chkLockedMode, SIGNAL(stateChanged(int)), ss, SIGNAL(parametersChanged()));
m_chkFanCorners = new QCheckBox(i18n("Fan Corners"), w);
connect(m_chkFanCorners, SIGNAL(stateChanged(int)), SLOT(setFanCornersEnabled(int)));
connect(m_chkFanCorners, SIGNAL(stateChanged(int)), ss, SIGNAL(parametersChanged()));
m_chkFanCorners->setChecked(m_fanCornersEnabled);
......@@ -106,7 +104,6 @@ QWidget* KisDynamicSensorDrawingAngle::createConfigurationWidget(QWidget* parent
m_intFanCornersStep->setSuffix(i18n("°"));
connect(m_intFanCornersStep, SIGNAL(valueChanged(int)), SLOT(setFanCornersStep(int)));
connect(m_intFanCornersStep, SIGNAL(valueChanged(int)), ss, SIGNAL(parametersChanged()));
m_intFanCornersStep->setValue(m_fanCornersStep);
......@@ -116,7 +113,6 @@ QWidget* KisDynamicSensorDrawingAngle::createConfigurationWidget(QWidget* parent
angleOffset->setSuffix(i18n("°"));
connect(angleOffset, SIGNAL(valueChanged(int)), SLOT(setAngleOffset(int)));
connect(angleOffset, SIGNAL(valueChanged(int)), ss, SIGNAL(parametersChanged()));
angleOffset->setValue(m_angleOffset);
......@@ -129,6 +125,11 @@ QWidget* KisDynamicSensorDrawingAngle::createConfigurationWidget(QWidget* parent
updateGUI();
connect(angleOffset, SIGNAL(valueChanged(int)), ss, SIGNAL(parametersChanged()));
connect(m_chkLockedMode, SIGNAL(stateChanged(int)), ss, SIGNAL(parametersChanged()));
connect(m_chkFanCorners, SIGNAL(stateChanged(int)), ss, SIGNAL(parametersChanged()));
connect(m_intFanCornersStep, SIGNAL(valueChanged(int)), ss, SIGNAL(parametersChanged()));
w->setLayout(l);
return w;
}
......
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