Freeciv21
Develop your civilization from humble roots to a global empire
mpgui_qt_worker.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 
12 #ifndef FC__MPGUI_QT_WORKER_H
13 #define FC__MPGUI_QT_WORKER_H
14 
15 #include <fc_config.h>
16 
17 // Qt
18 #include <QString>
19 #include <QThread>
20 #include <QUrl>
21 
22 // tools
23 #include "download.h"
24 
25 class mpgui;
26 struct fcmp_params;
27 
28 class mpqt_worker : public QThread {
29  Q_OBJECT
30 
31 public:
32  mpqt_worker() : m_gui(nullptr), m_fcmp(nullptr){};
33  void run() override;
34  void download(const QUrl &url, mpgui *gui, fcmp_params *fcmp,
36  const dl_pb_callback &pb_callback);
37 
38 private:
39  QUrl m_url;
44 };
45 
46 #endif // FC__MPGUI_QT_WORKER_H
Definition: mpgui_qt.h:44
dl_msg_callback m_msg_callback
fcmp_params * m_fcmp
dl_pb_callback m_pb_callback
void run() override
Run download thread.
void download(const QUrl &url, mpgui *gui, fcmp_params *fcmp, const dl_msg_callback &msg_callback, const dl_pb_callback &pb_callback)
Start thread to download and install given modpack.
std::function< void(int downloaded, int max)> dl_pb_callback
Definition: download.h:34
nf_errmsg dl_msg_callback
Definition: download.h:33
static void msg_callback(const QString &msg)
Progress indications from downloader.
Definition: mpcli.cpp:42
struct fcmp_params fcmp
Definition: mpcli.cpp:35
static mpgui * gui
Definition: mpgui_qt.cpp:47