MGR: preserve message filtering by project if Event Log is closed and reopened, but not when selecting a different host or exiting Manager

svn path=/trunk/boinc/; revision=22185
This commit is contained in:
Charlie Fenton 2010-08-11 08:07:14 +00:00
parent f039bf4bd8
commit efbaeb48a0
2 changed files with 36 additions and 36 deletions

View File

@ -200,7 +200,6 @@ bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& capt
SetIcons(icons);
CreateControls();
// SetFilterButtonText();
// Create List Pane Items
m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109);
@ -451,10 +450,7 @@ wxInt32 CDlgEventLog::GetDocCount() {
m_iTotalDocCount = wxGetApp().GetDocument()->GetMessageCount();
if (m_iTotalDocCount < m_iPreviousTotalDocCount) {
// Usually due to a disconnect from client
s_bIsFiltered = false;
s_strFilteredProjectName.clear();
m_iFilteredIndexes.Clear();
SetFilterButtonText();
ResetMessageFiltering();
}
if (s_bIsFiltered) {
@ -497,10 +493,7 @@ void CDlgEventLog::OnRefresh() {
wxInt32 iRowCount = GetDocCount();
if (0 >= iRowCount) {
m_pList->DeleteAllItems();
s_bIsFiltered = false;
s_strFilteredProjectName.clear();
m_iFilteredIndexes.Clear();
SetFilterButtonText();
ResetMessageFiltering();
} else {
// If connected computer changed, reset message filtering
isConnected = wxGetApp().GetDocument()->IsConnected();
@ -509,10 +502,7 @@ void CDlgEventLog::OnRefresh() {
if (strLastMachineName != strNewMachineName) {
strLastMachineName = strNewMachineName;
was_connected = false;
s_bIsFiltered = false;
s_strFilteredProjectName.clear();
m_iFilteredIndexes.Clear();
SetFilterButtonText();
ResetMessageFiltering();
}
}
@ -781,6 +771,14 @@ void CDlgEventLog::OnButtonHelp( wxCommandEvent& event ) {
}
void CDlgEventLog::ResetMessageFiltering() {
s_bIsFiltered = false;
s_strFilteredProjectName.clear();
m_iFilteredIndexes.Clear();
SetFilterButtonText();
}
void CDlgEventLog::UpdateButtons() {
bool enableFilterButton = s_bIsFiltered;
bool enableCopySelectedButon = false;

View File

@ -169,6 +169,8 @@ private:
void OnMouseUp(wxMouseEvent& event);
void ResetMessageFiltering();
bool EnsureLastItemVisible();
wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
wxInt32 FormatTime( wxInt32 item, wxString& strBuffer ) const;