mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4810
This commit is contained in:
parent
7a3f2d4939
commit
d84e0d23f1
|
@ -20999,3 +20999,27 @@ David 10 Dec 2004
|
|||
lib/
|
||||
filesys.C,h
|
||||
util.C,h
|
||||
|
||||
Rom 10 Dec 2004
|
||||
- Bug Fix: Under the previous arrangement there was a timer event that would
|
||||
fire off once a second to check for the possiblility that the item in the
|
||||
list view had been deselected. We weren't receiving a deselection event
|
||||
for single selection controls. So I've ripped out the timer code and
|
||||
trapped the controls click event, and check the controls state.
|
||||
|
||||
If we are a single selection control and the current selection is different
|
||||
from the row that has focus, then manually send the deselection event.
|
||||
|
||||
If we are a multi selection control, check to see if anything is selected,
|
||||
if not, then manually send the deselection event.
|
||||
|
||||
This has the added bonus of making our UI seem faster.
|
||||
|
||||
NOTE: I know this wasn't on the list to fix this release, but it was driving
|
||||
me nuts.
|
||||
|
||||
clientgui/
|
||||
BOINCBaseView.cpp, .h
|
||||
BOINCGUIApp.cpp
|
||||
BOINCListCtrl.cpp, .h
|
||||
MainFrame.cpp, .h
|
||||
|
|
|
@ -113,12 +113,6 @@ wxInt32 CBOINCBaseView::GetListRowCount()
|
|||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::FireOnTaskRender ( wxTimerEvent& event )
|
||||
{
|
||||
OnTaskRender( event );
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::FireOnListRender ( wxTimerEvent& event )
|
||||
{
|
||||
OnListRender( event );
|
||||
|
@ -191,28 +185,6 @@ wxInt32 CBOINCBaseView::GetDocCount()
|
|||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnTaskRender ( wxTimerEvent& event )
|
||||
{
|
||||
if (!m_bProcessingTaskRenderEvent)
|
||||
{
|
||||
m_bProcessingTaskRenderEvent = true;
|
||||
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
if ( ( 0 == m_pListPane->GetSelectedItemCount() ) && m_bItemSelected )
|
||||
{
|
||||
UpdateSelection();
|
||||
}
|
||||
|
||||
m_bProcessingTaskRenderEvent = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnListRender ( wxTimerEvent& event )
|
||||
{
|
||||
if (!m_bProcessingListRenderEvent)
|
||||
|
@ -236,10 +208,10 @@ void CBOINCBaseView::OnListRender ( wxTimerEvent& event )
|
|||
{
|
||||
if ( !(iDocCount == iCacheCount) )
|
||||
{
|
||||
wxInt32 iIndex = 0;
|
||||
wxInt32 iReturnValue = -1;
|
||||
if ( iDocCount > iCacheCount )
|
||||
{
|
||||
wxInt32 iIndex = 0;
|
||||
wxInt32 iReturnValue = -1;
|
||||
for ( iIndex = iCacheCount; iIndex <= iDocCount; iIndex++ )
|
||||
{
|
||||
iReturnValue = AddCacheElement();
|
||||
|
@ -248,8 +220,6 @@ void CBOINCBaseView::OnListRender ( wxTimerEvent& event )
|
|||
}
|
||||
else
|
||||
{
|
||||
wxInt32 iIndex = 0;
|
||||
wxInt32 iReturnValue = -1;
|
||||
for ( iIndex = iDocCount; iIndex >= iCacheCount; iIndex-- )
|
||||
{
|
||||
iReturnValue = RemoveCacheElement();
|
||||
|
@ -439,7 +409,6 @@ wxInt32 CBOINCBaseView::SyncronizeCache()
|
|||
wxInt32 iColumnTotal = 0;
|
||||
wxString strDocumentText = wxEmptyString;
|
||||
wxString strListPaneText = wxEmptyString;
|
||||
wxInt32 iReturnValue = -1;
|
||||
bool bNeedRefreshData = false;
|
||||
|
||||
iRowTotal = GetDocCount();
|
||||
|
@ -459,8 +428,10 @@ wxInt32 CBOINCBaseView::SyncronizeCache()
|
|||
|
||||
if ( !strDocumentText.IsSameAs(strListPaneText) )
|
||||
{
|
||||
iReturnValue = UpdateCache( iRowIndex, iColumnIndex, strDocumentText );
|
||||
wxASSERT( 0 == iReturnValue );
|
||||
if ( 0 != UpdateCache( iRowIndex, iColumnIndex, strDocumentText ) )
|
||||
{
|
||||
wxASSERT( FALSE );
|
||||
}
|
||||
bNeedRefreshData = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@ public:
|
|||
virtual char** GetViewIcon();
|
||||
virtual wxInt32 GetListRowCount();
|
||||
|
||||
void FireOnTaskRender( wxTimerEvent& event );
|
||||
void FireOnListRender( wxTimerEvent& event );
|
||||
bool FireOnSaveState( wxConfigBase* pConfig );
|
||||
bool FireOnRestoreState( wxConfigBase* pConfig );
|
||||
|
@ -77,7 +76,6 @@ protected:
|
|||
|
||||
virtual wxInt32 GetDocCount();
|
||||
|
||||
virtual void OnTaskRender( wxTimerEvent& event );
|
||||
virtual void OnListRender( wxTimerEvent& event );
|
||||
|
||||
virtual bool OnSaveState( wxConfigBase* pConfig );
|
||||
|
|
|
@ -47,7 +47,7 @@ bool CBOINCGUIApp::OnInit()
|
|||
m_lBOINCCoreProccessId = 0;
|
||||
|
||||
// Enable Trace Masks
|
||||
wxLog::AddTraceMask( wxT("Function Start/End") );
|
||||
//wxLog::AddTraceMask( wxT("Function Start/End") );
|
||||
|
||||
|
||||
// Enable the in memory virtual file system for
|
||||
|
|
|
@ -43,6 +43,24 @@ CBOINCListCtrl::CBOINCListCtrl( CBOINCBaseView* pView, wxWindowID iListWindowID,
|
|||
wxListView( pView, iListWindowID, wxDefaultPosition, wxSize(-1, -1), iListWindowFlags )
|
||||
{
|
||||
m_pParentView = pView;
|
||||
|
||||
m_bIsSingleSelection = ( iListWindowFlags & wxLC_SINGLE_SEL ) ? true : false ;
|
||||
|
||||
Connect(
|
||||
iListWindowID,
|
||||
wxEVT_COMMAND_LEFT_CLICK,
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) CBOINCListCtrl::OnClick
|
||||
);
|
||||
Connect(
|
||||
iListWindowID,
|
||||
wxEVT_COMMAND_LIST_ITEM_SELECTED,
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) CBOINCListCtrl::OnSelected
|
||||
);
|
||||
Connect(
|
||||
iListWindowID,
|
||||
wxEVT_COMMAND_LIST_ITEM_DESELECTED,
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) CBOINCListCtrl::OnDeselected
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -133,6 +151,51 @@ bool CBOINCListCtrl::OnRestoreState( wxConfigBase* pConfig )
|
|||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnClick( wxCommandEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
wxListEvent leEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED, m_windowId);
|
||||
leEvent.SetEventObject(this);
|
||||
|
||||
if ( m_bIsSingleSelection )
|
||||
{
|
||||
if ( GetFocusedItem() != GetFirstSelected() )
|
||||
OnDeselected( leEvent );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( -1 == GetFirstSelected() )
|
||||
OnDeselected( leEvent );
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnSelected( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
m_pParentView->FireOnListSelected( event );
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnDeselected( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
m_pParentView->FireOnListDeselected( event );
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
wxString CBOINCListCtrl::OnGetItemText( long item, long column ) const
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
|
|
|
@ -46,10 +46,16 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
virtual void OnClick( wxCommandEvent& event );
|
||||
virtual void OnSelected( wxListEvent& event );
|
||||
virtual void OnDeselected( wxListEvent& event );
|
||||
|
||||
virtual wxString OnGetItemText( long item, long column ) const;
|
||||
virtual int OnGetItemImage( long item ) const;
|
||||
virtual wxListItemAttr* OnGetItemAttr( long item ) const;
|
||||
|
||||
bool m_bIsSingleSelection;
|
||||
|
||||
CBOINCBaseView* m_pParentView;
|
||||
|
||||
};
|
||||
|
|
|
@ -65,14 +65,11 @@ BEGIN_EVENT_TABLE (CMainFrame, wxFrame)
|
|||
EVT_CLOSE(CMainFrame::OnClose)
|
||||
EVT_SIZE(CMainFrame::OnSize)
|
||||
EVT_CHAR(CMainFrame::OnChar)
|
||||
EVT_TIMER(ID_FRAMERENDERTIMER, CMainFrame::OnFrameRender)
|
||||
EVT_TIMER(ID_FRAMELISTRENDERTIMER, CMainFrame::OnListPanelRender)
|
||||
EVT_UPDATE_UI_RANGE(ID_ACTIVITYRUNALWAYS, ID_ACTIVITYSUSPEND, CMainFrame::OnUpdateActivitySelection)
|
||||
EVT_UPDATE_UI_RANGE(ID_NETWORKRUNALWAYS, ID_NETWORKSUSPEND, CMainFrame::OnUpdateNetworkSelection)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(ID_FRAMENOTEBOOK, CMainFrame::OnNotebookSelectionChanged)
|
||||
EVT_LIST_ITEM_SELECTED(wxID_ANY, CMainFrame::OnListSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(wxID_ANY, CMainFrame::OnListDeselected)
|
||||
EVT_TIMER(ID_FRAMERENDERTIMER, CMainFrame::OnFrameRender)
|
||||
EVT_TIMER(ID_FRAMELISTRENDERTIMER, CMainFrame::OnListPanelRender)
|
||||
EVT_TIMER(ID_FRAMETASKRENDERTIMER, CMainFrame::OnTaskPanelRender)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
|
||||
|
@ -109,14 +106,10 @@ CMainFrame::CMainFrame(wxString strTitle) :
|
|||
m_pFrameRenderTimer = new wxTimer(this, ID_FRAMERENDERTIMER);
|
||||
wxASSERT(NULL != m_pFrameRenderTimer);
|
||||
|
||||
m_pFrameTaskPanelRenderTimer = new wxTimer(this, ID_FRAMETASKRENDERTIMER);
|
||||
wxASSERT(NULL != m_pFrameTaskPanelRenderTimer);
|
||||
|
||||
m_pFrameListPanelRenderTimer = new wxTimer(this, ID_FRAMELISTRENDERTIMER);
|
||||
wxASSERT(NULL != m_pFrameListPanelRenderTimer);
|
||||
|
||||
m_pFrameRenderTimer->Start(1000); // Send event every 1 second
|
||||
m_pFrameTaskPanelRenderTimer->Start(1000); // Send event every 1 second
|
||||
m_pFrameListPanelRenderTimer->Start(5000); // Send event every 5 seconds
|
||||
|
||||
SetStatusBarPane(0);
|
||||
|
@ -132,7 +125,6 @@ CMainFrame::~CMainFrame()
|
|||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::~CMainFrame - Function Begin"));
|
||||
|
||||
wxASSERT(NULL != m_pFrameRenderTimer);
|
||||
wxASSERT(NULL != m_pFrameTaskPanelRenderTimer);
|
||||
wxASSERT(NULL != m_pFrameListPanelRenderTimer);
|
||||
wxASSERT(NULL != m_pMenubar);
|
||||
wxASSERT(NULL != m_pNotebook);
|
||||
|
@ -147,11 +139,6 @@ CMainFrame::~CMainFrame()
|
|||
delete m_pFrameRenderTimer;
|
||||
}
|
||||
|
||||
if (m_pFrameTaskPanelRenderTimer) {
|
||||
m_pFrameTaskPanelRenderTimer->Stop();
|
||||
delete m_pFrameTaskPanelRenderTimer;
|
||||
}
|
||||
|
||||
if (m_pFrameListPanelRenderTimer) {
|
||||
m_pFrameListPanelRenderTimer->Stop();
|
||||
delete m_pFrameListPanelRenderTimer;
|
||||
|
@ -933,7 +920,6 @@ void CMainFrame::OnNotebookSelectionChanged( wxNotebookEvent& event )
|
|||
pView = wxDynamicCast(pwndNotebookPage, CBOINCBaseView);
|
||||
wxASSERT(NULL != pView);
|
||||
|
||||
pView->FireOnTaskRender( timerEvent );
|
||||
pView->FireOnListRender( timerEvent );
|
||||
}
|
||||
|
||||
|
@ -943,58 +929,6 @@ void CMainFrame::OnNotebookSelectionChanged( wxNotebookEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void CMainFrame::OnListSelected( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnListSelected - Function Begin"));
|
||||
|
||||
if ( IsShown() )
|
||||
{
|
||||
wxWindow* pwndNotebookPage = NULL;
|
||||
CBOINCBaseView* pView = NULL;
|
||||
|
||||
wxASSERT(NULL != m_pNotebook);
|
||||
|
||||
pwndNotebookPage = m_pNotebook->GetPage( event.GetId() - ID_LIST_BASE );
|
||||
wxASSERT(NULL != pwndNotebookPage);
|
||||
|
||||
pView = wxDynamicCast(pwndNotebookPage, CBOINCBaseView);
|
||||
wxASSERT(NULL != pView);
|
||||
|
||||
pView->FireOnListSelected( event );
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnListSelected - Function End"));
|
||||
}
|
||||
|
||||
|
||||
void CMainFrame::OnListDeselected( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnListDeselected - Function Begin"));
|
||||
|
||||
if ( IsShown() )
|
||||
{
|
||||
wxWindow* pwndNotebookPage = NULL;
|
||||
CBOINCBaseView* pView = NULL;
|
||||
|
||||
wxASSERT(NULL != m_pNotebook);
|
||||
|
||||
pwndNotebookPage = m_pNotebook->GetPage( event.GetId() - ID_LIST_BASE );
|
||||
wxASSERT(NULL != pwndNotebookPage);
|
||||
|
||||
pView = wxDynamicCast(pwndNotebookPage, CBOINCBaseView);
|
||||
wxASSERT(NULL != pView);
|
||||
|
||||
pView->FireOnListDeselected( event );
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnListDeselected - Function End"));
|
||||
}
|
||||
|
||||
|
||||
void CMainFrame::OnFrameRender( wxTimerEvent &event )
|
||||
{
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnFrameRender - Function Begin"));
|
||||
|
@ -1064,32 +998,6 @@ void CMainFrame::OnListPanelRender( wxTimerEvent &event )
|
|||
}
|
||||
|
||||
|
||||
void CMainFrame::OnTaskPanelRender( wxTimerEvent &event )
|
||||
{
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnTaskPanelRender - Function Begin"));
|
||||
|
||||
if ( IsShown() )
|
||||
{
|
||||
wxWindow* pwndNotebookPage = NULL;
|
||||
CBOINCBaseView* pView = NULL;
|
||||
|
||||
wxASSERT(NULL != m_pNotebook);
|
||||
|
||||
pwndNotebookPage = m_pNotebook->GetPage( m_pNotebook->GetSelection() );
|
||||
wxASSERT(NULL != pwndNotebookPage);
|
||||
|
||||
pView = wxDynamicCast(pwndNotebookPage, CBOINCBaseView);
|
||||
wxASSERT(NULL != pView);
|
||||
|
||||
pView->FireOnTaskRender( event );
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnTaskPanelRender - Function End"));
|
||||
}
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
static volatile const char __attribute__((unused)) *BOINCrcsid="$Id$";
|
||||
#else
|
||||
|
|
|
@ -58,15 +58,10 @@ public:
|
|||
void OnSize( wxSizeEvent& event );
|
||||
void OnChar( wxKeyEvent& event );
|
||||
|
||||
|
||||
void OnNotebookSelectionChanged( wxNotebookEvent& event );
|
||||
|
||||
void OnListSelected( wxListEvent& event );
|
||||
void OnListDeselected( wxListEvent& event );
|
||||
|
||||
void OnFrameRender( wxTimerEvent& event );
|
||||
void OnListPanelRender( wxTimerEvent& event );
|
||||
void OnTaskPanelRender( wxTimerEvent& event );
|
||||
|
||||
void OnNotebookSelectionChanged( wxNotebookEvent& event );
|
||||
|
||||
private:
|
||||
|
||||
|
@ -74,7 +69,6 @@ private:
|
|||
wxNotebook* m_pNotebook;
|
||||
wxStatusBar* m_pStatusbar;
|
||||
wxTimer* m_pFrameRenderTimer;
|
||||
wxTimer* m_pFrameTaskPanelRenderTimer;
|
||||
wxTimer* m_pFrameListPanelRenderTimer;
|
||||
|
||||
wxStaticBitmap* m_pbmpConnected;
|
||||
|
|
Loading…
Reference in New Issue