GUI; Tweaks. Add tooltips, change texts.

This commit is contained in:
Daniel Marjamäki 2020-07-18 08:23:04 +02:00
parent 58638d7757
commit 744b363186
3 changed files with 62 additions and 51 deletions

View File

@ -208,6 +208,7 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, QWidget *parent)
connect(mUI.mListSuppressions, &QListWidget::doubleClicked, this, &ProjectFileDialog::editSuppression); connect(mUI.mListSuppressions, &QListWidget::doubleClicked, this, &ProjectFileDialog::editSuppression);
connect(mUI.mBtnBrowseMisraFile, &QPushButton::clicked, this, &ProjectFileDialog::browseMisraFile); connect(mUI.mBtnBrowseMisraFile, &QPushButton::clicked, this, &ProjectFileDialog::browseMisraFile);
connect(mUI.mChkAllVsConfigs, &QCheckBox::clicked, this, &ProjectFileDialog::checkAllVSConfigs); connect(mUI.mChkAllVsConfigs, &QCheckBox::clicked, this, &ProjectFileDialog::checkAllVSConfigs);
connect(mUI.mBtnNormalAnalysis, &QCheckBox::toggled, mUI.mBtnSafeClasses, &QCheckBox::setEnabled);
loadFromProjectFile(projectFile); loadFromProjectFile(projectFile);
} }
@ -266,7 +267,7 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
else else
mUI.mBtnCppcheckParser->setChecked(true); mUI.mBtnCppcheckParser->setChecked(true);
mUI.mBtnSafeClasses->setChecked(projectFile->safeChecks.classes); mUI.mBtnSafeClasses->setChecked(projectFile->safeChecks.classes);
mUI.mBugHunting->setChecked(projectFile->bugHunting); mUI.mBtnBugHunting->setChecked(projectFile->bugHunting);
setExcludedPaths(projectFile->getExcludedPaths()); setExcludedPaths(projectFile->getExcludedPaths());
setLibraries(projectFile->getLibraries()); setLibraries(projectFile->getLibraries());
const QString platform = projectFile->getPlatform(); const QString platform = projectFile->getPlatform();
@ -371,7 +372,7 @@ void ProjectFileDialog::saveToProjectFile(ProjectFile *projectFile) const
projectFile->setLibraries(getLibraries()); projectFile->setLibraries(getLibraries());
projectFile->clangParser = mUI.mBtnClangParser->isChecked(); projectFile->clangParser = mUI.mBtnClangParser->isChecked();
projectFile->safeChecks.classes = mUI.mBtnSafeClasses->isChecked(); projectFile->safeChecks.classes = mUI.mBtnSafeClasses->isChecked();
projectFile->bugHunting = mUI.mBugHunting->isChecked(); projectFile->bugHunting = mUI.mBtnBugHunting->isChecked();
if (mUI.mComboBoxPlatform->currentText().endsWith(".xml")) if (mUI.mComboBoxPlatform->currentText().endsWith(".xml"))
projectFile->setPlatform(mUI.mComboBoxPlatform->currentText()); projectFile->setPlatform(mUI.mComboBoxPlatform->currentText());
else { else {

View File

@ -420,7 +420,11 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLineEdit" name="mEditBuildDir"/> <widget class="QLineEdit" name="mEditBuildDir">
<property name="toolTip">
<string>This is a workfolder that Cppcheck will use for various purposes.</string>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="mBtnBrowseBuildDir"> <widget class="QPushButton" name="mBtnBrowseBuildDir">
@ -461,18 +465,31 @@
<item> <item>
<widget class="QGroupBox" name="groupBox_11"> <widget class="QGroupBox" name="groupBox_11">
<property name="title"> <property name="title">
<string>Check that code is safe</string> <string>Analysis</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_19"> <layout class="QVBoxLayout" name="verticalLayout_19">
<item> <item>
<widget class="QCheckBox" name="mBugHunting"> <widget class="QRadioButton" name="mBtnNormalAnalysis">
<property name="text"> <property name="text">
<string>Bug hunting -- Detect all bugs. Generates mostly noise.</string> <string>Normal analysis -- Avoid false positives.</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="mBtnBugHunting">
<property name="text">
<string>Bug hunting -- Generates mostly noise. The goal is to be &quot;soundy&quot; and detect most bugs.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="mBtnSafeClasses"> <widget class="QCheckBox" name="mBtnSafeClasses">
<property name="toolTip">
<string>If you want to design your classes to be as flexible and robust as possible then the public interface must be very robust. Cppcheck will asumme that arguments can take *any* value.</string>
</property>
<property name="text"> <property name="text">
<string>Check that each class has a safe public interface</string> <string>Check that each class has a safe public interface</string>
</property> </property>
@ -605,7 +622,11 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_13"> <layout class="QVBoxLayout" name="verticalLayout_13">
<item> <item>
<widget class="QLineEdit" name="mEditProjectRoot"/> <widget class="QLineEdit" name="mEditProjectRoot">
<property name="toolTip">
<string>Filepaths in warnings will be relative to this path</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -617,7 +638,11 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QLineEdit" name="mEditTags"/> <widget class="QLineEdit" name="mEditTags">
<property name="toolTip">
<string>If tags are added, you will be able to right click on warnings and set one of these tags. You can manually categorize warnings.</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -625,7 +650,7 @@
<item> <item>
<widget class="QGroupBox" name="groupBox_7"> <widget class="QGroupBox" name="groupBox_7">
<property name="title"> <property name="title">
<string>Exclude source files in paths</string> <string>Exclude source files</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>

View File

@ -159,49 +159,34 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<widget class="QSplitter" name="splitter"> <widget class="QLabel" name="label_2">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Configured contracts:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="mListAddedContracts">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Missing contracts:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="mListMissingContracts">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property> </property>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Configured contracts:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="mListAddedContracts">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Missing contracts:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="mListMissingContracts">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>