UI updates

- add import dialog
  this is more complex than I thought
- added scope exit
  grammar sugar
- main dialog is now linked to import dialog
- importer citra file path is fixed
- importer now reports maximum size
- file util is improved with GetDirectoryTreeSize
This commit is contained in:
zhupengfei
2019-08-28 23:02:30 +08:00
parent 7df0b63a1e
commit 8acfe9f304
13 changed files with 448 additions and 27 deletions
+41
View File
@@ -0,0 +1,41 @@
// Copyright 2019 threeSD Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <string>
#include <vector>
#include <QDialog>
#include "core/importer.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 PopulateContent();
void UpdateSizeDisplay();
void UpdateItemCheckState(QTreeWidgetItem* item);
std::unique_ptr<Ui::ImportDialog> ui;
std::string user_path;
Core::SDMCImporter importer;
std::vector<Core::ContentSpecifier> 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;
};