MGR: Immediately update preferences/registry on more changes:

- When Event Log is opened
  - When column widths are changed
This commit is contained in:
Charlie Fenton 2013-11-04 18:11:36 -08:00
parent d2d4d487b4
commit 56252e11a2
8 changed files with 45 additions and 1 deletions

View File

@ -75,6 +75,7 @@ BEGIN_EVENT_TABLE( CDlgEventLog, wxDialog )
EVT_SIZE(CDlgEventLog::OnSize)
EVT_MOVE(CDlgEventLog::OnMove)
EVT_CLOSE(CDlgEventLog::OnClose)
EVT_LIST_COL_END_DRAG(ID_SIMPLE_MESSAGESVIEW, CDlgEventLog::OnColResize)
////@end CDlgEventLog event table entries
END_EVENT_TABLE()
@ -256,7 +257,8 @@ bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& capt
SetTextColor();
RestoreState();
OnRefresh();
// Register that we had the Event Log open immediately
SaveState();
return true;
}
@ -885,6 +887,11 @@ void CDlgEventLog::OnButtonHelp( wxCommandEvent& event ) {
}
void CDlgEventLog::OnColResize( wxCommandEvent& ) {
// Register the new column widths immediately
SaveState();
}
void CDlgEventLog::ResetMessageFiltering() {
s_bIsFiltered = false;
s_strFilteredProjectName.clear();

View File

@ -118,6 +118,9 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP
void OnButtonHelp( wxCommandEvent& event );
/// EVT_LIST_COL_END_DRAG event handler for ID_SIMPLE_MESSAGESVIEW
void OnColResize( wxCommandEvent& event );
/// called from CMainDocument::HandleCompletedRPC() after wxEVT_RPC_FINISHED event
void OnRefresh();
////@end CDlgEventLog event handler declarations

View File

@ -86,6 +86,7 @@ BEGIN_EVENT_TABLE (CViewProjects, CBOINCBaseView)
EVT_LIST_ITEM_DESELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListDeselected)
EVT_LIST_COL_CLICK(ID_LIST_PROJECTSVIEW, CViewProjects::OnColClick)
EVT_LIST_CACHE_HINT(ID_LIST_PROJECTSVIEW, CViewProjects::OnCacheHint)
EVT_LIST_COL_END_DRAG(ID_LIST_PROJECTSVIEW, CViewProjects::OnColResize)
END_EVENT_TABLE ()
@ -554,6 +555,15 @@ void CViewProjects::OnProjectWebsiteClicked( wxEvent& event ) {
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectWebsiteClicked - Function End"));
}
bool CViewProjects::OnColResize( wxCommandEvent& ) {
// Register the new column widths immediately
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
wxASSERT(pFrame);
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
return pFrame->SaveState();
}
wxInt32 CViewProjects::GetDocCount() {
CMainDocument* pDoc = wxGetApp().GetDocument();

View File

@ -73,6 +73,7 @@ public:
void OnShowItemProperties( wxCommandEvent& event );
void OnProjectWebsiteClicked( wxEvent& event );
bool OnColResize( wxCommandEvent& event);
std::vector<CProject*> m_ProjectCache;

View File

@ -72,6 +72,7 @@ BEGIN_EVENT_TABLE (CViewTransfers, CBOINCBaseView)
EVT_LIST_ITEM_DESELECTED(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnListDeselected)
EVT_LIST_COL_CLICK(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnColClick)
EVT_LIST_CACHE_HINT(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnCacheHint)
EVT_LIST_COL_END_DRAG(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnColResize)
END_EVENT_TABLE ()
@ -364,6 +365,16 @@ void CViewTransfers::OnTransfersAbort( wxCommandEvent& WXUNUSED(event) ) {
}
bool CViewTransfers::OnColResize( wxCommandEvent& ) {
// Register the new column widths immediately
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
wxASSERT(pFrame);
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
return pFrame->SaveState();
}
wxInt32 CViewTransfers::GetDocCount() {
return wxGetApp().GetDocument()->GetTransferCount();
}

View File

@ -67,6 +67,7 @@ public:
void OnTransfersRetryNow( wxCommandEvent& event );
void OnTransfersAbort( wxCommandEvent& event );
bool OnColResize( wxCommandEvent& event);
std::vector<CTransfer*> m_TransferCache;

View File

@ -93,6 +93,7 @@ BEGIN_EVENT_TABLE (CViewWork, CBOINCBaseView)
EVT_LIST_ITEM_DESELECTED(ID_LIST_WORKVIEW, CViewWork::OnListDeselected)
EVT_LIST_COL_CLICK(ID_LIST_WORKVIEW, CViewWork::OnColClick)
EVT_LIST_CACHE_HINT(ID_LIST_WORKVIEW, CViewWork::OnCacheHint)
EVT_LIST_COL_END_DRAG(ID_LIST_WORKVIEW, CViewWork::OnColResize)
END_EVENT_TABLE ()
@ -610,6 +611,15 @@ void CViewWork::OnProjectWebsiteClicked( wxEvent& event ) {
wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnProjectWebsiteClicked - Function End"));
}
bool CViewWork::OnColResize( wxCommandEvent& ) {
// Register the new column widths immediately
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
wxASSERT(pFrame);
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
return pFrame->SaveState();
}
wxInt32 CViewWork::GetDocCount() {
return wxGetApp().GetDocument()->GetWorkCount();

View File

@ -75,6 +75,7 @@ public:
void OnActiveTasksOnly( wxCommandEvent& event );
void OnProjectWebsiteClicked( wxEvent& event );
bool OnColResize( wxCommandEvent& event);
std::vector<CWork*> m_WorkCache;