diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-07-07 00:02:04 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-07-07 00:02:04 +0200 |
commit | d934e6483190d7d173051380c62bc040911b42cd (patch) | |
tree | fe8a09797a23d324b13d5b3d08ffe9b1aaf55459 /gui/pages/ScreenshotsPage.cpp | |
parent | 15775bd30a3269adece8272badaee70823d64ec6 (diff) | |
download | MultiMC-d934e6483190d7d173051380c62bc040911b42cd.tar MultiMC-d934e6483190d7d173051380c62bc040911b42cd.tar.gz MultiMC-d934e6483190d7d173051380c62bc040911b42cd.tar.lz MultiMC-d934e6483190d7d173051380c62bc040911b42cd.tar.xz MultiMC-d934e6483190d7d173051380c62bc040911b42cd.zip |
Tweak the response to successful uploads (screenshots, log pastes)
The url will now be shown as link, put into the clipboard AND opened in a browser.
At the same time. To avoid losing the URL.
Diffstat (limited to 'gui/pages/ScreenshotsPage.cpp')
-rw-r--r-- | gui/pages/ScreenshotsPage.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gui/pages/ScreenshotsPage.cpp b/gui/pages/ScreenshotsPage.cpp index 466b3c19..ff4f0099 100644 --- a/gui/pages/ScreenshotsPage.cpp +++ b/gui/pages/ScreenshotsPage.cpp @@ -11,6 +11,8 @@ #include <QLineEdit> #include <QtGui/qevent.h> #include <QtGui/QPainter> +#include <QtGui/QClipboard> +#include <QtGui/QDesktopServices> #include <pathutils.h> @@ -333,11 +335,15 @@ void ScreenshotsPage::on_uploadBtn_clicked() } else { + auto link = QString("https://imgur.com/a/%1").arg(imgurAlbum->id()); + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(link); + QDesktopServices::openUrl(link); CustomMessageBox::selectable( this, tr("Upload finished"), - tr("<a href=\"https://imgur.com/a/%1\">Visit album</a><br/>Delete hash: %2 (save " + tr("The <a href=\"%1\">link to the uploaded album</a> has been opened in the default browser and placed in your clipboard.<br/>Delete hash: %2 (save " "this if you want to be able to edit/delete the album)") - .arg(imgurAlbum->id(), imgurAlbum->deleteHash()), + .arg(link, imgurAlbum->deleteHash()), QMessageBox::Information)->exec(); } } |