2010-06-02 17:44:38 +00:00
// This file is part of BOINC.
// http://boinc.berkeley.edu
2014-11-25 11:24:07 +00:00
// Copyright (C) 2014 University of California
2007-01-17 18:13:33 +00:00
//
2010-06-02 17:44:38 +00:00
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// This code was initially generated with wxFormBuilder (version Oct 13 2006)
// http://www.wxformbuilder.org/
2007-01-17 18:13:33 +00:00
2007-08-16 20:06:50 +00:00
# include "stdwx.h"
2011-01-28 09:55:03 +00:00
# include "Events.h"
2007-08-16 20:06:50 +00:00
# include "diagnostics.h"
# include "util.h"
# include "mfile.h"
# include "miofile.h"
# include "parse.h"
# include "LogBOINC.h"
# include "BOINCGUIApp.h"
2014-11-25 12:59:38 +00:00
# include "MainDocument.h"
2007-08-16 20:06:50 +00:00
# include "SkinManager.h"
2007-01-17 18:13:33 +00:00
# include "DlgAdvPreferencesBase.h"
///////////////////////////////////////////////////////////////////////////
2014-05-08 11:34:43 +00:00
// NOTE: On MS Windows with wxWidgets 3.0, controls inside a wxStaticBox
// don't refresh properly unless they are children of the wxStaticBox!
//
2007-08-16 20:06:50 +00:00
CDlgAdvPreferencesBase : : CDlgAdvPreferencesBase ( wxWindow * parent , int id , wxString title , wxPoint pos , wxSize size , int style ) :
wxDialog ( parent , id , title , pos , size , style )
2007-01-17 18:13:33 +00:00
{
2007-08-16 20:06:50 +00:00
wxString strCaption = title ;
if ( strCaption . IsEmpty ( ) ) {
CSkinAdvanced * pSkinAdvanced = wxGetApp ( ) . GetSkinManager ( ) - > GetAdvanced ( ) ;
wxASSERT ( pSkinAdvanced ) ;
wxASSERT ( wxDynamicCast ( pSkinAdvanced , CSkinAdvanced ) ) ;
2014-04-17 07:23:44 +00:00
strCaption . Printf ( _ ( " %s - Computing preferences " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2007-08-16 20:06:50 +00:00
}
2010-11-08 17:01:02 +00:00
this - > SetExtraStyle ( this - > GetExtraStyle ( ) | wxWS_EX_VALIDATE_RECURSIVELY ) ;
2010-06-02 17:44:38 +00:00
this - > Centre ( wxBOTH ) ;
2007-08-16 20:06:50 +00:00
this - > SetTitle ( strCaption ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
wxBoxSizer * dialogSizer = new wxBoxSizer ( wxVERTICAL ) ;
2014-05-08 11:34:43 +00:00
wxStaticBox * topControlsStaticBox = new wxStaticBox ( this , - 1 , wxT ( " " ) ) ;
2010-06-02 17:44:38 +00:00
2014-05-08 11:34:43 +00:00
wxStaticBoxSizer * topControlsSizer = new wxStaticBoxSizer ( topControlsStaticBox , wxHORIZONTAL ) ;
2010-06-02 17:44:38 +00:00
2014-06-24 08:22:31 +00:00
m_bmpWarning = new wxStaticBitmap ( topControlsStaticBox , ID_DEFAULT , wxNullBitmap , wxDefaultPosition , wxDefaultSize , 0 ) ;
2010-06-02 17:44:38 +00:00
m_bmpWarning - > SetMinSize ( wxSize ( 48 , 48 ) ) ;
topControlsSizer - > Add ( m_bmpWarning , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
2014-11-25 12:59:38 +00:00
wxBoxSizer * legendSizer = new wxBoxSizer ( wxVERTICAL ) ;
bool usingLocalPrefs = doesLocalPrefsFileExist ( ) ;
if ( usingLocalPrefs ) {
legendSizer - > Add (
new wxStaticText ( topControlsStaticBox , ID_DEFAULT ,
2014-11-26 07:38:03 +00:00
_ ( " Using local preferences. \n "
" Click \" Use web prefs \" to use web-based preferences from "
2014-11-25 12:59:38 +00:00
) , wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 1
) ;
} else {
legendSizer - > Add (
new wxStaticText ( topControlsStaticBox , ID_DEFAULT ,
2014-11-26 07:38:03 +00:00
_ ( " Using web-based preferences from " ) ,
2014-11-25 12:59:38 +00:00
wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 1
) ;
}
legendSizer - > Add (
new wxHyperlinkCtrl (
topControlsStaticBox , wxID_ANY , * web_prefs_url , * web_prefs_url ,
wxDefaultPosition , wxDefaultSize , wxHL_DEFAULT_STYLE
) ,
0 , wxLEFT , 5
) ;
if ( ! usingLocalPrefs ) {
legendSizer - > Add (
new wxStaticText ( topControlsStaticBox , ID_DEFAULT ,
2014-11-26 07:38:03 +00:00
_ ( " Set values and click OK to use local preferences instead. " ) ,
wxDefaultPosition , wxDefaultSize , 0 ) ,
2014-11-25 12:59:38 +00:00
0 , wxALL , 1
) ;
}
topControlsSizer - > Add ( legendSizer , 1 , wxALL , 1 ) ;
#if 0
2014-11-25 11:24:07 +00:00
wxStaticText * staticText321 = new wxStaticText ( topControlsStaticBox , ID_DEFAULT , _ ( " This dialog controls preferences for this computer only. \n Click OK to set preferences. \n Click Clear to restore web-based settings. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
topControlsSizer - > Add ( staticText321 , 1 , wxALL , 1 ) ;
2010-06-02 17:44:38 +00:00
2014-05-08 11:34:43 +00:00
m_btnClear = new wxButton ( topControlsStaticBox , ID_BTN_CLEAR , _ ( " Clear " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2010-06-02 17:44:38 +00:00
m_btnClear - > SetToolTip ( _ ( " clear all local preferences and close the dialog " ) ) ;
2014-11-25 12:59:38 +00:00
# endif
2010-06-02 17:44:38 +00:00
2014-11-25 12:59:38 +00:00
m_btnClear = new wxButton ( topControlsStaticBox , ID_BTN_CLEAR , _ ( " Use web prefs " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_btnClear - > SetToolTip ( _ ( " restore web-based preferences and close the dialog " ) ) ;
if ( ! usingLocalPrefs ) {
m_btnClear - > Hide ( ) ;
}
2014-06-19 11:02:09 +00:00
topControlsSizer - > Add ( m_btnClear , 0 , wxALIGN_BOTTOM | wxALL , 4 ) ;
2010-06-02 17:44:38 +00:00
dialogSizer - > Add ( topControlsSizer , 0 , wxALL | wxEXPAND , 1 ) ;
m_panelControls = new wxPanel ( this , ID_DEFAULT , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
m_panelControls - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
wxBoxSizer * notebookSizer = new wxBoxSizer ( wxVERTICAL ) ;
m_Notebook = new wxNotebook ( m_panelControls , ID_DEFAULT , wxDefaultPosition , wxDefaultSize , wxNB_FLAT | wxNB_TOP ) ;
m_Notebook - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
m_panelProcessor = createProcessorTab ( m_Notebook ) ;
2015-02-13 14:32:12 +00:00
m_Notebook - > AddPage ( m_panelProcessor , _ ( " Computing " ) , false ) ;
2010-06-02 17:44:38 +00:00
m_panelNetwork = createNetworkTab ( m_Notebook ) ;
2015-02-13 14:32:12 +00:00
m_Notebook - > AddPage ( m_panelNetwork , _ ( " Network " ) , true ) ;
2010-06-02 17:44:38 +00:00
m_panelDiskAndMemory = createDiskAndMemoryTab ( m_Notebook ) ;
2015-02-13 14:32:12 +00:00
m_Notebook - > AddPage ( m_panelDiskAndMemory , _ ( " Disk and Memory " ) , false ) ;
2015-02-14 13:50:07 +00:00
m_panelDailySchedules = createDailySchedulesTab ( m_Notebook ) ;
m_Notebook - > AddPage ( m_panelDailySchedules , _ ( " Daily Schedules " ) , false ) ;
2010-06-02 17:44:38 +00:00
notebookSizer - > Add ( m_Notebook , 1 , wxEXPAND | wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_panelControls - > SetSizer ( notebookSizer ) ;
m_panelControls - > Layout ( ) ;
notebookSizer - > Fit ( m_panelControls ) ;
2014-08-01 09:26:01 +00:00
2010-06-02 17:44:38 +00:00
dialogSizer - > Add ( m_panelControls , 1 , wxALL | wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_panelButtons = new wxPanel ( this , ID_DEFAULT , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
wxBoxSizer * buttonSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_btnOK = new wxButton ( m_panelButtons , wxID_OK , _ ( " OK " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_btnOK - > SetToolTip ( _ ( " save all values and close the dialog " ) ) ;
2014-06-20 11:48:05 +00:00
m_btnOK - > SetDefault ( ) ;
2010-06-02 17:44:38 +00:00
buttonSizer - > Add ( m_btnOK , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_btnCancel = new wxButton ( m_panelButtons , wxID_CANCEL , _ ( " Cancel " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_btnCancel - > SetToolTip ( _ ( " close the dialog without saving " ) ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
buttonSizer - > Add ( m_btnCancel , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2011-01-28 09:55:03 +00:00
m_btnHelp = new wxButton ( m_panelButtons , ID_HELPBOINC , _ ( " Help " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2010-06-02 17:44:38 +00:00
m_btnHelp - > SetToolTip ( _ ( " shows the preferences web page " ) ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
buttonSizer - > Add ( m_btnHelp , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_panelButtons - > SetSizer ( buttonSizer ) ;
m_panelButtons - > Layout ( ) ;
buttonSizer - > Fit ( m_panelButtons ) ;
dialogSizer - > Add ( m_panelButtons , 0 , wxALIGN_BOTTOM | wxALIGN_CENTER_HORIZONTAL | wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
dialogSizer - > Fit ( this ) ;
this - > SetSizer ( dialogSizer ) ;
}
wxPanel * CDlgAdvPreferencesBase : : createProcessorTab ( wxNotebook * notebook )
{
2014-07-30 10:42:25 +00:00
wxSize textCtrlSize = getTextCtrlSize ( wxT ( " 999.99 " ) ) ;
2010-06-02 17:44:38 +00:00
wxPanel * processorTab = new wxPanel ( notebook , ID_TABPAGE_PROC , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
processorTab - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
wxBoxSizer * processorTabSizer = new wxBoxSizer ( wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-12 13:48:28 +00:00
wxStaticBox * usageLimitsStaticBox = new wxStaticBox ( processorTab , - 1 , _ ( " Usage limits " ) ) ;
wxStaticBoxSizer * usageLimitsBoxSizer = new wxStaticBoxSizer ( usageLimitsStaticBox , wxVERTICAL ) ;
wxFlexGridSizer * usageLimitsGridSizer = new wxFlexGridSizer ( 2 , 3 , 0 , 0 ) ;
usageLimitsGridSizer - > AddGrowableCol ( 2 ) ;
usageLimitsGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
usageLimitsGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2015-02-13 14:21:14 +00:00
/*xgettext:no-c-format*/
wxStaticText * m_staticText20 = new wxStaticText (
usageLimitsStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
usageLimitsGridSizer - > Add ( m_staticText20 , 0 , wxALL | wxEXPAND , 5 ) ;
2015-02-12 13:48:28 +00:00
m_txtProcUseProcessors = new wxTextCtrl ( usageLimitsStaticBox , ID_TXTPROCUSEPROCESSORS , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
usageLimitsGridSizer - > Add ( m_txtProcUseProcessors , 0 , wxALL , 1 ) ;
/*xgettext:no-c-format*/
wxStaticText * staticText21 = new wxStaticText ( usageLimitsStaticBox , ID_DEFAULT , _ ( " % of the CPUs " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
usageLimitsGridSizer - > Add ( staticText21 , 0 , wxALL , 5 ) ;
2015-02-13 14:21:14 +00:00
wxStaticText * m_staticText22 = new wxStaticText (
usageLimitsStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
usageLimitsGridSizer - > Add ( m_staticText22 , 0 , wxALL | wxEXPAND , 5 ) ;
2015-02-12 13:48:28 +00:00
usageLimitsBoxSizer - > Add ( usageLimitsGridSizer , 0 , wxEXPAND , 1 ) ;
m_txtProcUseCPUTime = new wxTextCtrl ( usageLimitsStaticBox , ID_TXTPOCUSECPUTIME , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
usageLimitsGridSizer - > Add ( m_txtProcUseCPUTime , 0 , wxALL , 1 ) ;
/*xgettext:no-c-format*/
wxStaticText * staticText23 = new wxStaticText ( usageLimitsStaticBox , ID_DEFAULT , _ ( " % of CPU time " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
usageLimitsGridSizer - > Add ( staticText23 , 0 , wxALL , 5 ) ;
processorTabSizer - > Add ( usageLimitsBoxSizer , 0 , wxEXPAND , 1 ) ;
wxStaticBox * suspendComputingStaticBox = new wxStaticBox ( processorTab , - 1 , _ ( " When to suspend " ) ) ;
wxStaticBoxSizer * suspendComputingBoxSizer = new wxStaticBoxSizer ( suspendComputingStaticBox , wxVERTICAL ) ;
2014-05-08 11:34:43 +00:00
2010-06-02 17:44:38 +00:00
m_chkProcOnBatteries = new wxCheckBox (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_CHKPROCONBATTERIES ,
_ ( " Suspend when computer is on batteries " ) , wxDefaultPosition , wxDefaultSize , 0
2009-02-13 17:53:10 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_chkProcOnBatteries - > SetToolTip (
2015-02-12 13:48:28 +00:00
_ ( " check this if you don't want this computer to do work while it runs on batteries " )
2009-02-13 17:53:10 +00:00
) ;
2015-02-12 13:48:28 +00:00
suspendComputingBoxSizer - > Add ( m_chkProcOnBatteries , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_chkProcInUse = new wxCheckBox (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_CHKPROCINUSE ,
2015-02-17 12:45:00 +00:00
_ ( " Suspend processing and network activity when computer is in use " ) , wxDefaultPosition , wxDefaultSize , 0
2009-02-13 17:53:10 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_chkProcInUse - > SetToolTip (
2015-02-12 13:48:28 +00:00
_ ( " check this if you don't want this computer to do work when you're using it " )
2009-02-13 17:53:10 +00:00
) ;
2015-02-12 13:48:28 +00:00
suspendComputingBoxSizer - > Add ( m_chkProcInUse , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2009-02-13 17:53:10 +00:00
m_chkGPUProcInUse = new wxCheckBox (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_CHKGPUPROCINUSE ,
_ ( " Suspend GPU when computer is in use " ) , wxDefaultPosition , wxDefaultSize , 0
2009-02-13 17:53:10 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_chkGPUProcInUse - > SetToolTip (
2015-02-12 13:48:28 +00:00
_ ( " check this if you don't want your GPU to do work when you're using the computer " )
2009-02-13 17:53:10 +00:00
) ;
2015-02-12 13:48:28 +00:00
suspendComputingBoxSizer - > Add ( m_chkGPUProcInUse , 0 , wxALL , 5 ) ;
2009-02-13 17:53:10 +00:00
2010-02-16 18:58:00 +00:00
// min idle time
2014-11-25 09:37:41 +00:00
wxFlexGridSizer * procIdleSizer = new wxFlexGridSizer ( 2 , 4 , 0 , 0 ) ;
procIdleSizer - > AddGrowableCol ( 3 ) ;
procIdleSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
procIdleSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2010-06-02 17:44:38 +00:00
procIdleSizer - > Add (
2010-02-16 18:38:39 +00:00
new wxStaticText (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_DEFAULT ,
_ ( " 'In use' means mouse/keyboard input in last " ) ,
2010-02-16 18:38:39 +00:00
wxDefaultPosition , wxDefaultSize , 0
) ,
0 , wxALL , 5
) ;
2010-06-02 17:44:38 +00:00
m_txtProcIdleFor = new wxTextCtrl (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_TXTPROCIDLEFOR , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 999.99 " ) ) , wxTE_RIGHT
2010-02-16 18:38:39 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_txtProcIdleFor - > SetToolTip (
2010-02-16 18:38:39 +00:00
_ ( " do work only after you haven't used the computer for this number of minutes " )
) ;
2010-06-02 17:44:38 +00:00
procIdleSizer - > Add ( m_txtProcIdleFor , 0 , wxALL , 1 ) ;
procIdleSizer - > Add (
2010-02-16 18:38:39 +00:00
new wxStaticText (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_DEFAULT , _ ( " minutes " ) ,
2010-02-16 18:38:39 +00:00
wxDefaultPosition , wxDefaultSize , 0
) ,
0 , wxALL , 5
) ;
2010-06-02 17:44:38 +00:00
procIdleSizer - > Add (
2015-02-12 13:48:28 +00:00
new wxStaticText ( suspendComputingStaticBox , ID_DEFAULT , wxT ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ,
2014-11-25 09:37:41 +00:00
0 , wxALL , 5
2010-02-16 18:58:00 +00:00
) ;
2014-11-25 11:24:07 +00:00
2015-02-12 13:48:28 +00:00
suspendComputingBoxSizer - > Add ( procIdleSizer , 0 , wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-02-16 18:38:39 +00:00
// max CPU load
2015-02-17 12:45:00 +00:00
wxFlexGridSizer * maxLoadSizer = new wxFlexGridSizer ( 1 , 3 , 0 , 0 ) ;
2014-11-25 09:37:41 +00:00
maxLoadSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
maxLoadSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2015-02-12 13:48:28 +00:00
m_chkMaxLoad = new wxCheckBox (
suspendComputingStaticBox , ID_CHKMAXLOAD ,
_ ( " Suspend when non-BOINC CPU usage is above " ) , wxDefaultPosition , wxDefaultSize , 0
2010-02-16 18:38:39 +00:00
) ;
2015-02-12 13:48:28 +00:00
maxLoadSizer - > Add ( m_chkMaxLoad , 0 , wxALL , 5 ) ;
2010-06-02 17:44:38 +00:00
m_txtMaxLoad = new wxTextCtrl (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_TXTMAXLOAD , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 100.00 " ) ) , wxTE_RIGHT
2010-02-16 18:38:39 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_txtMaxLoad - > SetToolTip (
2010-02-16 18:38:39 +00:00
_ ( " suspend work if processor usage exceeds this level " )
) ;
2010-06-02 17:44:38 +00:00
maxLoadSizer - > Add ( m_txtMaxLoad , 0 , wxALL , 1 ) ;
maxLoadSizer - > Add (
2010-02-16 18:38:39 +00:00
new wxStaticText (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_DEFAULT , _ ( " percent " ) ,
2010-02-16 18:38:39 +00:00
wxDefaultPosition , wxDefaultSize , 0
) ,
0 , wxALL , 5
) ;
2015-02-17 12:45:00 +00:00
suspendComputingBoxSizer - > Add ( maxLoadSizer , 0 , wxEXPAND , 5 ) ;
suspendComputingBoxSizer - > Add (
new wxStaticText ( suspendComputingStaticBox , ID_DEFAULT , wxT ( " To suspend by time of day, see the \" Daily schedules \" section. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ,
2014-11-25 09:37:41 +00:00
0 , wxALL , 5
2010-02-16 18:58:00 +00:00
) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
processorTabSizer - > Add ( suspendComputingBoxSizer , 0 , wxEXPAND , 1 ) ;
2014-11-25 09:37:41 +00:00
2015-02-17 12:45:00 +00:00
wxStaticBox * miscProcStaticBox = new wxStaticBox ( processorTab , - 1 , _ ( " Other " ) ) ;
2015-02-14 13:50:07 +00:00
wxStaticBoxSizer * miscProcBoxSizer = new wxStaticBoxSizer ( miscProcStaticBox , wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxFlexGridSizer * miscProcGridSizer = new wxFlexGridSizer ( 4 , 3 , 0 , 0 ) ;
miscProcGridSizer - > AddGrowableCol ( 2 ) ;
miscProcGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
miscProcGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
// buffer sizes
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxStaticText * staticText30 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
_ ( " Maintain at least " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT
) ;
miscProcGridSizer - > Add ( staticText30 , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
m_txtNetConnectInterval = new wxTextCtrl (
miscProcStaticBox , ID_TXTNETCONNECTINTERVAL , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT
) ;
m_txtNetConnectInterval - > SetToolTip (
_ ( " Try to maintain enough tasks to keep busy for this many days " )
) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
miscProcGridSizer - > Add ( m_txtNetConnectInterval , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxStaticText * staticText31 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT , _ ( " days of work " ) , wxDefaultPosition , wxDefaultSize , 0
) ;
miscProcGridSizer - > Add ( staticText31 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxStaticText * staticText331 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
_ ( " Allow an additional " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT
) ;
miscProcGridSizer - > Add ( staticText331 , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
m_txtNetAdditionalDays = new wxTextCtrl (
miscProcStaticBox , ID_TXTNETADDITIONALDAYS , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT
) ;
m_txtNetAdditionalDays - > SetToolTip (
_ ( " In addition, maintain enough tasks for up to this many days " )
) ;
miscProcGridSizer - > Add ( m_txtNetAdditionalDays , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxBoxSizer * workBufAdditonalDaysSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxStaticText * staticText341 = new wxStaticText ( miscProcStaticBox , ID_DEFAULT , _ ( " days of work to be cached " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
workBufAdditonalDaysSizer - > Add ( staticText341 , 0 , 0 , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
miscProcGridSizer - > Add ( workBufAdditonalDaysSizer , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 11:24:07 +00:00
wxStaticText * staticText18 = new wxStaticText ( miscProcStaticBox , ID_DEFAULT , _ ( " Switch between applications every " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
miscProcGridSizer - > Add ( staticText18 , 0 , wxALL | wxEXPAND , 5 ) ;
2014-07-30 10:42:25 +00:00
m_txtProcSwitchEvery = new wxTextCtrl ( miscProcStaticBox , ID_TXTPROCSWITCHEVERY , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2010-06-02 17:44:38 +00:00
miscProcGridSizer - > Add ( m_txtProcSwitchEvery , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 11:24:07 +00:00
wxStaticText * staticText19 = new wxStaticText ( miscProcStaticBox , ID_DEFAULT , _ ( " minutes " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
miscProcGridSizer - > Add ( staticText19 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-12 13:48:28 +00:00
wxStaticText * staticText46 = new wxStaticText ( miscProcStaticBox , ID_DEFAULT , _ ( " Tasks checkpoint to disk at most every " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
miscProcGridSizer - > Add ( staticText46 , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-12 13:48:28 +00:00
m_txtDiskWriteToDisk = new wxTextCtrl ( miscProcStaticBox , ID_TXTDISKWRITETODISK , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
miscProcGridSizer - > Add ( m_txtDiskWriteToDisk , 0 , wxALL , 1 ) ;
2014-11-21 13:32:40 +00:00
2015-02-12 13:48:28 +00:00
wxStaticText * staticText47 = new wxStaticText ( miscProcStaticBox , ID_DEFAULT , _ ( " seconds " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
miscProcGridSizer - > Add ( staticText47 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
miscProcBoxSizer - > Add ( miscProcGridSizer , 0 , wxEXPAND , 1 ) ;
2014-11-25 11:24:07 +00:00
miscProcBoxSizer - > AddSpacer ( 1 ) ; // Ensure staticText22 is fully visible on Mac
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
processorTabSizer - > Add ( miscProcBoxSizer , 0 , wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
processorTab - > SetSizer ( processorTabSizer ) ;
processorTab - > Layout ( ) ;
processorTabSizer - > Fit ( processorTab ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
return processorTab ;
}
2011-04-28 13:00:04 +00:00
2010-06-02 17:44:38 +00:00
wxPanel * CDlgAdvPreferencesBase : : createNetworkTab ( wxNotebook * notebook )
{
2014-07-30 10:42:25 +00:00
wxSize textCtrlSize = getTextCtrlSize ( wxT ( " 9999.99 " ) ) ;
2010-06-02 17:44:38 +00:00
wxPanel * networkTab = new wxPanel ( notebook , ID_TABPAGE_NET , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
networkTab - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
wxBoxSizer * networkTabSizer = new wxBoxSizer ( wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticBox * networkUsageLimitsStaticBox = new wxStaticBox ( networkTab , - 1 , _ ( " Usage limits " ) ) ;
wxStaticBoxSizer * networkUsageLimitsBoxSizer = new wxStaticBoxSizer ( networkUsageLimitsStaticBox , wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxFlexGridSizer * networkUsageLimitsGridSizer = new wxFlexGridSizer ( 3 , 0 , 0 ) ;
networkUsageLimitsGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
networkUsageLimitsGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2007-04-02 18:04:54 +00:00
2010-04-23 21:21:48 +00:00
// upload/download rates
2015-02-17 12:45:00 +00:00
m_chkNetDownloadRate = new wxCheckBox ( networkUsageLimitsStaticBox , ID_CHKNETDOWNLOADRATE , _ ( " Limit download rate to " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
networkUsageLimitsGridSizer - > Add ( m_chkNetDownloadRate , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_txtNetDownloadRate = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETDOWNLOADRATE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
networkUsageLimitsGridSizer - > Add ( m_txtNetDownloadRate , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText33 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " KBytes/second " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
networkUsageLimitsGridSizer - > Add ( staticText33 , 0 , wxALL , 5 ) ;
2014-11-25 11:24:07 +00:00
2015-02-17 12:45:00 +00:00
m_chkNetUploadRate = new wxCheckBox ( networkUsageLimitsStaticBox , ID_CHKNETUPLOADRATE , _ ( " Limit upload rate to " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
networkUsageLimitsGridSizer - > Add ( m_chkNetUploadRate , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_txtNetUploadRate = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETUPLOADRATE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
networkUsageLimitsGridSizer - > Add ( m_txtNetUploadRate , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText35 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " KBytes/second " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
networkUsageLimitsGridSizer - > Add ( staticText35 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-06-19 11:02:09 +00:00
// long-term quota
2015-02-17 12:45:00 +00:00
m_chk_daily_xfer_limit = new wxCheckBox ( networkUsageLimitsStaticBox , ID_CHKDAILYXFERLIMIT , _ ( " Limit network usage to " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
networkUsageLimitsGridSizer - > Add ( m_chk_daily_xfer_limit , 0 , wxALL , 5 ) ;
2014-06-19 11:02:09 +00:00
2015-02-17 12:45:00 +00:00
m_txt_daily_xfer_limit_mb = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETDOWNLOADRATE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
networkUsageLimitsGridSizer - > Add ( m_txt_daily_xfer_limit_mb , 0 , wxALL , 1 ) ;
2014-06-30 23:45:29 +00:00
wxBoxSizer * networkTransferLimitSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2014-06-19 11:02:09 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText_daily_xfer2 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " MBytes every " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-06-19 11:02:09 +00:00
2014-11-25 11:24:07 +00:00
networkTransferLimitSizer - > Add ( staticText_daily_xfer2 , 0 , wxALL , 5 ) ;
2015-02-17 12:45:00 +00:00
m_txt_daily_xfer_period_days = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETUPLOADRATE , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 999.99 " ) ) , wxTE_RIGHT ) ;
2014-06-19 11:02:09 +00:00
networkTransferLimitSizer - > Add ( m_txt_daily_xfer_period_days , 0 , wxALL , 1 ) ;
2015-02-17 12:45:00 +00:00
wxStaticText * staticText_daily_xfer4 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " days " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-11-25 11:24:07 +00:00
networkTransferLimitSizer - > Add ( staticText_daily_xfer4 , 0 , wxALL , 5 ) ;
2014-06-19 11:02:09 +00:00
2015-02-17 12:45:00 +00:00
networkUsageLimitsGridSizer - > Add ( networkTransferLimitSizer , 0 , wxALL , 0 ) ;
2014-06-30 23:45:29 +00:00
2015-02-17 12:45:00 +00:00
networkUsageLimitsBoxSizer - > Add ( networkUsageLimitsGridSizer , 0 , wxEXPAND , 1 ) ;
2014-06-30 23:45:29 +00:00
2015-02-17 12:45:00 +00:00
networkUsageLimitsBoxSizer - > Add (
new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , wxT ( " See also \" suspend when computer is in use \" in the \" Computing \" section. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 5
) ;
networkUsageLimitsBoxSizer - > Add (
new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , wxT ( " To suspend by time of day, see the \" Daily schedules \" section. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 5
) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
networkTabSizer - > Add ( networkUsageLimitsBoxSizer , 0 , wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticBox * connectOptionsStaticBox = new wxStaticBox ( networkTab , - 1 , _ ( " Other " ) ) ;
wxStaticBoxSizer * connectOptionsSizer = new wxStaticBoxSizer ( connectOptionsStaticBox , wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_chkNetSkipImageVerification = new wxCheckBox ( connectOptionsStaticBox , ID_CHKNETSKIPIMAGEVERIFICATION , _ ( " Skip data verification for image files " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_chkNetSkipImageVerification - > SetToolTip ( _ ( " check this if your Internet provider modifies image files " ) ) ;
connectOptionsSizer - > Add ( m_chkNetSkipImageVerification , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-05-08 11:34:43 +00:00
m_chkNetConfirmBeforeConnect = new wxCheckBox ( connectOptionsStaticBox , ID_CHKNETCONFIRMBEFORECONNECT , _ ( " Confirm before connecting to internet " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_chkNetConfirmBeforeConnect - > SetToolTip ( _ ( " if checked, a confirmation dialog will be displayed before trying to connect to the Internet " ) ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 09:37:41 +00:00
connectOptionsSizer - > Add ( m_chkNetConfirmBeforeConnect , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-05-08 11:34:43 +00:00
m_chkNetDisconnectWhenDone = new wxCheckBox ( connectOptionsStaticBox , ID_CHKNETDISCONNECTWHENDONE , _ ( " Disconnect when done " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_chkNetDisconnectWhenDone - > SetToolTip ( _ ( " if checked, BOINC hangs up when network usage is done \n (only relevant for dialup-connection) " ) ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 09:37:41 +00:00
connectOptionsSizer - > Add ( m_chkNetDisconnectWhenDone , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
networkTabSizer - > Add ( connectOptionsSizer , 0 , wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
networkTab - > SetSizer ( networkTabSizer ) ;
networkTab - > Layout ( ) ;
networkTabSizer - > Fit ( networkTab ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
return networkTab ;
}
2011-04-28 13:00:04 +00:00
2010-06-02 17:44:38 +00:00
wxPanel * CDlgAdvPreferencesBase : : createDiskAndMemoryTab ( wxNotebook * notebook )
{
2014-07-30 10:42:25 +00:00
wxSize textCtrlSize = getTextCtrlSize ( wxT ( " 9999.99 " ) ) ;
2010-06-02 17:44:38 +00:00
wxPanel * diskMemoryTab = new wxPanel ( notebook , ID_TABPAGE_DISK , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
diskMemoryTab - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
wxBoxSizer * diskAndMemoryBoxSizer = new wxBoxSizer ( wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticBox * diskUsageStaticBox = new wxStaticBox ( diskMemoryTab , - 1 , _ ( " Disk " ) ) ;
2014-05-08 11:34:43 +00:00
wxStaticBoxSizer * diskUsageBoxSizer = new wxStaticBoxSizer ( diskUsageStaticBox , wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
diskUsageBoxSizer - > Add ( new wxStaticText ( diskUsageStaticBox , - 1 , _ ( " BOINC will use the most restrictive of these three settings: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 5
) ;
2014-11-25 11:24:07 +00:00
wxFlexGridSizer * diskUsageGridSizer = new wxFlexGridSizer ( 3 , 3 , 0 , 0 ) ;
2010-06-02 17:44:38 +00:00
diskUsageGridSizer - > AddGrowableCol ( 2 ) ;
diskUsageGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
diskUsageGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2007-04-02 18:04:54 +00:00
2015-02-12 13:48:28 +00:00
m_chkDiskMaxSpace = new wxCheckBox (
2015-02-17 12:45:00 +00:00
diskUsageStaticBox , ID_CHKDISKMAXSPACE , _ ( " Use no more than " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
2015-02-12 13:48:28 +00:00
diskUsageGridSizer - > Add ( m_chkDiskMaxSpace , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_txtDiskMaxSpace = new wxTextCtrl ( diskUsageStaticBox , ID_TXTDISKMAXSPACE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2010-06-02 17:44:38 +00:00
m_txtDiskMaxSpace - > SetToolTip ( _ ( " the maximum disk space used by BOINC (in Gigabytes) " ) ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
diskUsageGridSizer - > Add ( m_txtDiskMaxSpace , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText41 = new wxStaticText ( diskUsageStaticBox , ID_DEFAULT , _ ( " Gigabytes " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-11-25 11:24:07 +00:00
diskUsageGridSizer - > Add ( staticText41 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-12 13:48:28 +00:00
m_chkDiskLeastFree = new wxCheckBox (
2015-02-17 12:45:00 +00:00
diskUsageStaticBox , ID_CHKDISKLEASTFREE , _ ( " Leave at least " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
2015-02-12 13:48:28 +00:00
diskUsageGridSizer - > Add ( m_chkDiskLeastFree , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_txtDiskLeastFree = new wxTextCtrl ( diskUsageStaticBox , ID_TXTDISKLEASTFREE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2010-06-02 17:44:38 +00:00
m_txtDiskLeastFree - > SetToolTip ( _ ( " BOINC leaves at least this amount of disk space free (in Gigabytes) " ) ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
diskUsageGridSizer - > Add ( m_txtDiskLeastFree , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText43 = new wxStaticText ( diskUsageStaticBox , ID_DEFAULT , _ ( " Gigabytes free " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-11-25 11:24:07 +00:00
diskUsageGridSizer - > Add ( staticText43 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-12 13:48:28 +00:00
m_chkDiskMaxOfTotal = new wxCheckBox (
2015-02-17 12:45:00 +00:00
diskUsageStaticBox , ID_CHKDISKMAXOFTOTAL , _ ( " Use no more than " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
2015-02-12 13:48:28 +00:00
diskUsageGridSizer - > Add ( m_chkDiskMaxOfTotal , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_txtDiskMaxOfTotal = new wxTextCtrl ( diskUsageStaticBox , ID_TXTDISKMAXOFTOTAL , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2010-06-02 17:44:38 +00:00
m_txtDiskMaxOfTotal - > SetToolTip ( _ ( " BOINC uses at most this percentage of total disk space " ) ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
diskUsageGridSizer - > Add ( m_txtDiskMaxOfTotal , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2008-02-25 20:11:30 +00:00
/*xgettext:no-c-format*/
2015-02-17 12:45:00 +00:00
wxStaticText * staticText45 = new wxStaticText ( diskUsageStaticBox , ID_DEFAULT , _ ( " % of total disk space " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-11-25 11:24:07 +00:00
diskUsageGridSizer - > Add ( staticText45 , 0 , wxALL , 5 ) ;
2015-02-17 12:45:00 +00:00
diskUsageBoxSizer - > Add ( diskUsageGridSizer , 0 , wxEXPAND , 1 ) ;
2010-06-02 17:44:38 +00:00
diskAndMemoryBoxSizer - > Add ( diskUsageBoxSizer , 0 , wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticBox * memoryUsageStaticBox = new wxStaticBox ( diskMemoryTab , - 1 , _ ( " Memory " ) ) ;
2014-05-08 11:34:43 +00:00
wxStaticBoxSizer * memoryUsageBoxSizer = new wxStaticBoxSizer ( memoryUsageStaticBox , wxVERTICAL ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
wxFlexGridSizer * memoryUsageGridSizer = new wxFlexGridSizer ( 3 , 3 , 0 , 0 ) ;
memoryUsageGridSizer - > AddGrowableCol ( 2 ) ;
memoryUsageGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
memoryUsageGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 11:24:07 +00:00
wxStaticText * staticText50 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
memoryUsageGridSizer - > Add ( staticText50 , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-07-30 10:42:25 +00:00
textCtrlSize = getTextCtrlSize ( wxT ( " 100.00 " ) ) ;
m_txtMemoryMaxInUse = new wxTextCtrl ( memoryUsageStaticBox , ID_TXTMEMORYMAXINUSE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2010-06-02 17:44:38 +00:00
memoryUsageGridSizer - > Add ( m_txtMemoryMaxInUse , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2009-02-25 17:51:32 +00:00
/*xgettext:no-c-format*/
2014-11-25 11:24:07 +00:00
wxStaticText * staticText51 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " % when computer is in use " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
memoryUsageGridSizer - > Add ( staticText51 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 11:24:07 +00:00
wxStaticText * staticText52 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
memoryUsageGridSizer - > Add ( staticText52 , 0 , wxALL | wxEXPAND , 5 ) ;
2007-04-02 18:04:54 +00:00
2014-07-30 10:42:25 +00:00
m_txtMemoryMaxOnIdle = new wxTextCtrl ( memoryUsageStaticBox , ID_TXTMEMORYMAXONIDLE , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2010-06-02 17:44:38 +00:00
memoryUsageGridSizer - > Add ( m_txtMemoryMaxOnIdle , 0 , wxALL , 1 ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 11:24:07 +00:00
/*xgettext:no-c-format*/
wxStaticText * staticText53 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " % when computer is idle " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
memoryUsageGridSizer - > Add ( staticText53 , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText48 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_RIGHT ) ;
memoryUsageGridSizer - > Add ( staticText48 , 0 , wxALL | wxEXPAND , 5 ) ;
m_txtDiskMaxSwap = new wxTextCtrl ( memoryUsageStaticBox , ID_TXTDISKWRITETODISK , wxT ( " " ) , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
memoryUsageGridSizer - > Add ( m_txtDiskMaxSwap , 0 , wxALL , 1 ) ;
wxStaticText * staticText49 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " % of page file (swap space) " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
memoryUsageGridSizer - > Add ( staticText49 , 0 , wxALL , 5 ) ;
2010-06-02 17:44:38 +00:00
memoryUsageBoxSizer - > Add ( memoryUsageGridSizer , 0 , wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2015-02-17 12:45:00 +00:00
m_chkMemoryWhileSuspended = new wxCheckBox ( memoryUsageStaticBox , ID_CHKMEMORYWHILESUSPENDED , _ ( " Leave non-GPU applications in memory while suspended " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
m_chkMemoryWhileSuspended - > SetToolTip ( _ ( " if checked, suspended work units are left in memory " ) ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 09:37:41 +00:00
memoryUsageBoxSizer - > Add ( m_chkMemoryWhileSuspended , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
diskAndMemoryBoxSizer - > Add ( memoryUsageBoxSizer , 0 , wxALL | wxEXPAND , 1 ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
diskMemoryTab - > SetSizer ( diskAndMemoryBoxSizer ) ;
diskMemoryTab - > Layout ( ) ;
diskAndMemoryBoxSizer - > Fit ( diskMemoryTab ) ;
2007-04-02 18:04:54 +00:00
2010-06-02 17:44:38 +00:00
return diskMemoryTab ;
2007-01-17 18:13:33 +00:00
}
2011-04-28 13:00:04 +00:00
2015-02-14 13:50:07 +00:00
wxPanel * CDlgAdvPreferencesBase : : createDailySchedulesTab ( wxNotebook * notebook )
{
wxPanel * dailySchedulesTab = new wxPanel ( notebook , ID_TABPAGE_DISK , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
dailySchedulesTab - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
wxBoxSizer * dailySchedulesTabSizer = new wxBoxSizer ( wxVERTICAL ) ;
// Computing schedule
//
2015-02-18 01:01:50 +00:00
wxStaticBox * computingTimesStaticBox = new wxStaticBox ( dailySchedulesTab , - 1 , _ ( " Schedule computing " ) ) ;
2015-02-17 12:45:00 +00:00
wxStaticBoxSizer * computingTimesStaticBoxSizer = new wxStaticBoxSizer ( computingTimesStaticBox , wxVERTICAL ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 12:45:00 +00:00
wxBoxSizer * cpuTimesEveryDaySizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2015-02-14 13:50:07 +00:00
m_chkProcEveryDay = new wxCheckBox (
computingTimesStaticBox , ID_CHKPROCEVERYDAY ,
2015-02-18 00:55:40 +00:00
_ ( " Compute only between " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
cpuTimesEveryDaySizer - > Add ( m_chkProcEveryDay , 0 , wxLEFT | wxRIGHT , 5 ) ;
2015-02-14 13:50:07 +00:00
m_txtProcEveryDayStart = new wxTextCtrl ( computingTimesStaticBox , ID_TXTPROCEVERYDAYSTART , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 23:59 " ) ) , wxTE_RIGHT ) ;
2015-02-18 00:55:40 +00:00
m_txtProcEveryDayStart - > SetToolTip ( _ ( " allow work starting at this time " ) ) ;
2015-02-17 12:45:00 +00:00
cpuTimesEveryDaySizer - > Add ( m_txtProcEveryDayStart , 0 , wxLEFT | wxRIGHT , 1 ) ;
2015-02-14 13:50:07 +00:00
wxStaticText * staticText25 = new wxStaticText ( computingTimesStaticBox , ID_DEFAULT , _ ( " and " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_CENTRE ) ;
2015-02-17 12:45:00 +00:00
cpuTimesEveryDaySizer - > Add ( staticText25 , 0 , wxLEFT | wxRIGHT , 5 ) ;
2015-02-14 13:50:07 +00:00
m_txtProcEveryDayStop = new wxTextCtrl ( computingTimesStaticBox , ID_TXTPROCEVERYDAYSTOP , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 23:59 " ) ) , wxTE_RIGHT ) ;
2015-02-18 00:55:40 +00:00
m_txtProcEveryDayStop - > SetToolTip ( _ ( " stop allowing work at this time " ) ) ;
2015-02-17 12:45:00 +00:00
cpuTimesEveryDaySizer - > Add ( m_txtProcEveryDayStop , 0 , wxLEFT | wxRIGHT , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 12:45:00 +00:00
computingTimesStaticBoxSizer - > Add ( cpuTimesEveryDaySizer , 0 , wxLEFT | wxRIGHT , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 14:22:00 +00:00
procSpecialTimesStaticBox = new wxStaticBox ( computingTimesStaticBox , - 1 , _ ( " Day-of-week override: " ) ) ;
2015-02-17 12:45:00 +00:00
wxStaticBoxSizer * procSpecialTimesStaticBoxSizer = new wxStaticBoxSizer ( procSpecialTimesStaticBox , wxVERTICAL ) ;
2015-02-17 14:22:00 +00:00
wxStaticText * staticText36 = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , _ ( " Selected days will override the \" Every day \" times above " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
procSpecialTimesStaticBoxSizer - > Add ( staticText36 , 0 , wxALL , 0 ) ;
2015-02-17 14:22:00 +00:00
m_panelProcSpecialTimes = new wxPanel ( procSpecialTimesStaticBox , ID_DEFAULT , wxDefaultPosition , wxDefaultSize ) ;
m_panelProcSpecialTimes - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
m_panelProcSpecialTimes - > SetToolTip ( _ ( " On each selected \" override \" day, ignore the \" Every day \" times above and suspend if the time is outside the range shown for that day " ) ) ;
2015-02-14 13:50:07 +00:00
wxFlexGridSizer * procDaysSizer = new wxFlexGridSizer ( 4 , 4 , 0 , 0 ) ;
procDaysSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
procDaysSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2015-02-17 14:22:00 +00:00
m_chkProcMonday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCMONDAY , _ ( " Monday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcMonday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcMonday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCMONDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcMonday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkProcTuesday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCTUESDAY , _ ( " Tuesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcTuesday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcTuesday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCTUESDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcTuesday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkProcWednesday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCWEDNESDAY , _ ( " Wednesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcWednesday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcWednesday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCWEDNESDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcWednesday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkProcThursday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCTHURSDAY , _ ( " Thursday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcThursday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcThursday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCTHURSDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcThursday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkProcFriday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCFRIDAY , _ ( " Friday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcFriday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcFriday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCFRIDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcFriday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkProcSaturday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCSATURDAY , _ ( " Saturday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcSaturday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcSaturday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCSATURDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcSaturday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkProcSunday = new wxCheckBox ( m_panelProcSpecialTimes , ID_CHKPROCSUNDAY , _ ( " Sunday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_chkProcSunday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtProcSunday = new wxTextCtrl ( m_panelProcSpecialTimes , ID_TXTPROCSUNDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > Add ( m_txtProcSunday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_panelProcSpecialTimes - > SetSizer ( procDaysSizer ) ;
m_panelProcSpecialTimes - > Layout ( ) ;
procDaysSizer - > Fit ( m_panelProcSpecialTimes ) ;
procSpecialTimesStaticBoxSizer - > Add ( m_panelProcSpecialTimes , 0 , wxALL , 0 ) ;
2015-02-17 12:45:00 +00:00
computingTimesStaticBoxSizer - > Add ( procSpecialTimesStaticBoxSizer , 1 , wxEXPAND | wxALL , 1 ) ;
dailySchedulesTabSizer - > Add ( computingTimesStaticBoxSizer , 1 , wxEXPAND | wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
// Network schedule
//
2015-02-18 01:01:50 +00:00
wxStaticBox * networkTimesStaticBox = new wxStaticBox ( dailySchedulesTab , - 1 , _ ( " Schedule network usage " ) ) ;
2015-02-14 13:50:07 +00:00
wxStaticBoxSizer * networkTimesBoxSizer = new wxStaticBoxSizer ( networkTimesStaticBox , wxVERTICAL ) ;
2015-02-17 12:45:00 +00:00
wxBoxSizer * networkTimesEveryDaySizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 12:45:00 +00:00
m_chkNetEveryDay = new wxCheckBox (
2015-02-18 00:55:40 +00:00
networkTimesStaticBox , ID_CHKNETEVERYDAY , _ ( " Tranfer files only between " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
networkTimesEveryDaySizer - > Add ( m_chkNetEveryDay , 0 , wxLEFT | wxRIGHT , 5 ) ;
2015-02-14 13:50:07 +00:00
m_txtNetEveryDayStart = new wxTextCtrl ( networkTimesStaticBox , ID_TXTNETEVERYDAYSTART , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 23:59 " ) ) , 0 ) ;
2015-02-18 00:55:40 +00:00
m_txtNetEveryDayStart - > SetToolTip ( _ ( " allow file tranfers starting at this time " ) ) ;
2015-02-17 12:45:00 +00:00
networkTimesEveryDaySizer - > Add ( m_txtNetEveryDayStart , 0 , wxLEFT | wxRIGHT , 1 ) ;
2015-02-14 13:50:07 +00:00
wxStaticText * staticText37 = new wxStaticText ( networkTimesStaticBox , ID_DEFAULT , _ ( " and " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
networkTimesEveryDaySizer - > Add ( staticText37 , 0 , wxLEFT | wxRIGHT , 5 ) ;
2015-02-14 13:50:07 +00:00
m_txtNetEveryDayStop = new wxTextCtrl ( networkTimesStaticBox , ID_TXTNETEVERYDAYSTOP , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 23:59 " ) ) , 0 ) ;
2015-02-18 00:55:40 +00:00
m_txtNetEveryDayStop - > SetToolTip ( _ ( " stop allowing file tranfers at this time " ) ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 12:45:00 +00:00
networkTimesEveryDaySizer - > Add ( m_txtNetEveryDayStop , 0 , wxLEFT | wxRIGHT , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 12:45:00 +00:00
networkTimesBoxSizer - > Add ( networkTimesEveryDaySizer , 0 , wxLEFT | wxRIGHT , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 12:45:00 +00:00
wxStaticBox * netSpecialTimesStaticBox = new wxStaticBox ( networkTimesStaticBox , - 1 , _ ( " Day-of-week override: " ) ) ;
wxStaticBoxSizer * netSpecialTimesStaticBoxSizer = new wxStaticBoxSizer ( netSpecialTimesStaticBox , wxVERTICAL ) ;
2015-02-17 14:22:00 +00:00
wxStaticText * staticText39 = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , _ ( " Selected days will override the \" Every day \" times above " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
netSpecialTimesStaticBoxSizer - > Add ( staticText39 , 0 , wxALL , 0 ) ;
2015-02-14 13:50:07 +00:00
2015-02-17 14:22:00 +00:00
m_panelNetSpecialTimes = new wxPanel ( netSpecialTimesStaticBox , ID_DEFAULT , wxDefaultPosition , wxDefaultSize ) ;
m_panelNetSpecialTimes - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
m_panelNetSpecialTimes - > SetToolTip ( _ ( " On each selected \" override \" day, ignore the \" Every day \" times above and suspend if the time is outside the range shown for that day " ) ) ;
2015-02-14 13:50:07 +00:00
wxFlexGridSizer * netDaysGridSizer = new wxFlexGridSizer ( 4 , 4 , 0 , 0 ) ;
netDaysGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
netDaysGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2015-02-17 14:22:00 +00:00
m_chkNetMonday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETMONDAY , _ ( " Monday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetMonday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetMonday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETMONDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetMonday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkNetTuesday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETTUESDAY , _ ( " Tuesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetTuesday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetTuesday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETTUESDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetTuesday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkNetWednesday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETWEDNESDAY , _ ( " Wednesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetWednesday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetWednesday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETWEDNESDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetWednesday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkNetThursday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETTHURSDAY , _ ( " Thursday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetThursday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetThursday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETTHURSDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetThursday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkNetFriday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETFRIDAY , _ ( " Friday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetFriday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetFriday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETFRIDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetFriday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkNetSaturday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETSATURDAY , _ ( " Saturday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetSaturday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetSaturday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETSATURDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetSaturday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_chkNetSunday = new wxCheckBox ( m_panelNetSpecialTimes , ID_CHKNETSUNDAY , _ ( " Sunday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_chkNetSunday , 0 , wxALL , 5 ) ;
2015-02-17 14:22:00 +00:00
m_txtNetSunday = new wxTextCtrl ( m_panelNetSpecialTimes , ID_TXTNETSUNDAY , wxT ( " " ) , wxDefaultPosition , getTextCtrlSize ( wxT ( " 00:00-23:59 " ) ) , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > Add ( m_txtNetSunday , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
m_panelNetSpecialTimes - > SetSizer ( netDaysGridSizer ) ;
m_panelNetSpecialTimes - > Layout ( ) ;
netDaysGridSizer - > Fit ( m_panelNetSpecialTimes ) ;
netSpecialTimesStaticBoxSizer - > Add ( m_panelNetSpecialTimes , 1 , wxEXPAND | wxALL , 1 ) ;
2015-02-17 12:45:00 +00:00
networkTimesBoxSizer - > Add ( netSpecialTimesStaticBoxSizer , 1 , wxEXPAND | wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
dailySchedulesTabSizer - > Add ( networkTimesBoxSizer , 1 , wxEXPAND | wxALL , 1 ) ;
dailySchedulesTab - > SetSizer ( dailySchedulesTabSizer ) ;
dailySchedulesTab - > Layout ( ) ;
dailySchedulesTabSizer - > Fit ( dailySchedulesTab ) ;
return dailySchedulesTab ;
}
2014-07-30 10:42:25 +00:00
wxSize CDlgAdvPreferencesBase : : getTextCtrlSize ( wxString maxText ) {
int w , h , margin ;
wxSize sz ;
wxFont f = GetParent ( ) - > GetFont ( ) ;
GetTextExtent ( maxText , & w , & h , NULL , NULL , & f ) ;
margin = w / 3 ;
if ( margin < 9 ) margin = 9 ;
sz . x = w + margin ;
sz . y = wxDefaultCoord ;
return sz ;
}
2014-11-25 12:59:38 +00:00
bool CDlgAdvPreferencesBase : : doesLocalPrefsFileExist ( ) {
std : : string s ;
int retval ;
bool local_prefs_found = false ;
MIOFILE mf ;
bool found_venue ;
GLOBAL_PREFS web_prefs ;
GLOBAL_PREFS_MASK mask ;
CMainDocument * pDoc = wxGetApp ( ) . GetDocument ( ) ;
wxASSERT ( pDoc ) ;
wxASSERT ( wxDynamicCast ( pDoc , CMainDocument ) ) ;
retval = pDoc - > rpc . get_global_prefs_override ( s ) ;
local_prefs_found = ( retval = = BOINC_SUCCESS ) ;
s . clear ( ) ;
web_prefs . init ( ) ;
retval = pDoc - > rpc . get_global_prefs_file ( s ) ;
mf . init_buf_read ( s . c_str ( ) ) ;
XML_PARSER xp ( & mf ) ;
web_prefs . parse ( xp , " " , found_venue , mask ) ;
web_prefs_url = new wxString ( web_prefs . source_project ) ;
return local_prefs_found ;
}