diff options
-rw-r--r-- | utils/rbutilqt/base/rbsettings.cpp | 1 | ||||
-rw-r--r-- | utils/rbutilqt/base/rbsettings.h | 1 | ||||
-rw-r--r-- | utils/rbutilqt/gui/selectiveinstallwidget.cpp | 24 | ||||
-rw-r--r-- | utils/rbutilqt/gui/selectiveinstallwidget.h | 1 | ||||
-rw-r--r-- | utils/rbutilqt/themesinstallwindow.cpp | 22 | ||||
-rw-r--r-- | utils/rbutilqt/themesinstallwindow.h | 9 |
6 files changed, 17 insertions, 41 deletions
diff --git a/utils/rbutilqt/base/rbsettings.cpp b/utils/rbutilqt/base/rbsettings.cpp index 8eaa01f7f6..00a37c010e 100644 --- a/utils/rbutilqt/base/rbsettings.cpp +++ b/utils/rbutilqt/base/rbsettings.cpp | |||
@@ -45,7 +45,6 @@ const static struct { | |||
45 | { RbSettings::BackupPath, "backuppath", "" }, | 45 | { RbSettings::BackupPath, "backuppath", "" }, |
46 | { RbSettings::InstallRockbox, "install_rockbox", "true" }, | 46 | { RbSettings::InstallRockbox, "install_rockbox", "true" }, |
47 | { RbSettings::InstallFonts, "install_fonts", "true" }, | 47 | { RbSettings::InstallFonts, "install_fonts", "true" }, |
48 | { RbSettings::InstallThemes, "install_themes", "false" }, | ||
49 | { RbSettings::InstallPluginData, "install_plugin_data", "true" }, | 48 | { RbSettings::InstallPluginData, "install_plugin_data", "true" }, |
50 | { RbSettings::InstallVoice, "install_voice", "false" }, | 49 | { RbSettings::InstallVoice, "install_voice", "false" }, |
51 | { RbSettings::InstallManual, "install_manual", "false" }, | 50 | { RbSettings::InstallManual, "install_manual", "false" }, |
diff --git a/utils/rbutilqt/base/rbsettings.h b/utils/rbutilqt/base/rbsettings.h index ef0c4eb134..820b3e0067 100644 --- a/utils/rbutilqt/base/rbsettings.h +++ b/utils/rbutilqt/base/rbsettings.h | |||
@@ -44,7 +44,6 @@ class RbSettings : public QObject | |||
44 | BackupPath, | 44 | BackupPath, |
45 | InstallRockbox, | 45 | InstallRockbox, |
46 | InstallFonts, | 46 | InstallFonts, |
47 | InstallThemes, | ||
48 | InstallPluginData, | 47 | InstallPluginData, |
49 | InstallVoice, | 48 | InstallVoice, |
50 | InstallManual, | 49 | InstallManual, |
diff --git a/utils/rbutilqt/gui/selectiveinstallwidget.cpp b/utils/rbutilqt/gui/selectiveinstallwidget.cpp index 7ee7498d64..59fa1786c0 100644 --- a/utils/rbutilqt/gui/selectiveinstallwidget.cpp +++ b/utils/rbutilqt/gui/selectiveinstallwidget.cpp | |||
@@ -36,7 +36,6 @@ SelectiveInstallWidget::SelectiveInstallWidget(QWidget* parent) : QWidget(parent | |||
36 | ui.setupUi(this); | 36 | ui.setupUi(this); |
37 | ui.rockboxCheckbox->setChecked(RbSettings::value(RbSettings::InstallRockbox).toBool()); | 37 | ui.rockboxCheckbox->setChecked(RbSettings::value(RbSettings::InstallRockbox).toBool()); |
38 | ui.fontsCheckbox->setChecked(RbSettings::value(RbSettings::InstallFonts).toBool()); | 38 | ui.fontsCheckbox->setChecked(RbSettings::value(RbSettings::InstallFonts).toBool()); |
39 | ui.themesCheckbox->setChecked(RbSettings::value(RbSettings::InstallThemes).toBool()); | ||
40 | ui.pluginDataCheckbox->setChecked(RbSettings::value(RbSettings::InstallPluginData).toBool()); | 39 | ui.pluginDataCheckbox->setChecked(RbSettings::value(RbSettings::InstallPluginData).toBool()); |
41 | ui.voiceCheckbox->setChecked(RbSettings::value(RbSettings::InstallVoice).toBool()); | 40 | ui.voiceCheckbox->setChecked(RbSettings::value(RbSettings::InstallVoice).toBool()); |
42 | ui.manualCheckbox->setChecked(RbSettings::value(RbSettings::InstallManual).toBool()); | 41 | ui.manualCheckbox->setChecked(RbSettings::value(RbSettings::InstallManual).toBool()); |
@@ -52,14 +51,16 @@ SelectiveInstallWidget::SelectiveInstallWidget(QWidget* parent) : QWidget(parent | |||
52 | 51 | ||
53 | m_logger = nullptr; | 52 | m_logger = nullptr; |
54 | m_zipinstaller = nullptr; | 53 | m_zipinstaller = nullptr; |
55 | m_themesinstaller = nullptr; | 54 | m_themesinstaller = new ThemesInstallWindow(this); |
55 | connect(m_themesinstaller, &ThemesInstallWindow::selected, | ||
56 | [this](int count) {ui.themesCheckbox->setChecked(count > 0);}); | ||
56 | 57 | ||
57 | connect(ui.installButton, &QAbstractButton::clicked, | 58 | connect(ui.installButton, &QAbstractButton::clicked, |
58 | this, &SelectiveInstallWidget::startInstall); | 59 | this, &SelectiveInstallWidget::startInstall); |
59 | connect(this, &SelectiveInstallWidget::installSkipped, | 60 | connect(this, &SelectiveInstallWidget::installSkipped, |
60 | this, &SelectiveInstallWidget::continueInstall); | 61 | this, &SelectiveInstallWidget::continueInstall); |
61 | connect(ui.themesCustomize, &QAbstractButton::clicked, | 62 | connect(ui.themesCustomize, &QAbstractButton::clicked, |
62 | this, &SelectiveInstallWidget::customizeThemes); | 63 | [this]() { m_themesinstaller->show(); } ); |
63 | connect(ui.selectedVersion, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), | 64 | connect(ui.selectedVersion, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), |
64 | this, &SelectiveInstallWidget::selectedVersionChanged); | 65 | this, &SelectiveInstallWidget::selectedVersionChanged); |
65 | // update version information. This also handles setting the previously | 66 | // update version information. This also handles setting the previously |
@@ -202,7 +203,6 @@ void SelectiveInstallWidget::saveSettings(void) | |||
202 | 203 | ||
203 | RbSettings::setValue(RbSettings::InstallRockbox, ui.rockboxCheckbox->isChecked()); | 204 | RbSettings::setValue(RbSettings::InstallRockbox, ui.rockboxCheckbox->isChecked()); |
204 | RbSettings::setValue(RbSettings::InstallFonts, ui.fontsCheckbox->isChecked()); | 205 | RbSettings::setValue(RbSettings::InstallFonts, ui.fontsCheckbox->isChecked()); |
205 | RbSettings::setValue(RbSettings::InstallThemes, ui.themesCheckbox->isChecked()); | ||
206 | RbSettings::setValue(RbSettings::InstallPluginData, ui.pluginDataCheckbox->isChecked()); | 206 | RbSettings::setValue(RbSettings::InstallPluginData, ui.pluginDataCheckbox->isChecked()); |
207 | RbSettings::setValue(RbSettings::InstallVoice, ui.voiceCheckbox->isChecked()); | 207 | RbSettings::setValue(RbSettings::InstallVoice, ui.voiceCheckbox->isChecked()); |
208 | RbSettings::setValue(RbSettings::InstallManual, ui.manualCheckbox->isChecked()); | 208 | RbSettings::setValue(RbSettings::InstallManual, ui.manualCheckbox->isChecked()); |
@@ -584,28 +584,16 @@ void SelectiveInstallWidget::installManual(void) | |||
584 | } | 584 | } |
585 | } | 585 | } |
586 | 586 | ||
587 | void SelectiveInstallWidget::customizeThemes(void) | ||
588 | { | ||
589 | if(m_themesinstaller == nullptr) | ||
590 | m_themesinstaller = new ThemesInstallWindow(this); | ||
591 | |||
592 | m_themesinstaller->setSelectOnly(true); | ||
593 | m_themesinstaller->show(); | ||
594 | } | ||
595 | |||
596 | |||
597 | void SelectiveInstallWidget::installThemes(void) | 587 | void SelectiveInstallWidget::installThemes(void) |
598 | { | 588 | { |
599 | if(ui.themesCheckbox->isChecked()) { | 589 | if(ui.themesCheckbox->isChecked()) { |
600 | LOG_INFO() << "installing themes"; | 590 | LOG_INFO() << "installing themes"; |
601 | if(m_themesinstaller == nullptr) | ||
602 | m_themesinstaller = new ThemesInstallWindow(this); | ||
603 | 591 | ||
604 | connect(m_themesinstaller, &ThemesInstallWindow::done, | ||
605 | this, &SelectiveInstallWidget::continueInstall); | ||
606 | m_themesinstaller->setLogger(m_logger); | 592 | m_themesinstaller->setLogger(m_logger); |
607 | m_themesinstaller->setModal(true); | 593 | m_themesinstaller->setModal(true); |
608 | m_themesinstaller->install(); | 594 | m_themesinstaller->install(); |
595 | connect(m_themesinstaller, &ThemesInstallWindow::finished, | ||
596 | this, &SelectiveInstallWidget::continueInstall); | ||
609 | } | 597 | } |
610 | else { | 598 | else { |
611 | LOG_INFO() << "Themes install disabled."; | 599 | LOG_INFO() << "Themes install disabled."; |
diff --git a/utils/rbutilqt/gui/selectiveinstallwidget.h b/utils/rbutilqt/gui/selectiveinstallwidget.h index c961a387e0..d430cecb10 100644 --- a/utils/rbutilqt/gui/selectiveinstallwidget.h +++ b/utils/rbutilqt/gui/selectiveinstallwidget.h | |||
@@ -39,7 +39,6 @@ class SelectiveInstallWidget : public QWidget | |||
39 | 39 | ||
40 | private slots: | 40 | private slots: |
41 | void continueInstall(bool); | 41 | void continueInstall(bool); |
42 | void customizeThemes(void); | ||
43 | void selectedVersionChanged(int); | 42 | void selectedVersionChanged(int); |
44 | void updateVoiceLangs(); | 43 | void updateVoiceLangs(); |
45 | 44 | ||
diff --git a/utils/rbutilqt/themesinstallwindow.cpp b/utils/rbutilqt/themesinstallwindow.cpp index 7edfc91cd1..3dd564c5e5 100644 --- a/utils/rbutilqt/themesinstallwindow.cpp +++ b/utils/rbutilqt/themesinstallwindow.cpp | |||
@@ -44,7 +44,7 @@ ThemesInstallWindow::ThemesInstallWindow(QWidget *parent) : QDialog(parent) | |||
44 | ui.themeDescription->setLayoutDirection(Qt::LeftToRight); | 44 | ui.themeDescription->setLayoutDirection(Qt::LeftToRight); |
45 | 45 | ||
46 | connect(ui.buttonCancel, &QAbstractButton::clicked, this, &QWidget::close); | 46 | connect(ui.buttonCancel, &QAbstractButton::clicked, this, &QWidget::close); |
47 | connect(ui.buttonOk, &QAbstractButton::clicked, this, &ThemesInstallWindow::accept); | 47 | connect(ui.buttonOk, &QAbstractButton::clicked, this, &ThemesInstallWindow::buttonOk); |
48 | connect(ui.listThemes, &QListWidget::currentItemChanged, | 48 | connect(ui.listThemes, &QListWidget::currentItemChanged, |
49 | this, &ThemesInstallWindow::updateDetails); | 49 | this, &ThemesInstallWindow::updateDetails); |
50 | connect(ui.listThemes, &QListWidget::itemSelectionChanged, this, &ThemesInstallWindow::updateSize); | 50 | connect(ui.listThemes, &QListWidget::itemSelectionChanged, this, &ThemesInstallWindow::updateSize); |
@@ -287,8 +287,7 @@ void ThemesInstallWindow::resizeEvent(QResizeEvent* e) | |||
287 | void ThemesInstallWindow::show() | 287 | void ThemesInstallWindow::show() |
288 | { | 288 | { |
289 | QDialog::show(); | 289 | QDialog::show(); |
290 | if(windowSelectOnly) | 290 | ui.buttonOk->setText(tr("Select")); |
291 | ui.buttonOk->setText(tr("Select")); | ||
292 | 291 | ||
293 | if(!logger) | 292 | if(!logger) |
294 | logger = new ProgressLoggerGui(this); | 293 | logger = new ProgressLoggerGui(this); |
@@ -309,16 +308,14 @@ void ThemesInstallWindow::abort() | |||
309 | { | 308 | { |
310 | igetter.abort(); | 309 | igetter.abort(); |
311 | logger->setFinished(); | 310 | logger->setFinished(); |
312 | this->close(); | 311 | close(); |
313 | } | 312 | } |
314 | 313 | ||
315 | 314 | ||
316 | void ThemesInstallWindow::accept(void) | 315 | void ThemesInstallWindow::buttonOk(void) |
317 | { | 316 | { |
318 | if(!windowSelectOnly) | 317 | emit selected(ui.listThemes->selectedItems().size()); |
319 | install(); | 318 | close(); |
320 | else | ||
321 | close(); | ||
322 | } | 319 | } |
323 | 320 | ||
324 | 321 | ||
@@ -326,7 +323,6 @@ void ThemesInstallWindow::install() | |||
326 | { | 323 | { |
327 | if(ui.listThemes->selectedItems().size() == 0) { | 324 | if(ui.listThemes->selectedItems().size() == 0) { |
328 | logger->addItem(tr("No themes selected, skipping"), LOGINFO); | 325 | logger->addItem(tr("No themes selected, skipping"), LOGINFO); |
329 | emit done(false); | ||
330 | return; | 326 | return; |
331 | } | 327 | } |
332 | QStringList themes; | 328 | QStringList themes; |
@@ -368,13 +364,9 @@ void ThemesInstallWindow::install() | |||
368 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) | 364 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) |
369 | installer->setCache(true); | 365 | installer->setCache(true); |
370 | 366 | ||
371 | if(!windowSelectOnly) { | ||
372 | connect(logger, &ProgressLoggerGui::closed, this, &QWidget::close); | ||
373 | connect(installer, &ZipInstaller::done, logger, &ProgressLoggerGui::setFinished); | ||
374 | } | ||
375 | connect(installer, &ZipInstaller::logItem, logger, &ProgressLoggerGui::addItem); | 367 | connect(installer, &ZipInstaller::logItem, logger, &ProgressLoggerGui::addItem); |
376 | connect(installer, &ZipInstaller::logProgress, logger, &ProgressLoggerGui::setProgress); | 368 | connect(installer, &ZipInstaller::logProgress, logger, &ProgressLoggerGui::setProgress); |
377 | connect(installer, &ZipInstaller::done, this, &ThemesInstallWindow::done); | 369 | connect(installer, &ZipInstaller::done, this, &ThemesInstallWindow::finished); |
378 | connect(logger, &ProgressLoggerGui::aborted, installer, &ZipInstaller::abort); | 370 | connect(logger, &ProgressLoggerGui::aborted, installer, &ZipInstaller::abort); |
379 | installer->install(); | 371 | installer->install(); |
380 | } | 372 | } |
diff --git a/utils/rbutilqt/themesinstallwindow.h b/utils/rbutilqt/themesinstallwindow.h index c3ea850efd..e3c408b847 100644 --- a/utils/rbutilqt/themesinstallwindow.h +++ b/utils/rbutilqt/themesinstallwindow.h | |||
@@ -36,17 +36,16 @@ class ThemesInstallWindow : public QDialog | |||
36 | public: | 36 | public: |
37 | ThemesInstallWindow(QWidget* parent = 0); | 37 | ThemesInstallWindow(QWidget* parent = 0); |
38 | ~ThemesInstallWindow(); | 38 | ~ThemesInstallWindow(); |
39 | void downloadInfo(void); | ||
40 | void show(void); | 39 | void show(void); |
41 | void setLogger(ProgressLoggerGui* l) { logger = l; } | 40 | void setLogger(ProgressLoggerGui* l) { logger = l; } |
42 | void setSelectOnly(bool state) { windowSelectOnly = state; } | ||
43 | void install(void); | 41 | void install(void); |
44 | 42 | ||
45 | public slots: | 43 | public slots: |
46 | void accept(void); | 44 | void buttonOk(void); |
47 | 45 | ||
48 | signals: | 46 | signals: |
49 | void done(bool); | 47 | void selected(int); |
48 | void finished(bool); | ||
50 | 49 | ||
51 | private: | 50 | private: |
52 | Ui::ThemeInstallFrm ui; | 51 | Ui::ThemeInstallFrm ui; |
@@ -62,9 +61,9 @@ class ThemesInstallWindow : public QDialog | |||
62 | QString fileName; | 61 | QString fileName; |
63 | 62 | ||
64 | QString infocachedir; | 63 | QString infocachedir; |
65 | bool windowSelectOnly; | ||
66 | 64 | ||
67 | private slots: | 65 | private slots: |
66 | void downloadInfo(void); | ||
68 | void downloadDone(QNetworkReply::NetworkError error); | 67 | void downloadDone(QNetworkReply::NetworkError error); |
69 | void updateImage(QNetworkReply::NetworkError error); | 68 | void updateImage(QNetworkReply::NetworkError error); |
70 | void abort(void); | 69 | void abort(void); |