MGR: Update Makefile, New Simple GUI optimization

svn path=/trunk/boinc/; revision=22963
This commit is contained in:
Charlie Fenton 2011-01-31 09:58:34 +00:00
parent add6715355
commit 44649792ba
4 changed files with 43 additions and 11 deletions

View File

@ -391,7 +391,15 @@ Charlie 30 Jan 2011
sg_TaskPanel.cpp, .h
Charlie 30 Jan 2011
Fix compile break on Linux.
- MGR: Fix compile break on Linux.
clientgui/
sg_DlgPreferences.cpp
Charlie 31 Jan 2011
- MGR: Update Makefile.
- MGR: New Simple GUI optimization.
clientgui/
Makefile.am
sg_TaskPanel.cpp, .h

View File

@ -21,6 +21,7 @@ if OS_DARWIN
mac_sources = mac/SystemMenu.m \
mac/mac_saver_module.cpp \
mac/Mac_Saver_ModuleView.m \
mac/MacBitmapComboBox.cpp \
mac/MacSysMenu.cpp \
mac/Mac_GUI.cpp\
mac/browser_safari.mm
@ -83,6 +84,7 @@ boincmgr_SOURCES = \
ProjectPropertiesPage.cpp \
ProxyInfoPage.cpp \
ProxyPage.cpp \
sg_BoincSimpleFrame.cpp \
sg_BoincSimpleGUI.cpp \
sg_ClientStateIndicator.cpp \
sg_CustomControls.cpp \
@ -90,9 +92,15 @@ boincmgr_SOURCES = \
sg_DlgPreferences.cpp \
sg_ImageButton.cpp \
sg_ImageLoader.cpp \
sg_PanelBase.cpp \
sg_ProgressBar.cpp \
sg_ProjectsComponent.cpp \
sg_ProjectCommandPopup.cpp \
sg_ProjectPanel.cpp \
sg_ProjectWebSitesPopup.cpp \
sg_StatImageLoader.cpp \
sg_TaskCommandPopup.cpp \
sg_TaskPanel.cpp \
sg_ViewTabPage.cpp \
SkinManager.cpp \
stdwx.cpp \

View File

@ -304,7 +304,8 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) :
// non-standard progress indicator on Mac? See also optimizations in
// CSimpleGUIPanel::OnEraseBackground and CSimpleTaskPanel::OnEraseBackground.
m_ProgressBar = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL );
m_ProgressBar->SetValue( 50 );
m_iPctDoneX10 = 1000;
m_ProgressBar->SetValue( 100 );
GetTextExtent(wxT("0"), &w, &h);
m_ProgressBar->SetMinSize(wxSize(245, h));
m_ProgressBar->SetToolTip(_("This task's progress"));
@ -400,8 +401,11 @@ void CSimpleTaskPanel::Update() {
m_TimeRemainingValue->Hide();
m_ProgressValueText->Hide();
m_TaskCommandsButton->Hide();
m_ProgressBar->Pulse();
m_pulseTimer->Start(100);
if (m_iPctDoneX10 >= 0) {
m_iPctDoneX10 = -1;
m_ProgressBar->Pulse();
m_pulseTimer->Start(100);
}
}
DisplayIdleState();
@ -456,11 +460,19 @@ void CSimpleTaskPanel::Update() {
// f = result->final_elapsed_time;
UpdateStaticText(&m_ElapsedTimeValue, GetElapsedTimeString(f));
UpdateStaticText(&m_TimeRemainingValue, GetTimeRemainingString(result->estimated_cpu_time_remaining));
float percNum = result->fraction_done * 100.0;
m_ProgressBar->SetValue(percNum);
m_pulseTimer->Stop();
s.Printf(_("%.1lf%%"), percNum);
UpdateStaticText(&m_ProgressValueText, s);
int pctDoneX10 = result->fraction_done * 1000.0;
if (m_iPctDoneX10 != pctDoneX10) {
if (m_iPctDoneX10 < 0) {
m_pulseTimer->Stop();
}
int pctDone = pctDoneX10 / 10;
if (pctDone != (m_iPctDoneX10 / 10)) {
m_ProgressBar->SetValue(pctDone);
}
s.Printf(_("%d.%d%%"), pctDoneX10 / 10, pctDoneX10 % 10 );
m_iPctDoneX10 = pctDoneX10;
UpdateStaticText(&m_ProgressValueText, s);
}
UpdateStaticText(&m_StatusValueText, GetStatusString(result));
} else {
UpdateStaticText(&m_TaskProjectName, m_sNotAvailableString);
@ -469,8 +481,11 @@ void CSimpleTaskPanel::Update() {
#endif
UpdateStaticText(&m_ElapsedTimeValue, GetElapsedTimeString(-1.0));
UpdateStaticText(&m_TimeRemainingValue, GetTimeRemainingString(-1.0));
m_ProgressBar->Pulse();
m_pulseTimer->Start(100);
if (m_iPctDoneX10 >= 0) {
m_iPctDoneX10 = -1;
m_ProgressBar->Pulse();
m_pulseTimer->Start(100);
}
UpdateStaticText(&m_ProgressValueText, wxEmptyString);
UpdateStaticText(&m_StatusValueText, GetStatusString(NULL));
}

View File

@ -125,6 +125,7 @@ class CSimpleTaskPanel : public CSimplePanelBase
wxButton* m_TaskCommandsButton;
wxRect m_ProgressRect;
int m_oldWorkCount;
int m_iPctDoneX10;
time_t error_time;
wxBitmap m_GreenDot;
wxBitmap m_YellowDot;