diff options
author | Lioncash <mathew1800@gmail.com> | 2018-09-12 07:06:50 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-09-12 07:07:34 +0200 |
commit | 3a2567c97cc7dc03d662a7609c979aef9e0a80ae (patch) | |
tree | 3a6b2cb409cf748cec011529dd22234cd86b4740 /src | |
parent | Merge pull request #1300 from lioncash/audio (diff) | |
download | yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.tar yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.tar.gz yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.tar.bz2 yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.tar.lz yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.tar.xz yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.tar.zst yuzu-3a2567c97cc7dc03d662a7609c979aef9e0a80ae.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/configuration/configure_gamelist.cpp | 51 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_gamelist.h | 4 |
2 files changed, 32 insertions, 23 deletions
diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index 1ae3423cf..1238356a8 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -12,6 +12,33 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGameList) { ui->setupUi(this); + InitializeIconSizeComboBox(); + InitializeRowComboBoxes(); + + this->setConfiguration(); +} + +ConfigureGameList::~ConfigureGameList() = default; + +void ConfigureGameList::applyConfiguration() { + UISettings::values.show_unknown = ui->show_unknown->isChecked(); + UISettings::values.icon_size = ui->icon_size_combobox->currentData().toUInt(); + UISettings::values.row_1_text_id = ui->row_1_text_combobox->currentData().toUInt(); + UISettings::values.row_2_text_id = ui->row_2_text_combobox->currentData().toUInt(); + Settings::Apply(); +} + +void ConfigureGameList::setConfiguration() { + ui->show_unknown->setChecked(UISettings::values.show_unknown); + ui->icon_size_combobox->setCurrentIndex( + ui->icon_size_combobox->findData(UISettings::values.icon_size)); + ui->row_1_text_combobox->setCurrentIndex( + ui->row_1_text_combobox->findData(UISettings::values.row_1_text_id)); + ui->row_2_text_combobox->setCurrentIndex( + ui->row_2_text_combobox->findData(UISettings::values.row_2_text_id)); +} + +void ConfigureGameList::InitializeIconSizeComboBox() { static const std::vector<std::pair<u32, std::string>> default_icon_sizes{ std::make_pair(0, "None"), std::make_pair(32, "Small"), std::make_pair(64, "Standard"), std::make_pair(128, "Large"), @@ -24,7 +51,9 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) std::to_string(size.first) + ")"), size.first); } +} +void ConfigureGameList::InitializeRowComboBoxes() { static const std::vector<std::string> row_text_names{ "Filename", "Filetype", @@ -38,26 +67,4 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) ui->row_2_text_combobox->addItem(QString::fromStdString(row_text_names[i]), QVariant::fromValue(i)); } - - this->setConfiguration(); -} - -ConfigureGameList::~ConfigureGameList() {} - -void ConfigureGameList::setConfiguration() { - ui->show_unknown->setChecked(UISettings::values.show_unknown); - ui->icon_size_combobox->setCurrentIndex( - ui->icon_size_combobox->findData(UISettings::values.icon_size)); - ui->row_1_text_combobox->setCurrentIndex( - ui->row_1_text_combobox->findData(UISettings::values.row_1_text_id)); - ui->row_2_text_combobox->setCurrentIndex( - ui->row_2_text_combobox->findData(UISettings::values.row_2_text_id)); -} - -void ConfigureGameList::applyConfiguration() { - UISettings::values.show_unknown = ui->show_unknown->isChecked(); - UISettings::values.icon_size = ui->icon_size_combobox->currentData().toUInt(); - UISettings::values.row_1_text_id = ui->row_1_text_combobox->currentData().toUInt(); - UISettings::values.row_2_text_id = ui->row_2_text_combobox->currentData().toUInt(); - Settings::Apply(); } diff --git a/src/yuzu/configuration/configure_gamelist.h b/src/yuzu/configuration/configure_gamelist.h index 94fba6373..71fd67e99 100644 --- a/src/yuzu/configuration/configure_gamelist.h +++ b/src/yuzu/configuration/configure_gamelist.h @@ -23,6 +23,8 @@ public: private: void setConfiguration(); -private: + void InitializeIconSizeComboBox(); + void InitializeRowComboBoxes(); + std::unique_ptr<Ui::ConfigureGameList> ui; }; |