Merge pull request #8881 from JosJuice/convert-same-format
DolphinQt: Allow converting to same format
This commit is contained in:
commit
3411802fd1
|
@ -55,8 +55,13 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
|
||||||
grid_layout->setColumnStretch(1, 1);
|
grid_layout->setColumnStretch(1, 1);
|
||||||
|
|
||||||
m_format = new QComboBox;
|
m_format = new QComboBox;
|
||||||
AddToFormatComboBox(QStringLiteral("ISO"), DiscIO::BlobType::PLAIN);
|
m_format->addItem(QStringLiteral("ISO"), static_cast<int>(DiscIO::BlobType::PLAIN));
|
||||||
AddToFormatComboBox(QStringLiteral("GCZ"), DiscIO::BlobType::GCZ);
|
m_format->addItem(QStringLiteral("GCZ"), static_cast<int>(DiscIO::BlobType::GCZ));
|
||||||
|
if (std::all_of(m_files.begin(), m_files.end(),
|
||||||
|
[](const auto& file) { return file->GetBlobType() == DiscIO::BlobType::PLAIN; }))
|
||||||
|
{
|
||||||
|
m_format->setCurrentIndex(m_format->count() - 1);
|
||||||
|
}
|
||||||
grid_layout->addWidget(new QLabel(tr("Format:")), 0, 0);
|
grid_layout->addWidget(new QLabel(tr("Format:")), 0, 0);
|
||||||
grid_layout->addWidget(m_format, 0, 1);
|
grid_layout->addWidget(m_format, 0, 1);
|
||||||
|
|
||||||
|
@ -104,17 +109,6 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
|
||||||
OnFormatChanged();
|
OnFormatChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertDialog::AddToFormatComboBox(const QString& name, DiscIO::BlobType format)
|
|
||||||
{
|
|
||||||
if (std::all_of(m_files.begin(), m_files.end(),
|
|
||||||
[format](const auto& file) { return file->GetBlobType() == format; }))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_format->addItem(name, static_cast<int>(format));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConvertDialog::AddToBlockSizeComboBox(int size)
|
void ConvertDialog::AddToBlockSizeComboBox(int size)
|
||||||
{
|
{
|
||||||
m_block_size->addItem(QString::fromStdString(UICommon::FormatSize(size, 0)), size);
|
m_block_size->addItem(QString::fromStdString(UICommon::FormatSize(size, 0)), size);
|
||||||
|
|
|
@ -32,7 +32,6 @@ private slots:
|
||||||
void Convert();
|
void Convert();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddToFormatComboBox(const QString& name, DiscIO::BlobType format);
|
|
||||||
void AddToBlockSizeComboBox(int size);
|
void AddToBlockSizeComboBox(int size);
|
||||||
|
|
||||||
bool ShowAreYouSureDialog(const QString& text);
|
bool ShowAreYouSureDialog(const QString& text);
|
||||||
|
|
Loading…
Reference in New Issue