mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=1565
This commit is contained in:
parent
6029fc2d91
commit
64b6b6e814
|
@ -4878,6 +4878,22 @@ Karl 2003/06/19
|
||||||
sched/
|
sched/
|
||||||
make_work.C
|
make_work.C
|
||||||
|
|
||||||
|
Tim June 19, 2003
|
||||||
|
- Astropulse Website
|
||||||
|
added description to project preferences
|
||||||
|
- Windows GUI
|
||||||
|
implemented message pane entry limit
|
||||||
|
new icons
|
||||||
|
|
||||||
|
client/win/res/
|
||||||
|
icon.ico
|
||||||
|
iconhigh.ico
|
||||||
|
iconsmall.ico
|
||||||
|
html_user/
|
||||||
|
db.inc
|
||||||
|
host.inc
|
||||||
|
project_specific_prefs_ap.inc
|
||||||
|
|
||||||
Karl 2003/06/19
|
Karl 2003/06/19
|
||||||
- scheduler daemons: write pid to a pidfile. trap SIGINTs and exit on
|
- scheduler daemons: write pid to a pidfile. trap SIGINTs and exit on
|
||||||
the next check_stop_trigger() (the 'stop_server' file still works)
|
the next check_stop_trigger() (the 'stop_server' file still works)
|
||||||
|
@ -4937,3 +4953,10 @@ Karl 2003/06/20
|
||||||
apps/
|
apps/
|
||||||
Makefile.am
|
Makefile.am
|
||||||
upper_case.C
|
upper_case.C
|
||||||
|
|
||||||
|
Tim June 23, 2003
|
||||||
|
- Windows GUI
|
||||||
|
UpdateGUI only refreshes active tab
|
||||||
|
|
||||||
|
client/win/
|
||||||
|
wingui_mainwindow.cpp
|
||||||
|
|
|
@ -187,277 +187,301 @@ void CMainWindow::UpdateGUI(CLIENT_STATE* pcs)
|
||||||
{
|
{
|
||||||
CString strBuf;
|
CString strBuf;
|
||||||
float totalres;
|
float totalres;
|
||||||
int i;
|
int i, n;
|
||||||
|
|
||||||
// If we failed to set the taskbar icon before, keep trying!
|
// If we failed to set the taskbar icon before, keep trying!
|
||||||
if (m_nDesiredIconState != m_nIconState)
|
if (m_nDesiredIconState != m_nIconState)
|
||||||
SetStatusIcon(m_nDesiredIconState);
|
SetStatusIcon(m_nDesiredIconState);
|
||||||
|
|
||||||
// display projects
|
switch (m_TabCtrl.GetCurFocus()) {
|
||||||
m_ProjectListCtrl.SetRedraw(FALSE);
|
|
||||||
totalres = 0;
|
|
||||||
Syncronize(&m_ProjectListCtrl, (vector<void*>*)(&pcs->projects));
|
|
||||||
for(i = 0; i < pcs->projects.size(); i ++) {
|
|
||||||
totalres += pcs->projects[i]->resource_share;
|
|
||||||
}
|
|
||||||
for(i = 0; i < m_ProjectListCtrl.GetItemCount(); i ++) {
|
|
||||||
PROJECT* pr = (PROJECT*)m_ProjectListCtrl.GetItemData(i);
|
|
||||||
if(!pr) {
|
|
||||||
m_ProjectListCtrl.DeleteItem(i--);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the master URL for this object
|
case PROJECT_ID:
|
||||||
if (m_ProjectListCtrl.GetProjectURL(i) != pr->master_url)
|
|
||||||
m_ProjectListCtrl.SetProjectURL(i, pr->master_url);
|
|
||||||
|
|
||||||
// project
|
// display projects
|
||||||
if (m_ProjectListCtrl.GetItemText(i, 0) != pr->get_project_name())
|
m_ProjectListCtrl.SetRedraw(FALSE);
|
||||||
m_ProjectListCtrl.SetItemText(i, 0, pr->get_project_name());
|
totalres = 0;
|
||||||
|
Syncronize(&m_ProjectListCtrl, (vector<void*>*)(&pcs->projects));
|
||||||
|
for(i = 0; i < pcs->projects.size(); i ++) {
|
||||||
|
totalres += pcs->projects[i]->resource_share;
|
||||||
|
}
|
||||||
|
for(i = 0; i < m_ProjectListCtrl.GetItemCount(); i ++) {
|
||||||
|
PROJECT* pr = (PROJECT*)m_ProjectListCtrl.GetItemData(i);
|
||||||
|
if(!pr) {
|
||||||
|
m_ProjectListCtrl.DeleteItem(i--);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// account
|
// Set the master URL for this object
|
||||||
if (m_ProjectListCtrl.GetItemText(i, 1) != pr->user_name)
|
if (m_ProjectListCtrl.GetProjectURL(i) != pr->master_url)
|
||||||
m_ProjectListCtrl.SetItemText(i, 1, pr->user_name);
|
m_ProjectListCtrl.SetProjectURL(i, pr->master_url);
|
||||||
|
|
||||||
// total credit
|
// project
|
||||||
strBuf.Format("%0.2f", pr->user_total_credit);
|
if (m_ProjectListCtrl.GetItemText(i, 0) != pr->get_project_name())
|
||||||
if (m_ProjectListCtrl.GetItemText(i, 2) != strBuf)
|
m_ProjectListCtrl.SetItemText(i, 0, pr->get_project_name());
|
||||||
m_ProjectListCtrl.SetItemText(i, 2, strBuf);
|
|
||||||
|
|
||||||
// avg credit
|
// account
|
||||||
strBuf.Format("%0.2f", pr->user_expavg_credit);
|
if (m_ProjectListCtrl.GetItemText(i, 1) != pr->user_name)
|
||||||
if (m_ProjectListCtrl.GetItemText(i, 3) != strBuf)
|
m_ProjectListCtrl.SetItemText(i, 1, pr->user_name);
|
||||||
m_ProjectListCtrl.SetItemText(i, 3, strBuf);
|
|
||||||
|
|
||||||
// resource share
|
// total credit
|
||||||
if(totalres <= 0) {
|
strBuf.Format("%0.2f", pr->user_total_credit);
|
||||||
if (m_ProjectListCtrl.GetItemProgress(i, 4) != 100)
|
if (m_ProjectListCtrl.GetItemText(i, 2) != strBuf)
|
||||||
m_ProjectListCtrl.SetItemProgress(i, 4, 100);
|
m_ProjectListCtrl.SetItemText(i, 2, strBuf);
|
||||||
} else {
|
|
||||||
if (m_ProjectListCtrl.GetItemProgress(i, 4) != (100 * pr->resource_share) / totalres)
|
|
||||||
m_ProjectListCtrl.SetItemProgress(i, 4, (100 * pr->resource_share) / totalres);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_ProjectListCtrl.SetRedraw(TRUE);
|
|
||||||
|
|
||||||
// update results
|
// avg credit
|
||||||
m_ResultListCtrl.SetRedraw(FALSE);
|
strBuf.Format("%0.2f", pr->user_expavg_credit);
|
||||||
Syncronize(&m_ResultListCtrl, (vector<void*>*)(&pcs->results));
|
if (m_ProjectListCtrl.GetItemText(i, 3) != strBuf)
|
||||||
for(i = 0; i < m_ResultListCtrl.GetItemCount(); i ++) {
|
m_ProjectListCtrl.SetItemText(i, 3, strBuf);
|
||||||
RESULT* re = (RESULT*)m_ResultListCtrl.GetItemData(i);
|
|
||||||
if(!re) {
|
|
||||||
m_ResultListCtrl.DeleteItem(i--);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the master URL for this object
|
// resource share
|
||||||
if (m_ResultListCtrl.GetProjectURL(i) != re->project->master_url)
|
if(totalres <= 0) {
|
||||||
m_ResultListCtrl.SetProjectURL(i, re->project->master_url);
|
if (m_ProjectListCtrl.GetItemProgress(i, 4) != 100)
|
||||||
|
m_ProjectListCtrl.SetItemProgress(i, 4, 100);
|
||||||
|
} else {
|
||||||
|
if (m_ProjectListCtrl.GetItemProgress(i, 4) != (100 * pr->resource_share) / totalres)
|
||||||
|
m_ProjectListCtrl.SetItemProgress(i, 4, (100 * pr->resource_share) / totalres);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_ProjectListCtrl.SetRedraw(TRUE);
|
||||||
|
|
||||||
// project
|
break;
|
||||||
if (m_ResultListCtrl.GetItemText(i, 0) != re->project->project_name)
|
|
||||||
m_ResultListCtrl.SetItemText(i, 0, re->project->project_name);
|
|
||||||
|
|
||||||
// application
|
case RESULT_ID:
|
||||||
if (m_ResultListCtrl.GetItemText(i, 1) != re->app->name)
|
|
||||||
m_ResultListCtrl.SetItemText(i, 1, re->app->name);
|
|
||||||
|
|
||||||
// name
|
// update results
|
||||||
if (m_ResultListCtrl.GetItemText(i, 2) != re->name)
|
m_ResultListCtrl.SetRedraw(FALSE);
|
||||||
m_ResultListCtrl.SetItemText(i, 2, re->name);
|
Syncronize(&m_ResultListCtrl, (vector<void*>*)(&pcs->results));
|
||||||
|
for(i = 0; i < m_ResultListCtrl.GetItemCount(); i ++) {
|
||||||
|
RESULT* re = (RESULT*)m_ResultListCtrl.GetItemData(i);
|
||||||
|
if(!re) {
|
||||||
|
m_ResultListCtrl.DeleteItem(i--);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// cpu time
|
// Set the master URL for this object
|
||||||
ACTIVE_TASK* at = gstate.lookup_active_task_by_result(re);
|
if (m_ResultListCtrl.GetProjectURL(i) != re->project->master_url)
|
||||||
double cur_cpu;
|
m_ResultListCtrl.SetProjectURL(i, re->project->master_url);
|
||||||
if (at) {
|
|
||||||
cur_cpu = at->current_cpu_time;
|
|
||||||
} else {
|
|
||||||
if(re->state < RESULT_COMPUTE_DONE) cur_cpu = 0;
|
|
||||||
else cur_cpu = re->final_cpu_time;
|
|
||||||
}
|
|
||||||
int cpuhour = (int)(cur_cpu / (60 * 60));
|
|
||||||
int cpumin = (int)(cur_cpu / 60) % 60;
|
|
||||||
int cpusec = (int)(cur_cpu) % 60;
|
|
||||||
if (cur_cpu == 0)
|
|
||||||
strBuf.Format("---");
|
|
||||||
else
|
|
||||||
strBuf.Format("%0.2d:%0.2d:%0.2d", cpuhour, cpumin, cpusec);
|
|
||||||
if (m_ResultListCtrl.GetItemText(i, 3) != strBuf)
|
|
||||||
m_ResultListCtrl.SetItemText(i, 3, strBuf);
|
|
||||||
|
|
||||||
// progress
|
// project
|
||||||
if(!at) {
|
if (m_ResultListCtrl.GetItemText(i, 0) != re->project->project_name)
|
||||||
if (m_ResultListCtrl.GetItemProgress(i, 4) != 0)
|
m_ResultListCtrl.SetItemText(i, 0, re->project->project_name);
|
||||||
m_ResultListCtrl.SetItemProgress(i, 4, 0);
|
|
||||||
} else {
|
|
||||||
if (m_ResultListCtrl.GetItemProgress(i, 4) != at->fraction_done * 100)
|
|
||||||
m_ResultListCtrl.SetItemProgress(i, 4, at->fraction_done * 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
// to completion
|
// application
|
||||||
double tocomp;
|
if (m_ResultListCtrl.GetItemText(i, 1) != re->app->name)
|
||||||
if(!at || at->fraction_done == 0) {
|
m_ResultListCtrl.SetItemText(i, 1, re->app->name);
|
||||||
tocomp = gstate.estimate_cpu_time(*re->wup);
|
|
||||||
} else {
|
|
||||||
tocomp = at->est_time_to_completion();
|
|
||||||
}
|
|
||||||
cpuhour = (int)(tocomp / (60 * 60));
|
|
||||||
cpumin = (int)(tocomp / 60) % 60;
|
|
||||||
cpusec = (int)(tocomp) % 60;
|
|
||||||
strBuf.Format("%0.2d:%0.2d:%0.2d", cpuhour, cpumin, cpusec);
|
|
||||||
if (m_ResultListCtrl.GetItemText(i, 5) != strBuf)
|
|
||||||
m_ResultListCtrl.SetItemText(i, 5, strBuf);
|
|
||||||
|
|
||||||
// status
|
// name
|
||||||
switch(re->state) {
|
if (m_ResultListCtrl.GetItemText(i, 2) != re->name)
|
||||||
case RESULT_NEW:
|
m_ResultListCtrl.SetItemText(i, 2, re->name);
|
||||||
strBuf.Format(g_szMiscItems[0]); break;
|
|
||||||
case RESULT_FILES_DOWNLOADING:
|
|
||||||
strBuf.Format(g_szMiscItems[9]);
|
|
||||||
break;
|
|
||||||
case RESULT_FILES_DOWNLOADED:
|
|
||||||
if (at) strBuf.Format(g_szMiscItems[1]);
|
|
||||||
else strBuf.Format(g_szMiscItems[2]);
|
|
||||||
break;
|
|
||||||
case RESULT_COMPUTE_DONE:
|
|
||||||
strBuf.Format(g_szMiscItems[3]); break;
|
|
||||||
break;
|
|
||||||
case RESULT_FILES_UPLOADING:
|
|
||||||
strBuf.Format(g_szMiscItems[8]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (re->server_ack) strBuf.Format(g_szMiscItems[5]);
|
|
||||||
else if (re->ready_to_ack) strBuf.Format(g_szMiscItems[4]);
|
|
||||||
else strBuf.Format(g_szMiscItems[6]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (m_ResultListCtrl.GetItemText(i, 6) != strBuf)
|
|
||||||
m_ResultListCtrl.SetItemText(i, 6, strBuf);
|
|
||||||
}
|
|
||||||
m_ResultListCtrl.SetRedraw(TRUE);
|
|
||||||
|
|
||||||
// update xfers
|
// cpu time
|
||||||
m_XferListCtrl.SetRedraw(FALSE);
|
ACTIVE_TASK* at = gstate.lookup_active_task_by_result(re);
|
||||||
Syncronize(&m_XferListCtrl, (vector<void*>*)(&pcs->pers_xfers->pers_file_xfers));
|
double cur_cpu;
|
||||||
for(i = 0; i < m_XferListCtrl.GetItemCount(); i ++) {
|
if (at) {
|
||||||
PERS_FILE_XFER* pfx = (PERS_FILE_XFER*)m_XferListCtrl.GetItemData(i);
|
cur_cpu = at->current_cpu_time;
|
||||||
if(!pfx) {
|
} else {
|
||||||
m_XferListCtrl.DeleteItem(i--);
|
if(re->state < RESULT_COMPUTE_DONE) cur_cpu = 0;
|
||||||
continue;
|
else cur_cpu = re->final_cpu_time;
|
||||||
}
|
}
|
||||||
|
int cpuhour = (int)(cur_cpu / (60 * 60));
|
||||||
|
int cpumin = (int)(cur_cpu / 60) % 60;
|
||||||
|
int cpusec = (int)(cur_cpu) % 60;
|
||||||
|
if (cur_cpu == 0)
|
||||||
|
strBuf.Format("---");
|
||||||
|
else
|
||||||
|
strBuf.Format("%0.2d:%0.2d:%0.2d", cpuhour, cpumin, cpusec);
|
||||||
|
if (m_ResultListCtrl.GetItemText(i, 3) != strBuf)
|
||||||
|
m_ResultListCtrl.SetItemText(i, 3, strBuf);
|
||||||
|
|
||||||
// Set the master URL for this object
|
// progress
|
||||||
if (m_XferListCtrl.GetProjectURL(i) != pfx->fip->project->master_url)
|
if(!at) {
|
||||||
m_XferListCtrl.SetProjectURL(i, pfx->fip->project->master_url);
|
if (m_ResultListCtrl.GetItemProgress(i, 4) != 0)
|
||||||
|
m_ResultListCtrl.SetItemProgress(i, 4, 0);
|
||||||
|
} else {
|
||||||
|
if (m_ResultListCtrl.GetItemProgress(i, 4) != at->fraction_done * 100)
|
||||||
|
m_ResultListCtrl.SetItemProgress(i, 4, at->fraction_done * 100);
|
||||||
|
}
|
||||||
|
|
||||||
// project
|
// to completion
|
||||||
if (m_XferListCtrl.GetItemText(i, 0) != pfx->fip->project->project_name)
|
double tocomp;
|
||||||
m_XferListCtrl.SetItemText(i, 0, pfx->fip->project->project_name);
|
if(!at || at->fraction_done == 0) {
|
||||||
|
tocomp = gstate.estimate_cpu_time(*re->wup);
|
||||||
|
} else {
|
||||||
|
tocomp = at->est_time_to_completion();
|
||||||
|
}
|
||||||
|
cpuhour = (int)(tocomp / (60 * 60));
|
||||||
|
cpumin = (int)(tocomp / 60) % 60;
|
||||||
|
cpusec = (int)(tocomp) % 60;
|
||||||
|
strBuf.Format("%0.2d:%0.2d:%0.2d", cpuhour, cpumin, cpusec);
|
||||||
|
if (m_ResultListCtrl.GetItemText(i, 5) != strBuf)
|
||||||
|
m_ResultListCtrl.SetItemText(i, 5, strBuf);
|
||||||
|
|
||||||
// file
|
// status
|
||||||
if (m_XferListCtrl.GetItemText(i, 1) != pfx->fip->name)
|
switch(re->state) {
|
||||||
m_XferListCtrl.SetItemText(i, 1, pfx->fip->name);
|
case RESULT_NEW:
|
||||||
|
strBuf.Format(g_szMiscItems[0]); break;
|
||||||
|
case RESULT_FILES_DOWNLOADING:
|
||||||
|
strBuf.Format(g_szMiscItems[9]);
|
||||||
|
break;
|
||||||
|
case RESULT_FILES_DOWNLOADED:
|
||||||
|
if (at) strBuf.Format(g_szMiscItems[1]);
|
||||||
|
else strBuf.Format(g_szMiscItems[2]);
|
||||||
|
break;
|
||||||
|
case RESULT_COMPUTE_DONE:
|
||||||
|
strBuf.Format(g_szMiscItems[3]); break;
|
||||||
|
break;
|
||||||
|
case RESULT_FILES_UPLOADING:
|
||||||
|
strBuf.Format(g_szMiscItems[8]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (re->server_ack) strBuf.Format(g_szMiscItems[5]);
|
||||||
|
else if (re->ready_to_ack) strBuf.Format(g_szMiscItems[4]);
|
||||||
|
else strBuf.Format(g_szMiscItems[6]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (m_ResultListCtrl.GetItemText(i, 6) != strBuf)
|
||||||
|
m_ResultListCtrl.SetItemText(i, 6, strBuf);
|
||||||
|
}
|
||||||
|
m_ResultListCtrl.SetRedraw(TRUE);
|
||||||
|
|
||||||
// progress
|
break;
|
||||||
double xSent = 0;
|
|
||||||
if (pfx->fxp) {
|
|
||||||
xSent = pfx->fxp->bytes_xferred;
|
|
||||||
}
|
|
||||||
if (m_XferListCtrl.GetItemProgress(i, 2) != 100 * xSent / pfx->fip->nbytes)
|
|
||||||
m_XferListCtrl.SetItemProgress(i, 2, 100 * xSent / pfx->fip->nbytes);
|
|
||||||
|
|
||||||
// size
|
case XFER_ID:
|
||||||
char size_buf[256];
|
|
||||||
get_byte_string(xSent, pfx->fip->nbytes, size_buf, 256);
|
|
||||||
if (strcmp(m_XferListCtrl.GetItemText(i, 3).GetBuffer(0), size_buf))
|
|
||||||
m_XferListCtrl.SetItemText(i, 3, size_buf);
|
|
||||||
|
|
||||||
// time
|
// update xfers
|
||||||
double xtime = 0;
|
m_XferListCtrl.SetRedraw(FALSE);
|
||||||
xtime = pfx->time_so_far;
|
Syncronize(&m_XferListCtrl, (vector<void*>*)(&pcs->pers_xfers->pers_file_xfers));
|
||||||
int xhour = (int)(xtime / (60 * 60));
|
for(i = 0; i < m_XferListCtrl.GetItemCount(); i ++) {
|
||||||
int xmin = (int)(xtime / 60) % 60;
|
PERS_FILE_XFER* pfx = (PERS_FILE_XFER*)m_XferListCtrl.GetItemData(i);
|
||||||
int xsec = (int)(xtime) % 60;
|
if(!pfx) {
|
||||||
strBuf.Format("%0.2d:%0.2d:%0.2d", xhour, xmin, xsec);
|
m_XferListCtrl.DeleteItem(i--);
|
||||||
if (m_XferListCtrl.GetItemText(i, 4) != strBuf.GetBuffer(0))
|
continue;
|
||||||
m_XferListCtrl.SetItemText(i, 4, strBuf.GetBuffer(0));
|
}
|
||||||
|
|
||||||
// speed
|
// Set the master URL for this object
|
||||||
strBuf.Format("0.00 KBps");
|
if (m_XferListCtrl.GetProjectURL(i) != pfx->fip->project->master_url)
|
||||||
if(pfx->fxp) {
|
m_XferListCtrl.SetProjectURL(i, pfx->fip->project->master_url);
|
||||||
strBuf.Format("%0.2f KBps", pfx->fxp->xfer_speed/1024);
|
|
||||||
}
|
|
||||||
if (m_XferListCtrl.GetItemText(i, 5) != strBuf.GetBuffer(0))
|
|
||||||
m_XferListCtrl.SetItemText(i, 5, strBuf.GetBuffer(0));
|
|
||||||
|
|
||||||
// status
|
// project
|
||||||
if (pfx->next_request_time > time(0)) {
|
if (m_XferListCtrl.GetItemText(i, 0) != pfx->fip->project->project_name)
|
||||||
double xtime = pfx->next_request_time-time(0);
|
m_XferListCtrl.SetItemText(i, 0, pfx->fip->project->project_name);
|
||||||
int xhour = (int)(xtime / (60 * 60));
|
|
||||||
int xmin = (int)(xtime / 60) % 60;
|
// file
|
||||||
int xsec = (int)(xtime) % 60;
|
if (m_XferListCtrl.GetItemText(i, 1) != pfx->fip->name)
|
||||||
strBuf.Format("%s %0.2d:%0.2d:%0.2d", g_szMiscItems[10], xhour, xmin, xsec);
|
m_XferListCtrl.SetItemText(i, 1, pfx->fip->name);
|
||||||
if (m_XferListCtrl.GetItemText(i, 6) != strBuf)
|
|
||||||
m_XferListCtrl.SetItemText(i, 6, strBuf);
|
// progress
|
||||||
} else if (pfx->fip->status == ERR_GIVEUP_DOWNLOAD) {
|
double xSent = 0;
|
||||||
strBuf.Format(g_szMiscItems[11]);
|
if (pfx->fxp) {
|
||||||
if (m_XferListCtrl.GetItemText(i, 6) != strBuf)
|
xSent = pfx->fxp->bytes_xferred;
|
||||||
m_XferListCtrl.SetItemText(i, 6, strBuf);
|
}
|
||||||
} else if (pfx->fip->status == ERR_GIVEUP_UPLOAD) {
|
if (m_XferListCtrl.GetItemProgress(i, 2) != 100 * xSent / pfx->fip->nbytes)
|
||||||
strBuf.Format(g_szMiscItems[12]);
|
m_XferListCtrl.SetItemProgress(i, 2, 100 * xSent / pfx->fip->nbytes);
|
||||||
if (m_XferListCtrl.GetItemText(i, 6) != strBuf)
|
|
||||||
m_XferListCtrl.SetItemText(i, 6, strBuf);
|
// size
|
||||||
} else {
|
char size_buf[256];
|
||||||
if (m_XferListCtrl.GetItemText(i, 6) != pfx->fip->generated_locally?g_szMiscItems[8]:g_szMiscItems[9])
|
get_byte_string(xSent, pfx->fip->nbytes, size_buf, 256);
|
||||||
m_XferListCtrl.SetItemText(i, 6, pfx->fip->generated_locally?g_szMiscItems[8]:g_szMiscItems[9]);
|
if (strcmp(m_XferListCtrl.GetItemText(i, 3).GetBuffer(0), size_buf))
|
||||||
}
|
m_XferListCtrl.SetItemText(i, 3, size_buf);
|
||||||
}
|
|
||||||
m_XferListCtrl.SetRedraw(TRUE);
|
// time
|
||||||
|
double xtime = 0;
|
||||||
|
xtime = pfx->time_so_far;
|
||||||
|
int xhour = (int)(xtime / (60 * 60));
|
||||||
|
int xmin = (int)(xtime / 60) % 60;
|
||||||
|
int xsec = (int)(xtime) % 60;
|
||||||
|
strBuf.Format("%0.2d:%0.2d:%0.2d", xhour, xmin, xsec);
|
||||||
|
if (m_XferListCtrl.GetItemText(i, 4) != strBuf.GetBuffer(0))
|
||||||
|
m_XferListCtrl.SetItemText(i, 4, strBuf.GetBuffer(0));
|
||||||
|
|
||||||
|
// speed
|
||||||
|
strBuf.Format("0.00 KBps");
|
||||||
|
if(pfx->fxp) {
|
||||||
|
strBuf.Format("%0.2f KBps", pfx->fxp->xfer_speed/1024);
|
||||||
|
}
|
||||||
|
if (m_XferListCtrl.GetItemText(i, 5) != strBuf.GetBuffer(0))
|
||||||
|
m_XferListCtrl.SetItemText(i, 5, strBuf.GetBuffer(0));
|
||||||
|
|
||||||
|
// status
|
||||||
|
if (pfx->next_request_time > time(0)) {
|
||||||
|
double xtime = pfx->next_request_time-time(0);
|
||||||
|
int xhour = (int)(xtime / (60 * 60));
|
||||||
|
int xmin = (int)(xtime / 60) % 60;
|
||||||
|
int xsec = (int)(xtime) % 60;
|
||||||
|
strBuf.Format("%s %0.2d:%0.2d:%0.2d", g_szMiscItems[10], xhour, xmin, xsec);
|
||||||
|
if (m_XferListCtrl.GetItemText(i, 6) != strBuf)
|
||||||
|
m_XferListCtrl.SetItemText(i, 6, strBuf);
|
||||||
|
} else if (pfx->fip->status == ERR_GIVEUP_DOWNLOAD) {
|
||||||
|
strBuf.Format(g_szMiscItems[11]);
|
||||||
|
if (m_XferListCtrl.GetItemText(i, 6) != strBuf)
|
||||||
|
m_XferListCtrl.SetItemText(i, 6, strBuf);
|
||||||
|
} else if (pfx->fip->status == ERR_GIVEUP_UPLOAD) {
|
||||||
|
strBuf.Format(g_szMiscItems[12]);
|
||||||
|
if (m_XferListCtrl.GetItemText(i, 6) != strBuf)
|
||||||
|
m_XferListCtrl.SetItemText(i, 6, strBuf);
|
||||||
|
} else {
|
||||||
|
if (m_XferListCtrl.GetItemText(i, 6) != pfx->fip->generated_locally?g_szMiscItems[8]:g_szMiscItems[9])
|
||||||
|
m_XferListCtrl.SetItemText(i, 6, pfx->fip->generated_locally?g_szMiscItems[8]:g_szMiscItems[9]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_XferListCtrl.SetRedraw(TRUE);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MESSAGE_ID:
|
||||||
|
|
||||||
|
// check message pane size
|
||||||
|
n = m_MessageListCtrl.GetItemCount();
|
||||||
|
if (n > 2000) {
|
||||||
|
m_MessageListCtrl.SetRedraw(FALSE);
|
||||||
|
for (i = 0 ; i < n - 2000 ; i++)
|
||||||
|
m_MessageListCtrl.DeleteItem(0);
|
||||||
|
m_MessageListCtrl.SetRedraw(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case USAGE_ID:
|
||||||
|
|
||||||
|
// update usage
|
||||||
|
double xDiskTotal;
|
||||||
|
double xDiskFree; get_filesystem_info(xDiskTotal, xDiskFree);
|
||||||
|
double xDiskUsed = xDiskTotal - xDiskFree;
|
||||||
|
double xDiskAllow; gstate.allowed_disk_usage(xDiskAllow); xDiskAllow = xDiskFree - xDiskAllow;
|
||||||
|
double xDiskUsage; gstate.current_disk_usage(xDiskUsage);
|
||||||
|
|
||||||
|
m_UsagePieCtrl.SetTotal(xDiskTotal);
|
||||||
|
m_UsagePieCtrl.SetPiece(0, xDiskFree); // Free space
|
||||||
|
m_UsagePieCtrl.SetPiece(1, xDiskUsed - xDiskUsage); // Used space
|
||||||
|
m_UsagePieCtrl.SetPiece(2, xDiskUsage); // Used space: BOINC
|
||||||
|
m_UsagePieCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_NOERASE|RDW_FRAME);
|
||||||
|
|
||||||
|
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 < gstate.projects.size()) {
|
||||||
|
m_UsageBOINCPieCtrl.AddPiece("", GetPieColor(m_UsageBOINCPieCtrl.GetItemCount()), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 > gstate.projects.size()) {
|
||||||
|
m_UsageBOINCPieCtrl.RemovePiece(m_UsageBOINCPieCtrl.GetItemCount() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_UsageBOINCPieCtrl.SetTotal(xDiskUsage);
|
||||||
|
m_UsageBOINCPieCtrl.SetPiece(0, 1); // BOINC: core application
|
||||||
|
for(i = 0; i < gstate.projects.size(); i ++) {
|
||||||
|
double xUsage;
|
||||||
|
CString strLabel;
|
||||||
|
strLabel.Format("%s %s", g_szUsageItems[4], gstate.projects[i]->project_name);
|
||||||
|
gstate.project_disk_usage(gstate.projects[i], xUsage);
|
||||||
|
m_UsageBOINCPieCtrl.SetPieceLabel(i + 1, strLabel.GetBuffer(0));
|
||||||
|
m_UsageBOINCPieCtrl.SetPiece(i + 1, xUsage);
|
||||||
|
xDiskUsage -= xUsage;
|
||||||
|
}
|
||||||
|
m_UsageBOINCPieCtrl.SetPiece(0, xDiskUsage); // BOINC: core application
|
||||||
|
m_UsageBOINCPieCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_NOERASE|RDW_FRAME);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
// check message pane size
|
|
||||||
int n = m_MessageListCtrl.GetItemCount();
|
|
||||||
if (n > 2000) {
|
|
||||||
m_MessageListCtrl.SetRedraw(FALSE);
|
|
||||||
for (i = 0 ; i < n - 2000 ; i++)
|
|
||||||
m_MessageListCtrl.DeleteItem(0);
|
|
||||||
m_MessageListCtrl.SetRedraw(TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update usage
|
|
||||||
double xDiskTotal;
|
|
||||||
double xDiskFree; get_filesystem_info(xDiskTotal, xDiskFree);
|
|
||||||
double xDiskUsed = xDiskTotal - xDiskFree;
|
|
||||||
double xDiskAllow; gstate.allowed_disk_usage(xDiskAllow); xDiskAllow = xDiskFree - xDiskAllow;
|
|
||||||
double xDiskUsage; gstate.current_disk_usage(xDiskUsage);
|
|
||||||
|
|
||||||
m_UsagePieCtrl.SetTotal(xDiskTotal);
|
|
||||||
m_UsagePieCtrl.SetPiece(0, xDiskFree); // Free space
|
|
||||||
m_UsagePieCtrl.SetPiece(1, xDiskUsed - xDiskUsage); // Used space
|
|
||||||
m_UsagePieCtrl.SetPiece(2, xDiskUsage); // Used space: BOINC
|
|
||||||
m_UsagePieCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_NOERASE|RDW_FRAME);
|
|
||||||
|
|
||||||
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 < gstate.projects.size()) {
|
|
||||||
m_UsageBOINCPieCtrl.AddPiece("", GetPieColor(m_UsageBOINCPieCtrl.GetItemCount()), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 > gstate.projects.size()) {
|
|
||||||
m_UsageBOINCPieCtrl.RemovePiece(m_UsageBOINCPieCtrl.GetItemCount() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_UsageBOINCPieCtrl.SetTotal(xDiskUsage);
|
|
||||||
m_UsageBOINCPieCtrl.SetPiece(0, 1); // BOINC: core application
|
|
||||||
for(i = 0; i < gstate.projects.size(); i ++) {
|
|
||||||
double xUsage;
|
|
||||||
CString strLabel;
|
|
||||||
strLabel.Format("%s %s", g_szUsageItems[4], gstate.projects[i]->project_name);
|
|
||||||
gstate.project_disk_usage(gstate.projects[i], xUsage);
|
|
||||||
m_UsageBOINCPieCtrl.SetPieceLabel(i + 1, strLabel.GetBuffer(0));
|
|
||||||
m_UsageBOINCPieCtrl.SetPiece(i + 1, xUsage);
|
|
||||||
xDiskUsage -= xUsage;
|
|
||||||
}
|
|
||||||
m_UsageBOINCPieCtrl.SetPiece(0, xDiskUsage); // BOINC: core application
|
|
||||||
m_UsageBOINCPieCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_NOERASE|RDW_FRAME);
|
|
||||||
|
|
||||||
// make icon flash if needed
|
// make icon flash if needed
|
||||||
if(m_bMessage || m_bRequest) {
|
if(m_bMessage || m_bRequest) {
|
||||||
if(m_nIconState == ICON_NORMAL) {
|
if(m_nIconState == ICON_NORMAL) {
|
||||||
|
@ -567,13 +591,7 @@ void CMainWindow::ShowTab(int nTab)
|
||||||
}
|
}
|
||||||
m_TabCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_FRAME);
|
m_TabCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_FRAME);
|
||||||
RedrawWindow();
|
RedrawWindow();
|
||||||
|
UpdateGUI(&gstate);
|
||||||
/*
|
|
||||||
// draw line between menu and tabs
|
|
||||||
RECT rect = {0, 0, 0, 0}; GetClientRect(&rect);
|
|
||||||
GetDC()->MoveTo(0, 0);
|
|
||||||
GetDC()->LineTo(rect.right, 0);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////
|
//////////
|
||||||
|
|
Loading…
Reference in New Issue