Skip to content

Commit 43ce79a

Browse files
committed
update gui (fixup)
1 parent 0f32185 commit 43ce79a

4 files changed

Lines changed: 43 additions & 11 deletions

File tree

gui/mainwindow.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
210210
connect(mUI->mActionReportAutosar, &QAction::triggered, this, &MainWindow::changeReportType);
211211
connect(mUI->mActionReportCertC, &QAction::triggered, this, &MainWindow::changeReportType);
212212
connect(mUI->mActionReportCertCpp, &QAction::triggered, this, &MainWindow::changeReportType);
213-
connect(mUI->mActionReportMisraC, &QAction::triggered, this, &MainWindow::changeReportType);
213+
connect(mUI->mActionReportMisraC2012, &QAction::triggered, this, &MainWindow::changeReportType);
214+
connect(mUI->mActionReportMisraC2023, &QAction::triggered, this, &MainWindow::changeReportType);
215+
connect(mUI->mActionReportMisraC2025, &QAction::triggered, this, &MainWindow::changeReportType);
214216
connect(mUI->mActionReportMisraCpp2008, &QAction::triggered, this, &MainWindow::changeReportType);
215217
connect(mUI->mActionReportMisraCpp2023, &QAction::triggered, this, &MainWindow::changeReportType);
216218

@@ -279,7 +281,9 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
279281
mUI->mActionReportAutosar->setActionGroup(mSelectReportActions);
280282
mUI->mActionReportCertC->setActionGroup(mSelectReportActions);
281283
mUI->mActionReportCertCpp->setActionGroup(mSelectReportActions);
282-
mUI->mActionReportMisraC->setActionGroup(mSelectReportActions);
284+
mUI->mActionReportMisraC2012->setActionGroup(mSelectReportActions);
285+
mUI->mActionReportMisraC2023->setActionGroup(mSelectReportActions);
286+
mUI->mActionReportMisraC2025->setActionGroup(mSelectReportActions);
283287
mUI->mActionReportMisraCpp2008->setActionGroup(mSelectReportActions);
284288
mUI->mActionReportMisraCpp2023->setActionGroup(mSelectReportActions);
285289

@@ -391,7 +395,9 @@ void MainWindow::loadSettings()
391395
mUI->mActionReportAutosar->setChecked(reportType == ReportType::autosar);
392396
mUI->mActionReportCertC->setChecked(reportType == ReportType::certC);
393397
mUI->mActionReportCertCpp->setChecked(reportType == ReportType::certCpp);
394-
mUI->mActionReportMisraC->setChecked(reportType == ReportType::misraC);
398+
mUI->mActionReportMisraC2012->setChecked(reportType == ReportType::misraC2012);
399+
mUI->mActionReportMisraC2023->setChecked(reportType == ReportType::misraC2023);
400+
mUI->mActionReportMisraC2025->setChecked(reportType == ReportType::misraC2025);
395401
mUI->mActionReportMisraCpp2008->setChecked(reportType == ReportType::misraCpp2008);
396402
mUI->mActionReportMisraCpp2023->setChecked(reportType == ReportType::misraCpp2023);
397403

