Commit f5a8279f authored by David Redondo's avatar David Redondo 🏎
Browse files

Merge branch 'release/19.12'

parents 4370c548 a9f1e855
......@@ -157,7 +157,7 @@ void KSMainWindow::init()
mSendToButton->setAutoDefault(false);
mDialogButtonBox->addButton(mSendToButton, QDialogButtonBox::ActionRole);
mClipboardButton->setDefaultAction(KStandardAction::copy(ExportManager::instance(), &ExportManager::doCopyToClipboard, this));
mClipboardButton->setDefaultAction(KStandardAction::copy(this, &KSMainWindow::copy, this));
mClipboardButton->setText(i18n("Copy to Clipboard"));
mClipboardButton->setToolTip(i18n("Copy the current screenshot image to the clipboard."));
mClipboardButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
......@@ -462,11 +462,18 @@ void KSMainWindow::showImageSharedFeedback(bool error, const QString &message)
}
}
void KSMainWindow::copy()
{
const bool quitChecked = SpectacleConfig::instance()->quitAfterSaveOrCopyChecked();
ExportManager::instance()->doCopyToClipboard();
if (quitChecked) {
quit(QuitBehavior::QuitExternally);
}
}
void KSMainWindow::imageCopied()
{
SpectacleConfig::instance()->quitAfterSaveOrCopyChecked()
? quit()
: showInlineMessage(i18n("The screenshot has been copied to the clipboard."),
showInlineMessage(i18n("The screenshot has been copied to the clipboard."),
KMessageWidget::Information);
}
......
......@@ -97,6 +97,7 @@ class KSMainWindow: public QDialog
private:
void keyPressEvent(QKeyEvent *event) override;
void copy();
KSWidget *mKSWidget;
QFrame *mDivider;
......
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