Merge pull request #7200 from Techjar/qt-dialog-fixes-2-electric-boogaloo

Qt: Various dialog fixes
This commit is contained in:
spycrab 2018-07-03 12:32:31 +02:00 committed by GitHub
commit 47c5a2f7ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 8 deletions

View File

@ -153,9 +153,9 @@ void FilesystemWidget::PopulateDirectory(int partition_id, QStandardItem* root,
} }
} }
static QString SelectFolder() QString FilesystemWidget::SelectFolder()
{ {
return QFileDialog::getExistingDirectory(nullptr, QObject::tr("Choose the folder to extract to")); return QFileDialog::getExistingDirectory(this, QObject::tr("Choose the folder to extract to"));
} }
void FilesystemWidget::ShowContextMenu(const QPoint&) void FilesystemWidget::ShowContextMenu(const QPoint&)
@ -197,9 +197,9 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
return; return;
if (ExtractSystemData(partition, folder)) if (ExtractSystemData(partition, folder))
QMessageBox::information(nullptr, tr("Success"), tr("Successfully extracted system data.")); QMessageBox::information(this, tr("Success"), tr("Successfully extracted system data."));
else else
QMessageBox::critical(nullptr, tr("Error"), tr("Failed to extract system data.")); QMessageBox::critical(this, tr("Error"), tr("Failed to extract system data."));
}); });
} }
@ -291,6 +291,7 @@ void FilesystemWidget::ExtractDirectory(const DiscIO::Partition& partition, cons
dialog->setMinimum(0); dialog->setMinimum(0);
dialog->setMaximum(size); dialog->setMaximum(size);
dialog->show(); dialog->show();
dialog->setWindowTitle(tr("Progress"));
bool all = path.isEmpty(); bool all = path.isEmpty();
@ -320,9 +321,9 @@ void FilesystemWidget::ExtractFile(const DiscIO::Partition& partition, const QSt
*m_volume, partition, filesystem->FindFileInfo(path.toStdString()).get(), out.toStdString()); *m_volume, partition, filesystem->FindFileInfo(path.toStdString()).get(), out.toStdString());
if (success) if (success)
QMessageBox::information(nullptr, tr("Success"), tr("Successfully extracted file.")); QMessageBox::information(this, tr("Success"), tr("Successfully extracted file."));
else else
QMessageBox::critical(nullptr, tr("Error"), tr("Failed to extract file.")); QMessageBox::critical(this, tr("Error"), tr("Failed to extract file."));
} }
void FilesystemWidget::CheckIntegrity(const DiscIO::Partition& partition) void FilesystemWidget::CheckIntegrity(const DiscIO::Partition& partition)
@ -345,10 +346,10 @@ void FilesystemWidget::CheckIntegrity(const DiscIO::Partition& partition)
dialog->close(); dialog->close();
if (is_valid.get()) if (is_valid.get())
QMessageBox::information(nullptr, tr("Success"), QMessageBox::information(this, tr("Success"),
tr("Integrity check completed. No errors have been found.")); tr("Integrity check completed. No errors have been found."));
else else
QMessageBox::critical(nullptr, tr("Error"), QMessageBox::critical(this, tr("Error"),
tr("Integrity check for partition failed. The disc image is most " tr("Integrity check for partition failed. The disc image is most "
"likely corrupted or has been patched incorrectly.")); "likely corrupted or has been patched incorrectly."));
} }

View File

@ -35,6 +35,8 @@ private:
void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::Partition& partition); void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::Partition& partition);
void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::FileInfo& directory); void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::FileInfo& directory);
QString SelectFolder();
void ShowContextMenu(const QPoint&); void ShowContextMenu(const QPoint&);
void ExtractPartition(const DiscIO::Partition& partition, const QString& out); void ExtractPartition(const DiscIO::Partition& partition, const QString& out);

View File

@ -475,6 +475,9 @@ void GameList::CompressISO(bool decompress)
QProgressDialog progress_dialog(decompress ? tr("Decompressing...") : tr("Compressing..."), QProgressDialog progress_dialog(decompress ? tr("Decompressing...") : tr("Compressing..."),
tr("Abort"), 0, 100, this); tr("Abort"), 0, 100, this);
progress_dialog.setWindowModality(Qt::WindowModal); progress_dialog.setWindowModality(Qt::WindowModal);
progress_dialog.setWindowFlags(progress_dialog.windowFlags() &
~Qt::WindowContextHelpButtonHint);
progress_dialog.setWindowTitle(tr("Progress"));
bool good; bool good;