use enum and add default case
This commit is contained in:
parent
d462eacefb
commit
169b076913
2 changed files with 6 additions and 2 deletions
|
@ -33,12 +33,12 @@ void CompatDB::Submit() {
|
||||||
compatibility->addButton(ui->radioButton_IntroMenu, 4);
|
compatibility->addButton(ui->radioButton_IntroMenu, 4);
|
||||||
compatibility->addButton(ui->radioButton_WontBoot, 5);
|
compatibility->addButton(ui->radioButton_WontBoot, 5);
|
||||||
switch (currentId()) {
|
switch (currentId()) {
|
||||||
case 1:
|
case CompatDBPage::SelectionPage:
|
||||||
if (compatibility->checkedId() == -1) {
|
if (compatibility->checkedId() == -1) {
|
||||||
button(NextButton)->setEnabled(false);
|
button(NextButton)->setEnabled(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case CompatDBPage::FinalPage:
|
||||||
LOG_DEBUG(Frontend, "Compatibility Rating: %d", compatibility->checkedId());
|
LOG_DEBUG(Frontend, "Compatibility Rating: %d", compatibility->checkedId());
|
||||||
Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility",
|
Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility",
|
||||||
compatibility->checkedId());
|
compatibility->checkedId());
|
||||||
|
@ -46,6 +46,8 @@ void CompatDB::Submit() {
|
||||||
// workaround
|
// workaround
|
||||||
button(QWizard::CancelButton)->setVisible(false);
|
button(QWizard::CancelButton)->setVisible(false);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
LOG_ERROR(Frontend, "Unexpected page: %d", currentId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,3 +25,5 @@ private slots:
|
||||||
void Submit();
|
void Submit();
|
||||||
void EnableNext();
|
void EnableNext();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum CompatDBPage { IntroPage = 0, SelectionPage = 1, FinalPage = 2 };
|
||||||
|
|
Loading…
Reference in a new issue