BibleTime
Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
BtInstallMgr Class Reference

#include <btinstallmgr.h>

Inheritance diagram for BtInstallMgr:

Signals

void downloadStarted ()
 
void percentCompleted (const int total, const int file)
 

Public Member Functions

 BtInstallMgr (QObject *parent=nullptr)
 
bool isUserDisclaimerConfirmed () const override
 
 ~BtInstallMgr () override
 

Protected Member Functions

void preStatus (long totalBytes, long completedBytes, const char *message) override
 
void statusUpdate (double dltotal, double dlnow) override
 

Private Attributes

long m_completedBytes
 
bool m_firstCallOfPreStatus
 
long m_totalBytes
 

Detailed Description

Our own reimplementation to provide installation and status bar updates.

Definition at line 31 of file btinstallmgr.h.

Constructor & Destructor Documentation

◆ BtInstallMgr()

BtInstallMgr::BtInstallMgr ( QObject parent = nullptr)

Definition at line 66 of file btinstallmgr.cpp.

◆ ~BtInstallMgr()

BtInstallMgr::~BtInstallMgr ( )
override

Definition at line 78 of file btinstallmgr.cpp.

Member Function Documentation

◆ downloadStarted

void BtInstallMgr::downloadStarted ( )
signal

◆ isUserDisclaimerConfirmed()

bool BtInstallMgr::isUserDisclaimerConfirmed ( ) const
override

Definition at line 83 of file btinstallmgr.cpp.

◆ percentCompleted

void BtInstallMgr::percentCompleted ( const int  total,
const int  file 
)
signal

Download status. Percent of total and file.

Warning
Use these values for display only, since they might be incorrect.

Referenced by BtInstallThread::BtInstallThread(), CSwordSetupInstallSourcesDialog::CSwordSetupInstallSourcesDialog(), and statusUpdate().

◆ preStatus()

void BtInstallMgr::preStatus ( long  totalBytes,
long  completedBytes,
const char *  message 
)
overrideprotected
Note
Reimplementation of sword::StatusReporter::preStatus().
Warning
This method is not always called before statusUpdate(). Called before starting to download each file of the module package. The sword message is not i18n'ed, it's in the form "Downloading (1 of 6): nt.bzs". This function is not utilized in the UI ATM.

Definition at line 111 of file btinstallmgr.cpp.

References BT_ASSERT, downloadStarted(), m_completedBytes, m_firstCallOfPreStatus, and m_totalBytes.

◆ statusUpdate()

void BtInstallMgr::statusUpdate ( double  dltotal,
double  dlnow 
)
overrideprotected
Note
Reimplementation of sword::StatusReporter::statusUpdate().
Warning
Note that these might be rough measures due to the double data type being used by Sword to store the number of bytes. Special care must be taken to work around this, since the arguments may contain weird values which would otherwise break this logic.

Definition at line 89 of file btinstallmgr.cpp.

References anonymous_namespace{btinstallmgr.cpp}::calculateIntPercentage(), m_completedBytes, m_totalBytes, and percentCompleted().

Member Data Documentation

◆ m_completedBytes

long BtInstallMgr::m_completedBytes
private

Definition at line 75 of file btinstallmgr.h.

Referenced by preStatus(), and statusUpdate().

◆ m_firstCallOfPreStatus

bool BtInstallMgr::m_firstCallOfPreStatus
private

Definition at line 76 of file btinstallmgr.h.

Referenced by preStatus().

◆ m_totalBytes

long BtInstallMgr::m_totalBytes
private

Definition at line 74 of file btinstallmgr.h.

Referenced by preStatus(), and statusUpdate().


The documentation for this class was generated from the following files: