15 #include <QAbstractButton>
16 #include <QApplication>
20 #include <QMessageBox>
21 #include <QPushButton>
23 #include "../../backend/config/btconfig.h"
24 #include "../../backend/drivers/btmoduleset.h"
25 #include "../../util/btassert.h"
37 auto const GeometryKey = QStringLiteral(
"GUI/BookshelfWizard/geometry");
38 auto const SourcesKey = QStringLiteral(
"GUI/BookshelfWizard/sources");
39 auto const LanguagesKey = QStringLiteral(
"GUI/BookshelfWizard/languages");
45 , m_downloadInProgress(false)
46 , m_closeRequested(false)
47 , m_closeMessageBox(new QMessageBox(this))
68 QRect rect = geometry();
72 setOption(QWizard::NoBackButtonOnLastPage);
81 QAbstractButton * button = wizard->button(which);
82 if (button !=
nullptr)
83 button->setText(text);
88 replaceButtonText(wizard, QWizard::BackButton, QPushButton::tr(
"Back" ,
"Dialog Button"));
89 replaceButtonText(wizard, QWizard::NextButton, QPushButton::tr(
"Next" ,
"Dialog Button"));
90 replaceButtonText(wizard, QWizard::CommitButton, QPushButton::tr(
"Commit",
"Dialog Button"));
91 replaceButtonText(wizard, QWizard::FinishButton, QPushButton::tr(
"Finish",
"Dialog Button"));
92 replaceButtonText(wizard, QWizard::CancelButton, QPushButton::tr(
"Cancel",
"Dialog Button"));
93 replaceButtonText(wizard, QWizard::HelpButton, QPushButton::tr(
"Help" ,
"Dialog Button"));
98 setWindowTitle(QApplication::translate(
"BookshelfWizard",
99 "Bookshelf Manager"));
102 "Canceling Downloads"));
105 "The Bookshelf Manager will close when the current download finishes."));
164 if(event->key() == Qt::Key_Escape) {
172 QWizard::keyPressEvent(event);
void translateQWizardStandardButtons(QWizard *wizard)
static void replaceButtonText(QWizard *wizard, QWizard::WizardButton which, const QString &text)
BtConfig & btConfig()
This is a shortchand for BtConfig::getInstance().
QStringList selectedLanguages() const
QStringList selectedSources() const
WizardTaskType taskType() const
QMessageBox * m_closeMessageBox
QStringList selectedSources() const
bool m_downloadInProgress
BtBookshelfWizard(QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
virtual void keyPressEvent(QKeyEvent *event) override
BtBookshelfSourcesPage *const m_sourcesPage
QStringList selectedLanguages() const
void accept() final override
static bool autoUpdateSources()
static void setAutoUpdateSources(bool value)
BtBookshelfSourcesProgressPage *const m_sourcesProgressPage
BtBookshelfLanguagesPage *const m_languagesPage
BtBookshelfInstallFinalPage *const m_installFinalPage
QString installPath() const
WizardTaskType taskType() const
BtBookshelfWorksPage *const m_removeWorksPage
BtModuleSet selectedWorks() const
BtBookshelfWorksPage *const m_updateWorksPage
BtBookshelfWorksPage *const m_installWorksPage
BtBookshelfTaskPage *const m_taskPage
BtModuleSet const & checkedModules() const
QString installPath() const
void setValue(QString const &key, T const &value)
Sets a value for a key.