~ubuntu-branches/debian/sid/boinc/sid

« back to all changes in this revision

Viewing changes to clientgui/MainDocument.cpp

  • Committer: Package Import Robot
  • Author(s): Steffen Moeller
  • Date: 2011-08-08 01:36:51 UTC
  • mfrom: (6.1.11 experimental)
  • Revision ID: package-import@ubuntu.com-20110808013651-m1hs3cltiveuteyn
Tags: 6.13.1+dfsg-2
* Bringing notify patch to unstable.
* Adjusted build dependency to libjpeg-dev (Closes: #641093)
* Further improvements on stripchart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
410
410
 
411
411
    m_dtCachedStateTimestamp = wxDateTime((time_t)0);
412
412
    m_iGet_state_rpc_result = 0;
413
 
    m_iGet_host_info_rpc_result = 0;
414
413
    
415
414
    m_dtCachedCCStatusTimestamp = wxDateTime((time_t)0);
416
415
    m_iGet_status_rpc_result = 0;
516
515
        if (wxGetApp().ShouldShutdownCoreClient()) {
517
516
            // Shut down only local clients on Manager exit
518
517
            if (!wxGetApp().IsMgrMultipleInstance()) {
519
 
                    m_pClientManager->ShutdownBOINCCore();
 
518
                m_pClientManager->ShutdownBOINCCore();
520
519
            }
521
520
        }
522
521
        
623
622
    int     retval = 0;
624
623
 
625
624
    if (m_iGet_state_rpc_result) retval = m_iGet_state_rpc_result;
626
 
    if (m_iGet_host_info_rpc_result) retval = m_iGet_host_info_rpc_result;
627
625
            
628
626
    if (retval) m_pNetworkConnection->SetStateDisconnected();
629
627
 
634
632
int CMainDocument::ResetState() {
635
633
    rpcClient.close();
636
634
    state.clear();
637
 
    host.clear_host_info();
638
635
    results.clear();
639
636
    ft.clear();
640
637
    statistics_status.clear();
999
996
        request.arg1 = &async_state_buf;
1000
997
        request.exchangeBuf = &state;
1001
998
        request.rpcType = RPC_TYPE_ASYNC_NO_REFRESH;
 
999
        request.completionTime = &m_dtCachedStateTimestamp;
1002
1000
        request.resultPtr = &m_iGet_state_rpc_result;
1003
1001
       
1004
1002
        RequestRPC(request);
1005
 
 
1006
 
    // *********** RPC_GET_HOST_INFO **************
1007
 
 
1008
 
        request.clear();
1009
 
        request.which_rpc = RPC_GET_HOST_INFO;
1010
 
        request.arg1 = &async_host_buf;
1011
 
        request.exchangeBuf = &host;
1012
 
        request.rpcType = RPC_TYPE_ASYNC_NO_REFRESH;
1013
 
        request.completionTime = &m_dtCachedStateTimestamp;
1014
 
        request.resultPtr = &m_iGet_host_info_rpc_result;
1015
 
       
1016
 
        RequestRPC(request);
1017
1003
    }
1018
1004
    
1019
1005
    // **** All periodic RPCs after this point are used only 
1195
1181
            wxLogTrace(wxT("Function Status"), wxT("CMainDocument::ForceCacheUpdate - Get State Failed '%d'"), retval);
1196
1182
            m_pNetworkConnection->SetStateDisconnected();
1197
1183
        }
1198
 
        pFrame->UpdateStatusText(_("Retrieving host information; please wait..."));
1199
 
 
1200
 
        m_iGet_host_info_rpc_result = rpc.get_host_info(host);
1201
 
        if (m_iGet_host_info_rpc_result) {
1202
 
             retval = m_iGet_host_info_rpc_result;
1203
 
            wxLogTrace(wxT("Function Status"), wxT("CMainDocument::ForceCacheUpdate - Get Host Information Failed '%d'"), retval);
1204
 
            m_pNetworkConnection->SetStateDisconnected();
1205
 
        }
1206
1184
 
1207
1185
        pFrame->UpdateStatusText(wxEmptyString);
1208
1186
    } else {
1823
1801
 
1824
1802
    if (IsConnected()) {
1825
1803
        // Can't look up previous last read message until we know machine name
1826
 
        if (!strlen(host.domain_name)) {
 
1804
        if (!strlen(state.host_info.domain_name)) {
1827
1805
            goto done;
1828
1806
        }
1829
1807
        
1856
1834
    if (dLastSavedArrivalTime != m_dLastReadNoticeArrivalTime) {
1857
1835
        wxString        strBaseConfigLocation = wxString(wxT("/Notices/"));
1858
1836
        wxConfigBase*   pConfig = wxConfigBase::Get(FALSE);
1859
 
        wxString        strDomainName = wxString(host.domain_name, wxConvUTF8, strlen(host.domain_name));
 
1837
        wxString        strDomainName = wxString(state.host_info.domain_name, wxConvUTF8, strlen(state.host_info.domain_name));
1860
1838
        wxString        strArrivalTime = wxEmptyString;
1861
1839
 
1862
1840
        pConfig->SetPath(strBaseConfigLocation + strDomainName);
1872
1850
void CMainDocument::RestoreUnreadNoticeInfo() {
1873
1851
    wxString        strBaseConfigLocation = wxString(wxT("/Notices/"));
1874
1852
    wxConfigBase*   pConfig = wxConfigBase::Get(FALSE);
1875
 
    wxString        strDomainName = wxString(host.domain_name, wxConvUTF8, strlen(host.domain_name));
 
1853
    wxString        strDomainName = wxString(state.host_info.domain_name, wxConvUTF8, strlen(state.host_info.domain_name));
1876
1854
    double          dLastReadNoticeTime;
1877
1855
    wxString        strArrivalTime = wxEmptyString;
1878
1856
    int             i, n = (int)notices.notices.size();