15 #include <QApplication>
16 #include <QHBoxLayout>
18 #include <QProgressBar>
19 #include <QPushButton>
20 #include <QSizePolicy>
21 #include <QSpacerItem>
22 #include <QStringLiteral>
24 #include <QVBoxLayout>
25 #include <QWizardPage>
26 #include "../../backend/btinstallthread.h"
27 #include "../../backend/drivers/btmoduleset.h"
28 #include "../../backend/drivers/cswordmoduleinfo.h"
29 #include "../../backend/managers/cswordbackend.h"
30 #include "../../util/btconnect.h"
38 "GUI/BookshelfWizard/InstallPage/installPathIndex";
50 QSizePolicy::Expanding));
67 QHBoxLayout *
const horizontalLayout =
new QHBoxLayout();
69 horizontalLayout->addSpacerItem(
70 new QSpacerItem(1, 1, QSizePolicy::Expanding));
72 horizontalLayout->addSpacerItem(
73 new QSpacerItem(1, 1, QSizePolicy::Expanding));
79 QSizePolicy::Expanding));
99 setTitle(QApplication::translate(
100 "BookshelfWizard",
"Updating Works"));
101 setSubTitle(QApplication::translate(
103 "The selected works are being updated."));
105 setTitle(QApplication::translate(
106 "BookshelfWizard",
"Installing Works"));
107 setSubTitle(QApplication::translate(
109 "The selected works are being installed."));
121 m_modules = btWiz.selectedWorks().values();
125 Qt::QueuedConnection);
128 Qt::QueuedConnection);
131 Qt::QueuedConnection);
134 Qt::QueuedConnection);
154 tr(
"Installing \"%1\"").arg(
m_modules.at(moduleIndex)->name()));
170 int const perModuleIncrement = 100 /
m_modules.count();
172 + (status * perModuleIncrement / 100));
188 tr(
"Some of the selected works were not installed."));
189 m_msgLabel->setStyleSheet(
"QLabel{color:red}");
191 m_msgLabel->setText(tr(
"The selected works have been installed."));
198 Q_EMIT QWizardPage::completeChanged();
BtBookshelfInstallFinalPage(QWidget *parent=nullptr)
QList< CSwordModuleInfo * > m_modules
void slotThreadFinished()
void slotOneItemCompleted(int moduleIndex, bool status)
BtInstallThread * m_thread
void initializePage() final override
QPushButton * m_stopButton
void slotInstallStarted(int moduleIndex)
bool isComplete() const final override
void slotStatusUpdated(int moduleIndex, int status)
void destroyThread() noexcept
int nextId() const final override
QVBoxLayout * m_verticalLayout
QProgressBar * m_progressBar
BtBookshelfWizard & btWizard() const noexcept
void downloadStarted(int moduleIndex)
void preparingInstall(int moduleIndex)
void installCompleted(int moduleIndex, bool success)
void statusUpdated(int moduleIndex, int progressPercent)
void reloadModules()
Reloads all Sword modules.
static CSwordBackend & instance() noexcept
QString const installPathKey
QString const groupingOrderKey