diff --git a/doc/index.docbook b/doc/index.docbook --- a/doc/index.docbook +++ b/doc/index.docbook @@ -257,7 +257,7 @@ - Copy save location to clipboard + Copy file location to clipboard after saving When a screenshot is saved, copy the location at which the file was saved to the clipboard. You can then paste it anywhere that accepts text input. Note that you must be running a clipboard manager in order to keep the path in the clipboard after &spectacle; quits. diff --git a/src/Gui/KSMainWindow.cpp b/src/Gui/KSMainWindow.cpp --- a/src/Gui/KSMainWindow.cpp +++ b/src/Gui/KSMainWindow.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -264,6 +265,7 @@ void KSMainWindow::captureScreenshot(ImageGrabber::GrabMode mode, int timeout, bool includePointer, bool includeDecorations) { hide(); + mMessageWidget->hide(); emit newScreenshotRequest(mode, timeout, includePointer, includeDecorations); } @@ -362,8 +364,9 @@ if (message.isEmpty()) { showInlineMessage(i18n("Image shared"), KMessageWidget::Positive); } else { - showInlineMessage(i18n("You can find the shared image at: %1", message), + showInlineMessage(i18n("You can find the shared image at: %1. The link has been copied to the clipboard.", message), KMessageWidget::Positive, MessageDuration::Persistent); + QApplication::clipboard()->setText(message); } } } diff --git a/src/Gui/SettingsDialog/GeneralOptionsPage.cpp b/src/Gui/SettingsDialog/GeneralOptionsPage.cpp --- a/src/Gui/SettingsDialog/GeneralOptionsPage.cpp +++ b/src/Gui/SettingsDialog/GeneralOptionsPage.cpp @@ -34,9 +34,9 @@ QVBoxLayout *mainLayout = new QVBoxLayout(this); - // copy save path to clipboard + // copy file location to clipboard after saving - mCopyPathToClipboard = new QCheckBox(i18n("Copy save location to the clipboard"), this); + mCopyPathToClipboard = new QCheckBox(i18n("Copy file location to clipboard after saving"), this); connect(mCopyPathToClipboard, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); mainLayout->addWidget(mCopyPathToClipboard, 1); diff --git a/src/SpectacleConfig.cpp b/src/SpectacleConfig.cpp --- a/src/SpectacleConfig.cpp +++ b/src/SpectacleConfig.cpp @@ -240,7 +240,7 @@ mGeneralConfig.sync(); } -// copy save location to clipboard +// Copy file location to clipboard after saving bool SpectacleConfig::copySaveLocationToClipboard() const {