diff --git a/README.md b/README.md index d120fff3..4f63b22e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ New features in release v.1.0.29: - [Groups nesting ordering](./md/grouped_view/grouped_view.md#groups-nesting-ordering) - [Plot legend scrolling](./md/plot_view/plot_view.md#legend-scrolling) - [Regex group name glossary](./md/search/search.md#regex-group-name-glossary) +- [Regex text editor with the automatic height adjustment](./md/search/search.md#regex-text-editor) ---- diff --git a/dltmessageanalyzerplugin/src/components/filtersView/api/CFiltersView.hpp b/dltmessageanalyzerplugin/src/components/filtersView/api/CFiltersView.hpp index 85528a21..aaada60c 100644 --- a/dltmessageanalyzerplugin/src/components/filtersView/api/CFiltersView.hpp +++ b/dltmessageanalyzerplugin/src/components/filtersView/api/CFiltersView.hpp @@ -8,6 +8,7 @@ class CFiltersModel; class CFilterItemDelegate; +class CRegexHistoryTextEdit; class CFiltersView : public QTreeView, public CSettingsManagerClient @@ -22,7 +23,7 @@ class CFiltersView : public QTreeView, void setSpecificModel( CFiltersModel* pModel ); void highlightInvalidRegex(const QModelIndex &index); - void setRegexInputField(QLineEdit* pRegexInputField); + void setRegexInputField(CRegexHistoryTextEdit* pRegexTextEdit); protected: void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; @@ -51,6 +52,6 @@ class CFiltersView : public QTreeView, bool mbIsVerticalScrollBarVisible; bool mbResizeOnExpandCollapse; bool mbSkipFirstUpdateWidth; - QLineEdit* mpRegexInputField; + CRegexHistoryTextEdit* mpRegexTextEdit; CFilterItemDelegate* mpFilterItemDelegate; }; diff --git a/dltmessageanalyzerplugin/src/components/filtersView/src/CFiltersView.cpp b/dltmessageanalyzerplugin/src/components/filtersView/src/CFiltersView.cpp index dafeeb64..4e011809 100644 --- a/dltmessageanalyzerplugin/src/components/filtersView/src/CFiltersView.cpp +++ b/dltmessageanalyzerplugin/src/components/filtersView/src/CFiltersView.cpp @@ -11,11 +11,13 @@ #include "QLineEdit" #include "QKeyEvent" #include "QActionGroup" +#include "QTextEdit" #include "CFiltersModel.hpp" #include "components/settings/api/ISettingsManager.hpp" #include "components/log/api/CLog.hpp" #include "common/CQtHelper.hpp" +#include "components/regexHistory/api/CRegexHistoryTextEdit.hpp" #include "CFilterItemDelegate.hpp" #include "../api/CFiltersView.hpp" @@ -64,18 +66,18 @@ CFiltersView::CFiltersView(QWidget *parent): }); } -void CFiltersView::setRegexInputField(QLineEdit* pRegexInputField) +void CFiltersView::setRegexInputField(CRegexHistoryTextEdit* pRegexTextEdit) { - mpRegexInputField = pRegexInputField; + mpRegexTextEdit = pRegexTextEdit; } void CFiltersView::copySelectedRowToClipboard() { QClipboard* pClipboard = QApplication::clipboard(); - if(nullptr != pClipboard && nullptr != mpRegexInputField) + if(nullptr != pClipboard && nullptr != mpRegexTextEdit) { - pClipboard->setText(mpRegexInputField->selectedText()); + pClipboard->setText(mpRegexTextEdit->textCursor().selectedText()); } } @@ -86,10 +88,10 @@ void CFiltersView::currentChanged(const QModelIndex ¤t, const QModelIndex auto pTreeItem = static_cast(current.internalPointer()); if(nullptr != pTreeItem && - nullptr != mpRegexInputField) + nullptr != mpRegexTextEdit) { auto range = pTreeItem->data(static_cast(eRegexFiltersColumn::Range)).get(); - mpRegexInputField->setSelection(range.from, range.to - range.from + 1); + mpRegexTextEdit->setSelection(range.from, range.to - range.from + 1); } } @@ -267,9 +269,9 @@ void CFiltersView::keyPressEvent ( QKeyEvent * event ) { if(true == NShortcuts::isEnter(event)) { - if(nullptr != mpRegexInputField) + if(nullptr != mpRegexTextEdit) { - mpRegexInputField->setFocus(); + mpRegexTextEdit->setFocus(); } } else if(true == NShortcuts::isCopyShortcut(event)) @@ -325,9 +327,9 @@ void CFiltersView::handleSettingsManagerChange() pAction->setShortcut(QKeySequence(tr("Enter"))); connect(pAction, &QAction::triggered, [this]() { - if(nullptr != mpRegexInputField) + if(nullptr != mpRegexTextEdit) { - mpRegexInputField->setFocus(); + mpRegexTextEdit->setFocus(); } }); contextMenu.addAction(pAction); @@ -556,6 +558,6 @@ PUML_PACKAGE_BEGIN(DMA_FiltersView_API) PUML_INHERITANCE_CHECKED(CSettingsManagerClient, extends) PUML_COMPOSITION_DEPENDENCY_CHECKED(CFilterItemDelegate, 1, 1, contains) PUML_AGGREGATION_DEPENDENCY_CHECKED(CFiltersModel, 1, 1, uses) - PUML_AGGREGATION_DEPENDENCY_CHECKED(QLineEdit, 1, 1, regex input field) + PUML_AGGREGATION_DEPENDENCY_CHECKED(CRegexHistoryTextEdit, 1, 1, regex input field) PUML_CLASS_END() PUML_PACKAGE_END() diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryComponent.hpp b/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryComponent.hpp index fbdb5515..2da77603 100644 --- a/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryComponent.hpp +++ b/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryComponent.hpp @@ -9,7 +9,7 @@ #include "components/settings/api/ISettingsManager.hpp" #include "components/analyzer/api/IDLTMessageAnalyzerController.hpp" #include "components/regexHistory/api/IRegexHistoryProvider.hpp" -#include "components/regexHistory/api/CRegexHistoryLineEdit.hpp" +#include "components/regexHistory/api/CRegexHistoryTextEdit.hpp" class CPatternsView; @@ -36,7 +36,7 @@ class CRegexHistoryComponent : public DMA::IComponent * @param pDLTMessageAnalyzerController Shared pointer to the DLT message analyzer controller. */ CRegexHistoryComponent( const tSettingsManagerPtr& pSettingsManager, - CRegexHistoryLineEdit* pRegexHistoryLineEdit, + CRegexHistoryTextEdit* pRegexHistoryLineEdit, CPatternsView* pPatternsView, const tDLTMessageAnalyzerControllerPtr& pDLTMessageAnalyzerController); diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryLineEdit.hpp b/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryLineEdit.hpp deleted file mode 100644 index 68ccfe05..00000000 --- a/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryLineEdit.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include "QLineEdit" -#include "QKeyEvent" -#include "QWidget" - -#include "components/regexHistory/api/IRegexHistoryProvider.hpp" - -/** - * @brief A custom QLineEdit with regex history support. - * - * This class extends QLineEdit to include features for managing regex history - * and handling specific key events. - */ -class CRegexHistoryLineEdit : public QLineEdit -{ - Q_OBJECT - -public: - - /** - * @brief Constructs a CRegexHistoryLineEdit object. - * - * @param parent The parent widget for the line edit. Defaults to nullptr. - */ - explicit CRegexHistoryLineEdit(QWidget *parent = nullptr); - - /** - * @brief Sets the regex history provider. - * - * This method associates a regex history provider. - * - * @param pRegexHistoryProviderPtr Shared pointer to the regex history provider. - */ - void setRegexHistoryProvider(const tRegexHistoryProviderPtr& pRegexHistoryProviderPtr); - - /** - * @brief Sets whether to ignore return key events. - * - * This method allows control over whether the line edit should handle - * return (Enter) key events or ignore them. - * - * @param val True to ignore return key events, false otherwise. - */ - void setIgnoreReturnKeyEvent(bool val); - - - /** - * @brief Checks whether return key events are ignored. - * - * This method returns whether the line edit is currently set to ignore - * return key events. - * - * @return bool True if return key events are ignored, false otherwise. - */ - bool getIgnoreReturnKeyEvent() const; - - /** - * @brief Activates regex history. - * - * This method activates the regex history feature. - */ - void activateRegexHistory(); - -protected: - - virtual void focusInEvent(QFocusEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - -private: - - tRegexHistoryProviderPtr mpRegexHistoryProvider; - bool mbIgnoreReturnKeyEvent; -}; diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryTextEdit.hpp b/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryTextEdit.hpp new file mode 100644 index 00000000..1ad85d2e --- /dev/null +++ b/dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryTextEdit.hpp @@ -0,0 +1,122 @@ +#pragma once + +#include "QTextEdit" +#include "QKeyEvent" +#include "QWidget" + +#include "components/settings/api/CSettingsManagerClient.hpp" + +class QCompleter; + +#include "components/regexHistory/api/IRegexHistoryProvider.hpp" + +/** + * @brief A custom QTextEdit with regex history support. + * + * This class extends QTextEdit to include features for managing regex history + * and handling specific key events. + */ +class CRegexHistoryTextEdit : public QTextEdit, + public CSettingsManagerClient +{ + Q_OBJECT + +public: + + /** + * @brief Constructs a CRegexHistoryTextEdit object. + * + * @param parent The parent widget for the text edit. Defaults to nullptr. + */ + explicit CRegexHistoryTextEdit(QWidget *parent = nullptr); + + /** + * @brief Sets the regex history provider. + * + * This method associates a regex history provider. + * + * @param pRegexHistoryProviderPtr Shared pointer to the regex history provider. + */ + void setRegexHistoryProvider(const tRegexHistoryProviderPtr& pRegexHistoryProviderPtr); + + /** + * @brief Sets whether to ignore return key events. + * + * This method allows control over whether the line edit should handle + * return (Enter) key events or ignore them. + * + * @param val True to ignore return key events, false otherwise. + */ + void setIgnoreReturnKeyEvent(bool val); + + /** + * @brief Checks whether return key events are ignored. + * + * This method returns whether the line edit is currently set to ignore + * return key events. + * + * @return bool True if return key events are ignored, false otherwise. + */ + bool getIgnoreReturnKeyEvent() const; + + /** + * @brief Activates regex history. + * + * This method activates the regex history. + */ + void activateRegexHistory(); + + /** + * @brief Sets the completer for the text edit. + * + * This method allows setting a QCompleter to provide text completions. + * + * @param pCompleter Pointer to the QCompleter instance. + */ + void setCompleter(QCompleter* pCompleter); + + /** + * @brief Gets the current completer. + * + * This method returns the current QCompleter instance used by the text edit. + * + * @return QCompleter* Pointer to the current QCompleter. + */ + QCompleter *completer() const; + + /** + * @brief Sets the selection range within the text. + * + * This method allows setting a selection starting at a given position with + * a specified length. + * + * @param start The starting position of the selection. + * @param length The length of the selection. + */ + void setSelection(int start, int length); + +signals: + /** + * @brief Signal emitted when the return key is pressed. + */ + void returnPressed(); + +private slots: + void insertCompletion(const QString &completion); + +protected: + void insertFromMimeData(const QMimeData *source) override; + void resizeEvent(QResizeEvent *event) override; + virtual void focusInEvent(QFocusEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void handleSettingsManagerChange() override; + +private: + QString textUnderCursor() const; + void adjustHeightToContent(); + +private: + tRegexHistoryProviderPtr mpRegexHistoryProvider; + bool mbIgnoreReturnKeyEvent; + QCompleter* mpCompleter; +}; diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/src/CMakeLists.txt b/dltmessageanalyzerplugin/src/components/regexHistory/src/CMakeLists.txt index 43c7755e..ae86a273 100644 --- a/dltmessageanalyzerplugin/src/components/regexHistory/src/CMakeLists.txt +++ b/dltmessageanalyzerplugin/src/components/regexHistory/src/CMakeLists.txt @@ -1,6 +1,6 @@ set(WRAP_SRC ../api/IRegexHistoryProvider.hpp CRegexHistoryProvider.hpp - ../api/CRegexHistoryLineEdit.hpp) + ../api/CRegexHistoryTextEdit.hpp) DMA_qt_wrap_cpp(PROCESSED_MOCS WRAP_SRC) @@ -8,7 +8,7 @@ add_library(DMA_regexHistory STATIC CRegexHistoryComponent.cpp CRegexHistoryProvider.cpp IRegexHistoryProvider.cpp - CRegexHistoryLineEdit.cpp + CRegexHistoryTextEdit.cpp ${PROCESSED_MOCS}) target_link_libraries( DMA_regexHistory PUBLIC diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryComponent.cpp b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryComponent.cpp index 10b88a9c..383e640f 100644 --- a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryComponent.cpp +++ b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryComponent.cpp @@ -8,7 +8,7 @@ #include "dma/base/ForceLink.hpp" CRegexHistoryComponent::CRegexHistoryComponent( const tSettingsManagerPtr& pSettingsManager, - CRegexHistoryLineEdit* pRegexHistoryLineEdit, CPatternsView* pPatternsView, + CRegexHistoryTextEdit* pRegexHistoryLineEdit, CPatternsView* pPatternsView, const tDLTMessageAnalyzerControllerPtr& pDLTMessageAnalyzerController ): mpRegexHistoryProvider(std::make_shared(pSettingsManager, pRegexHistoryLineEdit, @@ -21,6 +21,7 @@ mpRegexHistoryProvider(std::make_shared(pSettingsManager, if(nullptr != pRegexHistoryLineEdit) { pRegexHistoryLineEdit->setRegexHistoryProvider(mpRegexHistoryProvider); + pRegexHistoryLineEdit->setSettingsManager(pSettingsManager); } } @@ -76,7 +77,7 @@ PUML_PACKAGE_BEGIN(DMA_RegexHistory_API) PUML_INHERITANCE_CHECKED(DMA::IComponent, implements) PUML_AGGREGATION_DEPENDENCY_CHECKED(CPatternsView, 1, 1, uses) PUML_USE_DEPENDENCY_CHECKED(ISettingsManager, 1, 1, passes) - PUML_USE_DEPENDENCY_CHECKED(CRegexHistoryLineEdit, 1, 1, passes) + PUML_USE_DEPENDENCY_CHECKED(CRegexHistoryTextEdit, 1, 1, passes) PUML_USE_DEPENDENCY_CHECKED(IDLTMessageAnalyzerController, 1, 1, passes) PUML_COMPOSITION_DEPENDENCY_CHECKED(CRegexHistoryProvider, 1, 1, creates) PUML_CLASS_END() diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryLineEdit.cpp b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryLineEdit.cpp deleted file mode 100644 index 5c316a10..00000000 --- a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryLineEdit.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "QCompleter" - -#include "../api/CRegexHistoryLineEdit.hpp" - -#include "DMA_Plantuml.hpp" - -CRegexHistoryLineEdit::CRegexHistoryLineEdit(QWidget *parent): - QLineEdit(parent), - mpRegexHistoryProvider(nullptr), - mbIgnoreReturnKeyEvent(false) -{} - -void CRegexHistoryLineEdit::focusInEvent(QFocusEvent *event) -{ - //SEND_MSG(QString("%1").arg(__FUNCTION__)); - QLineEdit::focusInEvent(event); - - if(nullptr != completer()) - { - //SEND_MSG(QString("%1 completer not nullptr").arg(__FUNCTION__)); - disconnect(completer(), QOverload::of(&QCompleter::activated), - static_cast(this), nullptr); - disconnect(completer(), QOverload::of(&QCompleter::activated), - static_cast(this), nullptr); - disconnect(completer(), QOverload::of(&QCompleter::highlighted), - static_cast(this), nullptr); - disconnect(completer(), QOverload::of(&QCompleter::highlighted), - static_cast(this), nullptr); - } -} - -void CRegexHistoryLineEdit::setRegexHistoryProvider(const tRegexHistoryProviderPtr& pRegexHistoryProviderPtr) -{ - mpRegexHistoryProvider = pRegexHistoryProviderPtr; -} - -void CRegexHistoryLineEdit::setIgnoreReturnKeyEvent(bool val) -{ - mbIgnoreReturnKeyEvent = val; -} - -bool CRegexHistoryLineEdit::getIgnoreReturnKeyEvent() const -{ - return mbIgnoreReturnKeyEvent; -} - -void CRegexHistoryLineEdit::activateRegexHistory() -{ - if(nullptr != mpRegexHistoryProvider) - { - mpRegexHistoryProvider->setSuggestionActive(true); - int numberOfSuggestions = mpRegexHistoryProvider->updateSuggestions(text()); - - if(0 == numberOfSuggestions) - { - mpRegexHistoryProvider->setSuggestionActive(false); - } - - update(); - } -} - -void CRegexHistoryLineEdit::keyPressEvent(QKeyEvent *event) -{ - if(nullptr != event) - { - if (event->key() == Qt::Key_Space && event->modifiers() == Qt::ControlModifier) - { - activateRegexHistory(); - } - else if(event->key() == Qt::Key_Escape) - { - if(nullptr != mpRegexHistoryProvider && - true == mpRegexHistoryProvider->getSuggestionActive()) - { - mpRegexHistoryProvider->setSuggestionActive(false); - update(); - } - else - { - QLineEdit::keyPressEvent(event); - } - } - else - { - QString prevText = text(); - - // Pass the event to the base class for normal processing - QLineEdit::keyPressEvent(event); - - QString newText = text(); - - if(prevText != newText) - { - if(nullptr != mpRegexHistoryProvider && - true == mpRegexHistoryProvider->getSuggestionActive()) - { - static_cast(mpRegexHistoryProvider->updateSuggestions(text())); - update(); - } - } - } - } -} - -PUML_PACKAGE_BEGIN(DMA_RegexHistory_API) - PUML_CLASS_BEGIN(CRegexHistoryLineEdit) - PUML_INHERITANCE_CHECKED(QLineEdit, extends) - PUML_AGGREGATION_DEPENDENCY_CHECKED(IRegexHistoryProvider, 1, 1, uses) - PUML_CLASS_END() -PUML_PACKAGE_END() diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.cpp b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.cpp index a12855b6..ff4eb21d 100644 --- a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.cpp +++ b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.cpp @@ -11,7 +11,7 @@ #include "CRegexHistoryProvider.hpp" #include "components/settings/api/ISettingsManager.hpp" -#include "components/regexHistory/api/CRegexHistoryLineEdit.hpp" +#include "components/regexHistory/api/CRegexHistoryTextEdit.hpp" #include "components/log/api/CLog.hpp" @@ -24,10 +24,10 @@ const static int sSuggestionTypeRole = 123; // CExtendedCompleter implementation CExtendedCompleter::CExtendedCompleter(QObject* parent, - CRegexHistoryLineEdit* pRegexLineEdit): + CRegexHistoryTextEdit* pRegexTextEdit): QCompleter(parent), mbStartProcessEventFilter(false), -mpRegexLineEdit(pRegexLineEdit) +mpRegexTextEdit(pRegexTextEdit) {} void CExtendedCompleter::initFinished() @@ -54,9 +54,9 @@ bool CExtendedCompleter::eventFilter(QObject *o, QEvent *e) // Handle the key press, prevent further propagation if (popup()->isVisible()) { - mpRegexLineEdit->setIgnoreReturnKeyEvent(true); + mpRegexTextEdit->setIgnoreReturnKeyEvent(true); bool bResult = QCompleter::eventFilter(o, e); - mpRegexLineEdit->setIgnoreReturnKeyEvent(false); + mpRegexTextEdit->setIgnoreReturnKeyEvent(false); return bResult; } } @@ -175,23 +175,23 @@ static void deleteNonRelevantElements(ISettingsManager::tRegexUsageStatisticsIte } CRegexHistoryProvider::CRegexHistoryProvider(const tSettingsManagerPtr& pSettingsManager, - CRegexHistoryLineEdit* pRegexLineEdit, CPatternsView* pPatternsView, + CRegexHistoryTextEdit* pRegexTextEdit, CPatternsView* pPatternsView, const tDLTMessageAnalyzerControllerPtr& pDLTMessageAnalyzerController): CSettingsManagerClient(pSettingsManager), -mpRegexLineEdit(pRegexLineEdit), +mpRegexTextEdit(pRegexTextEdit), mpPatternsView(pPatternsView), mpDLTMessageAnalyzerController(pDLTMessageAnalyzerController), mbSuggestionActive(false) { - if(nullptr != mpRegexLineEdit) + if(nullptr != mpRegexTextEdit) { - CExtendedCompleter* pCompleter = new CExtendedCompleter(this, mpRegexLineEdit); + CExtendedCompleter* pCompleter = new CExtendedCompleter(this, mpRegexTextEdit); QStandardItemModel* pModel = new QStandardItemModel(pCompleter); pCompleter->setModel(pModel); pCompleter->setCompletionMode(QCompleter::UnfilteredPopupCompletion); mCompletionData.pCompleter = pCompleter; - auto* pExtendedListView = new QListView(mpRegexLineEdit); + auto* pExtendedListView = new QListView(mpRegexTextEdit); mCompletionData.pPopUp = pExtendedListView; mCompletionData.pPopUp->setIconSize(QSize(50, 50)); @@ -201,7 +201,7 @@ mbSuggestionActive(false) mCompletionData.pPopUp->setSelectionMode(QAbstractItemView::SingleSelection); mCompletionData.pCompleter->setPopup(mCompletionData.pPopUp); - mpRegexLineEdit->setCompleter(mCompletionData.pCompleter); + mpRegexTextEdit->setCompleter(mCompletionData.pCompleter); connect(pCompleter, &CExtendedCompleter::loseFocus, this, [this]() @@ -256,19 +256,19 @@ mbSuggestionActive(false) auto insertText = [this](const QString& text) { - auto* pCompleter = mpRegexLineEdit->completer(); + auto* pCompleter = mpRegexTextEdit->completer(); if(nullptr != pCompleter) { clearSuggestions(); - mpRegexLineEdit->selectAll(); - mpRegexLineEdit->insert(text); + mpRegexTextEdit->selectAll(); + mpRegexTextEdit->insertPlainText(text); } }; if(true == mCompletionData.bAppendMode) { - QString previousText = mpRegexLineEdit->text(); + QString previousText = mpRegexTextEdit->toPlainText(); if(true == sFindLastPipeRegex.isValid()) { @@ -396,7 +396,7 @@ int CRegexHistoryProvider::updateSuggestions(const QString& input) int result = 0; if(nullptr != mCompletionData.pCompleter - && nullptr != mpRegexLineEdit) + && nullptr != mpRegexTextEdit) { QStandardItemModel* pModel = static_cast(mCompletionData.pCompleter->model()); pModel->clear(); @@ -536,7 +536,7 @@ PUML_PACKAGE_BEGIN(DMA_RegexHistory) PUML_CLASS_BEGIN_CHECKED(CRegexHistoryProvider) PUML_INHERITANCE_CHECKED(IRegexHistoryProvider, implements) PUML_INHERITANCE_CHECKED(CSettingsManagerClient, extends) - PUML_AGGREGATION_DEPENDENCY_CHECKED(CRegexHistoryLineEdit, 1, 1, uses) + PUML_AGGREGATION_DEPENDENCY_CHECKED(CRegexHistoryTextEdit, 1, 1, uses) PUML_AGGREGATION_DEPENDENCY_CHECKED(CPatternsView, 1, 1, uses) PUML_AGGREGATION_DEPENDENCY_CHECKED(IDLTMessageAnalyzerController, 1, 1, uses) PUML_AGGREGATION_DEPENDENCY_CHECKED(ISettingsManager, 1, 1, uses) diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.hpp b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.hpp index 8792c34b..0f2169e1 100644 --- a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.hpp +++ b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryProvider.hpp @@ -12,14 +12,14 @@ #include "components/patternsView/api/CPatternsView.hpp" #include "components/analyzer/api/IDLTMessageAnalyzerController.hpp" -class CRegexHistoryLineEdit; +class CRegexHistoryTextEdit; class CExtendedCompleter : public QCompleter { Q_OBJECT public: CExtendedCompleter(QObject *parent, - CRegexHistoryLineEdit* pRegexLineEdit); + CRegexHistoryTextEdit* pRegexTextEdit); void initFinished(); signals: @@ -30,7 +30,7 @@ class CExtendedCompleter : public QCompleter private: bool mbStartProcessEventFilter; - CRegexHistoryLineEdit* mpRegexLineEdit; + CRegexHistoryTextEdit* mpRegexTextEdit; }; class CRegexHistoryProvider : public IRegexHistoryProvider, @@ -47,7 +47,7 @@ class CRegexHistoryProvider : public IRegexHistoryProvider, * @param pLineEdit - instance of the taraget line edit */ CRegexHistoryProvider(const tSettingsManagerPtr& pSettingsManager, - CRegexHistoryLineEdit* pRegexLineEdit, CPatternsView* pPatternsView, + CRegexHistoryTextEdit* pRegexTextEdit, CPatternsView* pPatternsView, const tDLTMessageAnalyzerControllerPtr& pDLTMessageAnalyzerController); ~CRegexHistoryProvider(); @@ -98,7 +98,7 @@ class CRegexHistoryProvider : public IRegexHistoryProvider, tCompletionData mCompletionData; - CRegexHistoryLineEdit* mpRegexLineEdit; + CRegexHistoryTextEdit* mpRegexTextEdit; CPatternsView* mpPatternsView; tDLTMessageAnalyzerControllerPtr mpDLTMessageAnalyzerController; bool mbSuggestionActive; diff --git a/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryTextEdit.cpp b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryTextEdit.cpp new file mode 100644 index 00000000..dd07dc03 --- /dev/null +++ b/dltmessageanalyzerplugin/src/components/regexHistory/src/CRegexHistoryTextEdit.cpp @@ -0,0 +1,248 @@ +#include "../api/CRegexHistoryTextEdit.hpp" + +#include "QCompleter" +#include "QTextCursor" +#include "QMimeData" + +#include "DMA_Plantuml.hpp" + +CRegexHistoryTextEdit::CRegexHistoryTextEdit(QWidget *parent): + QTextEdit(parent), + mpRegexHistoryProvider(nullptr), + mbIgnoreReturnKeyEvent(false), + mpCompleter(nullptr) +{ + connect(this, &QTextEdit::textChanged, this, &CRegexHistoryTextEdit::adjustHeightToContent); +} + +void CRegexHistoryTextEdit::resizeEvent(QResizeEvent *event) +{ + QTextEdit::resizeEvent(event); + adjustHeightToContent(); +} + +void CRegexHistoryTextEdit::handleSettingsManagerChange() +{ + if(getSettingsManager()) + { + connect(getSettingsManager().get(), &ISettingsManager::regexInputFieldHeightChanged, this, [this](const int&) + { + adjustHeightToContent(); + }); + } +} + +void CRegexHistoryTextEdit::adjustHeightToContent() +{ + if(getSettingsManager()) + { + // Calculate the height of one line + QFontMetrics fontMetrics(font()); + int lineHeight = fontMetrics.lineSpacing(); + + // Calculate the height needed for the content + int contentHeight = document()->size().height(); + + auto regexInputFieldHeight = getSettingsManager()->getRegexInputFieldHeight(); + + // Calculate the maximum height allowed (4 lines in this case) + int maxHeight = lineHeight * regexInputFieldHeight + 10; + + // Set the height of the QTextEdit based on the content but capped at maxHeight + setFixedHeight(qMin(contentHeight, maxHeight)); + + if (regexInputFieldHeight == 1) + { + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setLineWrapMode(QTextEdit::NoWrap); + } + else + { + setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + setLineWrapMode(QTextEdit::WidgetWidth); + } + } +} + +void CRegexHistoryTextEdit::focusInEvent(QFocusEvent *event) +{ + //SEND_MSG(QString("%1").arg(__FUNCTION__)); + QTextEdit::focusInEvent(event); + + if(nullptr != completer()) + { + //SEND_MSG(QString("%1 completer not nullptr").arg(__FUNCTION__)); + completer()->setWidget(this); + + disconnect(completer(), QOverload::of(&QCompleter::activated), + static_cast(this), nullptr); + disconnect(completer(), QOverload::of(&QCompleter::activated), + static_cast(this), nullptr); + disconnect(completer(), QOverload::of(&QCompleter::highlighted), + static_cast(this), nullptr); + disconnect(completer(), QOverload::of(&QCompleter::highlighted), + static_cast(this), nullptr); + } +} + +void CRegexHistoryTextEdit::setRegexHistoryProvider(const tRegexHistoryProviderPtr& pRegexHistoryProviderPtr) +{ + mpRegexHistoryProvider = pRegexHistoryProviderPtr; +} + +void CRegexHistoryTextEdit::setIgnoreReturnKeyEvent(bool val) +{ + mbIgnoreReturnKeyEvent = val; +} + +bool CRegexHistoryTextEdit::getIgnoreReturnKeyEvent() const +{ + return mbIgnoreReturnKeyEvent; +} + +void CRegexHistoryTextEdit::activateRegexHistory() +{ + if(nullptr != mpRegexHistoryProvider) + { + mpRegexHistoryProvider->setSuggestionActive(true); + int numberOfSuggestions = mpRegexHistoryProvider->updateSuggestions(toPlainText()); + + if(0 == numberOfSuggestions) + { + mpRegexHistoryProvider->setSuggestionActive(false); + } + + update(); + } +} + +void CRegexHistoryTextEdit::keyPressEvent(QKeyEvent *event) +{ + if(nullptr != event) + { + if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) + { + emit returnPressed(); + } + else if (event->key() == Qt::Key_Space && event->modifiers() == Qt::ControlModifier) + { + activateRegexHistory(); + } + else if(event->key() == Qt::Key_Escape) + { + if(nullptr != mpRegexHistoryProvider && + true == mpRegexHistoryProvider->getSuggestionActive()) + { + mpRegexHistoryProvider->setSuggestionActive(false); + update(); + } + else + { + QTextEdit::keyPressEvent(event); + } + } + else + { + QString prevText = toPlainText(); + + // Pass the event to the base class for normal processing + QTextEdit::keyPressEvent(event); + + QString newText = toPlainText(); + + if(prevText != newText) + { + if(nullptr != mpRegexHistoryProvider && + true == mpRegexHistoryProvider->getSuggestionActive()) + { + static_cast(mpRegexHistoryProvider->updateSuggestions(toPlainText())); + update(); + } + } + } + } +} + +void CRegexHistoryTextEdit::insertFromMimeData(const QMimeData *source) +{ + // Check if the source has plain text + if (source->hasText()) + { + // Get the pasted text and remove all newlines + QString text = source->text(); + text.replace("\n", "").replace("\r", ""); // Remove all newline characters + + // Insert the modified text without newlines + insertPlainText(text); + + adjustHeightToContent(); + } + else + { + // If there's no plain text, use the default implementation + QTextEdit::insertFromMimeData(source); + } +} + +void CRegexHistoryTextEdit::setCompleter(QCompleter* pCompleter) +{ + if (mpCompleter) + { + mpCompleter->disconnect(this); + } + + mpCompleter = pCompleter; + + if (!pCompleter) + return; + + pCompleter->setWidget(this); + pCompleter->setCompletionMode(QCompleter::PopupCompletion); + pCompleter->setCaseSensitivity(Qt::CaseInsensitive); + QObject::connect(pCompleter, QOverload::of(&QCompleter::activated), + this, &CRegexHistoryTextEdit::insertCompletion); +} + +QCompleter* CRegexHistoryTextEdit::completer() const +{ + return mpCompleter; +} + +void CRegexHistoryTextEdit::insertCompletion(const QString &completion) +{ + if (mpCompleter->widget() != this) + return; + QTextCursor tc = textCursor(); + int extra = completion.length() - mpCompleter->completionPrefix().length(); + tc.movePosition(QTextCursor::Left); + tc.movePosition(QTextCursor::EndOfWord); + tc.insertText(completion.right(extra)); + setTextCursor(tc); +} + +QString CRegexHistoryTextEdit::textUnderCursor() const +{ + QTextCursor tc = textCursor(); + tc.select(QTextCursor::WordUnderCursor); + return tc.selectedText(); +} + +void CRegexHistoryTextEdit::setSelection(int start, int length) +{ + auto cursor_instance = textCursor(); + int end = start + length; + cursor_instance.setPosition(start); + cursor_instance.setPosition(end, QTextCursor::KeepAnchor); + setTextCursor(cursor_instance); +} + +PUML_PACKAGE_BEGIN(DMA_RegexHistory_API) + PUML_CLASS_BEGIN(CRegexHistoryTextEdit) + PUML_INHERITANCE_CHECKED(QTextEdit, extends) + PUML_INHERITANCE_CHECKED(CSettingsManagerClient, extends) + PUML_AGGREGATION_DEPENDENCY_CHECKED(IRegexHistoryProvider, 1, 1, uses) + PUML_AGGREGATION_DEPENDENCY_CHECKED(QCompleter, 1, 1, uses) + PUML_CLASS_END() +PUML_PACKAGE_END() diff --git a/dltmessageanalyzerplugin/src/components/settings/api/ISettingsManager.hpp b/dltmessageanalyzerplugin/src/components/settings/api/ISettingsManager.hpp index 33954f43..219ad6ad 100644 --- a/dltmessageanalyzerplugin/src/components/settings/api/ISettingsManager.hpp +++ b/dltmessageanalyzerplugin/src/components/settings/api/ISettingsManager.hpp @@ -159,6 +159,7 @@ class ISettingsManager : public QObject virtual void setRegexCompletion_CaseSensitive(const bool& val) = 0; virtual void setRegexCompletion_SearchPolicy(const bool& val) = 0; virtual void setUserName(const QString& val) = 0; + virtual void setRegexInputFieldHeight(const int& linesNumber) = 0; /** * @brief setSelectedRegexFile - updates selected regex file @@ -230,6 +231,7 @@ class ISettingsManager : public QObject virtual const bool& getRegexCompletion_CaseSensitive() const = 0; virtual const bool& getRegexCompletion_SearchPolicy() const = 0; virtual const QString& getUsername() const = 0; + virtual const int& getRegexInputFieldHeight() const = 0; // allowed ranges virtual const TOptional>& getSetting_NumberOfThreads_AllowedRange() const = 0; @@ -302,4 +304,5 @@ class ISettingsManager : public QObject void regexCompletion_MaxNumberOfSuggestionsChanged(const int& regexCompletion_MaxNumberOfSuggestions); void regexCompletion_SearchPolicyChanged(const bool& regexCompletion_SearchPolicy); void usernameChanged(const QString& username); + void regexInputFieldHeightChanged(const int& linesNumber); }; diff --git a/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.cpp b/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.cpp index 4e5e98f9..c4d34933 100644 --- a/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.cpp +++ b/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.cpp @@ -30,6 +30,7 @@ static const QString sSettingsManagerVersionKey = "settingsManagerVersion"; static const QString sAliasesKey = "aliases"; static const QString sRegexUsageStatisticsKey = "regexUsageStatistics"; static const QString sUsernameKey = "username"; +static const QString sRegexInputFieldHeight = "regexInputFieldHeight"; static const QString sAliasKey = "alias"; static const QString sRegexKey = "regex"; static const QString sIsDefaultKey = "isDefault"; @@ -545,6 +546,11 @@ CSettingsManager::CSettingsManager(): // this data is not critical and is stored to file ONLY during exit. }, getCurrentUserName())), + mSetting_RegexInputFieldHeight(createArithmeticSettingsItem(sRegexInputFieldHeight, + [this](const int&, + const int& data){ regexInputFieldHeightChanged(data); }, + [this](){tryStoreSettingsConfig();}, + 4)), mRootSettingItemPtrVec(), mUserSettingItemPtrVec(), mPatternsSettingItemPtrVec(), @@ -604,6 +610,7 @@ CSettingsManager::CSettingsManager(): mUserSettingItemPtrVec.push_back(&mSetting_JavaCustomPath); mUserSettingItemPtrVec.push_back(&mSetting_GroupedViewFeatureActive); mUserSettingItemPtrVec.push_back(&mSetting_Username); + mUserSettingItemPtrVec.push_back(&mSetting_RegexInputFieldHeight); /////////////// PATTERNS SETTINGS /////////////// mPatternsSettingItemPtrVec.push_back(&mSetting_Aliases); @@ -1894,6 +1901,11 @@ void CSettingsManager::setUserName(const QString& val) mSetting_Username.setData(val); } +void CSettingsManager::setRegexInputFieldHeight(const int& linesNumber) +{ + mSetting_RegexInputFieldHeight.setData(linesNumber); +} + void CSettingsManager::setSearchViewLastColumnWidthStrategy(const int& val) { mSetting_SearchViewLastColumnWidthStrategy.setData(val); @@ -2162,6 +2174,11 @@ const QString& CSettingsManager::getUsername() const return mSetting_Username.getData(); } +const int& CSettingsManager::getRegexInputFieldHeight() const +{ + return mSetting_RegexInputFieldHeight.getData(); +} + const int& CSettingsManager::getSearchViewLastColumnWidthStrategy() const { return mSetting_SearchViewLastColumnWidthStrategy.getData(); diff --git a/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.hpp b/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.hpp index 0b9112fc..9b622db0 100644 --- a/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.hpp +++ b/dltmessageanalyzerplugin/src/components/settings/src/CSettingsManager.hpp @@ -108,6 +108,7 @@ class CSettingsManager : public ISettingsManager void setRegexCompletion_CaseSensitive(const bool& val) override; void setRegexCompletion_SearchPolicy(const bool& val) override; void setUserName(const QString& val) override; + void setRegexInputFieldHeight(const int& linesNumber) override; void setSelectedRegexFile(const QString& val) override; @@ -174,6 +175,7 @@ class CSettingsManager : public ISettingsManager const bool& getRegexCompletion_CaseSensitive() const override; const bool& getRegexCompletion_SearchPolicy() const override; const QString& getUsername() const override; + const int& getRegexInputFieldHeight() const override; // allowed ranges const TRangedSettingItem::tOptionalAllowedRange& getSetting_NumberOfThreads_AllowedRange() const override; @@ -516,6 +518,7 @@ class CSettingsManager : public ISettingsManager TSettingItem mSetting_RegexUsageStatistics; TSettingItem mSetting_Username; + TSettingItem mSetting_RegexInputFieldHeight; typedef ISettingItem* tSettingItemPtr; typedef std::vector tSettingItemsPtrVec; diff --git a/dltmessageanalyzerplugin/src/dltmessageanalyzerplugin.cpp b/dltmessageanalyzerplugin/src/dltmessageanalyzerplugin.cpp index 1b750ffc..86d56dfd 100644 --- a/dltmessageanalyzerplugin/src/dltmessageanalyzerplugin.cpp +++ b/dltmessageanalyzerplugin/src/dltmessageanalyzerplugin.cpp @@ -358,7 +358,7 @@ QWidget* DLTMessageAnalyzerPlugin::initViewer() { auto pRegexHistoryComponent = std::make_shared(mpSettingsComponent->getSettingsManager(), - mpForm->getRegexLineEdit(), + mpForm->getRegexTextEdit(), mpPatternsViewComponent->getPatternsView(), mpAnalyzerComponent->getAnalyzerController()); mpRegexHistoryComponent = pRegexHistoryComponent; @@ -448,14 +448,14 @@ QWidget* DLTMessageAnalyzerPlugin::initViewer() if(nullptr != mpForm->getFiltersView()) { - mpForm->getFiltersView()->setRegexInputField(mpForm->getRegexLineEdit()); + mpForm->getFiltersView()->setRegexInputField(mpForm->getRegexTextEdit()); } mpDLTMessageAnalyzer = IDLTMessageAnalyzerControllerConsumer::createInstance(pAnalyzerController, mpGroupedViewComponent->getGroupedViewModel(), mpForm->getProgresBarLabel(), mpForm->getProgresBar(), - mpForm->getRegexLineEdit(), + mpForm->getRegexTextEdit(), mpForm->getErrorLabel(), mpPatternsViewComponent->getPatternsView(), mpPatternsViewComponent->getPatternsModel(), @@ -477,14 +477,14 @@ QWidget* DLTMessageAnalyzerPlugin::initViewer() mpPlotViewComponent->getPlot(), mpCoverageNoteComponent->getCoverageNoteProviderPtr()); - connect(mpForm->getRegexLineEdit(), &QLineEdit::returnPressed, + connect(mpForm->getRegexTextEdit(), &CRegexHistoryTextEdit::returnPressed, this, [this]() { if(nullptr != mpDLTMessageAnalyzer) { if(nullptr != mpForm) { - auto pRegexLineEdit = mpForm->getRegexLineEdit(); + auto pRegexLineEdit = mpForm->getRegexTextEdit(); if(nullptr != pRegexLineEdit && false == pRegexLineEdit->getIgnoreReturnKeyEvent() ) { mpDLTMessageAnalyzer->analyze(); @@ -801,7 +801,7 @@ void DLTMessageAnalyzerPlugin::analyze() { if( mpDLTMessageAnalyzer && mpForm ) { - if( false == mpForm->getRegexLineEdit()->text().isEmpty() ) // if search string is non-empty + if( false == mpForm->getRegexTextEdit()->toPlainText().isEmpty() ) // if search string is non-empty { bool bRunning = mpDLTMessageAnalyzer->analyze(); diff --git a/dltmessageanalyzerplugin/src/plugin/api/CDLTMessageAnalyzer.hpp b/dltmessageanalyzerplugin/src/plugin/api/CDLTMessageAnalyzer.hpp index 395c5595..176cec9d 100644 --- a/dltmessageanalyzerplugin/src/plugin/api/CDLTMessageAnalyzer.hpp +++ b/dltmessageanalyzerplugin/src/plugin/api/CDLTMessageAnalyzer.hpp @@ -45,7 +45,7 @@ class CSearchResultView; class ISearchResultModel; class CTableMemoryJumper; class CCustomPlotExtended; -class CRegexHistoryLineEdit; +class CRegexHistoryTextEdit; /** * @brief The CDLTMessageAnalyzer class - used as a main controller of the plugin. @@ -60,7 +60,7 @@ class CDLTMessageAnalyzer : public IDLTMessageAnalyzerControllerConsumer, CDLTMessageAnalyzer(const std::weak_ptr& pController, const tGroupedViewModelPtr& pGroupedViewModel, - QLabel* pProgressBarLabel, QProgressBar* pProgressBar, CRegexHistoryLineEdit* pRegexLineEdit, + QLabel* pProgressBarLabel, QProgressBar* pProgressBar, CRegexHistoryTextEdit* pRegexLineEdit, QLabel* pLabel, CPatternsView* pPatternsTableView, const tPatternsModelPtr& pPatternsModel, QComboBox* pNumberOfThreadsCombobBox, QCheckBox* pContinuousSearchCheckBox, @@ -250,6 +250,13 @@ class CDLTMessageAnalyzer : public IDLTMessageAnalyzerControllerConsumer, QLineEdit* pRegexLineEdit, QWidget* pErrorAnimationWidget = nullptr); + std::shared_ptr createRegex( const QString& regex, + const QString& onSuccessMessages, + const QString& onFailureMessages, + bool appendRegexError, + CRegexHistoryTextEdit* pRegexTextEdit, + QWidget* pErrorAnimationWidget = nullptr); + void updateStatusLabel( const QString& text, bool isError = false ); void processOverwritePattern(const QString& alias, const QString checkedRegex, const QModelIndex editItem = QModelIndex()); @@ -273,7 +280,7 @@ class CDLTMessageAnalyzer : public IDLTMessageAnalyzerControllerConsumer, // default widgets QLabel* mpProgressBarLabel; QProgressBar* mpProgressBar; - CRegexHistoryLineEdit* mpRegexLineEdit; + CRegexHistoryTextEdit* mpRegexTextEdit; QLabel* mpLabel; QComboBox* mpNumberOfThreadsCombobBox; QTableView* mpMainTableView; diff --git a/dltmessageanalyzerplugin/src/plugin/api/form.h b/dltmessageanalyzerplugin/src/plugin/api/form.h index c9c60c81..d83bc8ba 100644 --- a/dltmessageanalyzerplugin/src/plugin/api/form.h +++ b/dltmessageanalyzerplugin/src/plugin/api/form.h @@ -40,7 +40,7 @@ class CFiltersView; class CUMLView; class CLogo; class CCustomPlotExtended; -class CRegexHistoryLineEdit; +class CRegexHistoryTextEdit; namespace Ui { class Form; @@ -60,7 +60,7 @@ class Form : public QWidget, CGroupedView* getGroupedResultView(); QProgressBar* getProgresBar(); QLabel* getProgresBarLabel(); - CRegexHistoryLineEdit* getRegexLineEdit(); + CRegexHistoryTextEdit* getRegexTextEdit(); QLabel* getErrorLabel(); CPatternsView* getPatternsTableView(); QComboBox* getNumberOfThreadsComboBox(); diff --git a/dltmessageanalyzerplugin/src/plugin/src/CDLTMessageAnalyzer.cpp b/dltmessageanalyzerplugin/src/plugin/src/CDLTMessageAnalyzer.cpp index cffe898e..34fc3895 100644 --- a/dltmessageanalyzerplugin/src/plugin/src/CDLTMessageAnalyzer.cpp +++ b/dltmessageanalyzerplugin/src/plugin/src/CDLTMessageAnalyzer.cpp @@ -52,7 +52,7 @@ #include "components/logsWrapper/api/IDLTLogsWrapperCreator.hpp" -#include "components/regexHistory/api/CRegexHistoryLineEdit.hpp" +#include "components/regexHistory/api/CRegexHistoryTextEdit.hpp" #include "DMA_Plantuml.hpp" @@ -67,7 +67,7 @@ namespace NShortcuts //CDLTMessageAnalyzer CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr& pController, const tGroupedViewModelPtr& pGroupedViewModel, - QLabel* pProgressBarLabel, QProgressBar* pProgressBar, CRegexHistoryLineEdit* pRegexLineEdit, + QLabel* pProgressBarLabel, QProgressBar* pProgressBar, CRegexHistoryTextEdit* pRegexLineEdit, QLabel* pLabel, CPatternsView* pPatternsTableView, const tPatternsModelPtr& pPatternsModel, QComboBox* pNumberOfThreadsCombobBox, QCheckBox* pContinuousSearchCheckBox, @@ -88,7 +88,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrsetUsedRegex(regex); + mpFiltersModel->setUsedRegex(mpRegexTextEdit->toPlainText()); }); } } @@ -190,8 +190,8 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrselectAll(); - mpRegexLineEdit->insert( regexCandidate ); + mpRegexTextEdit->selectAll(); + mpRegexTextEdit->insertPlainText( regexCandidate ); static_cast(analyze(&selectedAliases)); if(nullptr != mpFiltersSearchInput) @@ -202,8 +202,8 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrselectAll(); - mpRegexLineEdit->insert( regex ); + mpRegexTextEdit->selectAll(); + mpRegexTextEdit->insertPlainText( regex ); static_cast(analyze()); }); @@ -211,8 +211,8 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrselectAll(); - mpRegexLineEdit->insert( regex ); + mpRegexTextEdit->selectAll(); + mpRegexTextEdit->insertPlainText( regex ); static_cast(analyze()); }); } @@ -261,16 +261,16 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrcreateStandardContextMenu(); + QMenu* pContextMenu = mpRegexTextEdit->createStandardContextMenu(); pContextMenu->addSeparator(); { - QAction* pAction = new QAction("Case sensitive search", mpRegexLineEdit); + QAction* pAction = new QAction("Case sensitive search", mpRegexTextEdit); connect(pAction, &QAction::triggered, this, [this](bool checked) { getSettingsManager()->setCaseSensitiveRegex(checked); @@ -283,7 +283,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptraddSeparator(); { - QAction* pAction = new QAction("Save ...", mpRegexLineEdit); + QAction* pAction = new QAction("Save ...", mpRegexTextEdit); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) pAction->setShortcut(Qt::CTRL + Qt::Key_S); #else @@ -291,7 +291,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrtext() ); + addPattern( mpRegexTextEdit->toPlainText() ); }); pContextMenu->addAction(pAction); @@ -301,45 +301,45 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrselectionStart(); - int length = mpRegexLineEdit->selectedText().length(); + int start = mpRegexTextEdit->textCursor().selectionStart(); + int length = mpRegexTextEdit->textCursor().selectedText().length(); if (start >= 0 && length > 0) { // If there is a selection, wrap the selected text - QString selectedText = mpRegexLineEdit->selectedText(); + QString selectedText = mpRegexTextEdit->textCursor().selectedText(); QString wrappedText = addBefore + selectedText + addAfter; - // Replace the selected text directly in mpRegexLineEdit - mpRegexLineEdit->setSelection(start, length); - mpRegexLineEdit->insert(wrappedText); + // Replace the selected text directly in mpRegexTextEdit + mpRegexTextEdit->setSelection(start, length); + mpRegexTextEdit->insertPlainText(wrappedText); // Keep the selection that was originally selected - mpRegexLineEdit->setSelection(start, wrappedText.length()); + mpRegexTextEdit->setSelection(start, wrappedText.length()); } else { // If there is no selection, insert addBefore and addAfter at the cursor position - int cursorPos = mpRegexLineEdit->cursorPosition(); - mpRegexLineEdit->insert(addBefore + addAfter); + int cursorPos = mpRegexTextEdit->textCursor().position(); + mpRegexTextEdit->insertPlainText(addBefore + addAfter); // Set the new cursor position between addBefore and addAfter - mpRegexLineEdit->setCursorPosition(cursorPos + addBefore.length()); + mpRegexTextEdit->textCursor().setPosition(cursorPos + addBefore.length()); } } }; { - QMenu* pSubMenu = new QMenu("Regex group name glossary", mpRegexLineEdit); + QMenu* pSubMenu = new QMenu("Regex group name glossary", mpRegexTextEdit); { - QMenu* pSubSubMenu = new QMenu("Highlighting", mpRegexLineEdit); + QMenu* pSubSubMenu = new QMenu("Highlighting", mpRegexTextEdit); { - QAction* pAction = new QAction("Color", mpRegexLineEdit); + QAction* pAction = new QAction("Color", mpRegexTextEdit); connect(pAction, &QAction::triggered, this, [wrapSelectedText](bool) { wrapSelectedText("(", ")"); @@ -348,7 +348,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -357,7 +357,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -366,7 +366,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -375,7 +375,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -387,10 +387,10 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -399,7 +399,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -411,10 +411,10 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -423,7 +423,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -432,7 +432,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -441,7 +441,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -450,7 +450,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -459,7 +459,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -468,7 +468,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -477,7 +477,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -486,7 +486,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -498,10 +498,10 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -510,7 +510,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -519,7 +519,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -528,7 +528,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -547,7 +547,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -556,7 +556,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -565,7 +565,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -574,7 +574,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -583,7 +583,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -592,7 +592,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -601,7 +601,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -610,7 +610,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -619,7 +619,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -628,7 +628,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -637,7 +637,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -649,10 +649,10 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -661,7 +661,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -670,7 +670,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -679,7 +679,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -688,7 +688,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -697,7 +697,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -716,7 +716,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -725,7 +725,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -734,7 +734,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -743,7 +743,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -752,7 +752,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -761,7 +761,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -770,7 +770,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -779,7 +779,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -788,7 +788,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -797,7 +797,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -809,10 +809,10 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptr", ")"); @@ -829,7 +829,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptraddSeparator(); { - QAction* pAction = new QAction("Activate regex history", mpRegexLineEdit); + QAction* pAction = new QAction("Activate regex history", mpRegexTextEdit); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) pAction->setShortcut(Qt::CTRL + Qt::Key_Space); #else @@ -837,17 +837,17 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptractivateRegexHistory(); + mpRegexTextEdit->activateRegexHistory(); }); pContextMenu->addAction(pAction); } { - QMenu* pSubMenu = new QMenu("Completion settings", mpRegexLineEdit); + QMenu* pSubMenu = new QMenu("Completion settings", mpRegexTextEdit); { - QAction* pAction = new QAction("Case sensitive", mpRegexLineEdit); + QAction* pAction = new QAction("Case sensitive", mpRegexTextEdit); connect(pAction, &QAction::triggered, this, [this](bool checked) { getSettingsManager()->setRegexCompletion_CaseSensitive(checked); @@ -858,13 +858,13 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrsetExclusive(true); { - QAction* pAction = new QAction("\"Starts with\"", mpRegexLineEdit); + QAction* pAction = new QAction("\"Starts with\"", mpRegexTextEdit); connect(pAction, &QAction::triggered, this, [this]() { getSettingsManager()->setRegexCompletion_SearchPolicy(false); @@ -877,7 +877,7 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrsetRegexCompletion_SearchPolicy(true); @@ -895,10 +895,67 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptraddMenu(pSubMenu); } - pContextMenu->exec(mpRegexLineEdit->mapToGlobal(pos)); + pContextMenu->addSeparator(); + + { + QAction* pAction = new QAction("Set regex text edit max height ...", mpRegexTextEdit); + connect(pAction, &QAction::triggered, this, [this](bool) + { + QDialog dialog(mpRegexTextEdit); + QFormLayout form(&dialog); + + form.addRow(new QLabel("Set regex text edit max height ( number of lines from 1 to 10 ):")); + QList fields; + + QLineEdit* pLineEdit = new QLineEdit(&dialog); + + { + pLineEdit->setText( QString::number( getSettingsManager()->getRegexInputFieldHeight() ) ); + QString label("Regex text edit max height:"); + form.addRow(label, pLineEdit); + fields << pLineEdit; + } + + dialog.resize(400, dialog.height()); + + QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, + Qt::Horizontal, &dialog); + form.addRow(&buttonBox); + + auto accept_handler = [this, &pLineEdit, &dialog]() + { + if(pLineEdit) + { + bool ok = false; + auto maxHeight = pLineEdit->text().toInt(&ok); + + if(ok && ( maxHeight > 0 && maxHeight <= 10) ) + { + getSettingsManager()->setRegexInputFieldHeight(maxHeight); + dialog.accept(); + } + } + }; + + auto reject_handler = [&dialog]() + { + dialog.reject(); + }; + + QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, accept_handler); + QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, reject_handler); + + // Show the dialog as modal + dialog.exec(); + }); + + pContextMenu->addAction(pAction); + } + + pContextMenu->exec(mpRegexTextEdit->mapToGlobal(pos)); }; - connect( mpRegexLineEdit, &QWidget::customContextMenuRequested, this, showContextMenu ); + connect( mpRegexTextEdit, &QWidget::customContextMenuRequested, this, showContextMenu ); } if(nullptr != mpNumberOfThreadsCombobBox && @@ -1132,9 +1189,9 @@ CDLTMessageAnalyzer::CDLTMessageAnalyzer(const std::weak_ptrinstallEventFilter(this); + mpRegexTextEdit->installEventFilter(this); } handleLoadedConfig(); @@ -1164,13 +1221,13 @@ bool CDLTMessageAnalyzer::eventFilter(QObject* pObj, QEvent* pEvent) if (pEvent->type() == QEvent::ShortcutOverride ) { QKeyEvent *pKeyEvent = static_cast(pEvent); - if(nullptr != mpRegexLineEdit - && pObj == mpRegexLineEdit - && true == mpRegexLineEdit->hasFocus() ) + if(nullptr != mpRegexTextEdit + && pObj == mpRegexTextEdit + && true == mpRegexTextEdit->hasFocus() ) { if( true == NShortcuts::isSaveRegexPatternShortcut( pKeyEvent ) ) { - addPattern( mpRegexLineEdit->text() ); + addPattern( mpRegexTextEdit->toPlainText() ); pEvent->accept(); bResult = true; } @@ -1335,6 +1392,57 @@ std::shared_ptr CDLTMessageAnalyzer::createRegex( const QStr return pResult; } +std::shared_ptr CDLTMessageAnalyzer::createRegex( const QString& regex, + const QString& onSuccessMessages, + const QString& onFailureMessages, + bool appendRegexError, + CRegexHistoryTextEdit* pRegexTextEdit, + QWidget* pErrorAnimationWidget + ) +{ + QString regex_ = addRegexOptions( regex ); + + auto caseSensitiveOption = getSettingsManager()->getCaseSensitiveRegex() ? + QRegularExpression::NoPatternOption: + QRegularExpression::CaseInsensitiveOption; + + std::shared_ptr pResult = std::make_shared(regex_, caseSensitiveOption); + + if(0 != regex_.size()) + { + if(true == pResult->isValid()) + { + updateStatusLabel( onSuccessMessages, false ); + mpGroupedViewModel->setUsedRegex(regex_); + } + else + { + QString error(onFailureMessages); + + if(true == appendRegexError) + { + error.append(getFormattedRegexError(*pResult)); + } + + updateStatusLabel( error, true ); + + if( nullptr != pRegexTextEdit) + { + pRegexTextEdit->setFocus(); + auto errorColumn = getRegexErrorColumn(*pResult); + pRegexTextEdit->setSelection(errorColumn, 1); + } + + if(nullptr != pErrorAnimationWidget) + { + animateError(pErrorAnimationWidget); + } + } + } + + return pResult; +} + void CDLTMessageAnalyzer::resetSearchRange() { if(nullptr != mpMainTabWidget) @@ -1518,9 +1626,9 @@ bool CDLTMessageAnalyzer::analyze(const QStringList* pSelectedAliases) QString regex; - if( nullptr != mpRegexLineEdit ) + if( nullptr != mpRegexTextEdit ) { - regex = mpRegexLineEdit->text(); + regex = mpRegexTextEdit->toPlainText(); } if(nullptr != mpSearchResultView) @@ -1530,7 +1638,7 @@ bool CDLTMessageAnalyzer::analyze(const QStringList* pSelectedAliases) if(0 != regex.size()) { - auto pRegex = createRegex( regex, sDefaultStatusText, "Regex error: ", true, mpRegexLineEdit, mpRegexLineEdit ); + auto pRegex = createRegex( regex, sDefaultStatusText, "Regex error: ", true, mpRegexTextEdit, mpRegexTextEdit ); if(nullptr == pRegex || false == pRegex->isValid()) { @@ -1686,7 +1794,7 @@ void CDLTMessageAnalyzer::animateError( QWidget* pAnimationWidget ) return; } - if(nullptr != mpRegexLineEdit) + if(nullptr != mpRegexTextEdit) { CBGColorAnimation* pAnimationProxy = new CBGColorAnimation(pAnimationWidget, QPalette::Base); @@ -1962,7 +2070,7 @@ void CDLTMessageAnalyzer::addPattern(const QString& pattern) bool ok; - auto pRegex = createRegex( pattern, sDefaultStatusText, "Pattern not saved. Regex error: ", true, mpRegexLineEdit, mpRegexLineEdit ); + auto pRegex = createRegex( pattern, sDefaultStatusText, "Pattern not saved. Regex error: ", true, mpRegexTextEdit, mpRegexTextEdit ); if(true == pRegex->isValid()) { @@ -2216,7 +2324,7 @@ void CDLTMessageAnalyzer::overwritePattern() { if( nullptr == mpPatternsModel || nullptr == mpPatternsTreeView || - nullptr == mpRegexLineEdit ) + nullptr == mpRegexTextEdit ) { return; } @@ -2228,8 +2336,8 @@ void CDLTMessageAnalyzer::overwritePattern() const auto& selectedRow = selectedRows[0]; QString alias = selectedRow.data().value(); - QString regex = mpRegexLineEdit->text(); - auto pParsedRegex = createRegex( regex, sDefaultStatusText, "Pattern not updated. Regex error: ", true, mpRegexLineEdit, mpRegexLineEdit ); + QString regex = mpRegexTextEdit->toPlainText(); + auto pParsedRegex = createRegex( regex, sDefaultStatusText, "Pattern not updated. Regex error: ", true, mpRegexTextEdit, mpRegexTextEdit ); if(nullptr != pParsedRegex && true == pParsedRegex->isValid()) { @@ -2513,6 +2621,6 @@ PUML_PACKAGE_BEGIN(DMA_Plugin_API) PUML_AGGREGATION_DEPENDENCY_CHECKED(ISettingsManager, 1, 1, gets and uses) PUML_AGGREGATION_DEPENDENCY_CHECKED(ICoverageNoteProvider, 1, 1, uses) PUML_USE_DEPENDENCY_CHECKED(IDLTMessageAnalyzerController, 1, 1, gets and feeds to IDLTMessageAnalyzerControllerConsumer) - PUML_USE_DEPENDENCY_CHECKED(CRegexHistoryLineEdit, 1, 1, uses and passes) + PUML_USE_DEPENDENCY_CHECKED(CRegexHistoryTextEdit, 1, 1, uses and passes) PUML_CLASS_END() PUML_PACKAGE_END() diff --git a/dltmessageanalyzerplugin/src/plugin/src/form.cpp b/dltmessageanalyzerplugin/src/plugin/src/form.cpp index c932290f..03a3c76c 100644 --- a/dltmessageanalyzerplugin/src/plugin/src/form.cpp +++ b/dltmessageanalyzerplugin/src/plugin/src/form.cpp @@ -574,9 +574,9 @@ QLabel* Form::getProgresBarLabel() return pResult; } -CRegexHistoryLineEdit* Form::getRegexLineEdit() +CRegexHistoryTextEdit* Form::getRegexTextEdit() { - CRegexHistoryLineEdit* pResult = nullptr; + CRegexHistoryTextEdit* pResult = nullptr; if(mpUI) { @@ -1117,6 +1117,6 @@ PUML_PACKAGE_BEGIN(DMA_Plugin_API) PUML_COMPOSITION_DEPENDENCY_CHECKED(CSearchResultView, 1, 1, contains) PUML_COMPOSITION_DEPENDENCY_CHECKED(CUMLView, 1, 1, contains) PUML_COMPOSITION_DEPENDENCY_CHECKED(CLogo, 1, 1, contains) - PUML_COMPOSITION_DEPENDENCY_CHECKED(CRegexHistoryLineEdit, 1, 1, contains) + PUML_COMPOSITION_DEPENDENCY_CHECKED(CRegexHistoryTextEdit, 1, 1, contains) PUML_CLASS_END() PUML_PACKAGE_END() diff --git a/dltmessageanalyzerplugin/src/plugin/src/form.ui b/dltmessageanalyzerplugin/src/plugin/src/form.ui index c49a99db..0577a2f4 100644 --- a/dltmessageanalyzerplugin/src/plugin/src/form.ui +++ b/dltmessageanalyzerplugin/src/plugin/src/form.ui @@ -7,7 +7,7 @@ 0 0 857 - 581 + 612 @@ -531,7 +531,7 @@ QPushButton:hover:!pressed{ 0 0 - 739 + 735 299 @@ -1046,46 +1046,54 @@ QPushButton:hover:!pressed{ - - - 6 + + + 0 - - QLayout::SetFixedSize + + 0 - - - - 0 - 0 - - - - - 30 - 0 - - - - - 30 - 16777215 - - - - - 75 - false - true - false - + + + 0 - - Qt::NoContextMenu + + 0 - - QPushButton { + + + + + 0 + 0 + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + + 75 + false + true + false + + + + Qt::NoContextMenu + + + QPushButton { border: 2px solid #8f8f91; border-radius: 2px; background-color: qlineargradient(spread:pad, x1:0.259, y1:0.720909, x2:0, y2:1, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); @@ -1103,37 +1111,93 @@ QPushButton:hover:!pressed{ background-color: qlineargradient(spread:pad, x1:0.119, y1:0.561682, x2:0.034, y2:0.926, stop:0 rgba(67, 115, 118, 255), stop:1 rgba(171, 211, 205, 255)); color: rgb(255, 255, 255); } - - - << - - + + + << + + + + + + + + 0 + 0 + + + + + 75 + true + + + + QLabel { + border: 1px solid #8f8f91; + background-color: qlineargradient(spread:pad, x1:0.259, y1:0.720909, x2:0, y2:1, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); + min-width: 80px; + color: rgb(255, 255, 255); +} + + + Regex: + + + Qt::AlignCenter + + + + + + + + 190 + 0 + + + + + 16777215 + 16777215 + + + + Qt::CustomContextMenu + + + + - - - - 10 - 0 - - - - - 16777215 - 16777215 - - - - - 75 - true - - - - Qt::CustomContextMenu + + + QLayout::SetFixedSize - - QPushButton { + + + + + 10 + 0 + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Qt::CustomContextMenu + + + QPushButton { border: 2px solid #8f8f91; border-radius: 2px; background-color: qlineargradient(spread:pad, x1:0.259, y1:0.720909, x2:0, y2:1, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); @@ -1152,83 +1216,66 @@ QPushButton:hover:!pressed{ background-color: qlineargradient(spread:pad, x1:0.119, y1:0.561682, x2:0.034, y2:0.926, stop:0 rgba(67, 115, 118, 255), stop:1 rgba(171, 211, 205, 255)); color: rgb(255, 255, 255); } - - - Analyze - - - - - - - - 190 - 0 - - - - - 16777215 - 16777215 - - - - Qt::CustomContextMenu - - - - - - - - 1 - 0 - - - - - 8 - 75 - true - - - - Cont. analysis - - - - - - - - 1 - 0 - - - - - 8 - 50 - false - - - - Number of threads: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 1 - 0 - - - + + + Analyze + + + + + + + + 1 + 0 + + + + + 8 + 75 + true + + + + Cont. analysis + + + + + + + + 1 + 0 + + + + + 8 + 50 + false + + + + Number of threads: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 1 + 0 + + + + + @@ -1435,9 +1482,9 @@ QPushButton:hover:!pressed{ 1 - CRegexHistoryLineEdit - QLineEdit -
components/regexHistory/api/CRegexHistoryLineEdit.hpp
+ CRegexHistoryTextEdit + QTextEdit +
components/regexHistory/api/CRegexHistoryTextEdit.hpp
diff --git a/md/dev_docs/puml/DLT.svg b/md/dev_docs/puml/DLT.svg index b93cc7cd..e2c3d69b 100644 --- a/md/dev_docs/puml/DLT.svg +++ b/md/dev_docs/puml/DLT.svg @@ -20,7 +20,7 @@ reverse link CDLTFileWrapper to QDltFile-->uses11uses11uses1*uses1*uses1*contains1*contains1*contains11creates and feeds into CContinuousAnalyzer11creates and feeds into CContinuousAnalyzer11contains11gets and feeds to IDLTMessageAnalyzerControllerConsumer11uses11passes11passes11extendsextendsextendsuses11uses11extendsimplementsimplementscontains1*contains1*uses11contains11gets and uses11contains11contains11QObjectextendsextendscontains1*contains1*passes to nested entities14uses11contains11uses11uses11contains11uses11uses11uses11uses11implementsextendscontains11contains1*contains1*QAbstractTableModelimplementsimplementsuses11uses11contains1*contains11uses11using to create IFiltersModel11using to create IFiltersModel11 "1" CFiltersModel : using to create IFiltersModel CFiltersViewComponent "1" o-- "1" CFiltersView : uses CFiltersViewComponent "1" *-- "1" IFiltersModel : contains diff --git a/md/dev_docs/puml/DMA_FiltersView_API.svg b/md/dev_docs/puml/DMA_FiltersView_API.svg index caf1da90..913a8ae8 100644 --- a/md/dev_docs/puml/DMA_FiltersView_API.svg +++ b/md/dev_docs/puml/DMA_FiltersView_API.svg @@ -1,40 +1,41 @@ -DMA_FiltersViewDMA_FiltersView_APIDMA_Framework_ComponentDMA_PluginDMA_Plugin_APIDMA_Settings_APIQtCFilterItemDelegateCFiltersModelCFiltersViewCFiltersViewComponentIFiltersModelvirtual void addCompletionData( const tFoundMatches& foundMatches ) = 0virtual void filterRegexTokens( const QString& filter ) = 0virtual void resetCompletionData() = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regexStr) = 0DMA::IComponentDLTMessageAnalyzerPluginCDLTMessageAnalyzerUi::FormCSettingsManagerClientQAbstractItemModelQLineEditQTreeViewimplementsextendsimplementsextendsimplementsimplementscontains11uses11regex input field11using to create IFiltersModel11uses11contains11contains11uses11uses11contains11DMA_FiltersViewDMA_FiltersView_APIDMA_Framework_ComponentDMA_PluginDMA_Plugin_APIDMA_RegexHistory_APIDMA_Settings_APIQtCFilterItemDelegateCFiltersModelCFiltersViewCFiltersViewComponentIFiltersModelvirtual void addCompletionData( const tFoundMatches& foundMatches ) = 0virtual void filterRegexTokens( const QString& filter ) = 0virtual void resetCompletionData() = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regexStr) = 0DMA::IComponentDLTMessageAnalyzerPluginCDLTMessageAnalyzerUi::FormCRegexHistoryTextEditCSettingsManagerClientQAbstractItemModelQTreeViewimplementsextendsimplementsextendsimplementsimplementscontains11uses11regex input field11using to create IFiltersModel11uses11contains11contains11uses11uses11contains11implementsimplementsuses11contains11contains11extendsextendsimplementsuses11uses11DMA::IComponentimplementsextendsimplementsimplementsDMA::CBaseSynchronousInitializablevirtual virtual tSyncInitOperationResult init() = 0virtual virtual tSyncInitOperationResult shutdown() = 0virtual virtual tSyncInitOperationResult startInit()virtual virtual tSyncInitOperationResult startShutdown()virtual virtual virtual bool isInitialized () constDMA::INamedObjectchar* getName() constDMA::ISynchronousInitializablevirtual virtual tSyncInitOperationResult startInit() = 0virtual virtual tSyncInitOperationResult startShutdown() = 0virtual virtual virtual bool isInitialized () const = 0implementsimplementsimplementsimplementsimplementsimplementsimplementsDMA::INamedObjectchar* getName() constDMA::IComponentextendsimplementsimplementsimplementsimplementscontains1*using to create IGroupedViewModel11using to create IGroupedViewModel11contains11contains11uses11contains11contains11extendsimplementsuses11contains11contains11QAbstractItemModelextendsimplementsimplementsimplementsconsole view tab widget11console tab11console input11contains11contains11implementscontains11contains11contains11contains11CLogComponentQPlainTextEditextendsimplementsimplementsCConsoleInputProcessorQObjectextendsextendsextendsimplementsuses11contains11contains11contains11QPushButtonextendsimplementsuses11uses11uses11creates instances1*creates instances1*creates instances1*creates instances1*contains11uses11uses11uses11uses11creates1*creates1*uses11provides11provides11implementsimplementsimplementscreates1*creates1*implementscontains1*uses11using to create IPatternsModel11using to create IPatternsModel11uses11contains11uses11uses11uses11implementscontains11uses11contains11contains11IPatternsModelvirtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isCombine, Qt::CheckState isDefault) = 0virtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isDefault = Qt::Unchecked) = 0virtual QModelIndex editData(const QModelIndex& idx, const QString& alias, const QString& regex, Qt::CheckState isDefault, Qt::CheckState isCombine) = 0virtual QString getAliasEditName( const QModelIndex& idx ) = 0virtual removeData(const QModelIndex& idx) = 0virtual signal void patternsRefreshed() = 0virtual tSearchResult search( const QString& alias ) = 0virtual void filterPatterns( const QString& filter ) = 0virtual void refreshRegexPatterns() = 0virtual void resetData() = 0virtual void updatePatternsInPersistency() = 0virtual void updateView() = 0CSettingsManagerClientextendsimplementsimplementsQWidgetextendscontains11contains11contains11uses11contains11uses11contains11contains11extendsextendsimplementsuses11uses11QtCImageViewerQWidgetextendsextendscontains1manyuses1*uses1*uses1manyuses1manyuses11uses1manyuses11contains11contains11extendsextendsimplementsuses11uses11QCPAbstractPlottable1D_QCPGanttBarsData_extendsextendscontains1manycontains1manycontains11contains11uses11contains11contains11 "1" CBGColorAnimation : uses CDLTMessageAnalyzer "1" o-- "1" CFiltersView : uses CDLTMessageAnalyzer "1" o-- "1" CPatternsView : uses CDLTMessageAnalyzer "1" *-- "1" CRegexDirectoryMonitor : contains -CDLTMessageAnalyzer "1" --> "1" CRegexHistoryLineEdit : uses and passes +CDLTMessageAnalyzer "1" --> "1" CRegexHistoryTextEdit : uses and passes CDLTMessageAnalyzer "1" o-- "1" CSearchResultView : uses CDLTMessageAnalyzer "1" o-- "1" CTableMemoryJumper : gets and uses CDLTMessageAnalyzer "1" o-- "1" CUMLView : uses @@ -282,7 +282,7 @@ Ui::Form "1" *-- "1" CFiltersView : contains Ui::Form "1" *-- "1" CGroupedView : contains Ui::Form "1" *-- "1" CLogo : contains Ui::Form "1" *-- "1" CPatternsView : contains -Ui::Form "1" *-- "1" CRegexHistoryLineEdit : contains +Ui::Form "1" *-- "1" CRegexHistoryTextEdit : contains Ui::Form "1" *-- "1" CSearchResultView : contains Ui::Form "1" *-- "1" CUMLView : contains diff --git a/md/dev_docs/puml/DMA_Plugin_API.svg b/md/dev_docs/puml/DMA_Plugin_API.svg index c92db777..9467a57b 100644 --- a/md/dev_docs/puml/DMA_Plugin_API.svg +++ b/md/dev_docs/puml/DMA_Plugin_API.svg @@ -1,80 +1,80 @@ -DMA_Analyzer_APIDMA_CommonDMA_CoverageNote_APIDMA_FiltersView_APIDMA_GroupedView_APIDMA_Log_APIDMA_Logo_APIDMA_LogsWrapper_APIDMA_PatternsView_APIDMA_PlantumlView_APIDMA_PluginDMA_Plugin_APIDMA_RegexHistory_APIDMA_SearchView_APIDMA_Settings_APIQtIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0IDLTMessageAnalyzerControllerConsumervirtual slot void progressNotification( const tProgressNotificationData& progressNotificationData ) = 0tRequestId requestAnalyze( const tRequestParameters& requestParameters )CBGColorAnimationCRegexDirectoryMonitorCTableMemoryJumperICoverageNoteProviderCFiltersViewIFiltersModelvirtual void addCompletionData( const tFoundMatches& foundMatches ) = 0virtual void filterRegexTokens( const QString& filter ) = 0virtual void resetCompletionData() = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regexStr) = 0CGroupedViewIGroupedViewModelvirtual int rowCount(const QModelIndex &parent = QModelIndex()) const = 0virtual std::pair<bool__QString> exportToHTML(QString& resultHTML) = 0virtual void addMatches( const tFoundMatches& matches, bool update ) = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regex) = 0CConsoleViewCLogoIFileWrappervirtual QString getCacheStatusAsString() const = 0virtual QString getFileName(int num = 0) = 0virtual bool cacheMsgByIndex( const tMsgId& msgId ) = 0virtual bool cacheMsgByIndexes( const QSet<tMsgId> msgIdSet ) = 0virtual bool cacheMsgByRange( const tIntRange& msgRange ) = 0virtual bool cacheMsgWrapper( const int& msgId, const tMsgWrapperPtr& pMsgWrapper ) = 0virtual bool getSubFilesHandlingStatus() const = 0virtual bool isFiltered() const = 0virtual int getMsgIdFromIndexInMainTable(int msgIdxInMainTable) const = 0virtual int getNumberOfFiles() const = 0virtual int size() const = 0virtual int sizeNonFiltered() const = 0signal void currentSizeMbChanged(tCacheSizeMB MBytes)signal void fullChanged(bool isFull)signal void isEnabledChanged(bool isEnabled)signal void loadChanged(unsigned int percents)signal void maxSizeMbChanged(tCacheSizeMB MBytes)virtual tIntRangeProperty normalizeSearchRange( const tIntRangeProperty& inputRange) = 0virtual tMsgWrapperPtr getMsg(const tMsgId& msgId) = 0virtual virtual tIntRangeList getSubFilesSizeRanges() const = 0virtual void copyFileNameToClipboard( const int& msgId ) const = 0virtual void copyFileNamesToClipboard( const tIntRange& msgsRange ) const = 0virtual void resetCache() = 0virtual void setEnableCache(bool isEnabled) = 0virtual void setMaxCacheSize(const tCacheSizeB& cacheSize ) = 0virtual void setMessageDecoder( IMsgDecoder* pMessageDecoder ) = 0virtual void setSubFilesHandlingStatus(const bool& val) = 0CPatternsViewIPatternsModelvirtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isCombine, Qt::CheckState isDefault) = 0virtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isDefault = Qt::Unchecked) = 0virtual QModelIndex editData(const QModelIndex& idx, const QString& alias, const QString& regex, Qt::CheckState isDefault, Qt::CheckState isCombine) = 0virtual QString getAliasEditName( const QModelIndex& idx ) = 0virtual removeData(const QModelIndex& idx) = 0virtual signal void patternsRefreshed() = 0virtual tSearchResult search( const QString& alias ) = 0virtual void filterPatterns( const QString& filter ) = 0virtual void refreshRegexPatterns() = 0virtual void resetData() = 0virtual void updatePatternsInPersistency() = 0virtual void updateView() = 0CUMLViewDLTMessageAnalyzerPluginCDLTMessageAnalyzerFormUi::FormCRegexHistoryLineEditCSearchResultViewISearchResultModelvirtual int getFileIdx( const QModelIndex& idx ) const = 0virtual std::pair<bool__tIntRange> addNextMessageIdxVec(const tFoundMatchesPack& foundMatchesPack) = 0virtual std::pair<int__QString > getUMLDiagramContent() const = 0virtual tPlotContent createPlotContent() const = 0virtual void resetData() = 0virtual void setFile(const tFileWrapperPtr& pFile) = 0virtual void updateView(const int& fromRow = 0) = 0CSettingsManagerClientISettingsManagerQWidgetQDltMessageDecoderextendsimplementsextendsextendscontains11contains11uses11uses11uses11uses11contains11uses and passes11uses11gets and uses11uses11uses11gets and feeds to IDLTMessageAnalyzerControllerConsumer11uses11uses11uses11uses11gets and uses11gets and uses11uses11contains11contains11contains11contains11contains11contains11contains11contains11contains11DMA_Analyzer_APIDMA_CommonDMA_CoverageNote_APIDMA_FiltersView_APIDMA_GroupedView_APIDMA_Log_APIDMA_Logo_APIDMA_LogsWrapper_APIDMA_PatternsView_APIDMA_PlantumlView_APIDMA_PluginDMA_Plugin_APIDMA_RegexHistory_APIDMA_SearchView_APIDMA_Settings_APIQtIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0IDLTMessageAnalyzerControllerConsumervirtual slot void progressNotification( const tProgressNotificationData& progressNotificationData ) = 0tRequestId requestAnalyze( const tRequestParameters& requestParameters )CBGColorAnimationCRegexDirectoryMonitorCTableMemoryJumperICoverageNoteProviderCFiltersViewIFiltersModelvirtual void addCompletionData( const tFoundMatches& foundMatches ) = 0virtual void filterRegexTokens( const QString& filter ) = 0virtual void resetCompletionData() = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regexStr) = 0CGroupedViewIGroupedViewModelvirtual int rowCount(const QModelIndex &parent = QModelIndex()) const = 0virtual std::pair<bool__QString> exportToHTML(QString& resultHTML) = 0virtual void addMatches( const tFoundMatches& matches, bool update ) = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regex) = 0CConsoleViewCLogoIFileWrappervirtual QString getCacheStatusAsString() const = 0virtual QString getFileName(int num = 0) = 0virtual bool cacheMsgByIndex( const tMsgId& msgId ) = 0virtual bool cacheMsgByIndexes( const QSet<tMsgId> msgIdSet ) = 0virtual bool cacheMsgByRange( const tIntRange& msgRange ) = 0virtual bool cacheMsgWrapper( const int& msgId, const tMsgWrapperPtr& pMsgWrapper ) = 0virtual bool getSubFilesHandlingStatus() const = 0virtual bool isFiltered() const = 0virtual int getMsgIdFromIndexInMainTable(int msgIdxInMainTable) const = 0virtual int getNumberOfFiles() const = 0virtual int size() const = 0virtual int sizeNonFiltered() const = 0signal void currentSizeMbChanged(tCacheSizeMB MBytes)signal void fullChanged(bool isFull)signal void isEnabledChanged(bool isEnabled)signal void loadChanged(unsigned int percents)signal void maxSizeMbChanged(tCacheSizeMB MBytes)virtual tIntRangeProperty normalizeSearchRange( const tIntRangeProperty& inputRange) = 0virtual tMsgWrapperPtr getMsg(const tMsgId& msgId) = 0virtual virtual tIntRangeList getSubFilesSizeRanges() const = 0virtual void copyFileNameToClipboard( const int& msgId ) const = 0virtual void copyFileNamesToClipboard( const tIntRange& msgsRange ) const = 0virtual void resetCache() = 0virtual void setEnableCache(bool isEnabled) = 0virtual void setMaxCacheSize(const tCacheSizeB& cacheSize ) = 0virtual void setMessageDecoder( IMsgDecoder* pMessageDecoder ) = 0virtual void setSubFilesHandlingStatus(const bool& val) = 0CPatternsViewIPatternsModelvirtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isCombine, Qt::CheckState isDefault) = 0virtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isDefault = Qt::Unchecked) = 0virtual QModelIndex editData(const QModelIndex& idx, const QString& alias, const QString& regex, Qt::CheckState isDefault, Qt::CheckState isCombine) = 0virtual QString getAliasEditName( const QModelIndex& idx ) = 0virtual removeData(const QModelIndex& idx) = 0virtual signal void patternsRefreshed() = 0virtual tSearchResult search( const QString& alias ) = 0virtual void filterPatterns( const QString& filter ) = 0virtual void refreshRegexPatterns() = 0virtual void resetData() = 0virtual void updatePatternsInPersistency() = 0virtual void updateView() = 0CUMLViewDLTMessageAnalyzerPluginCDLTMessageAnalyzerFormUi::FormCRegexHistoryTextEditCSearchResultViewISearchResultModelvirtual int getFileIdx( const QModelIndex& idx ) const = 0virtual std::pair<bool__tIntRange> addNextMessageIdxVec(const tFoundMatchesPack& foundMatchesPack) = 0virtual std::pair<int__QString > getUMLDiagramContent() const = 0virtual tPlotContent createPlotContent() const = 0virtual void resetData() = 0virtual void setFile(const tFileWrapperPtr& pFile) = 0virtual void updateView(const int& fromRow = 0) = 0CSettingsManagerClientISettingsManagerQWidgetQDltMessageDecoderextendsimplementsextendsextendscontains11contains11uses11uses11uses11uses11contains11uses and passes11uses11gets and uses11uses11uses11gets and feeds to IDLTMessageAnalyzerControllerConsumer11uses11uses11uses11uses11gets and uses11gets and uses11uses11contains11contains11contains11contains11contains11contains11contains11contains11contains11implementsextendsextendscontains11contains11implementsimplementsimplementsextendsextendsDMA_Analyzer_APIDMA_PatternsView_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_Settings_APIQtIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0CPatternsViewCExtendedCompleterCRegexHistoryProviderCRegexHistoryComponentCRegexHistoryLineEditIRegexHistoryProviderCSettingsManagerClientISettingsManagerQCompleterQListViewDMA_Analyzer_APIDMA_PatternsView_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_Settings_APIQtIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0CPatternsViewCExtendedCompleterCRegexHistoryProviderCRegexHistoryComponentCRegexHistoryTextEditIRegexHistoryProviderCSettingsManagerClientISettingsManagerQCompleterQListViewextendsextendsimplementscreates11uses11uses11uses11uses11uses11uses11creates11creates11creates11 "1" CRegexHistoryLineEdit : uses and passes -Ui::Form "1" *-- "1" CRegexHistoryLineEdit : contains -CRegexHistoryProvider "1" o-- "1" CRegexHistoryLineEdit : uses +CDLTMessageAnalyzer "1" --> "1" CRegexHistoryTextEdit : uses and passes +Ui::Form "1" *-- "1" CRegexHistoryTextEdit : contains +CRegexHistoryProvider "1" o-- "1" CRegexHistoryTextEdit : uses CRegexHistoryComponent "1" o-- "1" CPatternsView : uses -CRegexHistoryComponent "1" --> "1" CRegexHistoryLineEdit : passes CRegexHistoryComponent "1" *-- "1" CRegexHistoryProvider : creates +CRegexHistoryComponent "1" --> "1" CRegexHistoryTextEdit : passes CRegexHistoryComponent "1" --> "1" IDLTMessageAnalyzerController : passes CRegexHistoryComponent "1" --> "1" ISettingsManager : passes -CRegexHistoryLineEdit "1" o-- "1" IRegexHistoryProvider : uses +CRegexHistoryTextEdit "1" o-- "1" IRegexHistoryProvider : uses +CRegexHistoryTextEdit "1" o-- "1" QCompleter : uses @enduml \ No newline at end of file diff --git a/md/dev_docs/puml/DMA_RegexHistory_API.svg b/md/dev_docs/puml/DMA_RegexHistory_API.svg index 9716229a..9ad01f48 100644 --- a/md/dev_docs/puml/DMA_RegexHistory_API.svg +++ b/md/dev_docs/puml/DMA_RegexHistory_API.svg @@ -1,40 +1,47 @@ -DMA_Analyzer_APIDMA_Framework_ComponentDMA_PatternsView_APIDMA_PluginDMA_Plugin_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_Settings_APIQtIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0DMA::IComponentCPatternsViewDLTMessageAnalyzerPluginCDLTMessageAnalyzerUi::FormCRegexHistoryProviderCRegexHistoryComponentCRegexHistoryLineEditIRegexHistoryProviderISettingsManagerQLineEditQObjectimplementsimplementsextendsextendscontains11uses and passes11contains11uses11uses11passes11creates11passes11passes11uses11DMA_Analyzer_APIDMA_FiltersView_APIDMA_Framework_ComponentDMA_PatternsView_APIDMA_PluginDMA_Plugin_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_Settings_APIQtIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0CFiltersViewDMA::IComponentCPatternsViewDLTMessageAnalyzerPluginCDLTMessageAnalyzerUi::FormCRegexHistoryProviderCRegexHistoryComponentCRegexHistoryTextEditIRegexHistoryProviderCSettingsManagerClientISettingsManagerQCompleterQObjectQTextEditimplementsimplementsextendsextendsextendsregex input field11contains11uses and passes11contains11uses11uses11creates11passes11passes11passes11uses11uses11 "1" CRegexHistoryLineEdit : passes -CRegexHistoryLineEdit "1" o-- "1" IRegexHistoryProvider : uses +CRegexHistoryComponent "1" --> "1" CRegexHistoryTextEdit : passes +CRegexHistoryTextEdit "1" o-- "1" IRegexHistoryProvider : uses @enduml \ No newline at end of file diff --git a/md/dev_docs/puml/DMA_RegexHistory_API_standalone.svg b/md/dev_docs/puml/DMA_RegexHistory_API_standalone.svg index 5238aa9a..1b269663 100644 --- a/md/dev_docs/puml/DMA_RegexHistory_API_standalone.svg +++ b/md/dev_docs/puml/DMA_RegexHistory_API_standalone.svg @@ -1,18 +1,21 @@ -DMA_Framework_ComponentDMA_RegexHistory_APIQtDMA::IComponentCRegexHistoryComponentCRegexHistoryLineEditIRegexHistoryProviderQLineEditQObjectimplementsextendsextendspasses11uses11DMA_Framework_ComponentDMA_RegexHistory_APIDMA_Settings_APIQtDMA::IComponentCRegexHistoryComponentCRegexHistoryTextEditIRegexHistoryProviderCSettingsManagerClientQObjectQTextEditimplementsextendsextendsextendspasses11uses11extendsextendsimplementscreates11creates11uses11uses11uses11using to create ISearchResultModel11using to create ISearchResultModel11contains11uses11contains11uses11uses11implementsextendsuses11contains11contains11extendsextendsimplementsimplementsimplementsimplementsextendscontains1*creates11creates11DMA_AnalyzerDMA_Analyzer_APIDMA_CoverageNoteDMA_CoverageNote_APIDMA_FiltersViewDMA_FiltersView_APIDMA_Framework_ComponentDMA_GroupedViewDMA_GroupedView_APIDMA_PatternsViewDMA_PatternsView_APIDMA_PlantumlView_APIDMA_PlotView_APIDMA_Plugin_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_SearchViewDMA_SearchView_APIDMA_SettingsDMA_Settings_APIQtCDLTRegexAnalyzerWorkerCMTAnalyzerCAnalyzerComponentCCoverageNoteProviderCCoverageNoteComponentCFilterItemDelegateCFiltersModelCFiltersViewCFiltersViewComponentDMA::IComponentCGroupedViewModelCGroupedViewCGroupedViewComponentCPatternsModelCPatternsViewCPatternsViewComponentCUMLViewCUMLViewComponentCPlotViewComponentCDLTMessageAnalyzerFormCRegexHistoryProviderCRegexHistoryComponentCSearchResultHighlightingDelegateCSearchResultModelCSearchViewComponentCSettingsManagerCSettingsComponentCSettingsManagerClientISettingsManagerQObjectDMA_AnalyzerDMA_Analyzer_APIDMA_CoverageNoteDMA_CoverageNote_APIDMA_FiltersViewDMA_FiltersView_APIDMA_Framework_ComponentDMA_GroupedViewDMA_GroupedView_APIDMA_PatternsViewDMA_PatternsView_APIDMA_PlantumlView_APIDMA_PlotView_APIDMA_Plugin_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_SearchViewDMA_SearchView_APIDMA_SettingsDMA_Settings_APIQtCDLTRegexAnalyzerWorkerCMTAnalyzerCAnalyzerComponentCCoverageNoteProviderCCoverageNoteComponentCFilterItemDelegateCFiltersModelCFiltersViewCFiltersViewComponentDMA::IComponentCGroupedViewModelCGroupedViewCGroupedViewComponentCPatternsModelCPatternsViewCPatternsViewComponentCUMLViewCUMLViewComponentCPlotViewComponentCDLTMessageAnalyzerFormCRegexHistoryProviderCRegexHistoryComponentCRegexHistoryTextEditCSearchResultHighlightingDelegateCSearchResultModelCSearchViewComponentCSettingsManagerCSettingsComponentCSettingsManagerClientISettingsManagerQObjectextendsextendsextendsextendsextendsextendsextendsextendsextendsextendsextendsextendsimplementsimplementsextendsimplementsextendsuses11passes to nested entities11gets and uses11uses11passes11passes11creates11provides11uses11uses11implementsextendsprovides11uses11uses11partially implementsimplementsextendscontains1*contains1*DMA_AnalyzerDMA_Analyzer_APIDMA_CommonDMA_CoverageNoteDMA_CoverageNote_APIDMA_FiltersViewDMA_FiltersView_APIDMA_GroupedViewDMA_GroupedView_APIDMA_LogDMA_Log_APIDMA_Logo_APIDMA_LogsWrapper_APIDMA_PatternsView_APIDMA_PlantumlViewDMA_PlantumlView_APIDMA_PlotView_APIDMA_PluginDMA_Plugin_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_SearchViewDMA_SearchView_APIDMA_Settings_APIQtqcustomplotCDLTRegexAnalyzerWorkerCMTAnalyzerIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0IDLTMessageAnalyzerControllerConsumervirtual slot void progressNotification( const tProgressNotificationData& progressNotificationData ) = 0tRequestId requestAnalyze( const tRequestParameters& requestParameters )CBGColorAnimationCRegexDirectoryMonitorCTableMemoryJumperCCoverageNoteProviderCoverageNoteTableModelCCoverageNoteComponentICoverageNoteProviderCFilterItemDelegateCFiltersViewIFiltersModelvirtual void addCompletionData( const tFoundMatches& foundMatches ) = 0virtual void filterRegexTokens( const QString& filter ) = 0virtual void resetCompletionData() = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regexStr) = 0CGroupedViewModelCGroupedView«Singleton»CConsoleCtrlCConsoleInputProcessorCConsoleViewCLogoIFileWrappervirtual QString getCacheStatusAsString() const = 0virtual QString getFileName(int num = 0) = 0virtual bool cacheMsgByIndex( const tMsgId& msgId ) = 0virtual bool cacheMsgByIndexes( const QSet<tMsgId> msgIdSet ) = 0virtual bool cacheMsgByRange( const tIntRange& msgRange ) = 0virtual bool cacheMsgWrapper( const int& msgId, const tMsgWrapperPtr& pMsgWrapper ) = 0virtual bool getSubFilesHandlingStatus() const = 0virtual bool isFiltered() const = 0virtual int getMsgIdFromIndexInMainTable(int msgIdxInMainTable) const = 0virtual int getNumberOfFiles() const = 0virtual int size() const = 0virtual int sizeNonFiltered() const = 0signal void currentSizeMbChanged(tCacheSizeMB MBytes)signal void fullChanged(bool isFull)signal void isEnabledChanged(bool isEnabled)signal void loadChanged(unsigned int percents)signal void maxSizeMbChanged(tCacheSizeMB MBytes)virtual tIntRangeProperty normalizeSearchRange( const tIntRangeProperty& inputRange) = 0virtual tMsgWrapperPtr getMsg(const tMsgId& msgId) = 0virtual virtual tIntRangeList getSubFilesSizeRanges() const = 0virtual void copyFileNameToClipboard( const int& msgId ) const = 0virtual void copyFileNamesToClipboard( const tIntRange& msgsRange ) const = 0virtual void resetCache() = 0virtual void setEnableCache(bool isEnabled) = 0virtual void setMaxCacheSize(const tCacheSizeB& cacheSize ) = 0virtual void setMessageDecoder( IMsgDecoder* pMessageDecoder ) = 0virtual void setSubFilesHandlingStatus(const bool& val) = 0CPatternsViewCTreeRepresentationDelegateIPatternsModelvirtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isCombine, Qt::CheckState isDefault) = 0virtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isDefault = Qt::Unchecked) = 0virtual QModelIndex editData(const QModelIndex& idx, const QString& alias, const QString& regex, Qt::CheckState isDefault, Qt::CheckState isCombine) = 0virtual QString getAliasEditName( const QModelIndex& idx ) = 0virtual removeData(const QModelIndex& idx) = 0virtual signal void patternsRefreshed() = 0virtual tSearchResult search( const QString& alias ) = 0virtual void filterPatterns( const QString& filter ) = 0virtual void refreshRegexPatterns() = 0virtual void resetData() = 0virtual void updatePatternsInPersistency() = 0virtual void updateView() = 0CImageViewerCUMLViewCPlotViewComponentDLTMessageAnalyzerPluginFormCExtendedCompleterCRegexHistoryProviderCRegexHistoryLineEditIRegexHistoryProviderCSearchResultHighlightingDelegateCSearchResultModelCSearchResultViewCSearchViewComponentISettingsManagerQAbstractItemModelQAbstractTableModelQCompleterQElapsedTimerQFileSystemWatcherQImageQLineEditQListViewQObjectQPlainTextEditQProcessQPushButtonQStyledItemDelegateQTabWidgetQTableViewQTextEditQThreadQTimerQTreeViewQWidgetQCPAxisRectQCPGraphQCPLayerableQCPLegendQCustomPlotextendsextendsextendsextendsextendsimplementsextendsextendsimplementsimplementsimplementsextendsextendsextendsextendsextendsextendsextendsextendsimplementsextendsextendsextendsextendsextendsextendsextendsextendsimplementsextendsuses dlt-viewer main table view11extendsextendsextendsextendsextendsextendsextendscontains1*animation widget11contains11contains11passes to nested entities11passes to nested entities11passes to nested entities12passes to nested entities14passes to nested entities11passes to nested entities11passes to nested entities12passes to nested entities14uses11parent view11regex input field11console text edit11console view tab widget11console tab11console input11patterns search input11contains11contains12uses11contains11creates11uses main tab widget11uses11DMA_AnalyzerDMA_Analyzer_APIDMA_CommonDMA_CoverageNoteDMA_CoverageNote_APIDMA_FiltersViewDMA_FiltersView_APIDMA_GroupedViewDMA_GroupedView_APIDMA_LogDMA_Log_APIDMA_Logo_APIDMA_LogsWrapper_APIDMA_PatternsView_APIDMA_PlantumlViewDMA_PlantumlView_APIDMA_PlotView_APIDMA_PluginDMA_Plugin_APIDMA_RegexHistoryDMA_RegexHistory_APIDMA_SearchViewDMA_SearchView_APIDMA_Settings_APIQtqcustomplotCDLTRegexAnalyzerWorkerCMTAnalyzerIDLTMessageAnalyzerControllervirtual int getMaximumNumberOfThreads() const = 0signal void progressNotification( const tProgressNotificationData& progressNotificationData )virtual tRequestId requestAnalyze( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>&pClient, const tRequestParameters& requestParameters ) = 0virtual void cancelRequest( const std::weak_ptr<IDLTMessageAnalyzerControllerConsumer>& pClient,const tRequestId& requestId ) = 0IDLTMessageAnalyzerControllerConsumervirtual slot void progressNotification( const tProgressNotificationData& progressNotificationData ) = 0tRequestId requestAnalyze( const tRequestParameters& requestParameters )CBGColorAnimationCRegexDirectoryMonitorCTableMemoryJumperCCoverageNoteProviderCoverageNoteTableModelCCoverageNoteComponentICoverageNoteProviderCFilterItemDelegateCFiltersViewIFiltersModelvirtual void addCompletionData( const tFoundMatches& foundMatches ) = 0virtual void filterRegexTokens( const QString& filter ) = 0virtual void resetCompletionData() = 0virtual void resetData() = 0virtual void setUsedRegex(const QString& regexStr) = 0CGroupedViewModelCGroupedView«Singleton»CConsoleCtrlCConsoleInputProcessorCConsoleViewCLogoIFileWrappervirtual QString getCacheStatusAsString() const = 0virtual QString getFileName(int num = 0) = 0virtual bool cacheMsgByIndex( const tMsgId& msgId ) = 0virtual bool cacheMsgByIndexes( const QSet<tMsgId> msgIdSet ) = 0virtual bool cacheMsgByRange( const tIntRange& msgRange ) = 0virtual bool cacheMsgWrapper( const int& msgId, const tMsgWrapperPtr& pMsgWrapper ) = 0virtual bool getSubFilesHandlingStatus() const = 0virtual bool isFiltered() const = 0virtual int getMsgIdFromIndexInMainTable(int msgIdxInMainTable) const = 0virtual int getNumberOfFiles() const = 0virtual int size() const = 0virtual int sizeNonFiltered() const = 0signal void currentSizeMbChanged(tCacheSizeMB MBytes)signal void fullChanged(bool isFull)signal void isEnabledChanged(bool isEnabled)signal void loadChanged(unsigned int percents)signal void maxSizeMbChanged(tCacheSizeMB MBytes)virtual tIntRangeProperty normalizeSearchRange( const tIntRangeProperty& inputRange) = 0virtual tMsgWrapperPtr getMsg(const tMsgId& msgId) = 0virtual virtual tIntRangeList getSubFilesSizeRanges() const = 0virtual void copyFileNameToClipboard( const int& msgId ) const = 0virtual void copyFileNamesToClipboard( const tIntRange& msgsRange ) const = 0virtual void resetCache() = 0virtual void setEnableCache(bool isEnabled) = 0virtual void setMaxCacheSize(const tCacheSizeB& cacheSize ) = 0virtual void setMessageDecoder( IMsgDecoder* pMessageDecoder ) = 0virtual void setSubFilesHandlingStatus(const bool& val) = 0CPatternsViewCTreeRepresentationDelegateIPatternsModelvirtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isCombine, Qt::CheckState isDefault) = 0virtual QModelIndex addData(const QString& alias, const QString& regex, Qt::CheckState isDefault = Qt::Unchecked) = 0virtual QModelIndex editData(const QModelIndex& idx, const QString& alias, const QString& regex, Qt::CheckState isDefault, Qt::CheckState isCombine) = 0virtual QString getAliasEditName( const QModelIndex& idx ) = 0virtual removeData(const QModelIndex& idx) = 0virtual signal void patternsRefreshed() = 0virtual tSearchResult search( const QString& alias ) = 0virtual void filterPatterns( const QString& filter ) = 0virtual void refreshRegexPatterns() = 0virtual void resetData() = 0virtual void updatePatternsInPersistency() = 0virtual void updateView() = 0CImageViewerCUMLViewCPlotViewComponentDLTMessageAnalyzerPluginFormCExtendedCompleterCRegexHistoryProviderCRegexHistoryTextEditIRegexHistoryProviderCSearchResultHighlightingDelegateCSearchResultModelCSearchResultViewCSearchViewComponentISettingsManagerQAbstractItemModelQAbstractTableModelQCompleterQElapsedTimerQFileSystemWatcherQImageQLineEditQListViewQObjectQPlainTextEditQProcessQPushButtonQStyledItemDelegateQTabWidgetQTableViewQTextEditQThreadQTimerQTreeViewQWidgetQCPAxisRectQCPGraphQCPLayerableQCPLegendQCustomPlotextendsextendsextendsextendsextendsimplementsextendsextendsimplementsimplementsimplementsextendsextendsextendsextendsextendsextendsextendsextendsimplementsextendsextendsextendsextendsextendsextendsextendsextendsimplementsextendsuses dlt-viewer main table view11extendsextendsextendsextendsextendsextendsextendscontains1*animation widget11contains11contains11passes to nested entities11passes to nested entities11passes to nested entities12passes to nested entities14passes to nested entities11passes to nested entities11passes to nested entities12passes to nested entities14uses11parent view11console text edit11console view tab widget11console tab11console input11patterns search input11contains11contains12uses11contains11creates11uses11uses main tab widget11uses11nlohmann::jsonuses11uses11uses11uses11nlohmann_jsonnlohmann::jsonnlohmann::jsonextendsuses12uses1*uses1*uses1*extendsextendsextendsextendsextends