Refactor batch installing files

Key issues fixed:
- Progress dialog showing up as white/hanging/getting stuck/unresponsive.

Key changes:
- Progress dialog now shows progress as a function of all files instead of per nca within a file.
- Overwrite existing files will overwrite all files in the selection.
This commit is contained in:
Morph
2020-07-01 16:15:57 -04:00
parent 4c269e5ced
commit 7f4d96d873
4 changed files with 242 additions and 200 deletions

View File

@ -48,6 +48,13 @@ enum class EmulatedDirectoryTarget {
SDMC,
};
enum class InstallResult {
Success,
Overwrite,
AlreadyExists,
Failure,
};
enum class ReinitializeKeyBehavior {
NoWarning,
Warning,
@ -219,6 +226,10 @@ private slots:
private:
std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);
InstallResult InstallNSPXCI(const QString& filename, bool overwrite_files,
QProgressDialog& install_progress);
InstallResult InstallNCA(const QString& filename, bool overwrite_files,
QProgressDialog& install_progress);
void UpdateWindowTitle(const std::string& title_name = {},
const std::string& title_version = {});
void UpdateStatusBar();
@ -273,9 +284,6 @@ private:
HotkeyRegistry hotkey_registry;
// Install to NAND progress dialog
QProgressDialog* install_progress;
protected:
void dropEvent(QDropEvent* event) override;
void dragEnterEvent(QDragEnterEvent* event) override;