summaryrefslogtreecommitdiffstats
path: root/logic/net/PasteUpload.h
diff options
context:
space:
mode:
authorrobotbrainify <robotbrainify@gmail.com>2013-12-06 16:24:55 -0500
committerrobotbrainify <robotbrainify@gmail.com>2013-12-06 16:24:55 -0500
commit5ad95134dc521d5eeb85cc37e6681b72b8d62c62 (patch)
tree0d252776e7d21e7cab950a525a9284cd4ba83f72 /logic/net/PasteUpload.h
parent613699b3626aea750093ab7eaaeccaa28c0e87c6 (diff)
downloadMultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar.gz
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar.lz
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar.xz
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.zip
work on pasting instance logs
blame clang for formatting changes
Diffstat (limited to 'logic/net/PasteUpload.h')
-rw-r--r--logic/net/PasteUpload.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/logic/net/PasteUpload.h b/logic/net/PasteUpload.h
new file mode 100644
index 00000000..27186ba6
--- /dev/null
+++ b/logic/net/PasteUpload.h
@@ -0,0 +1,30 @@
+#pragma once
+#include "logic/tasks/Task.h"
+#include <QMessageBox>
+#include <QNetworkReply>
+#include <memory>
+
+class PasteUpload : public Task
+{
+public:
+ PasteUpload(QWidget *window, QString text);
+ QMessageBox *messageBox() const
+ {
+ return m_messageBox;
+ }
+
+protected:
+ virtual void executeTask();
+
+private:
+ bool parseResult(QJsonDocument doc, QString *parseError);
+ QString m_text;
+ QString m_error;
+ QWidget *m_window;
+ QMessageBox *m_messageBox;
+ std::shared_ptr<QNetworkReply> m_reply;
+public
+slots:
+ void downloadError(QNetworkReply::NetworkError);
+ void downloadFinished();
+};