Skip to content
Permalink
Browse files
Merge pull request #8881 from JosJuice/convert-same-format
DolphinQt: Allow converting to same format
  • Loading branch information
Tilka committed Jun 17, 2020
2 parents 7cdd0e2 + ec3ea6c commit 3411802
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
@@ -55,8 +55,13 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
grid_layout->setColumnStretch(1, 1);

m_format = new QComboBox;
AddToFormatComboBox(QStringLiteral("ISO"), DiscIO::BlobType::PLAIN);
AddToFormatComboBox(QStringLiteral("GCZ"), DiscIO::BlobType::GCZ);
m_format->addItem(QStringLiteral("ISO"), static_cast<int>(DiscIO::BlobType::PLAIN));
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(m_format, 0, 1);

@@ -104,17 +109,6 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
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)
{
m_block_size->addItem(QString::fromStdString(UICommon::FormatSize(size, 0)), size);
@@ -32,7 +32,6 @@ private slots:
void Convert();

private:
void AddToFormatComboBox(const QString& name, DiscIO::BlobType format);
void AddToBlockSizeComboBox(int size);

bool ShowAreYouSureDialog(const QString& text);

0 comments on commit 3411802

Please sign in to comment.