2010-06-02 17:44:38 +00:00
// This file is part of BOINC.
// http://boinc.berkeley.edu
2015-03-01 09:53:49 +00:00
// Copyright (C) 2015 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"
2015-03-02 12:16:13 +00:00
# define STATICBOXBORDERSIZE 8
# define STATICBOXVERTICALSPACER 10
# define DAYOFWEEKBORDERSIZE 10
2007-01-17 18:13:33 +00:00
///////////////////////////////////////////////////////////////////////////
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-11-25 12:59:38 +00:00
bool usingLocalPrefs = doesLocalPrefsFileExist ( ) ;
2015-04-08 10:03:26 +00:00
if ( web_prefs_url - > IsEmpty ( ) ) {
m_bmpWarning = NULL ;
2014-11-25 12:59:38 +00:00
} else {
2015-04-08 10:03:26 +00:00
wxStaticBox * topControlsStaticBox = new wxStaticBox ( this , - 1 , wxEmptyString ) ;
wxStaticBoxSizer * topControlsSizer = new wxStaticBoxSizer ( topControlsStaticBox , wxHORIZONTAL ) ;
m_bmpWarning = new wxStaticBitmap ( topControlsStaticBox , ID_DEFAULT , wxNullBitmap , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_bmpWarning - > SetMinSize ( wxSize ( 48 , 48 ) ) ;
topControlsSizer - > Add ( m_bmpWarning , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 0 ) ;
wxBoxSizer * legendSizer = new wxBoxSizer ( wxVERTICAL ) ;
if ( usingLocalPrefs ) {
legendSizer - > Add (
new wxStaticText ( topControlsStaticBox , ID_DEFAULT ,
_ ( " Using local preferences. \n "
" Click \" Use web prefs \" to use web-based preferences from "
) , wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 1
) ;
} else {
legendSizer - > Add (
new wxStaticText ( topControlsStaticBox , ID_DEFAULT ,
_ ( " Using web-based preferences from " ) ,
wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 1
) ;
}
2014-11-25 12:59:38 +00:00
legendSizer - > Add (
2015-04-08 10:03:26 +00:00
new wxHyperlinkCtrl (
topControlsStaticBox , wxID_ANY , * web_prefs_url , * web_prefs_url ,
wxDefaultPosition , wxDefaultSize , wxHL_DEFAULT_STYLE
) ,
0 , wxLEFT , 5
2014-11-25 12:59:38 +00:00
) ;
2015-04-08 10:03:26 +00:00
if ( ! usingLocalPrefs ) {
legendSizer - > Add (
new wxStaticText ( topControlsStaticBox , ID_DEFAULT ,
_ ( " Set values and click OK to use local preferences instead. " ) ,
wxDefaultPosition , wxDefaultSize , 0 ) ,
0 , wxALL , 1
) ;
}
topControlsSizer - > Add ( legendSizer , 1 , wxALL , 1 ) ;
2014-11-25 12:59:38 +00:00
2015-04-08 10:03:26 +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 ( ) ;
}
topControlsSizer - > Add ( m_btnClear , 0 , wxALIGN_BOTTOM | wxALL , 4 ) ;
2010-06-02 17:44:38 +00:00
2015-03-02 12:16:13 +00:00
# ifdef __WXMAC__
2015-04-08 10:03:26 +00:00
dialogSizer - > Add ( topControlsSizer , 0 , wxTOP | wxLEFT | wxRIGHT | wxEXPAND , 10 ) ;
2015-03-02 12:16:13 +00:00
# else
2015-04-08 10:03:26 +00:00
dialogSizer - > Add ( topControlsSizer , 0 , wxALL | wxEXPAND , 5 ) ;
2015-03-02 12:16:13 +00:00
# endif
2015-04-08 10:03:26 +00:00
}
2010-06-02 17:44:38 +00:00
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 ) ;
2015-02-27 10:21:51 +00:00
// Note: we must set the third AddPage argument ("select") to
// true for each page or ToolTips won't initialize properly.
2010-06-02 17:44:38 +00:00
m_panelProcessor = createProcessorTab ( m_Notebook ) ;
2015-02-27 10:21:51 +00:00
m_Notebook - > AddPage ( m_panelProcessor , _ ( " Computing " ) , true ) ;
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-03-14 06:55:20 +00:00
m_Notebook - > AddPage ( m_panelDiskAndMemory , _ ( " Disk and memory " ) , true ) ;
2015-02-14 13:50:07 +00:00
m_panelDailySchedules = createDailySchedulesTab ( m_Notebook ) ;
2015-03-14 06:55:20 +00:00
m_Notebook - > AddPage ( m_panelDailySchedules , _ ( " Daily schedules " ) , true ) ;
2015-02-14 13:50:07 +00:00
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
2015-03-02 12:16:13 +00:00
dialogSizer - > Add ( m_panelControls , 1 , wxALL | wxEXPAND , 5 ) ;
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 ) ;
2015-02-26 13:31:59 +00:00
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 ) ;
2015-02-26 13:31:59 +00:00
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 ) ;
2015-02-26 13:31:59 +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 ) ;
}
2015-02-28 14:29:27 +00:00
void CDlgAdvPreferencesBase : : addNewRowToSizer (
2015-02-28 09:12:05 +00:00
wxSizer * toSizer , wxString & toolTipText ,
wxWindow * first , wxWindow * second , wxWindow * third ,
wxWindow * fourth , wxWindow * fifth )
{
wxBoxSizer * rowSizer = new wxBoxSizer ( wxHORIZONTAL ) ;
2015-02-28 13:51:59 +00:00
# ifdef __WXMSW__
// MSW adds space to the right of checkbox label
if ( first - > IsKindOf ( CLASSINFO ( wxCheckBox ) ) ) {
rowSizer - > Add ( first , 0 , wxTOP | wxBOTTOM | wxLEFT , 5 ) ;
} else
# endif
rowSizer - > Add ( first , 0 , wxALL , 5 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 13:51:59 +00:00
first - > SetToolTip ( toolTipText ) ;
rowSizer - > Add ( second , 0 , wxALL , 2 ) ;
2015-02-28 09:12:05 +00:00
second - > SetToolTip ( toolTipText ) ;
2015-02-28 13:51:59 +00:00
rowSizer - > Add ( third , 0 , wxALL , 5 ) ;
2015-02-28 09:12:05 +00:00
third - > SetToolTip ( toolTipText ) ;
if ( fourth ) {
2015-02-28 13:51:59 +00:00
rowSizer - > Add ( fourth , 0 , wxALL , 2 ) ;
2015-02-28 09:12:05 +00:00
fourth - > SetToolTip ( toolTipText ) ;
}
if ( fifth ) {
2015-02-28 13:51:59 +00:00
rowSizer - > Add ( fifth , 0 , wxALL , 5 ) ;
2015-02-28 09:12:05 +00:00
fifth - > SetToolTip ( toolTipText ) ;
}
toSizer - > Add ( rowSizer , 0 , 0 , 1 ) ;
}
2010-06-02 17:44:38 +00:00
wxPanel * CDlgAdvPreferencesBase : : createProcessorTab ( wxNotebook * notebook )
{
2015-02-26 13:31:59 +00:00
CSkinAdvanced * pSkinAdvanced = wxGetApp ( ) . GetSkinManager ( ) - > GetAdvanced ( ) ;
wxASSERT ( pSkinAdvanced ) ;
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 ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( usageLimitsStaticBox ) ;
2015-02-12 13:48:28 +00:00
2015-02-13 14:21:14 +00:00
/*xgettext:no-c-format*/
2015-02-26 13:31:59 +00:00
wxString MaxCPUPctTT ( _ ( " Keep some CPUs free for other applications. Example: 75% means use 6 cores on an 8-core CPU. " ) ) ;
2015-02-25 13:21:36 +00:00
wxStaticText * staticText20 = new wxStaticText (
2015-02-13 14:21:14 +00:00
usageLimitsStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-18 12:34:31 +00:00
2015-03-02 22:49:09 +00:00
m_txtProcUseProcessors = new wxTextCtrl ( usageLimitsStaticBox , ID_TXTPROCUSEPROCESSORS , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2015-02-12 13:48:28 +00:00
/*xgettext:no-c-format*/
wxStaticText * staticText21 = new wxStaticText ( usageLimitsStaticBox , ID_DEFAULT , _ ( " % of the CPUs " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( usageLimitsBoxSizer , MaxCPUPctTT , staticText20 , m_txtProcUseProcessors , staticText21 ) ;
2015-02-12 13:48:28 +00:00
2015-02-26 13:31:59 +00:00
/*xgettext:no-c-format*/
wxString MaxCPUTimeTT ( _ ( " Suspend/resume computing every few seconds to reduce CPU temperature and energy usage. Example: 75% means compute for 3 seconds, wait for 1 second, and repeat. " ) ) ;
2015-02-25 13:21:36 +00:00
wxStaticText * staticText22 = new wxStaticText (
2015-02-13 14:21:14 +00:00
usageLimitsStaticBox , ID_DEFAULT , _ ( " Use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-12 13:48:28 +00:00
2015-03-02 22:49:09 +00:00
m_txtProcUseCPUTime = new wxTextCtrl ( usageLimitsStaticBox , ID_TXTPOCUSECPUTIME , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2015-02-12 13:48:28 +00:00
/*xgettext:no-c-format*/
wxStaticText * staticText23 = new wxStaticText ( usageLimitsStaticBox , ID_DEFAULT , _ ( " % of CPU time " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( usageLimitsBoxSizer , MaxCPUTimeTT , staticText22 , m_txtProcUseCPUTime , staticText23 ) ;
2015-02-12 13:48:28 +00:00
2015-03-02 12:16:13 +00:00
processorTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
processorTabSizer - > Add ( usageLimitsBoxSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
2015-02-12 13:48:28 +00:00
wxStaticBox * suspendComputingStaticBox = new wxStaticBox ( processorTab , - 1 , _ ( " When to suspend " ) ) ;
wxStaticBoxSizer * suspendComputingBoxSizer = new wxStaticBoxSizer ( suspendComputingStaticBox , wxVERTICAL ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( suspendComputingStaticBox ) ;
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 ,
2015-02-18 12:34:31 +00:00
_ ( " Suspend when computer is on battery " ) , wxDefaultPosition , wxDefaultSize , 0
2009-02-13 17:53:10 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_chkProcOnBatteries - > SetToolTip (
2015-02-26 13:31:59 +00:00
_ ( " Check this to suspend computing on portables when running on battery power. " )
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-18 12:34:31 +00:00
_ ( " Suspend 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-26 13:31:59 +00:00
_ ( " Check this to suspend computing and file transfers 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_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 ,
2015-02-18 12:34:31 +00:00
_ ( " Suspend GPU computing 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-26 13:31:59 +00:00
_ ( " Check this to suspend GPU computing 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
2015-02-26 13:31:59 +00:00
wxString ProcIdleForTT ( _ ( " This determines when the computer is considered 'in use'. " ) ) ;
2015-02-25 13:21:36 +00:00
wxStaticText * staticText24 = new wxStaticText (
2015-02-12 13:48:28 +00:00
suspendComputingStaticBox , ID_DEFAULT ,
2015-04-30 20:58:43 +00:00
// context: 'In use' means mouse/keyboard input in last ___ minutes
2015-02-12 13:48:28 +00:00
_ ( " 'In use' means mouse/keyboard input in last " ) ,
2010-02-16 18:38:39 +00:00
wxDefaultPosition , wxDefaultSize , 0
2015-02-25 13:21:36 +00:00
) ;
2010-06-02 17:44:38 +00:00
m_txtProcIdleFor = new wxTextCtrl (
2015-03-02 22:49:09 +00:00
suspendComputingStaticBox , ID_TXTPROCIDLEFOR , wxEmptyString , wxDefaultPosition , getTextCtrlSize ( wxT ( " 999.99 " ) ) , wxTE_RIGHT
2010-02-16 18:38:39 +00:00
) ;
2015-02-28 09:12:05 +00:00
2015-04-30 20:58:43 +00:00
wxStaticText * staticText25 = new wxStaticText (
suspendComputingStaticBox , ID_DEFAULT ,
// context: 'In use' means mouse/keyboard input in last ___ minutes
_ ( " minutes " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2014-11-25 11:24:07 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( suspendComputingBoxSizer , ProcIdleForTT , staticText24 , m_txtProcIdleFor , staticText25 ) ;
2007-04-02 18:04:54 +00:00
2010-02-16 18:38:39 +00:00
// max CPU load
2015-02-26 13:31:59 +00:00
wxString MaxLoadCheckBoxText = wxEmptyString ;
2015-05-01 21:04:25 +00:00
MaxLoadCheckBoxText . Printf ( _ ( " Suspend when non-BOINC CPU usage is above " ) ) ;
2015-02-26 13:31:59 +00:00
wxString MaxLoadTT ( _ ( " Suspend computing when your computer is busy running other programs. " ) ) ;
2015-02-12 13:48:28 +00:00
m_chkMaxLoad = new wxCheckBox (
2015-02-26 13:31:59 +00:00
suspendComputingStaticBox , ID_CHKMAXLOAD , MaxLoadCheckBoxText , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2010-06-02 17:44:38 +00:00
m_txtMaxLoad = new wxTextCtrl (
2015-03-02 22:49:09 +00:00
suspendComputingStaticBox , ID_TXTMAXLOAD , wxEmptyString , wxDefaultPosition , getTextCtrlSize ( wxT ( " 100.00 " ) ) , wxTE_RIGHT
2010-02-16 18:38:39 +00:00
) ;
2015-02-28 09:12:05 +00:00
2015-02-27 21:03:29 +00:00
wxStaticText * staticText26 = new wxStaticText ( suspendComputingStaticBox , ID_DEFAULT , wxT ( " % " ) ,
2015-02-25 13:21:36 +00:00
wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( suspendComputingBoxSizer , MaxLoadTT , m_chkMaxLoad , m_txtMaxLoad , staticText26 ) ;
2015-02-17 12:45:00 +00:00
suspendComputingBoxSizer - > Add (
2015-07-23 20:54:03 +00:00
new wxStaticText ( suspendComputingStaticBox , ID_DEFAULT , _ ( " 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-03-02 12:16:13 +00:00
processorTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
processorTabSizer - > Add ( suspendComputingBoxSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
2014-11-25 09:37:41 +00:00
2015-04-30 20:58:43 +00:00
wxStaticBox * miscProcStaticBox = new wxStaticBox (
processorTab , - 1 ,
// Context: heading for a group of miscellaneous preferences
_ ( " Other " )
) ;
2015-02-14 13:50:07 +00:00
wxStaticBoxSizer * miscProcBoxSizer = new wxStaticBoxSizer ( miscProcStaticBox , wxVERTICAL ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( miscProcStaticBox ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
// buffer sizes
2015-02-26 13:31:59 +00:00
wxString NetConnectIntervalTT ( _ ( " Store at least enough tasks to keep the computer busy for this long. " ) ) ;
2015-02-14 13:50:07 +00:00
wxStaticText * staticText30 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
2015-04-30 20:58:43 +00:00
// context: Store at least ___ days of work
_ ( " Store at least " ) ,
wxDefaultPosition , wxDefaultSize , 0
2015-02-14 13:50:07 +00:00
) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
m_txtNetConnectInterval = new wxTextCtrl (
2015-03-02 22:49:09 +00:00
miscProcStaticBox , ID_TXTNETCONNECTINTERVAL , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT
2015-02-14 13:50:07 +00:00
) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
wxStaticText * staticText31 = new wxStaticText (
2015-04-30 20:58:43 +00:00
miscProcStaticBox , ID_DEFAULT ,
// context: Store at least ___ days of work
_ ( " days of work " ) ,
wxDefaultPosition , wxDefaultSize , 0
2015-02-14 13:50:07 +00:00
) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( miscProcBoxSizer , NetConnectIntervalTT , staticText30 , m_txtNetConnectInterval , staticText31 ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString NetAdditionalDaysTT ( _ ( " Store additional tasks above the minimum level. Determines how much work is requested when contacting a project. " ) ) ;
2015-02-14 13:50:07 +00:00
wxStaticText * staticText331 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
2015-04-30 20:58:43 +00:00
// context: Store up to an additional ___ days of work
_ ( " Store up to an additional " ) ,
wxDefaultPosition , wxDefaultSize , 0
2015-02-14 13:50:07 +00:00
) ;
2015-02-25 13:21:36 +00:00
staticText331 - > SetToolTip ( NetAdditionalDaysTT ) ;
2007-04-02 18:04:54 +00:00
2015-02-14 13:50:07 +00:00
m_txtNetAdditionalDays = new wxTextCtrl (
2015-03-02 22:49:09 +00:00
miscProcStaticBox , ID_TXTNETADDITIONALDAYS , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT
2015-02-14 13:50:07 +00:00
) ;
2007-04-02 18:04:54 +00:00
2015-04-30 20:58:43 +00:00
wxStaticText * staticText341 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
// context: Store up to an additional ___ days of work
_ ( " days of work " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2007-04-02 18:04:54 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( miscProcBoxSizer , NetAdditionalDaysTT , staticText331 , m_txtNetAdditionalDays , staticText341 ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString ProcSwitchEveryTT = wxEmptyString ;
ProcSwitchEveryTT . Printf ( _ ( " If you run several projects, %s may switch between them this often. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-04-30 20:58:43 +00:00
wxStaticText * staticText18 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
// context: Switch between tasks every ___ minutes
_ ( " Switch between tasks every " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2014-07-30 10:42:25 +00:00
2015-03-02 22:49:09 +00:00
m_txtProcSwitchEvery = new wxTextCtrl ( miscProcStaticBox , ID_TXTPROCSWITCHEVERY , wxEmptyString , wxDefaultPosition , getTextCtrlSize ( wxT ( " 9999.99 " ) ) , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2015-04-30 20:58:43 +00:00
wxStaticText * staticText19 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
// context: Switch between tasks every ___ minutes
_ ( " minutes " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( miscProcBoxSizer , ProcSwitchEveryTT , staticText18 , m_txtProcSwitchEvery , staticText19 ) ;
2007-04-02 18:04:54 +00:00
2015-10-09 22:02:42 +00:00
wxString DiskWriteToDiskTT ( _ ( " This controls how often tasks save their state to disk, so that they later can be continued from that point. " ) ) ;
2015-04-30 20:58:43 +00:00
wxStaticText * staticText46 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
// context: Request tasks to checkpoint at most every ___ seconds
_ ( " Request tasks to checkpoint at most every " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2007-04-02 18:04:54 +00:00
2015-03-02 22:49:09 +00:00
m_txtDiskWriteToDisk = new wxTextCtrl ( miscProcStaticBox , ID_TXTDISKWRITETODISK , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2014-11-21 13:32:40 +00:00
2015-04-30 20:58:43 +00:00
wxStaticText * staticText47 = new wxStaticText (
miscProcStaticBox , ID_DEFAULT ,
// context: Request tasks to checkpoint at most every ___ seconds
_ ( " seconds " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2007-04-02 18:04:54 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( miscProcBoxSizer , DiskWriteToDiskTT , staticText46 , m_txtDiskWriteToDisk , staticText47 ) ;
2015-02-28 09:12:05 +00:00
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
2015-03-02 12:16:13 +00:00
processorTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
processorTabSizer - > Add ( miscProcBoxSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
processorTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
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 )
{
2015-02-26 13:31:59 +00:00
CSkinAdvanced * pSkinAdvanced = wxGetApp ( ) . GetSkinManager ( ) - > GetAdvanced ( ) ;
wxASSERT ( pSkinAdvanced ) ;
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 ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( networkUsageLimitsStaticBox ) ;
2007-04-02 18:04:54 +00:00
2010-04-23 21:21:48 +00:00
// upload/download rates
2015-02-26 13:31:59 +00:00
wxString NetDownloadRateTT ( _ ( " Limit the download rate of file transfers. " ) ) ;
2015-02-17 12:45:00 +00:00
m_chkNetDownloadRate = new wxCheckBox ( networkUsageLimitsStaticBox , ID_CHKNETDOWNLOADRATE , _ ( " Limit download rate to " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-26 13:31:59 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetDownloadRate = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETDOWNLOADRATE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2015-02-27 21:03:29 +00:00
wxStaticText * staticText33 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " KB/second " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( networkUsageLimitsBoxSizer , NetDownloadRateTT , m_chkNetDownloadRate , m_txtNetDownloadRate , staticText33 ) ;
2014-11-25 11:24:07 +00:00
2015-02-26 13:31:59 +00:00
wxString NetUploadRateTT ( _ ( " Limit the upload rate of file transfers. " ) ) ;
2015-02-17 12:45:00 +00:00
m_chkNetUploadRate = new wxCheckBox ( networkUsageLimitsStaticBox , ID_CHKNETUPLOADRATE , _ ( " Limit upload rate to " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetUploadRate = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETUPLOADRATE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2015-02-27 21:03:29 +00:00
wxStaticText * staticText35 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " KB/second " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( networkUsageLimitsBoxSizer , NetUploadRateTT , m_chkNetUploadRate , m_txtNetUploadRate , staticText35 ) ;
2007-04-02 18:04:54 +00:00
2014-06-19 11:02:09 +00:00
// long-term quota
2015-02-26 13:31:59 +00:00
wxString daily_xfer_limitTT = wxEmptyString ;
daily_xfer_limitTT . Printf ( _ ( " Example: %s should transfer at most 2000 MB of data every 30 days. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-18 12:34:31 +00:00
m_chk_daily_xfer_limit = new wxCheckBox ( networkUsageLimitsStaticBox , ID_CHKDAILYXFERLIMIT , _ ( " Limit usage to " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-06-19 11:02:09 +00:00
2015-03-02 22:49:09 +00:00
m_txt_daily_xfer_limit_mb = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETDOWNLOADRATE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2014-06-19 11:02:09 +00:00
2015-02-27 21:03:29 +00:00
wxStaticText * staticText_daily_xfer2 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " MB every " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-11-25 11:24:07 +00:00
2015-03-02 22:49:09 +00:00
m_txt_daily_xfer_period_days = new wxTextCtrl ( networkUsageLimitsStaticBox , ID_TXTNETUPLOADRATE , wxEmptyString , wxDefaultPosition , getTextCtrlSize ( wxT ( " 999.99 " ) ) , wxTE_RIGHT ) ;
2014-06-19 11:02:09 +00:00
2015-02-17 12:45:00 +00:00
wxStaticText * staticText_daily_xfer4 = new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " days " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-06-30 23:45:29 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( networkUsageLimitsBoxSizer , daily_xfer_limitTT , m_chk_daily_xfer_limit , m_txt_daily_xfer_limit_mb , staticText_daily_xfer2 , m_txt_daily_xfer_period_days , staticText_daily_xfer4 ) ;
2014-06-30 23:45:29 +00:00
2015-02-17 12:45:00 +00:00
networkUsageLimitsBoxSizer - > Add (
2015-07-23 20:54:03 +00:00
new wxStaticText ( networkUsageLimitsStaticBox , ID_DEFAULT , _ ( " To limit transfers by time of day, see the \" Daily Schedules \" section. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ,
2015-02-17 12:45:00 +00:00
0 , wxALL , 5
) ;
2007-04-02 18:04:54 +00:00
2015-03-02 12:16:13 +00:00
networkTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
networkTabSizer - > Add ( networkUsageLimitsBoxSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
2007-04-02 18:04:54 +00:00
2015-04-30 20:58:43 +00:00
// Context: heading for a group of miscellaneous preferences
wxStaticBox * connectOptionsStaticBox = new wxStaticBox (
networkTab , - 1 ,
// Context: heading for a group of miscellaneous preferences
_ ( " Other " )
) ;
2015-02-17 12:45:00 +00:00
wxStaticBoxSizer * connectOptionsSizer = new wxStaticBoxSizer ( connectOptionsStaticBox , wxVERTICAL ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( connectOptionsStaticBox ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString NetSkipImageVerificationTT = wxEmptyString ;
NetSkipImageVerificationTT . Printf ( _ ( " Check this only if your Internet provider modifies image files. Skipping verification reduces the security of %s. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-17 12:45:00 +00:00
m_chkNetSkipImageVerification = new wxCheckBox ( connectOptionsStaticBox , ID_CHKNETSKIPIMAGEVERIFICATION , _ ( " Skip data verification for image files " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-26 13:31:59 +00:00
m_chkNetSkipImageVerification - > SetToolTip ( NetSkipImageVerificationTT ) ;
2015-02-17 12:45:00 +00:00
connectOptionsSizer - > Add ( m_chkNetSkipImageVerification , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-02-18 12:34:31 +00:00
m_chkNetConfirmBeforeConnect = new wxCheckBox ( connectOptionsStaticBox , ID_CHKNETCONFIRMBEFORECONNECT , _ ( " Confirm before connecting to Internet " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-26 13:31:59 +00:00
m_chkNetConfirmBeforeConnect - > SetToolTip ( _ ( " Useful only if you have a modem, ISDN or VPN connection. " ) ) ;
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 ) ;
2015-02-26 13:31:59 +00:00
m_chkNetDisconnectWhenDone - > SetToolTip ( _ ( " Useful only if you have a modem, ISDN or VPN connection. " ) ) ;
2014-11-25 09:37:41 +00:00
connectOptionsSizer - > Add ( m_chkNetDisconnectWhenDone , 0 , wxALL , 5 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 12:16:13 +00:00
networkTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
networkTabSizer - > Add ( connectOptionsSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
networkTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
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 )
{
2015-02-26 13:31:59 +00:00
CSkinAdvanced * pSkinAdvanced = wxGetApp ( ) . GetSkinManager ( ) - > GetAdvanced ( ) ;
wxASSERT ( pSkinAdvanced ) ;
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
2015-03-02 12:16:13 +00:00
wxBoxSizer * diskAndMemoryTabSizer = 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 ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( diskUsageStaticBox ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString MostRestrictiveText = wxEmptyString ;
2015-03-03 11:26:40 +00:00
MostRestrictiveText . Printf ( _ ( " %s will use the most restrictive of these settings: " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-26 13:31:59 +00:00
diskUsageBoxSizer - > Add ( new wxStaticText ( diskUsageStaticBox , - 1 , MostRestrictiveText , wxDefaultPosition , wxDefaultSize , 0 ) ,
2015-02-17 12:45:00 +00:00
0 , wxALL , 5
) ;
2014-11-25 11:24:07 +00:00
2015-02-26 13:31:59 +00:00
wxString DiskMaxSpaceTT = wxEmptyString ;
DiskMaxSpaceTT . Printf ( _ ( " Limit the total amount of disk space used by %s. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-12 13:48:28 +00:00
m_chkDiskMaxSpace = new wxCheckBox (
2015-02-28 13:51:59 +00:00
diskUsageStaticBox , ID_CHKDISKMAXSPACE , _ ( " Use no more than " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 22:49:09 +00:00
m_txtDiskMaxSpace = new wxTextCtrl ( diskUsageStaticBox , ID_TXTDISKMAXSPACE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2015-02-27 21:03:29 +00:00
wxStaticText * staticText41 = new wxStaticText ( diskUsageStaticBox , ID_DEFAULT , _ ( " GB " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( diskUsageBoxSizer , DiskMaxSpaceTT , m_chkDiskMaxSpace , m_txtDiskMaxSpace , staticText41 ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString DiskLeastFreeTT = wxEmptyString ;
DiskLeastFreeTT . Printf ( _ ( " Limit disk usage to leave this much free space on the volume where %s stores data. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-12 13:48:28 +00:00
m_chkDiskLeastFree = new wxCheckBox (
2015-02-28 13:51:59 +00:00
diskUsageStaticBox , ID_CHKDISKLEASTFREE , _ ( " Leave at least " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 22:49:09 +00:00
m_txtDiskLeastFree = new wxTextCtrl ( diskUsageStaticBox , ID_TXTDISKLEASTFREE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2015-02-27 21:03:29 +00:00
wxStaticText * staticText43 = new wxStaticText ( diskUsageStaticBox , ID_DEFAULT , _ ( " GB free " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( diskUsageBoxSizer , DiskLeastFreeTT , m_chkDiskLeastFree , m_txtDiskLeastFree , staticText43 ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString DiskMaxOfTotalTT = wxEmptyString ;
DiskMaxOfTotalTT . Printf ( _ ( " Limit the percentage of disk space used by %s on the volume where it stores data. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-12 13:48:28 +00:00
m_chkDiskMaxOfTotal = new wxCheckBox (
2015-02-28 13:51:59 +00:00
diskUsageStaticBox , ID_CHKDISKMAXOFTOTAL , _ ( " Use no more than " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 22:49:09 +00:00
m_txtDiskMaxOfTotal = new wxTextCtrl ( diskUsageStaticBox , ID_TXTDISKMAXOFTOTAL , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2008-02-25 20:11:30 +00:00
/*xgettext:no-c-format*/
2015-02-18 12:34:31 +00:00
wxStaticText * staticText45 = new wxStaticText ( diskUsageStaticBox , ID_DEFAULT , _ ( " % of total " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2014-11-25 11:24:07 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( diskUsageBoxSizer , DiskMaxOfTotalTT , m_chkDiskMaxOfTotal , m_txtDiskMaxOfTotal , staticText45 ) ;
2015-02-28 09:12:05 +00:00
2015-03-02 12:16:13 +00:00
diskAndMemoryTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
diskAndMemoryTabSizer - > Add ( diskUsageBoxSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
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 ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( memoryUsageStaticBox ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString MemoryMaxInUseTT = wxEmptyString ;
MemoryMaxInUseTT . Printf ( _ ( " Limit the memory used by %s when you're using the computer. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-28 13:51:59 +00:00
wxStaticText * staticText50 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " When computer is in use, use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2014-07-30 10:42:25 +00:00
textCtrlSize = getTextCtrlSize ( wxT ( " 100.00 " ) ) ;
2015-03-02 22:49:09 +00:00
m_txtMemoryMaxInUse = new wxTextCtrl ( memoryUsageStaticBox , ID_TXTMEMORYMAXINUSE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2009-02-25 17:51:32 +00:00
/*xgettext:no-c-format*/
2015-02-18 12:34:31 +00:00
wxStaticText * staticText51 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " % " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( memoryUsageBoxSizer , MemoryMaxInUseTT , staticText50 , m_txtMemoryMaxInUse , staticText51 ) ;
2007-04-02 18:04:54 +00:00
2015-02-26 13:31:59 +00:00
wxString MemoryMaxOnIdleTT = wxEmptyString ;
MemoryMaxOnIdleTT . Printf ( _ ( " Limit the memory used by %s when you're not using the computer. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-28 13:51:59 +00:00
wxStaticText * staticText52 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " When computer is not in use, use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 22:49:09 +00:00
m_txtMemoryMaxOnIdle = new wxTextCtrl ( memoryUsageStaticBox , ID_TXTMEMORYMAXONIDLE , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2007-04-02 18:04:54 +00:00
2014-11-25 11:24:07 +00:00
/*xgettext:no-c-format*/
2015-02-18 12:34:31 +00:00
wxStaticText * staticText53 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " % " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-28 09:12:05 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( memoryUsageBoxSizer , MemoryMaxOnIdleTT , staticText52 , m_txtMemoryMaxOnIdle , staticText53 ) ;
2007-04-02 18:04:54 +00:00
2015-02-27 10:55:39 +00:00
m_chkMemoryWhileSuspended = new wxCheckBox ( memoryUsageStaticBox , ID_CHKMEMORYWHILESUSPENDED , _ ( " Leave non-GPU tasks in memory while suspended " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_chkMemoryWhileSuspended - > SetToolTip ( _ ( " If checked, suspended tasks stay in memory, and resume with no work lost. If unchecked, suspended tasks are removed from memory, and resume from their last checkpoint. " ) ) ;
2015-02-28 09:12:05 +00:00
memoryUsageBoxSizer - > Add ( m_chkMemoryWhileSuspended , 0 , wxALL , 5 ) ;
2015-02-27 10:55:39 +00:00
2015-02-26 13:31:59 +00:00
wxString DiskMaxSwapTT = wxEmptyString ;
DiskMaxSwapTT . Printf ( _ ( " Limit the swap space (page file) used by %s. " ) , pSkinAdvanced - > GetApplicationShortName ( ) . c_str ( ) ) ;
2015-02-28 13:51:59 +00:00
wxStaticText * staticText48 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " Page/swap file: use at most " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
2015-03-02 22:49:09 +00:00
m_txtDiskMaxSwap = new wxTextCtrl ( memoryUsageStaticBox , ID_TXTDISKWRITETODISK , wxEmptyString , wxDefaultPosition , textCtrlSize , wxTE_RIGHT ) ;
2015-02-17 12:45:00 +00:00
2015-02-26 13:31:59 +00:00
/*xgettext:no-c-format*/
2015-02-18 12:34:31 +00:00
wxStaticText * staticText49 = new wxStaticText ( memoryUsageStaticBox , ID_DEFAULT , _ ( " % " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-17 12:45:00 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( memoryUsageBoxSizer , DiskMaxSwapTT , staticText48 , m_txtDiskMaxSwap , staticText49 ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 12:16:13 +00:00
diskAndMemoryTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
diskAndMemoryTabSizer - > Add ( memoryUsageBoxSizer , 0 , wxLEFT | wxRIGHT | wxEXPAND , STATICBOXBORDERSIZE ) ;
diskAndMemoryTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
2007-04-02 18:04:54 +00:00
2015-03-02 12:16:13 +00:00
diskMemoryTab - > SetSizer ( diskAndMemoryTabSizer ) ;
2010-06-02 17:44:38 +00:00
diskMemoryTab - > Layout ( ) ;
2015-03-02 12:16:13 +00:00
diskAndMemoryTabSizer - > 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 )
{
2015-02-28 13:51:59 +00:00
wxSize textCtrlSize = getTextCtrlSize ( wxT ( " 23:59 " ) ) ;
2015-02-28 09:12:05 +00:00
wxString andString ( _ ( " and " ) ) ;
2015-02-27 21:03:29 +00:00
wxString toString ( wxT ( " " ) + _ ( " to " ) + wxT ( " " ) ) ;
2015-02-25 13:21:36 +00:00
2015-06-22 06:44:08 +00:00
wxPanel * dailySchedulesTab = new wxPanel (
notebook , ID_TABPAGE_SCHED , wxDefaultPosition ,
wxDefaultSize , wxTAB_TRAVERSAL
) ;
2015-02-14 13:50:07 +00:00
dailySchedulesTab - > SetExtraStyle ( wxWS_EX_VALIDATE_RECURSIVELY ) ;
wxBoxSizer * dailySchedulesTabSizer = new wxBoxSizer ( wxVERTICAL ) ;
// Computing schedule
//
2015-06-22 06:44:08 +00:00
wxStaticBox * computingTimesStaticBox = new wxStaticBox (
dailySchedulesTab , - 1 , _ ( " Computing " )
) ;
wxStaticBoxSizer * computingTimesStaticBoxSizer = new wxStaticBoxSizer (
computingTimesStaticBox , wxVERTICAL
) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( computingTimesStaticBox ) ;
2015-03-03 18:03:27 +00:00
wxString ProcEveryDayTT ( _ ( " Compute only during a particular period each day. " ) ) ;
2015-02-14 13:50:07 +00:00
m_chkProcEveryDay = new wxCheckBox (
computingTimesStaticBox , ID_CHKPROCEVERYDAY ,
2015-06-22 06:44:08 +00:00
_ ( " Compute only between " ) , wxDefaultPosition , wxDefaultSize , 0
) ;
2015-02-14 13:50:07 +00:00
2015-06-22 06:44:08 +00:00
m_txtProcEveryDayStart = new wxTextCtrl (
computingTimesStaticBox , ID_TXTPROCEVERYDAYSTART , wxEmptyString ,
wxDefaultPosition , textCtrlSize , wxTE_RIGHT
) ;
2015-02-14 13:50:07 +00:00
2015-06-22 06:44:08 +00:00
wxStaticText * staticText25 = new wxStaticText (
computingTimesStaticBox , ID_DEFAULT , andString , wxDefaultPosition ,
wxDefaultSize , wxALIGN_CENTRE
) ;
2015-02-14 13:50:07 +00:00
2015-06-22 06:44:08 +00:00
m_txtProcEveryDayStop = new wxTextCtrl (
computingTimesStaticBox , ID_TXTPROCEVERYDAYSTOP , wxEmptyString ,
wxDefaultPosition , textCtrlSize , wxTE_RIGHT
) ;
2015-02-14 13:50:07 +00:00
2015-06-22 06:44:08 +00:00
addNewRowToSizer (
computingTimesStaticBoxSizer , ProcEveryDayTT , m_chkProcEveryDay ,
m_txtProcEveryDayStart , staticText25 , m_txtProcEveryDayStop
) ;
2015-02-14 13:50:07 +00:00
2015-06-22 06:44:08 +00:00
wxStaticBox * procSpecialTimesStaticBox = new wxStaticBox (
computingTimesStaticBox , - 1 , _ ( " Day-of-week override " )
) ;
wxStaticBoxSizer * procSpecialTimesStaticBoxSizer = new wxStaticBoxSizer (
procSpecialTimesStaticBox , wxVERTICAL
) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( procSpecialTimesStaticBox ) ;
2015-02-17 14:22:00 +00:00
2015-06-22 06:44:08 +00:00
wxStaticText * staticText36 = new wxStaticText (
procSpecialTimesStaticBox , ID_DEFAULT ,
_ ( " Override the times above on the selected days: " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2015-03-02 12:16:13 +00:00
# ifdef __WXMAC__
procSpecialTimesStaticBoxSizer - > Add ( staticText36 , 0 , wxLEFT , 5 ) ;
# else
procSpecialTimesStaticBoxSizer - > Add ( staticText36 , 0 , wxLEFT , DAYOFWEEKBORDERSIZE ) ;
# endif
2015-02-17 12:45:00 +00:00
2015-02-26 13:31:59 +00:00
procSpecialTimesStaticBoxSizer - > AddSpacer ( 3 ) ;
// procSpecialTimesStaticBox->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-17 14:22:00 +00:00
2015-02-25 13:21:36 +00:00
wxFlexGridSizer * procDaysSizer = new wxFlexGridSizer ( 4 , 9 , 0 , 0 ) ;
2015-02-14 13:50:07 +00:00
procDaysSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
procDaysSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2015-06-22 06:44:08 +00:00
// Tooltips for Day-of-Week override wxCheckBoxes and wxTextCtrls
// are set in CDlgAdvPreferences::SetSpecialTooltips()
//
2015-02-27 10:21:51 +00:00
wxString procDaysTimeTT ( PROC_DAY_OF_WEEK_TOOLTIP_TEXT ) ;
2015-06-22 06:44:08 +00:00
m_chkProcMonday = new wxCheckBox (
procSpecialTimesStaticBox , ID_CHKPROCMONDAY , _ ( " Monday " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_chkProcMonday , 0 , wxTOP , 5 ) ;
2015-02-25 13:21:36 +00:00
2015-06-22 06:44:08 +00:00
m_txtProcMondayStart = new wxTextCtrl (
procSpecialTimesStaticBox , ID_TXTPROCMONDAYSTART , wxEmptyString ,
wxDefaultPosition , textCtrlSize , 0
) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcMondayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
2015-06-22 06:44:08 +00:00
wxStaticText * toStringProcMonday = new wxStaticText (
procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition ,
wxDefaultSize , 0
) ;
2015-02-27 10:21:51 +00:00
toStringProcMonday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcMonday , 0 , wxTOP , 5 ) ;
2015-06-22 06:44:08 +00:00
m_txtProcMondayStop = new wxTextCtrl (
procSpecialTimesStaticBox , ID_TXTPROCMONDAYSTOP , wxEmptyString ,
wxDefaultPosition , textCtrlSize , 0
) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcMondayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-25 13:21:36 +00:00
procDaysSizer - > AddSpacer ( 15 ) ;
2015-02-14 13:50:07 +00:00
2015-06-22 06:44:08 +00:00
m_chkProcFriday = new wxCheckBox (
procSpecialTimesStaticBox , ID_CHKPROCFRIDAY , _ ( " Friday " ) ,
wxDefaultPosition , wxDefaultSize , 0
) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_chkProcFriday , 0 , wxTOP , 5 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtProcFridayStart = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCFRIDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcFridayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringProcFriday = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringProcFriday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcFriday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcFridayStop = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCFRIDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcFridayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 12:16:13 +00:00
m_chkProcTuesday = new wxCheckBox ( procSpecialTimesStaticBox , ID_CHKPROCTUESDAY , _ ( " Tuesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
procDaysSizer - > Add ( m_chkProcTuesday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcTuesdayStart = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCTUESDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_txtProcTuesdayStart , 0 , wxALL , 1 ) ;
wxStaticText * toStringProcTuesday = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringProcTuesday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcTuesday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcTuesdayStop = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCTUESDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_txtProcTuesdayStop , 0 , wxALL , 1 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > AddSpacer ( 15 ) ;
2015-02-14 13:50:07 +00:00
2015-02-25 13:21:36 +00:00
m_chkProcSaturday = new wxCheckBox ( procSpecialTimesStaticBox , ID_CHKPROCSATURDAY , _ ( " Saturday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_chkProcSaturday , 0 , wxTOP , 5 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtProcSaturdayStart = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCSATURDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcSaturdayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringProcSaturday = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringProcSaturday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcSaturday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcSaturdayStop = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCSATURDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcSaturdayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 12:16:13 +00:00
m_chkProcWednesday = new wxCheckBox ( procSpecialTimesStaticBox , ID_CHKPROCWEDNESDAY , _ ( " Wednesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
procDaysSizer - > Add ( m_chkProcWednesday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcWednesdayStart = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCWEDNESDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_txtProcWednesdayStart , 0 , wxALL , 1 ) ;
wxStaticText * toStringProcWednesday = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringProcWednesday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcWednesday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcWednesdayStop = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCWEDNESDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_txtProcWednesdayStop , 0 , wxALL , 1 ) ;
procDaysSizer - > AddSpacer ( 15 ) ;
2015-02-25 13:21:36 +00:00
m_chkProcSunday = new wxCheckBox ( procSpecialTimesStaticBox , ID_CHKPROCSUNDAY , _ ( " Sunday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_chkProcSunday , 0 , wxTOP , 5 ) ;
2015-02-25 13:21:36 +00:00
2015-03-02 22:49:09 +00:00
m_txtProcSundayStart = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCSUNDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcSundayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringProcSunday = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringProcSunday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcSunday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcSundayStop = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCSUNDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
procDaysSizer - > Add ( m_txtProcSundayStop , 0 , wxALL , 1 ) ;
2015-03-02 12:16:13 +00:00
m_chkProcThursday = new wxCheckBox ( procSpecialTimesStaticBox , ID_CHKPROCTHURSDAY , _ ( " Thursday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
procDaysSizer - > Add ( m_chkProcThursday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcThursdayStart = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCTHURSDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_txtProcThursdayStart , 0 , wxALL , 1 ) ;
wxStaticText * toStringProcThursday = new wxStaticText ( procSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringProcThursday - > SetToolTip ( procDaysTimeTT ) ;
procDaysSizer - > Add ( toStringProcThursday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtProcThursdayStop = new wxTextCtrl ( procSpecialTimesStaticBox , ID_TXTPROCTHURSDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
procDaysSizer - > Add ( m_txtProcThursdayStop , 0 , wxALL , 1 ) ;
2015-02-17 14:22:00 +00:00
2015-03-02 12:16:13 +00:00
# ifdef __WXMAC__
2015-06-22 06:44:08 +00:00
procSpecialTimesStaticBoxSizer - > Add (
procDaysSizer , 0 , wxRIGHT | wxBOTTOM , DAYOFWEEKBORDERSIZE
) ;
computingTimesStaticBoxSizer - > Add (
procSpecialTimesStaticBoxSizer , 0 , wxRIGHT | wxBOTTOM ,
STATICBOXBORDERSIZE + 3
) ;
2015-03-02 12:16:13 +00:00
# else
2015-06-22 06:44:08 +00:00
procSpecialTimesStaticBoxSizer - > Add (
procDaysSizer , 1 , wxRIGHT | wxLEFT | wxBOTTOM , DAYOFWEEKBORDERSIZE
) ;
computingTimesStaticBoxSizer - > Add (
procSpecialTimesStaticBoxSizer , 1 , wxRIGHT | wxLEFT | wxBOTTOM ,
STATICBOXBORDERSIZE
) ;
2015-03-02 12:16:13 +00:00
# endif
dailySchedulesTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
2015-06-22 06:44:08 +00:00
dailySchedulesTabSizer - > Add (
computingTimesStaticBoxSizer , 1 , wxRIGHT | wxLEFT | wxEXPAND ,
STATICBOXBORDERSIZE
) ;
2015-02-14 13:50:07 +00:00
// Network schedule
//
2015-02-27 21:03:29 +00:00
wxStaticBox * networkTimesStaticBox = new wxStaticBox ( dailySchedulesTab , - 1 , _ ( " Network " ) ) ;
2015-02-14 13:50:07 +00:00
wxStaticBoxSizer * networkTimesBoxSizer = new wxStaticBoxSizer ( networkTimesStaticBox , wxVERTICAL ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( networkTimesStaticBox ) ;
2015-02-14 13:50:07 +00:00
2015-03-03 18:03:27 +00:00
wxString NetEveryDayTT ( _ ( " Transfer files only during a particular period each day. " ) ) ;
2015-02-17 12:45:00 +00:00
m_chkNetEveryDay = new wxCheckBox (
2015-02-27 21:03:29 +00:00
networkTimesStaticBox , ID_CHKNETEVERYDAY , _ ( " Transfer files only between " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetEveryDayStart = new wxTextCtrl ( networkTimesStaticBox , ID_TXTNETEVERYDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-14 13:50:07 +00:00
2015-02-28 09:12:05 +00:00
wxStaticText * staticText37 = new wxStaticText ( networkTimesStaticBox , ID_DEFAULT , andString , wxDefaultPosition , wxDefaultSize , wxALIGN_CENTRE ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetEveryDayStop = new wxTextCtrl ( networkTimesStaticBox , ID_TXTNETEVERYDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-14 13:50:07 +00:00
2015-02-28 14:29:27 +00:00
addNewRowToSizer ( networkTimesBoxSizer , NetEveryDayTT , m_chkNetEveryDay , m_txtNetEveryDayStart , staticText37 , m_txtNetEveryDayStop ) ;
2015-02-14 13:50:07 +00:00
2015-02-18 12:34:31 +00:00
wxStaticBox * netSpecialTimesStaticBox = new wxStaticBox ( networkTimesStaticBox , - 1 , _ ( " Day-of-week override " ) ) ;
2015-02-17 12:45:00 +00:00
wxStaticBoxSizer * netSpecialTimesStaticBoxSizer = new wxStaticBoxSizer ( netSpecialTimesStaticBox , wxVERTICAL ) ;
2015-02-18 12:34:31 +00:00
makeStaticBoxLabelItalic ( netSpecialTimesStaticBox ) ;
2015-02-17 12:45:00 +00:00
2015-03-02 12:16:13 +00:00
wxStaticText * staticText39 = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , _ ( " Override the times above on the selected days: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
# ifdef __WXMAC__
netSpecialTimesStaticBoxSizer - > Add ( staticText39 , 0 , wxLEFT , 5 ) ;
# else
netSpecialTimesStaticBoxSizer - > Add ( staticText39 , 0 , wxLEFT , DAYOFWEEKBORDERSIZE ) ;
# endif
2015-02-26 13:31:59 +00:00
netSpecialTimesStaticBoxSizer - > AddSpacer ( 3 ) ;
// netSpecialTimesStaticBox->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-17 14:22:00 +00:00
2015-02-26 13:31:59 +00:00
// Tooltips for Day-of-Week overrides are set in CDlgAdvPreferences::SetSpecialTooltips()
2015-02-27 10:21:51 +00:00
wxString netDaysTimeTT ( NET_DAY_OF_WEEK_TOOLTIP_TEXT ) ;
2015-02-25 13:21:36 +00:00
wxFlexGridSizer * netDaysGridSizer = new wxFlexGridSizer ( 4 , 9 , 0 , 0 ) ;
2015-02-14 13:50:07 +00:00
netDaysGridSizer - > SetFlexibleDirection ( wxHORIZONTAL ) ;
netDaysGridSizer - > SetNonFlexibleGrowMode ( wxFLEX_GROWMODE_SPECIFIED ) ;
2015-02-25 13:21:36 +00:00
m_chkNetMonday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETMONDAY , _ ( " Monday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_chkNetMonday , 0 , wxTOP , 5 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetMondayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETMONDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetMondayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringNetMonday = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetMonday - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetMonday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetMondayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETMONDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetMondayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > AddSpacer ( 15 ) ;
2015-03-02 12:16:13 +00:00
m_chkNetFriday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETFRIDAY , _ ( " Friday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
netDaysGridSizer - > Add ( m_chkNetFriday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetFridayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETFRIDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_txtNetFridayStart , 0 , wxALL , 1 ) ;
wxStaticText * toStringNetFriday = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetFriday - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetFriday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetFridayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETFRIDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_txtNetFridayStop , 0 , wxALL , 1 ) ;
2015-02-25 13:21:36 +00:00
m_chkNetTuesday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETTUESDAY , _ ( " Tuesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_chkNetTuesday , 0 , wxTOP , 5 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetTuesdayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETTUESDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetTuesdayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringNetTuesay = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetTuesay - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetTuesay , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetTuesdayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETTUESDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetTuesdayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > AddSpacer ( 15 ) ;
2015-02-14 13:50:07 +00:00
2015-02-25 13:21:36 +00:00
m_chkNetSaturday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETSATURDAY , _ ( " Saturday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_chkNetSaturday , 0 , wxTOP , 5 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetSaturdayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETSATURDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetSaturdayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringNetSaturday = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetSaturday - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetSaturday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetSaturdayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETSATURDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetSaturdayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 12:16:13 +00:00
m_chkNetWednesday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETWEDNESDAY , _ ( " Wednesday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
netDaysGridSizer - > Add ( m_chkNetWednesday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetWednesdayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETWEDNESDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_txtNetWednesdayStart , 0 , wxALL , 1 ) ;
wxStaticText * toStringNetWednesday = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetWednesday - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetWednesday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetWednesdayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETWEDNESDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_txtNetWednesdayStop , 0 , wxALL , 1 ) ;
netDaysGridSizer - > AddSpacer ( 15 ) ;
2015-02-25 13:21:36 +00:00
m_chkNetSunday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETSUNDAY , _ ( " Sunday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_chkNetSunday , 0 , wxTOP , 5 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 22:49:09 +00:00
m_txtNetSundayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETSUNDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetSundayStart , 0 , wxALL , 1 ) ;
2015-02-27 10:21:51 +00:00
wxStaticText * toStringNetSunday = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetSunday - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetSunday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetSundayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETSUNDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-02-25 13:21:36 +00:00
netDaysGridSizer - > Add ( m_txtNetSundayStop , 0 , wxALL , 1 ) ;
2015-02-14 13:50:07 +00:00
2015-03-02 12:16:13 +00:00
m_chkNetThursday = new wxCheckBox ( netSpecialTimesStaticBox , ID_CHKNETTHURSDAY , _ ( " Thursday " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
netDaysGridSizer - > Add ( m_chkNetThursday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetThursdayStart = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETTHURSDAYSTART , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_txtNetThursdayStart , 0 , wxALL , 1 ) ;
wxStaticText * toStringNetThursday = new wxStaticText ( netSpecialTimesStaticBox , ID_DEFAULT , toString , wxDefaultPosition , wxDefaultSize , 0 ) ;
toStringNetThursday - > SetToolTip ( netDaysTimeTT ) ;
netDaysGridSizer - > Add ( toStringNetThursday , 0 , wxTOP , 5 ) ;
2015-03-02 22:49:09 +00:00
m_txtNetThursdayStop = new wxTextCtrl ( netSpecialTimesStaticBox , ID_TXTNETTHURSDAYSTOP , wxEmptyString , wxDefaultPosition , textCtrlSize , 0 ) ;
2015-03-02 12:16:13 +00:00
netDaysGridSizer - > Add ( m_txtNetThursdayStop , 0 , wxALL , 1 ) ;
# ifdef __WXMAC__
netSpecialTimesStaticBoxSizer - > Add ( netDaysGridSizer , 1 , wxRIGHT | wxBOTTOM , DAYOFWEEKBORDERSIZE ) ;
networkTimesBoxSizer - > Add ( netSpecialTimesStaticBoxSizer , 1 , wxRIGHT | wxBOTTOM , STATICBOXBORDERSIZE + 3 ) ;
# else
netSpecialTimesStaticBoxSizer - > Add ( netDaysGridSizer , 1 , wxRIGHT | wxLEFT | wxBOTTOM , DAYOFWEEKBORDERSIZE ) ;
networkTimesBoxSizer - > Add ( netSpecialTimesStaticBoxSizer , 1 , wxRIGHT | wxLEFT | wxBOTTOM , STATICBOXBORDERSIZE ) ;
# endif
dailySchedulesTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
dailySchedulesTabSizer - > Add ( networkTimesBoxSizer , 1 , wxRIGHT | wxLEFT | wxEXPAND , STATICBOXBORDERSIZE ) ;
dailySchedulesTabSizer - > AddSpacer ( STATICBOXVERTICALSPACER ) ;
2015-02-14 13:50:07 +00:00
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 ) ;
2015-04-08 10:03:26 +00:00
if ( retval ) {
web_prefs_url = new wxString ( wxEmptyString ) ;
} else {
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 ) ;
}
2014-11-25 12:59:38 +00:00
return local_prefs_found ;
}
2015-02-18 12:34:31 +00:00
void CDlgAdvPreferencesBase : : makeStaticBoxLabelItalic ( wxStaticBox * staticBox ) {
# if defined(__WXMSW__) || defined(__WXGTK__)
wxFont myFont = staticBox - > GetFont ( ) ;
myFont . MakeItalic ( ) ;
myFont . MakeBold ( ) ;
staticBox - > SetOwnFont ( myFont ) ;
# endif
}