Commit ccc25f2e authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix crash when converting color space with OCIO enabled

The crash happened because of recursive entrance into
KisOpenGLImageTextures when a message box was opened. This
patch removes a message box and adds nitification with a floating
message.

BUG:411045
parent d0602e63
......@@ -157,6 +157,10 @@ KisOpenGLCanvas2::KisOpenGLCanvas2(KisCanvas2 *canvas,
colorConverter->renderingIntent(),
colorConverter->conversionFlags());
connect(d->openGLImageTextures.data(),
SIGNAL(sigShowFloatingMessage(QString, int, bool)),
SLOT(slotShowFloatingMessage(QString, int, bool)));
setAcceptDrops(true);
setAutoFillBackground(false);
......@@ -898,6 +902,11 @@ void KisOpenGLCanvas2::slotPixelGridModeChanged()
update();
}
void KisOpenGLCanvas2::slotShowFloatingMessage(const QString &message, int timeout, bool priority)
{
canvas()->imageView()->showFloatingMessage(message, QIcon(), timeout, priority ? KisFloatingMessage::High : KisFloatingMessage::Medium);
}
QVariant KisOpenGLCanvas2::inputMethodQuery(Qt::InputMethodQuery query) const
{
return processInputMethodQuery(query);
......
......@@ -108,6 +108,9 @@ public Q_SLOTS:
void slotConfigChanged();
void slotPixelGridModeChanged();
private Q_SLOTS:
void slotShowFloatingMessage(const QString &message, int timeout, bool priority);
protected: // KisCanvasWidgetBase
bool callFocusNextPrevChild(bool next) override;
......
......@@ -572,12 +572,11 @@ void KisOpenGLImageTextures::updateTextureFormat()
KisConfig::OcioColorManagementMode cm = cfg.ocioColorManagementMode();
if (cm != KisConfig::INTERNAL) {
QMessageBox::critical(0,
i18nc("@title:window", "Krita"),
i18n("You enabled OpenColorIO based color management, but your image is not an RGB image.\n"
"OpenColorIO-based color management only works with RGB images.\n"
"Please check the settings in the LUT docker.\n"
"OpenColorIO will now be deactivated."));
emit sigShowFloatingMessage(
i18n("You enabled OpenColorIO based color management, but your image is not an RGB image.\n"
"OpenColorIO-based color management only works with RGB images.\n"
"Please check the settings in the LUT docker.\n"
"OpenColorIO will now be deactivated."), 5000, true);
}
warnUI << "WARNING: Internal color management was forcibly enabled";
......
......@@ -40,11 +40,13 @@ typedef QSharedPointer<KisTextureTileInfoPool> KisTextureTileInfoPoolSP;
class KisProofingConfiguration;
typedef QSharedPointer<KisProofingConfiguration> KisProofingConfigurationSP;
/**
* A set of OpenGL textures that contains the projection of a KisImage.
*/
class KRITAUI_EXPORT KisOpenGLImageTextures : public KisShared
class KRITAUI_EXPORT KisOpenGLImageTextures : public QObject, public KisShared
{
Q_OBJECT
public:
/**
* Obtain a KisOpenGLImageTextures object for the given image.
......@@ -151,6 +153,9 @@ public:
KisOpenGLUpdateInfoBuilder& updateInfoBuilder();
Q_SIGNALS:
void sigShowFloatingMessage(const QString &message, int timeout, bool priority);
protected:
KisOpenGLImageTextures(KisImageWSP image, const KoColorProfile *monitorProfile,
......
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