summaryrefslogtreecommitdiff
path: root/utils/rbutilqt/themesinstallwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rbutilqt/themesinstallwindow.cpp')
-rw-r--r--utils/rbutilqt/themesinstallwindow.cpp22
1 files changed, 7 insertions, 15 deletions
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)
287void ThemesInstallWindow::show() 287void 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
316void ThemesInstallWindow::accept(void) 315void 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}