From dc22ac2066944d380ea6010f24dc181e117bae54 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Thu, 20 Jul 2023 21:56:34 -0500 Subject: [PATCH 01/10] feat: add alert button This adds a wxButton to the window to allow the user to filter the event log by alerts. --- clientgui/DlgEventLog.cpp | 6 +++++- clientgui/DlgEventLog.h | 3 ++- clientgui/Events.h | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index a6868adf652..4c5862fdb38 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2022 University of California +// Copyright (C) 2023 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -79,6 +79,7 @@ BEGIN_EVENT_TABLE( CDlgEventLog, DlgEventLogBase ) EVT_BUTTON(wxID_OK, CDlgEventLog::OnOK) EVT_BUTTON(ID_COPYAll, CDlgEventLog::OnMessagesCopyAll) EVT_BUTTON(ID_COPYSELECTED, CDlgEventLog::OnMessagesCopySelected) + EVT_BUTTON(ID_TASK_MESSAGES_FILTERBYERROR, CDlgEventLog::OnErrorFilter) EVT_BUTTON(ID_TASK_MESSAGES_FILTERBYPROJECT, CDlgEventLog::OnMessagesFilter) EVT_BUTTON(ID_SIMPLE_HELP, CDlgEventLog::OnButtonHelp) EVT_MENU(ID_SGDIAGNOSTICLOGFLAGS, CDlgEventLog::OnDiagnosticLogFlags) @@ -327,6 +328,9 @@ void CDlgEventLog::CreateControls() itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 12); + m_pErrorFilterButton = new wxButton(this, ID_TASK_MESSAGES_FILTERBYERROR, _("Show only aler&ts"), wxDefaultPosition, wxDefaultSize); + itemBoxSizer4->Add(m_pErrorFilterButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + m_pFilterButton = new wxButton(this, ID_TASK_MESSAGES_FILTERBYPROJECT, _("&Show only this project"), wxDefaultPosition, wxDefaultSize); itemBoxSizer4->Add(m_pFilterButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); diff --git a/clientgui/DlgEventLog.h b/clientgui/DlgEventLog.h index 2865028bbf6..3235d367a71 100644 --- a/clientgui/DlgEventLog.h +++ b/clientgui/DlgEventLog.h @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2023 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -173,6 +173,7 @@ class CDlgEventLog : public DlgEventLogBase wxInt32 m_iPreviousRowCount; wxButton* m_pFilterButton; wxButton* m_pCopySelectedButton; + wxButton* m_pErrorFilterButton; wxListItemAttr* m_pMessageInfoAttr; wxListItemAttr* m_pMessageErrorAttr; diff --git a/clientgui/Events.h b/clientgui/Events.h index 58783cc9359..647863d593f 100644 --- a/clientgui/Events.h +++ b/clientgui/Events.h @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2023 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -138,6 +138,7 @@ #define ID_TASK_MESSAGES_COPYALL 9400 #define ID_TASK_MESSAGES_COPYSELECTED 9401 #define ID_TASK_MESSAGES_FILTERBYPROJECT 9402 +#define ID_TASK_MESSAGES_FILTERBYERROR 9403 #define ID_TASK_STATISTICS_USERTOTAL 9500 #define ID_TASK_STATISTICS_USERAVERAGE 9501 #define ID_TASK_STATISTICS_HOSTTOTAL 9502 From bf28f45859d600e80911979c653d46cbb05f5f1f Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Thu, 20 Jul 2023 21:58:26 -0500 Subject: [PATCH 02/10] feat: add static bool variables New bools added to be used to determine if filtering by alert/errors is active and if the filtering has changed. --- clientgui/DlgEventLog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 4c5862fdb38..4154062582d 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -60,6 +60,8 @@ const int dlgEventlogMinHeight = 250; static bool s_bIsFiltered = false; static bool s_bFilteringChanged = false; +static bool s_bErrorIsFiltered = false; +static bool s_bErrorFilteringChanged = false; static std::string s_strFilteredProjectName; /*! From 59eb2c20ea749c7df63cf43bf020558ac44ad7f7 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Thu, 20 Jul 2023 21:59:47 -0500 Subject: [PATCH 03/10] Feat: add new functions to find error/project messages Consolidates code used multiple times in OnErrorFilter and OnMessagesFilter. --- clientgui/DlgEventLog.cpp | 83 +++++++++++++++++++++++++++++++++++++++ clientgui/DlgEventLog.h | 3 ++ 2 files changed, 86 insertions(+) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 4154062582d..73746c72a8d 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -973,6 +973,89 @@ void CDlgEventLog::ResetMessageFiltering() { } +// Function to search through messages and find messages that contain an error. This function first reads the input +// to see if it should search all indexes or a pre-filtered set of indexes. Then, it will search through the indexes. +// For each index that is an error (priority == MSG_USER_ALERT), it will add that message's index to a temporary +// array of indexes. After the for loop is complete, the recently filtered indexes will be written to m_iFilteredIndexes +// and the recently filtered indexes will be stored in m_iFilteredDocCount. +// +// The following input variable is required: +// isfiltered: If the wxArrayInt that we want to search is already filtered (m_iFilteredIndexes), this will be true. +// If we want to search all indexes (m_iTotalIndexes), this will be false). +// +void CDlgEventLog::finderrormessages(bool isfiltered) { + wxArrayInt filteredindexes; + MESSAGE* message; + wxInt32 i = 0; + if (isfiltered) { + for (i; i < m_iFilteredDocCount; i++) { + message = wxGetApp().GetDocument()->message(GetFilteredMessageIndex(i)); + if (message) { + if (message->priority == MSG_USER_ALERT) { + filteredindexes.Add(GetFilteredMessageIndex(i)); + } + } + } + } + else { + for (i; i < m_iTotalDocCount; i++) { + message = wxGetApp().GetDocument()->message(i); + if (message) { + if (message->priority == MSG_USER_ALERT) { + filteredindexes.Add(i); + } + } + } + } + m_iFilteredIndexes = filteredindexes; + m_iFilteredDocCount = static_cast(filteredindexes.GetCount()); +} + + +// Function to search through messages and find all messages that are associated with a specific project. Messages that do +// not have a project are included in the filtered indexes. +// +// This function first reads the input to see if it should search all indexes or a pre-filtered set of indexes. +// Then, it will search through those indexes. For each message that matches the associated +// project (s_strFilteredProjectName) or has no associated project, it will add that message's index to a temporary +// array of indexes. After the for loop is complete, the recently filtered indexes will be written to +// m_iFilteredIndexes and the recently filtered indexes will be stored in m_iFilteredDocCount. +// +// It is assumed s_strFilteredProjectName is correct prior to this function being called. +// +// The following input variable is required: +// isfiltered: If the wxArrayInt that we want to search is already filtered (m_iFilteredIndexes), this will be true. +// If we want to search all indexes (m_iTotalIndexes), this will be false). +// +void CDlgEventLog::findprojectmessages(bool isfiltered) { + wxArrayInt filteredindexes; + MESSAGE* message; + wxInt32 i = 0; + if (isfiltered) { + for (i; i < m_iFilteredDocCount; i++) { + message = wxGetApp().GetDocument()->message(GetFilteredMessageIndex(i)); + if (message) { + if (message->project.empty() || message->project == s_strFilteredProjectName) { + filteredindexes.Add(GetFilteredMessageIndex(i)); + } + } + } + } + else { + for (i; i < m_iTotalDocCount; i++) { + message = wxGetApp().GetDocument()->message(i); + if (message) { + if (message->project.empty() || message->project == s_strFilteredProjectName) { + filteredindexes.Add(i); + } + } + } + } + m_iFilteredIndexes = filteredindexes; + m_iFilteredDocCount = static_cast(m_iFilteredIndexes.GetCount()); +} + + void CDlgEventLog::UpdateButtons() { bool enableFilterButton = s_bIsFiltered; bool enableCopySelectedButton = false; diff --git a/clientgui/DlgEventLog.h b/clientgui/DlgEventLog.h index 3235d367a71..6530651e8ce 100644 --- a/clientgui/DlgEventLog.h +++ b/clientgui/DlgEventLog.h @@ -199,6 +199,9 @@ class CDlgEventLog : public DlgEventLogBase void ResetMessageFiltering(); + void finderrormessages(bool isfiltered); + void findprojectmessages(bool isfiltered); + bool EnsureLastItemVisible(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; wxInt32 FormatTime( wxInt32 item, wxString& strBuffer ) const; From e7d88275dd7bd6040447542034580107f57f72ec Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Thu, 20 Jul 2023 22:01:34 -0500 Subject: [PATCH 04/10] feat: add error filtering function New function created to filter errors (alerts) when alert filter button is used. --- clientgui/DlgEventLog.cpp | 51 +++++++++++++++++++++++++++++++++++++++ clientgui/DlgEventLog.h | 3 +++ 2 files changed, 54 insertions(+) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 73746c72a8d..0b801da43c5 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -476,6 +476,57 @@ void CDlgEventLog::OnClose(wxCloseEvent& WXUNUSED(event)) { } +// Function used to filter errors displayed in the Event Log. +// This Function will first check if errors are currently filtered. Then, regardless if true or false, +// will evaluate if a project filter is active or not. Depending on the combination of error and +// project filters, the filtered list will be updated. One of three possibilities could happen: +// 1. Restarting from the original event log list (if error filter was active and it is being deactivated) +// 2. Restarting the list and re-filtering (if both filters were active, but then one is being deactivated) +// 3. Filtering the currently filtered list (if one filter was active and the other filter is being activated). +// After filtering is completed, then the buttons in the event log window are updated and the event log list +// is updated to reflect the changes made to the list. +// +void CDlgEventLog::OnErrorFilter(wxCommandEvent& WXUNUSED(event)) { + wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnErrorFilter - Function Begin")); + wxASSERT(m_pList); + if (s_bErrorIsFiltered) { + // Errors are currently filtered. Whether a project filter is enabled or not, + // the list will need to be reset to the original list first. + // + s_bErrorIsFiltered = false; + m_iFilteredDocCount = m_iTotalDocCount; + m_iFilteredIndexes.Clear(); + m_iTotalDeletedFilterRows = 0; + // Now that the settings are changed, need to determine if project filtering is currently + // enabled or not. If it is not enabled, do nothing. If it is enabled, need to re-filter + // by the project. + // + if (s_bIsFiltered) { // Errors are currently filtered and a project is filtered + findprojectmessages(false); + } + } + else { + // Errors are not currently filtered. Take the list as it is and filter out errors. + s_bErrorIsFiltered = true; + if (!s_bIsFiltered) { // Errors are not currently filtered but are filtered by a project. Filter from the current list. + m_iFilteredDocCount = m_iTotalDocCount; + m_iFilteredIndexes.Clear(); + m_iTotalDeletedFilterRows = 0; + } + finderrormessages(s_bIsFiltered); + } + + s_bErrorFilteringChanged = true; + SetFilterButtonText(); + // Force a complete update + m_iPreviousRowCount = 0; + m_pList->DeleteAllItems(); + m_pList->SetItemCount(m_iFilteredDocCount); + OnRefresh(); + wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnErrorFilter - Function End")); +} + + void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnMessagesFilter - Function Begin")); diff --git a/clientgui/DlgEventLog.h b/clientgui/DlgEventLog.h index 6530651e8ce..1d068706413 100644 --- a/clientgui/DlgEventLog.h +++ b/clientgui/DlgEventLog.h @@ -124,6 +124,9 @@ class CDlgEventLog : public DlgEventLogBase /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPYSELECTED void OnMessagesCopySelected( wxCommandEvent& event ); + // wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_TASK_MESSAGES_FILTERBYERROR + void OnErrorFilter(wxCommandEvent& event); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_TASK_MESSAGES_FILTERBYPROJECT void OnMessagesFilter( wxCommandEvent& event ); From 0a359996351af0cc2c57b2ae6937b0272e0d4e2d Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Thu, 20 Jul 2023 22:05:29 -0500 Subject: [PATCH 05/10] feat: provide functionality for filtering alerts Additions or modifications to either maintain functionality of the existing function and/or to include functionality for filtering by alerts. --- clientgui/DlgEventLog.cpp | 89 ++++++++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 21 deletions(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 0b801da43c5..4a1b02e0959 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -387,6 +387,20 @@ void CDlgEventLog::SetFilterButtonText() { m_pFilterButton->SetHelpText( _("Show only the messages for the selected project") ); #ifdef wxUSE_TOOLTIPS m_pFilterButton->SetToolTip(_("Show only the messages for the selected project")); +#endif + } + if (s_bErrorIsFiltered) { + m_pErrorFilterButton->SetLabel(_("Show all message &types")); + m_pErrorFilterButton->SetHelpText(_("Shows messages of all types (information, alerts, etc.)")); +#ifdef wxUSE_TOOLTIPS + m_pErrorFilterButton->SetToolTip(_("Shows messages of all types (information, alerts, etc.)")); +#endif + } + else { + m_pErrorFilterButton->SetLabel(_("Show only aler&t messages")); + m_pErrorFilterButton->SetHelpText(_("Shows only the messages that are alerts")); +#ifdef wxUSE_TOOLTIPS + m_pErrorFilterButton->SetToolTip(_("Show only the messages that are alerts")); #endif } // Adjust button size for new text @@ -531,34 +545,45 @@ void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnMessagesFilter - Function Begin")); wxInt32 iIndex = -1; - MESSAGE* message; - wxASSERT(m_pList); - m_iFilteredIndexes.Clear(); - s_strFilteredProjectName.clear(); - m_iTotalDeletedFilterRows = 0; - if (s_bIsFiltered) { + // Event log is filtering by a project. Whether the error filter is enabled or not, + // the list will need to be reset to the original list first. + // s_bIsFiltered = false; m_iFilteredDocCount = m_iTotalDocCount; - } else { + m_iFilteredIndexes.Clear(); + s_strFilteredProjectName.clear(); + m_iTotalDeletedFilterRows = 0; + // Now that the settings are changed, need to determine if error filtering is currently + // enabled or not. If it is not enabled, do nothing. If it is enabled, need to re-filter + // by errors. + // + if (s_bErrorIsFiltered) { // List is currently filtered by project and by error. + finderrormessages(false); + } + } else { // List will now be filtered by a project. + // Get project name to be filtered. + s_strFilteredProjectName.clear(); + MESSAGE* message; iIndex = m_pList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (iIndex >= 0) { - message = wxGetApp().GetDocument()->message(iIndex); + message = wxGetApp().GetDocument()->message(GetFilteredMessageIndex(iIndex)); + if (message) { if ((message->project).size() > 0) { s_strFilteredProjectName = message->project; - s_bIsFiltered = true; - for (iIndex = 0; iIndex < m_iTotalDocCount; iIndex++) { - message = wxGetApp().GetDocument()->message(iIndex); - if (message->project.empty() || (message->project == s_strFilteredProjectName)) { - m_iFilteredIndexes.Add(iIndex); } - } - m_iFilteredDocCount = (int)(m_iFilteredIndexes.GetCount()); } + if (!s_bErrorIsFiltered) { + // List is not filtered by errors nor by a project, so clear filtered indexes, count, etc. + m_iFilteredIndexes.Clear(); + m_iFilteredDocCount = m_iTotalDocCount; + m_iTotalDeletedFilterRows = 0; } + findprojectmessages(s_bErrorIsFiltered); + s_bIsFiltered = true; } s_bFilteringChanged = true; @@ -575,7 +600,7 @@ void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { wxInt32 CDlgEventLog::GetFilteredMessageIndex( wxInt32 iRow) const { - if (s_bIsFiltered) return m_iFilteredIndexes[iRow]; + if (s_bIsFiltered || s_bErrorIsFiltered) return m_iFilteredIndexes[iRow]; return iRow; } @@ -586,6 +611,7 @@ wxInt32 CDlgEventLog::GetFilteredMessageIndex( wxInt32 iRow) const { // // Get the (possibly filtered) item count (i.e., the Row count) and // make any needed adjustments if oldest items have been deleted. +// wxInt32 CDlgEventLog::GetDocCount() { int i, j, numDeletedRows; CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -600,7 +626,7 @@ wxInt32 CDlgEventLog::GetDocCount() { } m_iNumDeletedFilteredRows = 0; - if (s_bIsFiltered) { + if (s_bIsFiltered || s_bErrorIsFiltered) { if (numDeletedRows > 0) { // Remove any deleted messages from our filtered list while (m_iFilteredIndexes.GetCount() > 0) { @@ -621,10 +647,20 @@ wxInt32 CDlgEventLog::GetDocCount() { if (i < 0) i = 0; for (; i < m_iTotalDocCount; i++) { MESSAGE* message = pDoc->message(i); - if (message->project.empty() || (message->project == s_strFilteredProjectName)) { + if (message) { + if (s_bIsFiltered) { + if (s_bErrorIsFiltered) { + if (message->priority == MSG_USER_ALERT && (message->project.empty() || message->project == s_strFilteredProjectName)) { + m_iFilteredIndexes.Add(i); + } + } else if (message->project.empty() || message->project == s_strFilteredProjectName) { + m_iFilteredIndexes.Add(i); + } + } else if (s_bErrorIsFiltered && message->priority == MSG_USER_ALERT) { m_iFilteredIndexes.Add(i); } } + } m_iFilteredDocCount = (int)(m_iFilteredIndexes.GetCount()); } else { m_iFilteredDocCount = m_iTotalDocCount; @@ -653,7 +689,7 @@ wxInt32 CDlgEventLog::GetDocCount() { } } - return s_bIsFiltered ? m_iFilteredDocCount : m_iTotalDocCount; + return (s_bIsFiltered || s_bErrorIsFiltered) ? m_iFilteredDocCount : m_iTotalDocCount; } @@ -677,7 +713,13 @@ void CDlgEventLog::OnRefresh() { wxInt32 iRowCount = GetDocCount(); long topItem = m_pList->GetTopItem(); - if (0 >= iRowCount) { + // If the total rows is negative then it is presumed that something went wrong. + // This conditional resets message filtering, clears the list of event logs that were to + // be displayed. This also happens if the row count is zero, since there should always be + // a message. One exception to this is when error filtering is enabled since it is possible + // for no errors to occur. + // + if ((0 >= iRowCount) && !s_bErrorIsFiltered) { m_pList->DeleteAllItems(); ResetMessageFiltering(); m_iPreviousFirstMsgSeqNum = 0; @@ -723,6 +765,9 @@ void CDlgEventLog::OnRefresh() { if (s_bFilteringChanged) { m_pList->EnsureVisible(iRowCount - 1); s_bFilteringChanged = false; + } else if (s_bErrorFilteringChanged) { + m_pList->EnsureVisible(iRowCount - 1); + s_bErrorFilteringChanged = false; } else { if (m_iPreviousLastMsgSeqNum != pDoc->GetLastMsgSeqNum()) { if (EnsureLastItemVisible()) { @@ -1016,7 +1061,9 @@ void CDlgEventLog::OnColResize( wxListEvent& ) { void CDlgEventLog::ResetMessageFiltering() { s_bFilteringChanged = false; + s_bErrorFilteringChanged = false; s_bIsFiltered = false; + s_bErrorIsFiltered = false; s_strFilteredProjectName.clear(); m_iFilteredIndexes.Clear(); SetFilterButtonText(); @@ -1118,7 +1165,7 @@ void CDlgEventLog::UpdateButtons() { if ((n == 1) && (! s_bIsFiltered)) { n = m_pList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - MESSAGE* message = wxGetApp().GetDocument()->message(n); + MESSAGE* message = wxGetApp().GetDocument()->message(GetFilteredMessageIndex(n)); if ((message->project).size() > 0) { enableFilterButton = true; } From 3986eee6315daa1c1d63b58d3c0978001ec96f30 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Thu, 20 Jul 2023 22:09:31 -0500 Subject: [PATCH 06/10] fix: increase minimum width of window Prevents the filter alerts button from being cut off when the window is reduced in width. --- clientgui/DlgEventLog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 4a1b02e0959..7af468a22f8 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -50,7 +50,7 @@ const int dlgEventlogInitialWidth = 640; const int dlgEventLogInitialHeight = 480; -const int dlgEventlogMinWidth = 600; +const int dlgEventlogMinWidth = 620; const int dlgEventlogMinHeight = 250; #define COLUMN_PROJECT 0 From a3134f49195c18cdefdcb05a8efccb91a1399335 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Fri, 21 Jul 2023 20:53:16 -0500 Subject: [PATCH 07/10] style: change to CamelCase --- clientgui/DlgEventLog.cpp | 16 ++++++++-------- clientgui/DlgEventLog.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 7af468a22f8..6e55486a375 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -516,7 +516,7 @@ void CDlgEventLog::OnErrorFilter(wxCommandEvent& WXUNUSED(event)) { // by the project. // if (s_bIsFiltered) { // Errors are currently filtered and a project is filtered - findprojectmessages(false); + FindProjectMessages(false); } } else { @@ -527,7 +527,7 @@ void CDlgEventLog::OnErrorFilter(wxCommandEvent& WXUNUSED(event)) { m_iFilteredIndexes.Clear(); m_iTotalDeletedFilterRows = 0; } - finderrormessages(s_bIsFiltered); + FindErrorMessages(s_bIsFiltered); } s_bErrorFilteringChanged = true; @@ -561,7 +561,7 @@ void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { // by errors. // if (s_bErrorIsFiltered) { // List is currently filtered by project and by error. - finderrormessages(false); + FindErrorMessages(false); } } else { // List will now be filtered by a project. // Get project name to be filtered. @@ -582,7 +582,7 @@ void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { m_iFilteredDocCount = m_iTotalDocCount; m_iTotalDeletedFilterRows = 0; } - findprojectmessages(s_bErrorIsFiltered); + FindProjectMessages(s_bErrorIsFiltered); s_bIsFiltered = true; } @@ -1081,11 +1081,11 @@ void CDlgEventLog::ResetMessageFiltering() { // isfiltered: If the wxArrayInt that we want to search is already filtered (m_iFilteredIndexes), this will be true. // If we want to search all indexes (m_iTotalIndexes), this will be false). // -void CDlgEventLog::finderrormessages(bool isfiltered) { +void CDlgEventLog::FindErrorMessages(bool isFiltered) { wxArrayInt filteredindexes; MESSAGE* message; wxInt32 i = 0; - if (isfiltered) { + if (isFiltered) { for (i; i < m_iFilteredDocCount; i++) { message = wxGetApp().GetDocument()->message(GetFilteredMessageIndex(i)); if (message) { @@ -1125,11 +1125,11 @@ void CDlgEventLog::finderrormessages(bool isfiltered) { // isfiltered: If the wxArrayInt that we want to search is already filtered (m_iFilteredIndexes), this will be true. // If we want to search all indexes (m_iTotalIndexes), this will be false). // -void CDlgEventLog::findprojectmessages(bool isfiltered) { +void CDlgEventLog::FindProjectMessages(bool isFiltered) { wxArrayInt filteredindexes; MESSAGE* message; wxInt32 i = 0; - if (isfiltered) { + if (isFiltered) { for (i; i < m_iFilteredDocCount; i++) { message = wxGetApp().GetDocument()->message(GetFilteredMessageIndex(i)); if (message) { diff --git a/clientgui/DlgEventLog.h b/clientgui/DlgEventLog.h index 1d068706413..f46270d458b 100644 --- a/clientgui/DlgEventLog.h +++ b/clientgui/DlgEventLog.h @@ -202,8 +202,8 @@ class CDlgEventLog : public DlgEventLogBase void ResetMessageFiltering(); - void finderrormessages(bool isfiltered); - void findprojectmessages(bool isfiltered); + void FindErrorMessages(bool isFiltered); + void FindProjectMessages(bool isFiltered); bool EnsureLastItemVisible(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; From f755b98c6b5e3046546742811e4df2d2b0ba70bd Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Fri, 21 Jul 2023 20:55:06 -0500 Subject: [PATCH 08/10] style: removed whitespace --- clientgui/DlgEventLog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 6e55486a375..271b1d34308 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -1076,7 +1076,7 @@ void CDlgEventLog::ResetMessageFiltering() { // For each index that is an error (priority == MSG_USER_ALERT), it will add that message's index to a temporary // array of indexes. After the for loop is complete, the recently filtered indexes will be written to m_iFilteredIndexes // and the recently filtered indexes will be stored in m_iFilteredDocCount. -// +// // The following input variable is required: // isfiltered: If the wxArrayInt that we want to search is already filtered (m_iFilteredIndexes), this will be true. // If we want to search all indexes (m_iTotalIndexes), this will be false). @@ -1112,15 +1112,15 @@ void CDlgEventLog::FindErrorMessages(bool isFiltered) { // Function to search through messages and find all messages that are associated with a specific project. Messages that do // not have a project are included in the filtered indexes. -// +// // This function first reads the input to see if it should search all indexes or a pre-filtered set of indexes. // Then, it will search through those indexes. For each message that matches the associated // project (s_strFilteredProjectName) or has no associated project, it will add that message's index to a temporary // array of indexes. After the for loop is complete, the recently filtered indexes will be written to // m_iFilteredIndexes and the recently filtered indexes will be stored in m_iFilteredDocCount. -// +// // It is assumed s_strFilteredProjectName is correct prior to this function being called. -// +// // The following input variable is required: // isfiltered: If the wxArrayInt that we want to search is already filtered (m_iFilteredIndexes), this will be true. // If we want to search all indexes (m_iTotalIndexes), this will be false). From b9de9d1065db7c211d759bd1bd2ac313dc019c1e Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Fri, 21 Jul 2023 21:09:55 -0500 Subject: [PATCH 09/10] feat: update alert button text --- clientgui/DlgEventLog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 271b1d34308..ab90cf33884 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -390,14 +390,14 @@ void CDlgEventLog::SetFilterButtonText() { #endif } if (s_bErrorIsFiltered) { - m_pErrorFilterButton->SetLabel(_("Show all message &types")); + m_pErrorFilterButton->SetLabel(_("Show al&l")); m_pErrorFilterButton->SetHelpText(_("Shows messages of all types (information, alerts, etc.)")); #ifdef wxUSE_TOOLTIPS m_pErrorFilterButton->SetToolTip(_("Shows messages of all types (information, alerts, etc.)")); #endif } else { - m_pErrorFilterButton->SetLabel(_("Show only aler&t messages")); + m_pErrorFilterButton->SetLabel(_("Show only aler&ts")); m_pErrorFilterButton->SetHelpText(_("Shows only the messages that are alerts")); #ifdef wxUSE_TOOLTIPS m_pErrorFilterButton->SetToolTip(_("Show only the messages that are alerts")); From fb9bd51b9243bdc43cfa505022d6a8f48f36db69 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Fri, 21 Jul 2023 21:12:24 -0500 Subject: [PATCH 10/10] revert: minimum width changed back to 600 3986eee6315daa1c1d63b58d3c0978001ec96f30 --- clientgui/DlgEventLog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index ab90cf33884..00c13a6f396 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -50,7 +50,7 @@ const int dlgEventlogInitialWidth = 640; const int dlgEventLogInitialHeight = 480; -const int dlgEventlogMinWidth = 620; +const int dlgEventlogMinWidth = 600; const int dlgEventlogMinHeight = 250; #define COLUMN_PROJECT 0