diff options
-rw-r--r-- | gui/ConsoleWindow.cpp | 6 | ||||
-rw-r--r-- | logic/net/PasteUpload.cpp | 4 | ||||
-rw-r--r-- | logic/net/PasteUpload.h | 5 |
3 files changed, 3 insertions, 12 deletions
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index f08f10de..5db4442e 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -189,11 +189,7 @@ void ConsoleWindow::on_btnPaste_clicked() ProgressDialog dialog(this); PasteUpload* paste=new PasteUpload(this, text); dialog.exec(paste); - if(paste->successful()) - { - paste->messageBox()->exec(); - } - else + if(!paste->successful()) { CustomMessageBox::selectable(this, "Upload failed", paste->failReason(), QMessageBox::Critical)->exec(); } diff --git a/logic/net/PasteUpload.cpp b/logic/net/PasteUpload.cpp index efe0e053..acf09291 100644 --- a/logic/net/PasteUpload.cpp +++ b/logic/net/PasteUpload.cpp @@ -4,6 +4,7 @@ #include <QJsonObject> #include <QJsonDocument> #include "gui/dialogs/CustomMessageBox.h" +#include <QDesktopServices> PasteUpload::PasteUpload(QWidget *window, QString text) : m_text(text), m_window(window) { @@ -78,7 +79,6 @@ bool PasteUpload::parseResult(QJsonDocument doc, QString *parseError) return false; } QString pasteUrl = object.value("paste").toObject().value("link").toString(); - m_messageBox = CustomMessageBox::selectable(m_window, "Paste upload successful!", - QString("Find your paste at %1").arg(pasteUrl)); + QDesktopServices::openUrl(pasteUrl); return true; } diff --git a/logic/net/PasteUpload.h b/logic/net/PasteUpload.h index 3105d6a1..917a0016 100644 --- a/logic/net/PasteUpload.h +++ b/logic/net/PasteUpload.h @@ -9,10 +9,6 @@ class PasteUpload : public Task Q_OBJECT public: PasteUpload(QWidget *window, QString text); - QMessageBox *messageBox() const - { - return m_messageBox; - } protected: virtual void executeTask(); @@ -22,7 +18,6 @@ private: QString m_text; QString m_error; QWidget *m_window; - QMessageBox *m_messageBox; std::shared_ptr<QNetworkReply> m_reply; public slots: |