mirror of https://github.com/BOINC/boinc.git
- manager: add network quota to advanced prefs dialog
svn path=/trunk/boinc/; revision=21270
This commit is contained in:
parent
8f91d96150
commit
25b7607ba1
|
@ -3136,3 +3136,12 @@ David 23 Apr 2010
|
|||
prefs.cpp,h
|
||||
client/
|
||||
cs_prefs.cpp
|
||||
|
||||
David 23 Apr 2010
|
||||
- manager: add network quota to advanced prefs dialog
|
||||
|
||||
clientgui/
|
||||
DlgAdvPreferences.cpp
|
||||
DlgAdvPreferencesBase.cpp
|
||||
DlgAdvPreferencesBase.h
|
||||
|
||||
|
|
|
@ -101,6 +101,8 @@ void CDlgAdvPreferences::SetValidators() {
|
|||
//net page
|
||||
m_txtNetConnectInterval->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
m_txtNetDownloadRate->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
m_txt_daily_xfer_limit_mb->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
m_txt_daily_xfer_period_days->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
m_txtNetUploadRate->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
m_txtNetAdditionalDays->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
//disk and memory page
|
||||
|
@ -263,6 +265,12 @@ void CDlgAdvPreferences::ReadPreferenceSettings() {
|
|||
// upload rate
|
||||
buffer.Printf(wxT("%.2f"),prefs.max_bytes_sec_up / 1024);
|
||||
*m_txtNetUploadRate << buffer;
|
||||
|
||||
buffer.Printf(wxT("%.2f"),prefs.daily_xfer_limit_mb);
|
||||
*m_txt_daily_xfer_limit_mb << buffer;
|
||||
buffer.Printf(wxT("%.2f"),prefs.daily_xfer_period_days );
|
||||
*m_txt_daily_xfer_period_days << buffer;
|
||||
|
||||
//
|
||||
buffer.Printf(wxT("%.2f"),prefs.work_buf_additional_days);
|
||||
*m_txtNetAdditionalDays << buffer;
|
||||
|
@ -383,6 +391,13 @@ bool CDlgAdvPreferences::SavePreferencesSettings() {
|
|||
td = td * 1024;
|
||||
prefs.max_bytes_sec_up=td;
|
||||
mask.max_bytes_sec_up=true;
|
||||
|
||||
m_txt_daily_xfer_limit_mb->GetValue().ToDouble(&td);
|
||||
prefs.daily_xfer_limit_mb=td;
|
||||
mask.daily_xfer_limit_mb=true;
|
||||
m_txt_daily_xfer_period_days->GetValue().ToDouble(&td);
|
||||
prefs.daily_xfer_period_days=(int)td;
|
||||
mask.daily_xfer_period_days=true;
|
||||
//
|
||||
prefs.dont_verify_images=m_chkNetSkipImageVerification->GetValue();
|
||||
mask.dont_verify_images=true;
|
||||
|
|
|
@ -328,6 +328,8 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri
|
|||
fgSizer7->SetFlexibleDirection( wxHORIZONTAL );
|
||||
fgSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
// upload/download rates
|
||||
|
||||
m_staticText32 = new wxStaticText( m_panelNetwork, ID_DEFAULT, _("Maximum download rate"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer7->Add( m_staticText32, 0, wxALL, 5 );
|
||||
|
||||
|
@ -346,6 +348,26 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri
|
|||
m_staticText35 = new wxStaticText( m_panelNetwork, ID_DEFAULT, _("KBytes/sec."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer7->Add( m_staticText35, 0, wxALL, 5 );
|
||||
|
||||
// long-term quota
|
||||
|
||||
m_staticText_daily_xfer1 = new wxStaticText( m_panelNetwork, ID_DEFAULT, _("Transfer at most"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer7->Add( m_staticText_daily_xfer1, 0, wxALL, 5 );
|
||||
|
||||
m_txt_daily_xfer_limit_mb = new wxTextCtrl( m_panelNetwork, ID_TXTNETDOWNLOADRATE, wxT(""), wxDefaultPosition, wxSize( 50,-1 ), wxTE_RIGHT );
|
||||
fgSizer7->Add( m_txt_daily_xfer_limit_mb, 0, wxALL, 1 );
|
||||
|
||||
m_staticText_daily_xfer2 = new wxStaticText( m_panelNetwork, ID_DEFAULT, _("Mbytes every"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer7->Add( m_staticText_daily_xfer2, 0, wxALL, 5 );
|
||||
|
||||
m_txt_daily_xfer_period_days = new wxTextCtrl( m_panelNetwork, ID_TXTNETUPLOADRATE, wxT(""), wxDefaultPosition, wxSize( 50,-1 ), wxTE_RIGHT );
|
||||
fgSizer7->Add( m_txt_daily_xfer_period_days, 0, wxALL, 1 );
|
||||
|
||||
m_staticText_daily_xfer3 = new wxStaticText( m_panelNetwork, ID_DEFAULT, _("days"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer7->Add( m_staticText_daily_xfer3, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
|
||||
|
||||
// buffer sizes
|
||||
|
||||
m_staticText30 = new wxStaticText( m_panelNetwork, ID_DEFAULT, _("Connect about every"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer7->Add( m_staticText30, 0, wxALL, 5 );
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@
|
|||
#define ID_TXTPROCWEDNESDAY 20055
|
||||
#define ID_CHKGPUPROCINUSE 20056
|
||||
#define ID_TXTMAXLOAD 20057
|
||||
#define ID_DAILY_XFER_LIMIT_MB 20058
|
||||
#define ID_DAILY_XFER_PERIOD_DAYS 20059
|
||||
|
||||
/**
|
||||
* Class CDlgAdvPreferencesBase
|
||||
|
@ -142,6 +144,13 @@ class CDlgAdvPreferencesBase : public wxDialog
|
|||
wxStaticText* m_staticText34;
|
||||
wxTextCtrl* m_txtNetUploadRate;
|
||||
wxStaticText* m_staticText35;
|
||||
|
||||
wxStaticText* m_staticText_daily_xfer1;
|
||||
wxTextCtrl* m_txt_daily_xfer_limit_mb;
|
||||
wxStaticText* m_staticText_daily_xfer2;
|
||||
wxTextCtrl* m_txt_daily_xfer_period_days;
|
||||
wxStaticText* m_staticText_daily_xfer3;
|
||||
|
||||
wxStaticText* m_staticText30;
|
||||
wxTextCtrl* m_txtNetConnectInterval;
|
||||
wxStaticText* m_staticText31;
|
||||
|
|
Loading…
Reference in New Issue