From 4b46d1c114b5698f40cb21adf155042c09f5d45c Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 28 Apr 2010 09:23:18 +0000 Subject: [PATCH] MGR: more Event Log bug fixes: Copy Selected button when filtering by project; save window dimensions when exiting Manager; fix sizer problem on Mac svn path=/trunk/boinc/; revision=21310 --- checkin_notes | 11 +++++++++++ clientgui/DlgEventLog.cpp | 24 ++++++++++++++---------- clientgui/DlgEventLogListCtrl.cpp | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/checkin_notes b/checkin_notes index 93c4e36407..3c20bc70b2 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3222,3 +3222,14 @@ David 27 Apr 2010 html/project.sample/ project_specific_prefs.inc +Charlie 28 Apr 2010 + - MGR: more Event Log bug fixes: fix Copy Selected button when filtering + by project; save window dimensions properly when exiting Manager with + Event Log window open; add spaces around field delimiters when copying + to clipboard for better readability; fix sizer problem on Mac (buttons + disappeared if window height was too small) by initializing size of + CDlgEventLogListCtrl to wxDefaultSize instead of 640X480. + + clientgui/ + DlgEventLog.cpp + DlgEventLogListCtrl.cpp diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 9c68356438..7a3579263c 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -90,6 +90,9 @@ CDlgEventLog::CDlgEventLog( wxWindow* parent, wxWindowID id, const wxString& cap CDlgEventLog::~CDlgEventLog() { wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::CDlgEventLog - Destructor Function Begin")); + SaveState(); + SetWindowDimensions(); + if (m_pMessageInfoAttr) { delete m_pMessageInfoAttr; m_pMessageInfoAttr = NULL; @@ -342,8 +345,6 @@ void CDlgEventLog::OnOK( wxCommandEvent& WXUNUSED(event) ) { */ void CDlgEventLog::OnClose(wxCloseEvent& WXUNUSED(event)) { - SaveState(); - SetWindowDimensions(); Destroy(); } @@ -740,12 +741,13 @@ void CDlgEventLog::OnButtonHelp( wxCommandEvent& event ) { void CDlgEventLog::UpdateButtons() { bool enableFilterButton = m_bIsFiltered; bool enableCopySelectedButon = false; - if ((! m_bIsFiltered) && (m_iTotalDocCount > 0)) { + if (m_iTotalDocCount > 0) { int n = m_pList->GetSelectedItemCount(); if (n > 0) { enableCopySelectedButon = true; } - if (n == 1) { + + if ((n == 1) && (! m_bIsFiltered)) { n = m_pList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); MESSAGE* message = wxGetApp().GetDocument()->message(n); if ((message->project).size() > 0) { @@ -780,7 +782,8 @@ wxString CDlgEventLog::OnListGetItemText(long item, long column) const { wxListItemAttr* CDlgEventLog::OnListGetItemAttr(long item) const { wxListItemAttr* pAttribute = NULL; - MESSAGE* message = wxGetApp().GetDocument()->message(item); + wxInt32 index = GetFilteredMessageIndex(item); + MESSAGE* message = wxGetApp().GetDocument()->message(index); if (message) { switch(message->priority) { @@ -868,6 +871,7 @@ bool CDlgEventLog::OpenClipboard( wxInt32 size ) { wxInt32 CDlgEventLog::CopyToClipboard(wxInt32 item) { wxInt32 iRetVal = -1; + wxInt32 index = GetFilteredMessageIndex(item); if (m_bClipboardOpen) { wxString strBuffer = wxEmptyString; @@ -875,14 +879,14 @@ wxInt32 CDlgEventLog::CopyToClipboard(wxInt32 item) { wxString strProject = wxEmptyString; wxString strMessage = wxEmptyString; - FormatTime(item, strTimeStamp); - FormatProjectName(item, strProject); - FormatMessage(item, strMessage); + FormatTime(index, strTimeStamp); + FormatProjectName(index, strProject); + FormatMessage(index, strMessage); #ifdef __WXMSW__ - strBuffer.Printf(wxT("%s|%s|%s\r\n"), strTimeStamp.c_str(), strProject.c_str(), strMessage.c_str()); + strBuffer.Printf(wxT("%s | %s | %s\r\n"), strTimeStamp.c_str(), strProject.c_str(), strMessage.c_str()); #else - strBuffer.Printf(wxT("%s|%s|%s\n"), strTimeStamp.c_str(), strProject.c_str(), strMessage.c_str()); + strBuffer.Printf(wxT("%s | %s | %s\n"), strTimeStamp.c_str(), strProject.c_str(), strMessage.c_str()); #endif m_strClipboardData += strBuffer; diff --git a/clientgui/DlgEventLogListCtrl.cpp b/clientgui/DlgEventLogListCtrl.cpp index 75a7d0d810..4501ab8f08 100644 --- a/clientgui/DlgEventLogListCtrl.cpp +++ b/clientgui/DlgEventLogListCtrl.cpp @@ -43,7 +43,7 @@ END_EVENT_TABLE() CDlgEventLogListCtrl::CDlgEventLogListCtrl() {} CDlgEventLogListCtrl::CDlgEventLogListCtrl(CDlgEventLog* pView, wxWindowID iListWindowID, wxInt32 iListWindowFlags) - : DLG_LISTCTRL_BASE(pView, iListWindowID, wxDefaultPosition, wxSize(640,480), iListWindowFlags) + : DLG_LISTCTRL_BASE(pView, iListWindowID, wxDefaultPosition, wxDefaultSize, iListWindowFlags) { m_pParentView = pView;