mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Merge pull request #14073 from jordan-woyak/convert-dialog-min-size
DolphinQt: Make disc ConvertDialog have a better minimum size and use QFormLayout.
This commit is contained in:
commit
ab2ceb10ae
@ -5,14 +5,13 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <functional>
|
|
||||||
#include <future>
|
#include <future>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QGridLayout>
|
#include <QFormLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@ -42,8 +41,8 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
|
|||||||
|
|
||||||
setWindowTitle(tr("Convert"));
|
setWindowTitle(tr("Convert"));
|
||||||
|
|
||||||
QGridLayout* grid_layout = new QGridLayout;
|
auto* const form_layout = new QFormLayout;
|
||||||
grid_layout->setColumnStretch(1, 1);
|
form_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||||
|
|
||||||
m_format = new QComboBox;
|
m_format = new QComboBox;
|
||||||
m_format->addItem(QStringLiteral("ISO"), static_cast<int>(DiscIO::BlobType::PLAIN));
|
m_format->addItem(QStringLiteral("ISO"), static_cast<int>(DiscIO::BlobType::PLAIN));
|
||||||
@ -55,34 +54,23 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
|
|||||||
{
|
{
|
||||||
m_format->setCurrentIndex(m_format->count() - 1);
|
m_format->setCurrentIndex(m_format->count() - 1);
|
||||||
}
|
}
|
||||||
grid_layout->addWidget(new QLabel(tr("Format:")), 0, 0);
|
form_layout->addRow(tr("Format:"), m_format);
|
||||||
grid_layout->addWidget(m_format, 0, 1);
|
|
||||||
|
|
||||||
m_block_size = new QComboBox;
|
m_block_size = new QComboBox;
|
||||||
grid_layout->addWidget(new QLabel(tr("Block Size:")), 1, 0);
|
form_layout->addRow(tr("Block Size:"), m_block_size);
|
||||||
grid_layout->addWidget(m_block_size, 1, 1);
|
|
||||||
|
|
||||||
m_compression = new QComboBox;
|
m_compression = new QComboBox;
|
||||||
grid_layout->addWidget(new QLabel(tr("Compression:")), 2, 0);
|
form_layout->addRow(tr("Compression:"), m_compression);
|
||||||
grid_layout->addWidget(m_compression, 2, 1);
|
|
||||||
|
|
||||||
m_compression_level = new QComboBox;
|
m_compression_level = new QComboBox;
|
||||||
grid_layout->addWidget(new QLabel(tr("Compression Level:")), 3, 0);
|
form_layout->addRow(tr("Compression Level:"), m_compression_level);
|
||||||
grid_layout->addWidget(m_compression_level, 3, 1);
|
|
||||||
|
|
||||||
m_scrub = new QCheckBox;
|
m_scrub = new QCheckBox;
|
||||||
grid_layout->addWidget(new QLabel(tr("Remove Junk Data (Irreversible):")), 4, 0);
|
form_layout->addRow(tr("Remove Junk Data (Irreversible):"), m_scrub);
|
||||||
grid_layout->addWidget(m_scrub, 4, 1);
|
|
||||||
|
|
||||||
QPushButton* convert_button = new QPushButton(tr("Convert..."));
|
auto* const convert_button = new QPushButton(tr("Convert..."));
|
||||||
|
|
||||||
QVBoxLayout* options_layout = new QVBoxLayout;
|
auto* const info_text = new QLabel(
|
||||||
options_layout->addLayout(grid_layout);
|
|
||||||
options_layout->addWidget(convert_button);
|
|
||||||
QGroupBox* options_group = new QGroupBox(tr("Options"));
|
|
||||||
options_group->setLayout(options_layout);
|
|
||||||
|
|
||||||
QLabel* info_text = new QLabel(
|
|
||||||
tr("ISO: A simple and robust format which is supported by many programs. It takes up more "
|
tr("ISO: A simple and robust format which is supported by many programs. It takes up more "
|
||||||
"space than any other format.\n\n"
|
"space than any other format.\n\n"
|
||||||
"GCZ: A basic compressed format which is compatible with most versions of Dolphin and "
|
"GCZ: A basic compressed format which is compatible with most versions of Dolphin and "
|
||||||
@ -94,17 +82,20 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
|
|||||||
"RVZ: An advanced compressed format which is compatible with Dolphin 5.0-12188 and later. "
|
"RVZ: An advanced compressed format which is compatible with Dolphin 5.0-12188 and later. "
|
||||||
"It can efficiently compress both junk data and encrypted Wii data."));
|
"It can efficiently compress both junk data and encrypted Wii data."));
|
||||||
info_text->setWordWrap(true);
|
info_text->setWordWrap(true);
|
||||||
|
info_text->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
|
|
||||||
QVBoxLayout* info_layout = new QVBoxLayout;
|
auto* const options_group = new QGroupBox(tr("Options"));
|
||||||
|
auto* const options_layout = new QVBoxLayout{options_group};
|
||||||
|
options_layout->addLayout(form_layout);
|
||||||
|
options_layout->addWidget(convert_button);
|
||||||
|
|
||||||
|
auto* const info_group = new QGroupBox(tr("Info"));
|
||||||
|
auto* const info_layout = new QVBoxLayout{info_group};
|
||||||
info_layout->addWidget(info_text);
|
info_layout->addWidget(info_text);
|
||||||
QGroupBox* info_group = new QGroupBox(tr("Info"));
|
|
||||||
info_group->setLayout(info_layout);
|
|
||||||
|
|
||||||
QVBoxLayout* main_layout = new QVBoxLayout;
|
auto* const main_layout = new QVBoxLayout{this};
|
||||||
main_layout->addWidget(options_group);
|
main_layout->addWidget(options_group);
|
||||||
main_layout->addWidget(info_group);
|
main_layout->addWidget(info_group, 1);
|
||||||
|
|
||||||
setLayout(main_layout);
|
|
||||||
|
|
||||||
connect(m_format, &QComboBox::currentIndexChanged, this, &ConvertDialog::OnFormatChanged);
|
connect(m_format, &QComboBox::currentIndexChanged, this, &ConvertDialog::OnFormatChanged);
|
||||||
connect(m_compression, &QComboBox::currentIndexChanged, this,
|
connect(m_compression, &QComboBox::currentIndexChanged, this,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user