Commit 09a1cc8e authored by Dmitry Kazakov's avatar Dmitry Kazakov

[bugfix] Connect KisPaintOpBox to the resource manager in constructor

That fixes initialization of the toolbox sliders with correct
values of the lastly used preset. The problem was caused by
the fact that this preset was initialized in cold initialization
of slotInputDeviceChanged(), but the paintop box was not
connected to the resource manager at that time. Calling
restorePreset() later didn't help because the resource manager
already had this preset installed, therefore it didn't emit
any signals again.
parent 232df0a4
......@@ -305,9 +305,6 @@ KisViewManager::KisViewManager(QWidget *parent, KActionCollection *_actionCollec
connect(&d->nodeManager, SIGNAL(sigNodeActivated(KisNodeSP)),
resourceProvider(), SLOT(slotNodeActivated(KisNodeSP)));
connect(resourceProvider()->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
d->controlFrame.paintopBox(), SLOT(slotCanvasResourceChanged(int,QVariant)));
connect(KisPart::instance(), SIGNAL(sigViewAdded(KisView*)), SLOT(slotViewAdded(KisView*)));
connect(KisPart::instance(), SIGNAL(sigViewRemoved(KisView*)), SLOT(slotViewRemoved(KisView*)));
......
......@@ -482,6 +482,8 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
connect(m_favoriteResourceManager, SIGNAL(sigEnableChangeColor(bool)), m_resourceProvider, SLOT(slotResetEnableFGChange(bool)));
connect(view->mainWindow(), SIGNAL(themeChanged()), this, SLOT(slotUpdateSelectionIcon()));
connect(m_resourceProvider->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
this, SLOT(slotCanvasResourceChanged(int,QVariant)));
slotInputDeviceChanged(KoToolManager::instance()->currentInputDevice());
......@@ -537,9 +539,8 @@ KisPaintopBox::~KisPaintopBox()
void KisPaintopBox::restoreResource(KoResource* resource)
{
KisPaintOpPreset* preset = dynamic_cast<KisPaintOpPreset*>(resource);
//qDebug() << "restoreResource" << resource << preset;
if (preset) {
setCurrentPaintop(preset);
......
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