*** empty log message ***

svn path=/trunk/boinc/; revision=5240
This commit is contained in:
Rom Walton 2005-01-29 00:58:43 +00:00
parent 1935bf0c3d
commit d5b2784ad3
16 changed files with 156 additions and 154 deletions

View File

@ -23407,3 +23407,25 @@ David 28 Jan 2005
time_stats.C,h
win
win_net.cpp,h
Rom 28 Jan 2005
- Check to see if we are already connected to the core client before
attempting to get the activity state and network state.
- Change the dynamic object array for the view caches to a vector for
a perf increase, and to cleanup a possible crashing error.
- Add aditional asserts in the base view to check for a possible cache
inconsistency.
- Remove an out of date file from the build list.
clientgui/
BOINCBaseView.cpp, .h
MainDocument.cpp
ViewMessages.cpp, .h
ViewProjects.cpp, .h
ViewResources.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
win_build/
BOINCGUI.vcproj
winbuild/installerv2/
BOINC.ism

View File

@ -215,6 +215,7 @@ void CBOINCBaseView::OnListRender ( wxTimerEvent& event )
iReturnValue = AddCacheElement();
wxASSERT( 0 == iReturnValue );
}
wxASSERT( GetDocCount() == GetCacheCount() );
}
else
{
@ -223,17 +224,18 @@ void CBOINCBaseView::OnListRender ( wxTimerEvent& event )
iReturnValue = RemoveCacheElement();
wxASSERT( 0 == iReturnValue );
}
wxASSERT( GetDocCount() == GetCacheCount() );
}
m_pListPane->SetItemCount( iDocCount );
}
}
if ( iCacheCount )
if ( iDocCount )
SyncronizeCache();
if ( EnsureLastItemVisible() )
m_pListPane->EnsureVisible( iDocCount );
if ( _EnsureLastItemVisible() && ( iDocCount != iCacheCount ) )
m_pListPane->EnsureVisible( iDocCount - 1 );
m_bProcessingListRenderEvent = false;
}
@ -448,6 +450,12 @@ wxInt32 CBOINCBaseView::UpdateCache( long WXUNUSED(item), long WXUNUSED(column),
}
bool CBOINCBaseView::_EnsureLastItemVisible()
{
return EnsureLastItemVisible();
}
bool CBOINCBaseView::EnsureLastItemVisible()
{
return false;

View File

@ -100,6 +100,7 @@ protected:
virtual wxInt32 SyncronizeCache();
virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData );
bool _EnsureLastItemVisible();
virtual bool EnsureLastItemVisible();
virtual bool UpdateQuickTip( const wxString& strCurrentLink, const wxString& strQuickTip, const wxString& strQuickTipText );

View File

@ -253,13 +253,14 @@ wxInt32 CMainDocument::GetActivityRunMode( wxInt32& iMode )
{
m_dtCachedActivityRunModeTimestamp = wxDateTime::Now();
iRetVal = rpc.get_run_mode( iMode );
if ( 0 == iRetVal )
if ( IsConnected() )
{
m_iCachedActivityRunMode = iMode;
iRetVal = rpc.get_run_mode( iMode );
if ( 0 == iRetVal )
{
m_iCachedActivityRunMode = iMode;
}
}
else
Connect( strEmpty );
}
else
{
@ -275,15 +276,15 @@ wxInt32 CMainDocument::SetActivityRunMode( wxInt32 iMode )
wxInt32 iRetVal = 0;
wxString strEmpty = wxEmptyString;
iRetVal = rpc.set_run_mode( iMode );
if ( 0 == iRetVal )
if ( IsConnected() )
{
m_dtCachedActivityRunModeTimestamp = wxDateTime::Now();
m_iCachedActivityRunMode = iMode;
iRetVal = rpc.set_run_mode( iMode );
if ( 0 == iRetVal )
{
m_dtCachedActivityRunModeTimestamp = wxDateTime::Now();
m_iCachedActivityRunMode = iMode;
}
}
else
Connect( strEmpty );
return iRetVal;
}
@ -299,13 +300,14 @@ wxInt32 CMainDocument::GetNetworkRunMode( wxInt32& iMode )
{
m_dtCachedNetworkRunModeTimestamp = wxDateTime::Now();
iRetVal = rpc.get_network_mode( iMode );
if ( 0 == iRetVal )
if ( IsConnected() )
{
m_iCachedNetworkRunMode = iMode;
iRetVal = rpc.get_network_mode( iMode );
if ( 0 == iRetVal )
{
m_iCachedNetworkRunMode = iMode;
}
}
else
Connect( strEmpty );
}
else
{
@ -321,14 +323,15 @@ wxInt32 CMainDocument::SetNetworkRunMode( wxInt32 iMode )
wxInt32 iRetVal = 0;
wxString strEmpty = wxEmptyString;
iRetVal = rpc.set_network_mode( iMode );
if ( 0 == iRetVal )
if ( IsConnected() )
{
m_dtCachedNetworkRunModeTimestamp = wxDateTime::Now();
m_iCachedNetworkRunMode = iMode;
iRetVal = rpc.set_network_mode( iMode );
if ( 0 == iRetVal )
{
m_dtCachedNetworkRunModeTimestamp = wxDateTime::Now();
m_iCachedNetworkRunMode = iMode;
}
}
else
Connect( strEmpty );
return iRetVal;
}

