Commit 205d6b36 authored by Nate Graham's avatar Nate Graham
Browse files

Auto-copy shared image link to clipboard

Summary:
Whenever an image is shared and a link is provided, the link is automatically copied to the clipboard.

We also rename the {nav Copy save location} checkbox to prevent user confusion with this new feature (and also to better reflect what the {nav Copy save location} feature actually does).

FEATURE: 392722
FIXED-IN 18.08.0

Test Plan:
Shared an image via Imgur. The link immediately appeared at the top of Klipper's history.

{F5918565}

Reviewers: #spectacle, #kde_applications, rkflx

Reviewed By: #spectacle, rkflx

Subscribers: kde-doc-english, rkflx

Tags: #documentation

Differential Revision: https://phabricator.kde.org/D13493
parent 2323baf0
......@@ -257,7 +257,7 @@
</mediaobject>
<variablelist>
<varlistentry>
<term><guilabel>Copy save location to clipboard</guilabel></term>
<term><guilabel>Copy file location to clipboard after saving</guilabel></term>
<listitem>
<para>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.</para>
......
......@@ -32,6 +32,7 @@
#include <KStandardGuiItem>
#include <KWindowSystem>
#include <QClipboard>
#include <QDesktopServices>
#include <QJsonArray>
#include <QPrintDialog>
......@@ -363,8 +364,9 @@ void KSMainWindow::showImageSharedFeedback(bool error, const QString &message)
if (message.isEmpty()) {
showInlineMessage(i18n("Image shared"), KMessageWidget::Positive);
} else {
showInlineMessage(i18n("You can find the shared image at: <a href=\"%1\">%1</a>", message),
showInlineMessage(i18n("The shared image link (<a href=\"%1\">%1</a>) has been copied to the clipboard.", message),
KMessageWidget::Positive, MessageDuration::Persistent);
QApplication::clipboard()->setText(message);
}
}
}
......
......@@ -34,9 +34,9 @@ GeneralOptionsPage::GeneralOptionsPage(QWidget *parent) :
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);
......
......@@ -240,7 +240,7 @@ void SpectacleConfig::setAutoSaveLocation(const QString &location)
mGeneralConfig.sync();
}
// copy save location to clipboard
// copy file location to clipboard after saving
bool SpectacleConfig::copySaveLocationToClipboard() const
{
......
Supports Markdown
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