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:
parent
d31b8ab0fa
commit
29b9d83e05
4 changed files with 242 additions and 200 deletions
|
@ -22,7 +22,7 @@ InstallDialog::InstallDialog(QWidget* parent, const QStringList& files) : QDialo
|
|||
item->setCheckState(Qt::Checked);
|
||||
}
|
||||
|
||||
file_list->setMinimumWidth((file_list->sizeHintForColumn(0) * 6) / 5);
|
||||
file_list->setMinimumWidth((file_list->sizeHintForColumn(0) * 10) / 9);
|
||||
|
||||
vbox_layout = new QVBoxLayout;
|
||||
|
||||
|
@ -54,19 +54,23 @@ InstallDialog::InstallDialog(QWidget* parent, const QStringList& files) : QDialo
|
|||
|
||||
InstallDialog::~InstallDialog() = default;
|
||||
|
||||
QStringList InstallDialog::GetFilenames() const {
|
||||
QStringList filenames;
|
||||
QStringList InstallDialog::GetFiles() const {
|
||||
QStringList files;
|
||||
|
||||
for (int i = 0; i < file_list->count(); ++i) {
|
||||
const QListWidgetItem* item = file_list->item(i);
|
||||
if (item->checkState() == Qt::Checked) {
|
||||
filenames.append(item->data(Qt::UserRole).toString());
|
||||
files.append(item->data(Qt::UserRole).toString());
|
||||
}
|
||||
}
|
||||
|
||||
return filenames;
|
||||
return files;
|
||||
}
|
||||
|
||||
bool InstallDialog::ShouldOverwriteFiles() const {
|
||||
return overwrite_files->isChecked();
|
||||
}
|
||||
}
|
||||
|
||||
int InstallDialog::GetMinimumWidth() const {
|
||||
return file_list->width();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue