diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 420e0d31ad..ff9b70ca1c 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -380,15 +380,46 @@ void main_window::BootRsxCapture() LOG_SUCCESS(LOADER, "Capture Boot Success"); } -void main_window::InstallPkg(const QString& dropPath) +void main_window::InstallPkg(const QString& dropPath, bool is_bulk) { QString filePath = dropPath; - if (filePath.isEmpty()) + if (m_install_bulk == QMessageBox::NoToAll) + { + LOG_NOTICE(LOADER, "PKG: Skipped installation from drop. File: %s", sstr(filePath)); + return; + } + else if (m_install_bulk == QMessageBox::YesToAll) + { + LOG_NOTICE(LOADER, "PKG: Continuing bulk installation from drop. File: %s", sstr(filePath)); + } + else if (filePath.isEmpty()) { QString path_last_PKG = guiSettings->GetValue(gui::fd_install_pkg).toString(); filePath = QFileDialog::getOpenFileName(this, tr("Select PKG To Install"), path_last_PKG, tr("PKG files (*.pkg);;All files (*.*)")); } + else if (is_bulk) + { + QMessageBox::StandardButton ret = QMessageBox::question(this, tr("PKG Decrypter / Installer"), tr("Install package: %1?").arg(filePath), + QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::NoToAll | QMessageBox::No, QMessageBox::No); + + if (ret == QMessageBox::No) + { + LOG_NOTICE(LOADER, "PKG: Cancelled installation from drop. File: %s", sstr(filePath)); + return; + } + else if (ret == QMessageBox::NoToAll) + { + LOG_NOTICE(LOADER, "PKG: Cancelled bulk installation from drop. File: %s", sstr(filePath)); + m_install_bulk = ret; + return; + } + else if (ret == QMessageBox::YesToAll) + { + LOG_NOTICE(LOADER, "PKG: Accepted bulk installation from drop. File: %s", sstr(filePath)); + m_install_bulk = ret; + } + } else { if (QMessageBox::question(this, tr("PKG Decrypter / Installer"), tr("Install package: %1?").arg(filePath), @@ -1714,8 +1745,9 @@ void main_window::dropEvent(QDropEvent* event) case drop_type::drop_pkg: // install the packages for (const auto& path : dropPaths) { - InstallPkg(path); + InstallPkg(path, dropPaths.count() > 1); } + m_install_bulk = QMessageBox::NoButton; break; case drop_type::drop_pup: // install the firmware InstallPup(dropPaths.first()); diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index c8c86dc2ce..4f74995ffd 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -115,7 +115,7 @@ private: void CreateConnects(); void CreateDockWindows(); void EnableMenus(bool enabled); - void InstallPkg(const QString& dropPath = ""); + void InstallPkg(const QString& dropPath = "", bool is_bulk = false); void InstallPup(const QString& dropPath = ""); int IsValidFile(const QMimeData& md, QStringList* dropPaths = nullptr); @@ -132,6 +132,8 @@ private: QActionGroup* m_listModeActGroup; QActionGroup* m_categoryVisibleActGroup; + QMessageBox::StandardButton m_install_bulk = QMessageBox::NoButton; + // Dockable widget frames QMainWindow *m_mw; log_frame *m_logFrame;