Commit c22deff0 authored by Bharadwaj Raju's avatar Bharadwaj Raju 📚 Committed by Nate Graham
Browse files

Disable Annotate button when there's no image

Clicking it when there's no image crashes Spectacle.
parent 36fb0817
......@@ -394,6 +394,9 @@ void KSMainWindow::setScreenshotAndShow(const QPixmap &pixmap)
mExportMenu->imageUpdated();
setWindowTitle(i18nc("@title:window Unsaved Screenshot", "Unsaved[*]"));
setWindowModified(true);
#ifdef KIMAGEANNOTATOR_FOUND
mAnnotateButton->setEnabled(true);
#endif
} else {
restoreWindowTitle();
}
......@@ -538,6 +541,9 @@ void KSMainWindow::screenshotFailed()
showInlineMessage(i18n("Could not take a screenshot. Please report this bug here: <a href=\"https://bugs.kde.org/enter_bug.cgi?product=Spectacle\">create "
"a spectacle bug</a>"),
KMessageWidget::Warning);
#ifdef KIMAGEANNOTATOR_FOUND
mAnnotateButton->setEnabled(false);
#endif
}
void KSMainWindow::setPlaceholderTextOnLaunch()
......@@ -610,6 +616,9 @@ void KSMainWindow::restoreWindowTitle()
} else {
setPlaceholderTextOnLaunch();
}
#ifdef KIMAGEANNOTATOR_FOUND
mAnnotateButton->setEnabled(mKSWidget->isScreenshotSet());
#endif
}
}
......
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