Commit 65caf817 authored by Halla Rempt's avatar Halla Rempt

BUG:373846 Fix creating a brush from a stamp

If you'd create an image, and then without changing brush preset
would try to use that image as a new stamp, it would fail because
the preset editor was initialized before the image was added to
to the viewmanager.
parent e51b5f13
...@@ -320,7 +320,7 @@ void KisViewManager::slotViewAdded(KisView *view) ...@@ -320,7 +320,7 @@ void KisViewManager::slotViewAdded(KisView *view)
{ {
d->inputManager.addTrackedCanvas(view->canvasBase()); d->inputManager.addTrackedCanvas(view->canvasBase());
if (viewCount() == 0) { if (viewCount() != 0) {
d->statusBar.showAllStatusBarItems(); d->statusBar.showAllStatusBarItems();
} }
} }
...@@ -350,6 +350,18 @@ void KisViewManager::setCurrentView(KisView *view) ...@@ -350,6 +350,18 @@ void KisViewManager::setCurrentView(KisView *view)
d->viewConnections.clear(); d->viewConnections.clear();
} }
d->softProof->setChecked(view->softProofing());
d->gamutCheck->setChecked(view->gamutCheck());
QPointer<KisView>imageView = qobject_cast<KisView*>(view);
if (imageView) {
// Wait for the async image to have loaded
KisDocument* doc = view->document();
// connect(canvasController()->proxyObject, SIGNAL(documentMousePositionChanged(QPointF)), d->statusBar, SLOT(documentMousePositionChanged(QPointF)));
d->currentImageView = imageView;
// Restore the last used brush preset, color and background color. // Restore the last used brush preset, color and background color.
if (first) { if (first) {
KisConfig cfg; KisConfig cfg;
...@@ -375,17 +387,6 @@ void KisViewManager::setCurrentView(KisView *view) ...@@ -375,17 +387,6 @@ void KisViewManager::setCurrentView(KisView *view)
} }
d->softProof->setChecked(view->softProofing());
d->gamutCheck->setChecked(view->gamutCheck());
QPointer<KisView>imageView = qobject_cast<KisView*>(view);
if (imageView) {
// Wait for the async image to have loaded
KisDocument* doc = view->document();
// connect(canvasController()->proxyObject, SIGNAL(documentMousePositionChanged(QPointF)), d->statusBar, SLOT(documentMousePositionChanged(QPointF)));
d->currentImageView = imageView;
KisCanvasController *canvasController = dynamic_cast<KisCanvasController*>(d->currentImageView->canvasController()); KisCanvasController *canvasController = dynamic_cast<KisCanvasController*>(d->currentImageView->canvasController());
d->viewConnections.addUniqueConnection(&d->nodeManager, SIGNAL(sigNodeActivated(KisNodeSP)), doc->image(), SLOT(requestStrokeEndActiveNode())); d->viewConnections.addUniqueConnection(&d->nodeManager, SIGNAL(sigNodeActivated(KisNodeSP)), doc->image(), SLOT(requestStrokeEndActiveNode()));
...@@ -454,6 +455,8 @@ void KisViewManager::setCurrentView(KisView *view) ...@@ -454,6 +455,8 @@ void KisViewManager::setCurrentView(KisView *view)
resourceProvider()->slotImageSizeChanged(); resourceProvider()->slotImageSizeChanged();
resourceProvider()->slotOnScreenResolutionChanged(); resourceProvider()->slotOnScreenResolutionChanged();
Q_EMIT viewChanged(); Q_EMIT viewChanged();
} }
......
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