View File

@ -45,9 +45,6 @@
#define PRIORITY_ERROR 2
WX_DEFINE_OBJARRAY( CMessageCache );
CMessage::CMessage()
{
m_strPriority = wxEmptyString;
@ -239,19 +236,19 @@ wxInt32 CViewMessages::GetDocCount()
wxString CViewMessages::OnListGetItemText( long item, long column ) const
{
CMessage& message = m_MessageCache.Item( item );
CMessage* message = m_MessageCache.at( item );
wxString strBuffer = wxEmptyString;
switch(column)
{
case COLUMN_PROJECT:
message.GetProjectName( strBuffer );
message->GetProjectName( strBuffer );
break;
case COLUMN_TIME:
message.GetTime( strBuffer );
message->GetTime( strBuffer );
break;
case COLUMN_MESSAGE:
message.GetMessage( strBuffer );
message->GetMessage( strBuffer );
break;
}
@ -262,10 +259,10 @@ wxString CViewMessages::OnListGetItemText( long item, long column ) const
wxListItemAttr* CViewMessages::OnListGetItemAttr( long item ) const
{
wxListItemAttr* pAttribute = NULL;
CMessage& message = m_MessageCache.Item( item );
CMessage* message = m_MessageCache.at( item );
wxString strBuffer = wxEmptyString;
message.GetPriority( strBuffer );
message->GetPriority( strBuffer );
if ( wxT("E") == strBuffer )
{
@ -392,7 +389,7 @@ wxInt32 CViewMessages::AddCacheElement()
wxASSERT( NULL != pItem );
if ( NULL != pItem )
{
m_MessageCache.Add( pItem );
m_MessageCache.push_back( pItem );
return 0;
}
return -1;
@ -406,7 +403,7 @@ wxInt32 CViewMessages::EmptyCache()
wxASSERT(NULL != pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
m_MessageCache.Empty();
m_MessageCache.clear();
pDoc->ResetMessageState();
return 0;
@ -415,37 +412,37 @@ wxInt32 CViewMessages::EmptyCache()
wxInt32 CViewMessages::GetCacheCount()
{
return m_MessageCache.GetCount();
return m_MessageCache.size();
}
wxInt32 CViewMessages::RemoveCacheElement()
{
m_MessageCache.RemoveAt( m_MessageCache.GetCount() - 1 );
m_MessageCache.erase( m_MessageCache.end() );
return 0;
}
wxInt32 CViewMessages::UpdateCache( long item, long column, wxString& strNewData )
{
CMessage& message = m_MessageCache.Item( item );
CMessage* message = m_MessageCache.at( item );
wxString strPriority = wxEmptyString;
switch(column)
{
case COLUMN_PROJECT:
message.SetProjectName( strNewData );
message->SetProjectName( strNewData );
break;
case COLUMN_TIME:
message.SetTime( strNewData );
message->SetTime( strNewData );
break;
case COLUMN_MESSAGE:
message.SetMessage( strNewData );
message->SetMessage( strNewData );
break;
}
FormatPriority( item, strPriority );
message.SetPriority( strPriority );
message->SetPriority( strPriority );
return 0;
}

View File

@ -51,8 +51,6 @@ protected:
wxString m_strMessage;
};
WX_DECLARE_OBJARRAY( CMessage, CMessageCache );
class CViewMessages : public CBOINCBaseView
{
@ -78,7 +76,7 @@ protected:
wxListItemAttr* m_pMessageInfoAttr;
wxListItemAttr* m_pMessageErrorAttr;
CMessageCache m_MessageCache;
std::vector<CMessage*> m_MessageCache;
virtual wxInt32 GetDocCount();

View File

@ -30,8 +30,6 @@
#include "DlgAttachProject.h"
#include "Events.h"
#include "wx/arrimpl.cpp"
#include "res/boinc.xpm"
#include "res/proj.xpm"
@ -49,9 +47,6 @@
#define COLUMN_STATUS 6
WX_DEFINE_OBJARRAY( CProjectCache );
CProject::CProject()
{
m_strProjectName = wxEmptyString;
@ -332,31 +327,31 @@ wxInt32 CViewProjects::GetDocCount()
wxString CViewProjects::OnListGetItemText(long item, long column) const
{
CProject& project = m_ProjectCache.Item( item );
CProject* project = m_ProjectCache.at( item );
wxString strBuffer = wxEmptyString;
switch(column)
{
case COLUMN_PROJECT:
project.GetProjectName( strBuffer );
project->GetProjectName( strBuffer );
break;
case COLUMN_ACCOUNTNAME:
project.GetAccountName( strBuffer );
project->GetAccountName( strBuffer );
break;
case COLUMN_TEAMNAME:
project.GetTeamName( strBuffer );
project->GetTeamName( strBuffer );
break;
case COLUMN_TOTALCREDIT:
project.GetTotalCredit( strBuffer );
project->GetTotalCredit( strBuffer );
break;
case COLUMN_AVGCREDIT:
project.GetAVGCredit( strBuffer );
project->GetAVGCredit( strBuffer );
break;
case COLUMN_RESOURCESHARE:
project.GetResourceShare( strBuffer );
project->GetResourceShare( strBuffer );
break;
case COLUMN_STATUS:
project.GetStatus( strBuffer );
project->GetStatus( strBuffer );
break;
}
@ -604,7 +599,7 @@ wxInt32 CViewProjects::AddCacheElement()
wxASSERT( NULL != pItem );
if ( NULL != pItem )
{
m_ProjectCache.Add( pItem );
m_ProjectCache.push_back( pItem );
return 0;
}
return -1;
@ -613,50 +608,54 @@ wxInt32 CViewProjects::AddCacheElement()
wxInt32 CViewProjects::EmptyCache()
{
m_ProjectCache.Empty();
unsigned int i;
for (i=0; i<m_ProjectCache.size(); i++) {
delete m_ProjectCache[i];
}
m_ProjectCache.clear();
return 0;
}
wxInt32 CViewProjects::GetCacheCount()
{
return m_ProjectCache.GetCount();
return m_ProjectCache.size();
}
wxInt32 CViewProjects::RemoveCacheElement()
{
m_ProjectCache.RemoveAt( m_ProjectCache.GetCount() - 1 );
m_ProjectCache.erase( m_ProjectCache.end() );
return 0;
}
wxInt32 CViewProjects::UpdateCache( long item, long column, wxString& strNewData )
{
CProject& project = m_ProjectCache.Item( item );
CProject* project = m_ProjectCache.at( item );
switch(column)
{
case COLUMN_PROJECT:
project.SetProjectName( strNewData );
project->SetProjectName( strNewData );
break;
case COLUMN_ACCOUNTNAME:
project.SetAccountName( strNewData );
project->SetAccountName( strNewData );
break;
case COLUMN_TEAMNAME:
project.SetTeamName( strNewData );
project->SetTeamName( strNewData );
break;
case COLUMN_TOTALCREDIT:
project.SetTotalCredit( strNewData );
project->SetTotalCredit( strNewData );
break;
case COLUMN_AVGCREDIT:
project.SetAVGCredit( strNewData );
project->SetAVGCredit( strNewData );
break;
case COLUMN_RESOURCESHARE:
project.SetResourceShare( strNewData );
project->SetResourceShare( strNewData );
break;
case COLUMN_STATUS:
project.SetStatus( strNewData );
project->SetStatus( strNewData );
break;
}

View File

@ -60,8 +60,6 @@ protected:
wxString m_strStatus;
};
WX_DECLARE_OBJARRAY( CProject, CProjectCache );
class CViewProjects : public CBOINCBaseView
{
@ -94,7 +92,7 @@ protected:
bool m_bItemSelected;
CProjectCache m_ProjectCache;
std::vector<CProject*> m_ProjectCache;
virtual wxInt32 GetDocCount();

View File

@ -29,8 +29,6 @@
#include "ViewResources.h"
#include "Events.h"
#include "wx/arrimpl.cpp"
#include "res/usage.xpm"
#include "res/task.xpm"
@ -41,9 +39,6 @@
#define COLUMN_DISKSPACE 1
WX_DEFINE_OBJARRAY( CResourceCache );
CResource::CResource()
{
m_strProjectName = wxEmptyString;
@ -177,16 +172,16 @@ wxInt32 CViewResources::GetDocCount()
wxString CViewResources::OnListGetItemText( long item, long column ) const
{
CResource& resource = m_ResourceCache.Item( item );
CResource* resource = m_ResourceCache.at( item );
wxString strBuffer = wxEmptyString;
switch(column)
{
case COLUMN_PROJECT:
resource.GetProjectName( strBuffer );
resource->GetProjectName( strBuffer );
break;
case COLUMN_DISKSPACE:
resource.GetDiskSpace( strBuffer );
resource->GetDiskSpace( strBuffer );
break;
}
@ -268,7 +263,7 @@ wxInt32 CViewResources::AddCacheElement()
wxASSERT( NULL != pItem );
if ( NULL != pItem )
{
m_ResourceCache.Add( pItem );
m_ResourceCache.push_back( pItem );
return 0;
}
return -1;
@ -277,35 +272,35 @@ wxInt32 CViewResources::AddCacheElement()
wxInt32 CViewResources::EmptyCache()
{
m_ResourceCache.Empty();
m_ResourceCache.clear();
return 0;
}
wxInt32 CViewResources::GetCacheCount()
{
return m_ResourceCache.GetCount();
return m_ResourceCache.size();
}
wxInt32 CViewResources::RemoveCacheElement()
{
m_ResourceCache.RemoveAt( m_ResourceCache.GetCount() - 1 );
m_ResourceCache.erase( m_ResourceCache.end() );
return 0;
}
wxInt32 CViewResources::UpdateCache( long item, long column, wxString& strNewData )
{
CResource& resource = m_ResourceCache.Item( item );
CResource* resource = m_ResourceCache.at( item );
switch(column)
{
case COLUMN_PROJECT:
resource.SetProjectName( strNewData );
resource->SetProjectName( strNewData );
break;
case COLUMN_DISKSPACE:
resource.SetDiskSpace( strNewData );
resource->SetDiskSpace( strNewData );
break;
}

View File

@ -45,8 +45,6 @@ protected:
wxString m_strDiskSpace;
};
WX_DECLARE_OBJARRAY( CResource, CResourceCache );
class CViewResources : public CBOINCBaseView
{
@ -69,7 +67,7 @@ protected:
bool m_bItemSelected;
CResourceCache m_ResourceCache;
std::vector<CResource*> m_ResourceCache;
virtual wxInt32 GetDocCount();

View File

@ -30,8 +30,6 @@
#include "Events.h"
#include "error_numbers.h"
#include "wx/arrimpl.cpp"
#include "res/xfer.xpm"
#include "res/task.xpm"
@ -47,9 +45,6 @@
#define COLUMN_STATUS 6
WX_DEFINE_OBJARRAY( CTransferCache );
CTransfer::CTransfer()
{
m_strProjectName = wxEmptyString;
@ -279,31 +274,31 @@ wxInt32 CViewTransfers::GetDocCount()
wxString CViewTransfers::OnListGetItemText(long item, long column) const
{
CTransfer& transfer = m_TransferCache.Item( item );
CTransfer* transfer = m_TransferCache.at( item );
wxString strBuffer = wxEmptyString;
switch(column)
{
case COLUMN_PROJECT:
transfer.GetProjectName( strBuffer );
transfer->GetProjectName( strBuffer );
break;
case COLUMN_FILE:
transfer.GetFileName( strBuffer );
transfer->GetFileName( strBuffer );
break;
case COLUMN_PROGRESS:
transfer.GetProgress( strBuffer );
transfer->GetProgress( strBuffer );
break;
case COLUMN_SIZE:
transfer.GetSize( strBuffer );
transfer->GetSize( strBuffer );
break;
case COLUMN_TIME:
transfer.GetTime( strBuffer );
transfer->GetTime( strBuffer );
break;
case COLUMN_SPEED:
transfer.GetSpeed( strBuffer );
transfer->GetSpeed( strBuffer );
break;
case COLUMN_STATUS:
transfer.GetStatus( strBuffer );
transfer->GetStatus( strBuffer );
break;
}
@ -441,7 +436,7 @@ wxInt32 CViewTransfers::AddCacheElement()
wxASSERT( NULL != pItem );
if ( NULL != pItem )
{
m_TransferCache.Add( pItem );
m_TransferCache.push_back( pItem );
return 0;
}
return -1;
@ -450,50 +445,50 @@ wxInt32 CViewTransfers::AddCacheElement()
wxInt32 CViewTransfers::EmptyCache()
{
m_TransferCache.Empty();
m_TransferCache.clear();
return 0;
}
wxInt32 CViewTransfers::GetCacheCount()
{
return m_TransferCache.GetCount();
return m_TransferCache.size();
}
wxInt32 CViewTransfers::RemoveCacheElement()
{
m_TransferCache.RemoveAt( m_TransferCache.GetCount() - 1 );
m_TransferCache.erase( m_TransferCache.end() );
return 0;
}
wxInt32 CViewTransfers::UpdateCache( long item, long column, wxString& strNewData )
{
CTransfer& transfer = m_TransferCache.Item( item );
CTransfer* transfer = m_TransferCache.at( item );
switch(column)
{
case COLUMN_PROJECT:
transfer.SetProjectName( strNewData );
transfer->SetProjectName( strNewData );
break;
case COLUMN_FILE:
transfer.SetFileName( strNewData );
transfer->SetFileName( strNewData );
break;
case COLUMN_PROGRESS:
transfer.SetProgress( strNewData );
transfer->SetProgress( strNewData );
break;
case COLUMN_SIZE:
transfer.SetSize( strNewData );
transfer->SetSize( strNewData );
break;
case COLUMN_TIME:
transfer.SetTime( strNewData );
transfer->SetTime( strNewData );
break;
case COLUMN_SPEED:
transfer.SetSpeed( strNewData );
transfer->SetSpeed( strNewData );
break;
case COLUMN_STATUS:
transfer.SetStatus( strNewData );
transfer->SetStatus( strNewData );
break;
}

View File

@ -60,8 +60,6 @@ protected:
wxString m_strStatus;
};
WX_DECLARE_OBJARRAY( CTransfer, CTransferCache );
class CViewTransfers : public CBOINCBaseView
{
@ -86,7 +84,7 @@ protected:
bool m_bItemSelected;
CTransferCache m_TransferCache;
std::vector<CTransfer*> m_TransferCache;
virtual wxInt32 GetDocCount();

View File

@ -29,8 +29,6 @@
#include "ViewWork.h"
#include "Events.h"
#include "wx/arrimpl.cpp"
#include "res/result.xpm"
#include "res/task.xpm"
@ -47,9 +45,6 @@
#define COLUMN_STATUS 7
WX_DEFINE_OBJARRAY( CWorkCache );
CWork::CWork()
{
m_strProjectName = wxEmptyString;
@ -306,34 +301,34 @@ wxInt32 CViewWork::GetDocCount()
wxString CViewWork::OnListGetItemText( long item, long column ) const
{
CWork& work = m_WorkCache.Item( item );
CWork* work = m_WorkCache.at( item );
wxString strBuffer = wxEmptyString;
switch(column)
{
case COLUMN_PROJECT:
work.GetProjectName( strBuffer );
work->GetProjectName( strBuffer );
break;
case COLUMN_APPLICATION:
work.GetApplicationName( strBuffer );
work->GetApplicationName( strBuffer );
break;
case COLUMN_NAME:
work.GetName( strBuffer );
work->GetName( strBuffer );
break;
case COLUMN_CPUTIME:
work.GetCPUTime( strBuffer );
work->GetCPUTime( strBuffer );
break;
case COLUMN_PROGRESS:
work.GetProgress( strBuffer );
work->GetProgress( strBuffer );
break;
case COLUMN_TOCOMPLETETION:
work.GetTimeToCompletion( strBuffer );
work->GetTimeToCompletion( strBuffer );
break;
case COLUMN_REPORTDEADLINE:
work.GetReportDeadline( strBuffer );
work->GetReportDeadline( strBuffer );
break;
case COLUMN_STATUS:
work.GetStatus( strBuffer );
work->GetStatus( strBuffer );
break;
}
@ -517,7 +512,7 @@ wxInt32 CViewWork::AddCacheElement()
wxASSERT( NULL != pItem );
if ( NULL != pItem )
{
m_WorkCache.Add( pItem );
m_WorkCache.push_back( pItem );
return 0;
}
return -1;
@ -526,53 +521,53 @@ wxInt32 CViewWork::AddCacheElement()
wxInt32 CViewWork::EmptyCache()
{
m_WorkCache.Empty();
m_WorkCache.clear();
return 0;
}
wxInt32 CViewWork::GetCacheCount()
{
return m_WorkCache.GetCount();
return m_WorkCache.size();
}
wxInt32 CViewWork::RemoveCacheElement()
{
m_WorkCache.RemoveAt( m_WorkCache.GetCount() - 1 );
m_WorkCache.erase( m_WorkCache.end() );
return 0;
}
wxInt32 CViewWork::UpdateCache( long item, long column, wxString& strNewData )
{
CWork& work = m_WorkCache.Item( item );
CWork* work = m_WorkCache.at( item );
switch(column)
{
case COLUMN_PROJECT:
work.SetProjectName( strNewData );
work->SetProjectName( strNewData );
break;
case COLUMN_APPLICATION:
work.SetApplicationName( strNewData );
work->SetApplicationName( strNewData );
break;
case COLUMN_NAME:
work.SetName( strNewData );
work->SetName( strNewData );
break;
case COLUMN_CPUTIME:
work.SetCPUTime( strNewData );
work->SetCPUTime( strNewData );
break;
case COLUMN_PROGRESS:
work.SetProgress( strNewData );
work->SetProgress( strNewData );
break;
case COLUMN_TOCOMPLETETION:
work.SetTimeToCompletion( strNewData );
work->SetTimeToCompletion( strNewData );
break;
case COLUMN_REPORTDEADLINE:
work.SetReportDeadline( strNewData );
work->SetReportDeadline( strNewData );
break;
case COLUMN_STATUS:
work.SetStatus( strNewData );
work->SetStatus( strNewData );
break;
}

View File

@ -63,8 +63,6 @@ protected:
wxString m_strStatus;
};
WX_DECLARE_OBJARRAY( CWork, CWorkCache );
class CViewWork : public CBOINCBaseView
{
@ -91,7 +89,7 @@ protected:
bool m_bItemSelected;
CWorkCache m_WorkCache;
std::vector<CWork*> m_WorkCache;
virtual wxInt32 GetDocCount();

View File

@ -476,9 +476,6 @@
<File
RelativePath="..\clientgui\ViewWork.h">
</File>
<File
RelativePath="..\client\win\win_config.h">
</File>
</Filter>
<Filter
Name="Resource Files"

Binary file not shown.