summaryrefslogtreecommitdiffstats
path: root/gui/pages/LogPage.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-07-07 00:02:04 +0200
committerPetr Mrázek <peterix@gmail.com>2014-07-07 00:02:04 +0200
commitd934e6483190d7d173051380c62bc040911b42cd (patch)
treefe8a09797a23d324b13d5b3d08ffe9b1aaf55459 /gui/pages/LogPage.cpp
parent15775bd30a3269adece8272badaee70823d64ec6 (diff)
downloadMultiMC-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/LogPage.cpp')
-rw-r--r--gui/pages/LogPage.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/gui/pages/LogPage.cpp b/gui/pages/LogPage.cpp
index dd088862..a9e32cc2 100644
--- a/gui/pages/LogPage.cpp
+++ b/gui/pages/LogPage.cpp
@@ -6,6 +6,8 @@
#include "ui_LogPage.h"
#include "logic/net/PasteUpload.h"
#include <QScrollBar>
+#include <QtGui/QClipboard>
+#include <QtGui/QDesktopServices>
QString LogPage::displayName()
{
@@ -56,6 +58,19 @@ void LogPage::on_btnPaste_clicked()
CustomMessageBox::selectable(this, "Upload failed", paste->failReason(),
QMessageBox::Critical)->exec();
}
+ else
+ {
+ QString link = paste->pasteLink();
+ QClipboard *clipboard = QApplication::clipboard();
+ clipboard->setText(link);
+ QDesktopServices::openUrl(link);
+ CustomMessageBox::selectable(
+ this, tr("Upload finished"),
+ tr("The <a href=\"%1\">link to the uploaded log</a> has been opened in the default browser and placed in your clipboard.")
+ .arg(link),
+ QMessageBox::Information)->exec();
+ }
+ delete paste;
}
void LogPage::writeColor(QString text, const char *color, const char * background)