mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=5282
This commit is contained in:
parent
21e1990508
commit
5e2881d058
|
@ -23801,4 +23801,15 @@ Bruce 2 Feb 2005
|
|||
tools/
|
||||
backend_lib.C
|
||||
|
||||
Rom 2 Feb 2005
|
||||
- Bug Fix: Adjust the manager so that it'll set it's current directory to that
|
||||
of it's installed location. This will fix the bug of the log files ending
|
||||
up where the installer is executed from.
|
||||
- Bug Fix: Remove the message cache from the message view in the manager. This
|
||||
should clear up a crashing problem that seems to strike the Win9x platform.
|
||||
|
||||
clientgui/
|
||||
BOINCGUIApp.cpp
|
||||
ViewMessages.cpp, .h
|
||||
|
||||
|
||||
|
|
|
@ -41,6 +41,21 @@ IMPLEMENT_DYNAMIC_CLASS(CBOINCGUIApp, wxApp)
|
|||
|
||||
bool CBOINCGUIApp::OnInit()
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
|
||||
TCHAR szPath[MAX_PATH-1];
|
||||
|
||||
// change the current directory to the boinc install directory
|
||||
GetModuleFileName(NULL, szPath, (sizeof(szPath)/sizeof(TCHAR)));
|
||||
|
||||
TCHAR *pszProg = strrchr(szPath, '\\');
|
||||
if (pszProg) {
|
||||
szPath[pszProg - szPath + 1] = 0;
|
||||
SetCurrentDirectory(szPath);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Setup application and company information
|
||||
SetVendorName(wxT("Space Sciences Laboratory, U.C. Berkeley"));
|
||||
SetAppName(wxT("BOINC Manager"));
|
||||
|
|
|
@ -45,80 +45,6 @@
|
|||
#define PRIORITY_ERROR 2
|
||||
|
||||
|
||||
CMessage::CMessage()
|
||||
{
|
||||
m_strPriority = wxEmptyString;
|
||||
m_strProjectName = wxEmptyString;
|
||||
m_strTime = wxEmptyString;
|
||||
m_strMessage = wxEmptyString;
|
||||
}
|
||||
|
||||
|
||||
CMessage::~CMessage()
|
||||
{
|
||||
m_strPriority.Clear();
|
||||
m_strProjectName.Clear();
|
||||
m_strTime.Clear();
|
||||
m_strMessage.Clear();
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::GetProjectName( wxString& strProjectName )
|
||||
{
|
||||
strProjectName = m_strProjectName;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::GetPriority( wxString& strPriority )
|
||||
{
|
||||
strPriority = m_strPriority;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::GetTime( wxString& strTime )
|
||||
{
|
||||
strTime = m_strTime;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::GetMessage( wxString& strMessage )
|
||||
{
|
||||
strMessage = m_strMessage;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::SetProjectName( wxString& strProjectName )
|
||||
{
|
||||
m_strProjectName = strProjectName;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::SetPriority( wxString& strPriority )
|
||||
{
|
||||
m_strPriority = strPriority;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::SetTime( wxString& strTime )
|
||||
{
|
||||
m_strTime = strTime;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CMessage::SetMessage( wxString& strMessage )
|
||||
{
|
||||
m_strMessage = strMessage;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS( CViewMessages, CBOINCBaseView )
|
||||
|
||||
|
||||
|
@ -133,6 +59,12 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) :
|
|||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
//
|
||||
// Initialize variables used in later parts of the class
|
||||
//
|
||||
m_iPreviousDocCount = 0;
|
||||
|
||||
|
||||
//
|
||||
// Globalization/Localization
|
||||
//
|
||||
|
@ -197,8 +129,6 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) :
|
|||
|
||||
CViewMessages::~CViewMessages()
|
||||
{
|
||||
EmptyCache();
|
||||
|
||||
if ( m_pMessageInfoAttr )
|
||||
{
|
||||
delete m_pMessageInfoAttr;
|
||||
|
@ -236,53 +166,42 @@ wxInt32 CViewMessages::GetDocCount()
|
|||
}
|
||||
|
||||
|
||||
void CViewMessages::OnListRender ( wxTimerEvent& event )
|
||||
{
|
||||
if (!m_bProcessingListRenderEvent)
|
||||
{
|
||||
m_bProcessingListRenderEvent = true;
|
||||
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
wxInt32 iDocCount = GetDocCount();
|
||||
if ( 0 >= iDocCount )
|
||||
{
|
||||
m_pListPane->DeleteAllItems();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_iPreviousDocCount != iDocCount )
|
||||
{
|
||||
m_pListPane->SetItemCount( iDocCount );
|
||||
m_iPreviousDocCount = iDocCount;
|
||||
}
|
||||
}
|
||||
|
||||
if ( _EnsureLastItemVisible() && iDocCount )
|
||||
m_pListPane->EnsureVisible( iDocCount - 1 );
|
||||
|
||||
m_bProcessingListRenderEvent = false;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
wxString CViewMessages::OnListGetItemText( long item, long column ) const
|
||||
{
|
||||
CMessage* message = m_MessageCache.at( item );
|
||||
wxString strBuffer = wxEmptyString;
|
||||
|
||||
switch(column)
|
||||
{
|
||||
case COLUMN_PROJECT:
|
||||
message->GetProjectName( strBuffer );
|
||||
break;
|
||||
case COLUMN_TIME:
|
||||
message->GetTime( strBuffer );
|
||||
break;
|
||||
case COLUMN_MESSAGE:
|
||||
message->GetMessage( strBuffer );
|
||||
break;
|
||||
}
|
||||
|
||||
return strBuffer;
|
||||
}
|
||||
|
||||
|
||||
wxListItemAttr* CViewMessages::OnListGetItemAttr( long item ) const
|
||||
{
|
||||
wxListItemAttr* pAttribute = NULL;
|
||||
CMessage* message = m_MessageCache.at( item );
|
||||
wxString strBuffer = wxEmptyString;
|
||||
|
||||
message->GetPriority( strBuffer );
|
||||
|
||||
if ( wxT("E") == strBuffer )
|
||||
{
|
||||
pAttribute = m_pMessageErrorAttr;
|
||||
}
|
||||
else
|
||||
{
|
||||
pAttribute = m_pMessageInfoAttr;
|
||||
}
|
||||
|
||||
return pAttribute;
|
||||
}
|
||||
|
||||
|
||||
wxString CViewMessages::OnDocGetItemText( long item, long column ) const
|
||||
{
|
||||
wxString strBuffer = wxEmptyString;
|
||||
|
||||
switch(column)
|
||||
{
|
||||
case COLUMN_PROJECT:
|
||||
|
@ -300,6 +219,26 @@ wxString CViewMessages::OnDocGetItemText( long item, long column ) const
|
|||
}
|
||||
|
||||
|
||||
wxListItemAttr* CViewMessages::OnListGetItemAttr( long item ) const
|
||||
{
|
||||
wxListItemAttr* pAttribute = NULL;
|
||||
wxString strBuffer = wxEmptyString;
|
||||
|
||||
FormatPriority( item, strBuffer );
|
||||
|
||||
if ( wxT("E") == strBuffer )
|
||||
{
|
||||
pAttribute = m_pMessageErrorAttr;
|
||||
}
|
||||
else
|
||||
{
|
||||
pAttribute = m_pMessageInfoAttr;
|
||||
}
|
||||
|
||||
return pAttribute;
|
||||
}
|
||||
|
||||
|
||||
void CViewMessages::OnTaskLinkClicked( const wxHtmlLinkInfo& link )
|
||||
{
|
||||
wxInt32 iIndex = -1;
|
||||
|
@ -385,76 +324,6 @@ void CViewMessages::OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord WXUNUSED(x),
|
|||
}
|
||||
|
||||
|
||||
wxInt32 CViewMessages::AddCacheElement()
|
||||
{
|
||||
CMessage* pItem = new CMessage();
|
||||
wxASSERT( NULL != pItem );
|
||||
if ( NULL != pItem )
|
||||
{
|
||||
m_MessageCache.push_back( pItem );
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CViewMessages::EmptyCache()
|
||||
{
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
|
||||
wxASSERT(NULL != pDoc);
|
||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||
|
||||
unsigned int i;
|
||||
for (i=0; i<m_MessageCache.size(); i++) {
|
||||
delete m_MessageCache[i];
|
||||
}
|
||||
m_MessageCache.clear();
|
||||
pDoc->ResetMessageState();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CViewMessages::GetCacheCount()
|
||||
{
|
||||
return m_MessageCache.size();
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CViewMessages::RemoveCacheElement()
|
||||
{
|
||||
delete m_MessageCache.back();
|
||||
m_MessageCache.erase( m_MessageCache.end() - 1 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CViewMessages::UpdateCache( long item, long column, wxString& strNewData )
|
||||
{
|
||||
CMessage* message = m_MessageCache.at( item );
|
||||
wxString strPriority = wxEmptyString;
|
||||
|
||||
switch(column)
|
||||
{
|
||||
case COLUMN_PROJECT:
|
||||
message->SetProjectName( strNewData );
|
||||
break;
|
||||
case COLUMN_TIME:
|
||||
message->SetTime( strNewData );
|
||||
break;
|
||||
case COLUMN_MESSAGE:
|
||||
message->SetMessage( strNewData );
|
||||
break;
|
||||
}
|
||||
|
||||
FormatPriority( item, strPriority );
|
||||
message->SetPriority( strPriority );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool CViewMessages::EnsureLastItemVisible()
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -28,30 +28,6 @@
|
|||
#include "BOINCBaseView.h"
|
||||
|
||||
|
||||
class CMessage : public wxObject
|
||||
{
|
||||
public:
|
||||
CMessage();
|
||||
~CMessage();
|
||||
|
||||
wxInt32 GetProjectName( wxString& strProjectName );
|
||||
wxInt32 GetPriority( wxString& strPriority );
|
||||
wxInt32 GetTime( wxString& strTime );
|
||||
wxInt32 GetMessage( wxString& strMessage );
|
||||
|
||||
wxInt32 SetProjectName( wxString& strProjectName );
|
||||
wxInt32 SetPriority( wxString& strPriority );
|
||||
wxInt32 SetTime( wxString& strTime );
|
||||
wxInt32 SetMessage( wxString& strMessage );
|
||||
|
||||
protected:
|
||||
wxString m_strProjectName;
|
||||
wxString m_strPriority;
|
||||
wxString m_strTime;
|
||||
wxString m_strMessage;
|
||||
};
|
||||
|
||||
|
||||
class CViewMessages : public CBOINCBaseView
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS( CViewMessages )
|
||||
|
@ -73,27 +49,21 @@ protected:
|
|||
|
||||
bool m_bTipsHeaderHidden;
|
||||
|
||||
wxInt32 m_iPreviousDocCount;
|
||||
|
||||
wxListItemAttr* m_pMessageInfoAttr;
|
||||
wxListItemAttr* m_pMessageErrorAttr;
|
||||
|
||||
std::vector<CMessage*> m_MessageCache;
|
||||
virtual void OnListRender( wxTimerEvent& event );
|
||||
|
||||
virtual wxInt32 GetDocCount();
|
||||
|
||||
virtual wxString OnListGetItemText( long item, long column ) const;
|
||||
virtual wxListItemAttr* OnListGetItemAttr( long item ) const;
|
||||
|
||||
virtual wxString OnDocGetItemText( long item, long column ) const;
|
||||
|
||||
virtual void OnTaskLinkClicked( const wxHtmlLinkInfo& link );
|
||||
virtual void OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y );
|
||||
|
||||
virtual wxInt32 AddCacheElement();
|
||||
virtual wxInt32 EmptyCache();
|
||||
virtual wxInt32 GetCacheCount();
|
||||
virtual wxInt32 RemoveCacheElement();
|
||||
virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData );
|
||||
|
||||
virtual bool EnsureLastItemVisible();
|
||||
|
||||
virtual void UpdateSelection();
|
||||
|
|
|
@ -60,21 +60,15 @@ Global
|
|||
{21E7357D-41D8-444C-A120-18064B497174}.Release.ActiveCfg = Release|Win32
|
||||
{21E7357D-41D8-444C-A120-18064B497174}.Release.Build.0 = Release|Win32
|
||||
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Debug.ActiveCfg = Debug|Win32
|
||||
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Debug.Build.0 = Debug|Win32
|
||||
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Release.ActiveCfg = Release|Win32
|
||||
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Release.Build.0 = Release|Win32
|
||||
{DA997BD1-B575-465C-9851-EEBB727F506A}.Debug.ActiveCfg = Debug|Win32
|
||||
{DA997BD1-B575-465C-9851-EEBB727F506A}.Debug.Build.0 = Debug|Win32
|
||||
{DA997BD1-B575-465C-9851-EEBB727F506A}.Release.ActiveCfg = Release|Win32
|
||||
{DA997BD1-B575-465C-9851-EEBB727F506A}.Release.Build.0 = Release|Win32
|
||||
{06113715-AC51-4E91-8B9D-C987CABE0920}.Debug.ActiveCfg = Debug|Win32
|
||||
{06113715-AC51-4E91-8B9D-C987CABE0920}.Debug.Build.0 = Debug|Win32
|
||||
{06113715-AC51-4E91-8B9D-C987CABE0920}.Release.ActiveCfg = Release|Win32
|
||||
{06113715-AC51-4E91-8B9D-C987CABE0920}.Release.Build.0 = Release|Win32
|
||||
{78BA7B4E-4E37-4CAB-B954-CD906AC0E011}.Debug.ActiveCfg = Debug|Win32
|
||||
{78BA7B4E-4E37-4CAB-B954-CD906AC0E011}.Debug.Build.0 = Debug|Win32
|
||||
{78BA7B4E-4E37-4CAB-B954-CD906AC0E011}.Release.ActiveCfg = Release|Win32
|
||||
{78BA7B4E-4E37-4CAB-B954-CD906AC0E011}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
|
Loading…
Reference in New Issue