// Copyright 2019 threeSD Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #pragma once #include #include #include #include #include #include "core/importer.h" #include "core/ncch/ncch_container.h" class QTreeWidgetItem; namespace Ui { class ImportDialog; } class ImportDialog : public QDialog { Q_OBJECT public: explicit ImportDialog(QWidget* parent, const Core::Config& config); ~ImportDialog() override; private: void RelistContent(); void RepopulateContent(); void UpdateSizeDisplay(); void UpdateItemCheckState(QTreeWidgetItem* item); std::vector GetSelectedContentList(); void StartImporting(); void InsertTopLevelItem(const QString& text, QPixmap icon = {}); // When replace_name and replace_icon are present they are used instead of those in `content`. void InsertSecondLevelItem(std::size_t row, const Core::ContentSpecifier& content, std::size_t id, QString replace_name = {}, QPixmap replace_icon = {}); Core::ContentSpecifier SpecifierFromItem(QTreeWidgetItem* item) const; void OnContextMenu(const QPoint& point); void StartDumpingCXI(const Core::ContentSpecifier& content); Core::NCCHContainer dump_cxi_container; // NCCH container used for dumping CXI QString last_dump_cxi_path; // Used for recording last path in StartDumpingCXI std::unique_ptr ui; std::string user_path; Core::SDMCImporter importer; std::vector contents; u64 total_size = 0; // HACK: To tell whether the checkbox state change is a programmatic trigger // TODO: Is there a more elegant way of doing the same? bool program_trigger = false; // Whether the System Archive / System Data warning has been shown bool warning_shown = false; // TODO: Why this won't work as locals? Core::ContentSpecifier current_content = {}; u64 current_count = 0; };