Commit 91d7da8c authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Make views smart enough to track softproof/gamutcheck-state.

Also add a floating message to say when the softproofing or gamutcheck
is turned on in the view. Wording may change.

Ref T2337
parent 5c48dd2c
......@@ -147,8 +147,8 @@ public:
QPointer<KisFloatingMessage> savedFloatingMessage;
KisSignalCompressor floatingMessageCompressor;
bool softProofing;
bool gamutCheck;
bool softProofing = false;
bool gamutCheck = false;
// Hmm sorry for polluting the private class with such a big inner class.
// At the beginning it was a little struct :)
......@@ -808,6 +808,45 @@ KisSelectionSP KisView::selection()
return 0;
}
void KisView::slotSoftProofing(bool softProofing)
{
d->softProofing = softProofing;
QString message;
if (softProofing){
message = i18n("Softproofing turned on.");
} else {
message = i18n("Softproofing turned off.");
}
viewManager()->showFloatingMessage(message,QIcon());
canvasBase()->slotSoftProofing(softProofing);
}
void KisView::slotGamutCheck(bool gamutCheck)
{
d->gamutCheck = gamutCheck;
QString message;
if (gamutCheck){
message = i18n("Gamut alarms turned on.");
if (!d->softProofing){
message += "\n "+i18n("But softproofing is still off.");
}
} else {
message = i18n("Gamut alarms turned off.");
}
viewManager()->showFloatingMessage(message,QIcon());
canvasBase()->slotGamutCheck(gamutCheck);
}
bool KisView::softProofing()
{
return d->softProofing;
}
bool KisView::gamutCheck()
{
return d->gamutCheck;
}
void KisView::slotLoadingFinished()
{
if (!document()) return;
......@@ -884,8 +923,3 @@ void KisView::slotImageSizeChanged(const QPointF &oldStillPoint, const QPointF &
zoomManager()->updateImageBoundsSnapping();
zoomManager()->updateGUI();
}
void KisView::setProofingOptions(bool softProofing, bool gamutCheck)
{
canvasBase()->setProofingOptions(softProofing, gamutCheck);
}
......@@ -192,6 +192,16 @@ public:
KisNodeSP currentNode() const;
KisLayerSP currentLayer() const;
KisMaskSP currentMask() const;
/**
* @brief softProofing
* @return whether or not we're softproofing in this view.
*/
bool softProofing();
/**
* @brief gamutCheck
* @return whether or not we're using gamut warnings in this view.
*/
bool gamutCheck();
/// Convenience method to get at the active selection (the
/// selection of the current layer, or, if that does not exist,
......@@ -216,6 +226,16 @@ public Q_SLOTS:
* @todo rename to something more generic
*/
void slotClearStatusText();
/**
* @brief slotSoftProofing set whether or not we're softproofing in this view.
* Will be setting the same in the canvas belonging to the view.
*/
void slotSoftProofing(bool softProofing);
/**
* @brief slotGamutCheck set whether or not we're gamutchecking in this view.
* Will be setting the same in the vans belonging to the view.
*/
void slotGamutCheck(bool gamutCheck);
bool queryClose();
......@@ -256,7 +276,6 @@ public Q_SLOTS:
private:
void setProofingOptions(bool softProofing, bool gamutCheck);
class Private;
Private * const d;
......
......@@ -358,6 +358,9 @@ void KisViewManager::setCurrentView(KisView *view)
}
d->softProof->setChecked(view->softProofing());
d->gamutCheck->setChecked(view->gamutCheck());
QPointer<KisView>imageView = qobject_cast<KisView*>(view);
if (imageView) {
......@@ -387,8 +390,8 @@ void KisViewManager::setCurrentView(KisView *view)
d->viewConnections.addUniqueConnection(d->zoomIn, SIGNAL(triggered()), imageView->zoomController()->zoomAction(), SLOT(zoomIn()));
d->viewConnections.addUniqueConnection(d->zoomOut, SIGNAL(triggered()), imageView->zoomController()->zoomAction(), SLOT(zoomOut()));
d->viewConnections.addUniqueConnection(d->softProof, SIGNAL(toggled(bool)), d->currentImageView->canvasBase(), SLOT(slotSoftProofing(bool)) );
d->viewConnections.addUniqueConnection(d->gamutCheck, SIGNAL(toggled(bool)), d->currentImageView->canvasBase(), SLOT(slotGamutCheck(bool)) );
d->viewConnections.addUniqueConnection(d->softProof, SIGNAL(toggled(bool)), view, SLOT(slotSoftProofing(bool)) );
d->viewConnections.addUniqueConnection(d->gamutCheck, SIGNAL(toggled(bool)), view, SLOT(slotGamutCheck(bool)) );
imageView->zoomManager()->setShowRulers(d->showRulersAction->isChecked());
imageView->zoomManager()->setRulersTrackMouse(d->rulersTrackMouseAction->isChecked());
......
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