BibleTime
btinstallmgr.h
Go to the documentation of this file.
1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, https://bibletime.info/
6*
7* Copyright 1999-2026 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12
13#pragma once
14
15#include <QObject>
16
17#include <QString>
18
19// Sword includes:
20#ifdef __GNUC__
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wextra-semi"
23#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
24#endif
25#include <installmgr.h>
26#include <remotetrans.h>
27#ifdef __GNUC__
28#pragma GCC diagnostic pop
29#endif
30
31
32/**
33* Our own reimplementation to provide installation and status bar updates.
34*/
36 : public QObject
37 , public sword::InstallMgr
38 , private sword::StatusReporter
39{
40
41 Q_OBJECT
42
43public: // methods:
44
45 BtInstallMgr(QObject * parent = nullptr);
46 ~BtInstallMgr() override;
47
48 bool isUserDisclaimerConfirmed() const override;
49
50Q_SIGNALS:
51
52 /**
53 Download status. Percent of total and file.
54 \warning Use these values for display only, since they might be incorrect.
55 */
56 void percentCompleted(const int total, const int file);
57
59
60protected: // methods:
61
62 /** \note Reimplementation of sword::StatusReporter::statusUpdate(). */
63 void statusUpdate(double dltotal, double dlnow) override;
64
65 /**
66 * \note Reimplementation of sword::StatusReporter::preStatus().
67 * \warning This method is not always called before statusUpdate().
68 * Called before starting to download each file of the module package.
69 * The sword message is not i18n'ed, it's in the form "Downloading (1 of 6): nt.bzs".
70 * This function is not utilized in the UI ATM.
71 */
72 void preStatus(long totalBytes,
73 long completedBytes,
74 const char * message) override;
75
76private: // fields:
77
81
82};
void percentCompleted(const int total, const int file)
bool m_firstCallOfPreStatus
void statusUpdate(double dltotal, double dlnow) override
void downloadStarted()
bool isUserDisclaimerConfirmed() const override
~BtInstallMgr() override
long m_completedBytes
void preStatus(long totalBytes, long completedBytes, const char *message) override