@@ -480,7 +486,9 @@ void MainWindow::saveSettings() const
480486
const ReportType reportType = mUI->mActionReportAutosar->isChecked() ? ReportType::autosar :
481487
mUI->mActionReportCertC->isChecked() ? ReportType::certC :
482488
mUI->mActionReportCertCpp->isChecked() ? ReportType::certCpp :
483-
mUI->mActionReportMisraC->isChecked() ? ReportType::misraC :
489+
mUI->mActionReportMisraC2012->isChecked() ? ReportType::misraC2012 :
490+
mUI->mActionReportMisraC2023->isChecked() ? ReportType::misraC2023 :
491+
mUI->mActionReportMisraC2025->isChecked() ? ReportType::misraC2025 :
484492
mUI->mActionReportMisraCpp2008->isChecked() ? ReportType::misraCpp2008 :
485493
mUI->mActionReportMisraCpp2023->isChecked() ? ReportType::misraCpp2023 :
486494
ReportType::normal;
@@ -2283,7 +2291,9 @@ void MainWindow::changeReportType() {
22832291
const ReportType reportType = mUI->mActionReportAutosar->isChecked() ? ReportType::autosar :
22842292
mUI->mActionReportCertC->isChecked() ? ReportType::certC :
22852293
mUI->mActionReportCertCpp->isChecked() ? ReportType::certCpp :
2286-
mUI->mActionReportMisraC->isChecked() ? ReportType::misraC :
2294+
mUI->mActionReportMisraC2012->isChecked() ? ReportType::misraC2012 :
2295+
mUI->mActionReportMisraC2023->isChecked() ? ReportType::misraC2023 :
2296+
mUI->mActionReportMisraC2025->isChecked() ? ReportType::misraC2025 :
22872297
mUI->mActionReportMisraCpp2008->isChecked() ? ReportType::misraCpp2008 :
22882298
mUI->mActionReportMisraCpp2023->isChecked() ? ReportType::misraCpp2023 :
22892299
ReportType::normal;
@@ -2308,7 +2318,9 @@ void MainWindow::changeReportType() {
23082318
setTextAndHint(mUI->mActionShowPortability, "");
23092319
setTextAndHint(mUI->mActionShowPerformance, "");
23102320
setTextAndHint(mUI->mActionShowInformation, "");
2311-
} else if (mUI->mActionReportMisraC->isChecked() || mUI->mActionReportMisraCpp2008->isChecked() || mUI->mActionReportMisraCpp2023->isChecked()) {
2321+
} else if (mUI->mActionReportMisraC2012->isChecked() || mUI->mActionReportMisraC2023->isChecked() ||
2322+
mUI->mActionReportMisraC2025->isChecked() || mUI->mActionReportMisraCpp2008->isChecked() ||
2323+
mUI->mActionReportMisraCpp2023->isChecked()) {
23122324
setTextAndHint(mUI->mActionShowErrors, mUI->mActionReportMisraCpp2008->isChecked() ? "" : showMandatory);
23132325
setTextAndHint(mUI->mActionShowWarnings, showRequired);
23142326
setTextAndHint(mUI->mActionShowStyle, showAdvisory);

gui/mainwindow.ui

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167
<addaction name="mActionReportAutosar"/>
168168
<addaction name="mActionReportCertC"/>
169169
<addaction name="mActionReportCertCpp"/>
170-
<addaction name="mActionReportMisraC"/>
170+
<addaction name="mActionReportMisraC2012"/>
171+
<addaction name="mActionReportMisraC2023"/>
172+
<addaction name="mActionReportMisraC2025"/>
171173
<addaction name="mActionReportMisraCpp2008"/>
172174
<addaction name="mActionReportMisraCpp2023"/>
173175
</widget>
@@ -977,7 +979,23 @@
977979
<string>Normal</string>
978980
</property>
979981
</action>
980-
<action name="mActionReportMisraC">
982+
<action name="mActionReportMisraC2012">
983+
<property name="checkable">
984+
<bool>true</bool>
985+
</property>
986+
<property name="text">
987+
<string>Misra C</string>
988+
</property>
989+
</action>
990+
<action name="mActionReportMisraC2023">
991+
<property name="checkable">
992+
<bool>true</bool>
993+
</property>
994+
<property name="text">
995+
<string>Misra C</string>
996+
</property>
997+
</action>
998+
<action name="mActionReportMisraC2025">
981999
<property name="checkable">
9821000
<bool>true</bool>
9831001
</property>

gui/resultstree.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,9 @@ bool ResultsTree::isCertReport() const {
15341534

15351535
bool ResultsTree::isAutosarMisraReport() const {
15361536
return mReportType == ReportType::autosar ||
1537-
mReportType == ReportType::misraC ||
1537+
mReportType == ReportType::misraC2012 ||
1538+
mReportType == ReportType::misraC2023 ||
1539+
mReportType == ReportType::misraC2025 ||
15381540
mReportType == ReportType::misraCpp2008 ||
15391541
mReportType == ReportType::misraCpp2023;
15401542
}

gui/test/resultstree/testresultstree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void TestResultsTree::testReportType() const
157157
QCOMPARE(report.output, "id1,,\nunusedVariable,,");
158158

159159
// switch to Misra C report and check that "id1" is not shown
160-
tree.setReportType(ReportType::misraC);
160+
tree.setReportType(ReportType::misraC2012);
161161
tree.saveResults(&report);
162162
QCOMPARE(report.output, "unusedVariable,Advisory,2.8");
163163

@@ -187,7 +187,7 @@ void TestResultsTree::testGetGuidelineError() const
187187

188188
// normal report with 2 errors
189189
ResultsTree tree(nullptr);
190-
tree.setReportType(ReportType::misraC);
190+
tree.setReportType(ReportType::misraC2012);
191191
tree.addErrorItem(createErrorItem(Severity::error, "id1")); // error severity => guideline 1.3
192192
tree.saveResults(&report);
193193
QCOMPARE(report.output, "id1,Required,1.3");

0 commit comments

Comments
 (0)