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