comparison src/gui/dialog/settings/application.cpp @ 15:cde8f67a7c7d

*: update, megacommit :)
author Paper <mrpapersonic@gmail.com>
date Tue, 19 Sep 2023 22:36:08 -0400
parents 4b198a111713
children 2743011a6042
comparison
equal deleted inserted replaced
14:a29c9402faf0 15:cde8f67a7c7d
50 QComboBox* lang_combo_box = new QComboBox(appearance_group_box); 50 QComboBox* lang_combo_box = new QComboBox(appearance_group_box);
51 lang_combo_box->addItem(tr("Romaji")); 51 lang_combo_box->addItem(tr("Romaji"));
52 lang_combo_box->addItem(tr("Native")); 52 lang_combo_box->addItem(tr("Native"));
53 lang_combo_box->addItem(tr("English")); 53 lang_combo_box->addItem(tr("English"));
54 connect(lang_combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, 54 connect(lang_combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
55 [this](int index) { language = static_cast<Anime::TitleLanguage>(index); }); 55 [this](int index) { language = static_cast<Anime::TitleLanguage>(index); });
56 lang_combo_box->setCurrentIndex(static_cast<int>(language)); 56 lang_combo_box->setCurrentIndex(static_cast<int>(language));
57 57
58 QCheckBox* hl_anime_box = 58 QCheckBox* hl_anime_box =
59 new QCheckBox(tr("Highlight anime if next episode is available in library folders"), appearance_group_box); 59 new QCheckBox(tr("Highlight anime if next episode is available in library folders"), appearance_group_box);
60 QCheckBox* hl_above_anime_box = new QCheckBox(tr("Display highlighted anime above others"), appearance_group_box); 60 QCheckBox* hl_above_anime_box = new QCheckBox(tr("Display highlighted anime above others"), appearance_group_box);
61 connect(hl_anime_box, &QCheckBox::stateChanged, this, [this, hl_above_anime_box](int state) { 61 connect(hl_anime_box, &QCheckBox::stateChanged, this, [this, hl_above_anime_box](int state) {
62 highlight_anime_if_available = (state == Qt::Unchecked) ? false : true; 62 highlight_anime_if_available = (state == Qt::Unchecked) ? false : true;
63 hl_above_anime_box->setEnabled(state); 63 hl_above_anime_box->setEnabled(state);
64 }); 64 });
65 connect(hl_above_anime_box, &QCheckBox::stateChanged, this, 65 connect(hl_above_anime_box, &QCheckBox::stateChanged, this,
66 [this](int state) { highlight_anime_if_available = (state == Qt::Unchecked) ? false : true; }); 66 [this](int state) { highlight_anime_if_available = (state == Qt::Unchecked) ? false : true; });
67 hl_anime_box->setCheckState(highlight_anime_if_available ? Qt::Checked : Qt::Unchecked); 67 hl_anime_box->setCheckState(highlight_anime_if_available ? Qt::Checked : Qt::Unchecked);
68 hl_above_anime_box->setCheckState(highlighted_anime_above_others ? Qt::Checked : Qt::Unchecked); 68 hl_above_anime_box->setCheckState(highlighted_anime_above_others ? Qt::Checked : Qt::Unchecked);
69 hl_above_anime_box->setEnabled(hl_anime_box->checkState() != Qt::Unchecked); 69 hl_above_anime_box->setEnabled(hl_anime_box->checkState() != Qt::Unchecked);
70 hl_above_anime_box->setStyleSheet("margin-left: 10px;"); 70 hl_above_anime_box->setStyleSheet("margin-left: 10px;");
71 71
79 79
80 QGroupBox* progress_group_box = new QGroupBox(tr("Progress"), result); 80 QGroupBox* progress_group_box = new QGroupBox(tr("Progress"), result);
81 progress_group_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 81 progress_group_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
82 82
83 QCheckBox* progress_display_aired_episodes = 83 QCheckBox* progress_display_aired_episodes =
84 new QCheckBox(tr("Display aired episodes (estimated)"), progress_group_box); 84 new QCheckBox(tr("Display aired episodes (estimated)"), progress_group_box);
85 connect(progress_display_aired_episodes, &QCheckBox::stateChanged, this, 85 connect(progress_display_aired_episodes, &QCheckBox::stateChanged, this,
86 [this](int state) { display_aired_episodes = (state == Qt::Unchecked) ? false : true; }); 86 [this](int state) { display_aired_episodes = (state == Qt::Unchecked) ? false : true; });
87 progress_display_aired_episodes->setCheckState(display_aired_episodes ? Qt::Checked : Qt::Unchecked); 87 progress_display_aired_episodes->setCheckState(display_aired_episodes ? Qt::Checked : Qt::Unchecked);
88 88
89 QCheckBox* progress_display_available_episodes = 89 QCheckBox* progress_display_available_episodes =
90 new QCheckBox(tr("Display available episodes in library folders"), progress_group_box); 90 new QCheckBox(tr("Display available episodes in library folders"), progress_group_box);
91 connect(progress_display_available_episodes, &QCheckBox::stateChanged, this, 91 connect(progress_display_available_episodes, &QCheckBox::stateChanged, this,
92 [this](int state) { display_available_episodes = (state == Qt::Unchecked) ? false : true; }); 92 [this](int state) { display_available_episodes = (state == Qt::Unchecked) ? false : true; });
93 progress_display_available_episodes->setCheckState(display_available_episodes ? Qt::Checked : Qt::Unchecked); 93 progress_display_available_episodes->setCheckState(display_available_episodes ? Qt::Checked : Qt::Unchecked);
94 94
95 QVBoxLayout* progress_layout = new QVBoxLayout; 95 QVBoxLayout* progress_layout = new QVBoxLayout;
96 progress_layout->addWidget(progress_display_aired_episodes); 96 progress_layout->addWidget(progress_display_aired_episodes);
97 progress_layout->addWidget(progress_display_available_episodes); 97 progress_layout->addWidget(progress_display_available_episodes);