2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2007-01-17 18:13:33 +00:00
|
|
|
// 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
|
|
|
//
|
2008-08-06 18:36:30 +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.
|
2007-01-17 18:13:33 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2007-01-17 18:13:33 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2007-01-17 18:13:33 +00:00
|
|
|
//
|
|
|
|
#ifndef _DLGADVPREFERENCES_H_
|
|
|
|
#define _DLGADVPREFERENCES_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "DlgAdvPreferences.cpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include "DlgAdvPreferencesBase.h"
|
|
|
|
#include "prefs.h"
|
2011-04-29 12:04:07 +00:00
|
|
|
#include "cc_config.h"
|
2007-01-17 18:13:33 +00:00
|
|
|
|
|
|
|
class CDlgAdvPreferences : public CDlgAdvPreferencesBase {
|
|
|
|
DECLARE_DYNAMIC_CLASS( CDlgAdvPreferences )
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
void ReadPreferenceSettings();
|
|
|
|
bool SavePreferencesSettings();
|
|
|
|
void UpdateControlStates();
|
|
|
|
void SetSpecialTooltips();
|
|
|
|
bool SaveState();
|
|
|
|
bool RestoreState();
|
|
|
|
bool ValidateInput();
|
|
|
|
void SetValidators();
|
|
|
|
bool IsValidFloatChar(const wxChar& ch);
|
2014-06-19 11:02:09 +00:00
|
|
|
bool IsValidFloatValue(const wxString& value, bool allowNegative=false);
|
2014-06-20 11:48:05 +00:00
|
|
|
bool IsValidFloatValueBetween(const wxString& value, double minVal, double maxVal);
|
2007-01-17 18:13:33 +00:00
|
|
|
bool IsValidTimeChar(const wxChar& ch);
|
|
|
|
bool IsValidTimeValue(const wxString& value);
|
2007-04-02 18:04:54 +00:00
|
|
|
void ShowErrorMessage(wxString& msg,wxTextCtrl* errorCtrl);
|
2007-01-17 18:13:33 +00:00
|
|
|
bool EnsureTabPageVisible(wxTextCtrl* txtCtrl);
|
2007-01-19 00:59:31 +00:00
|
|
|
bool ConfirmClear();
|
2014-11-25 09:37:41 +00:00
|
|
|
wxString DoubleToTimeString(double dt);
|
2007-03-27 17:42:45 +00:00
|
|
|
double TimeStringToDouble(wxString timeStr);
|
2014-06-19 11:02:09 +00:00
|
|
|
double RoundToHundredths(double td);
|
2007-01-17 18:13:33 +00:00
|
|
|
public:
|
|
|
|
CDlgAdvPreferences(wxWindow* parent=NULL);//to act as standard constructor set a default value
|
|
|
|
virtual ~CDlgAdvPreferences();
|
|
|
|
//generic event handler
|
|
|
|
void OnHandleCommandEvent(wxCommandEvent& ev);
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
void OnHelp(wxCommandEvent& event);
|
2007-01-19 00:59:31 +00:00
|
|
|
void OnClear(wxCommandEvent& event);
|
2015-03-02 07:22:26 +00:00
|
|
|
void DisplayValue(double value, wxTextCtrl* textCtrl, wxCheckBox* checkBox=NULL);
|
2015-04-08 10:03:26 +00:00
|
|
|
bool OKToShow() { return m_bOKToShow; }
|
2007-01-17 18:13:33 +00:00
|
|
|
private:
|
|
|
|
GLOBAL_PREFS prefs;
|
|
|
|
GLOBAL_PREFS_MASK mask;
|
2015-02-13 14:21:14 +00:00
|
|
|
GLOBAL_PREFS defaultPrefs;
|
2011-04-29 12:04:07 +00:00
|
|
|
LOG_FLAGS log_flags;
|
2014-05-08 08:05:11 +00:00
|
|
|
CC_CONFIG config;
|
2007-01-17 18:13:33 +00:00
|
|
|
wxArrayInt m_arrTabPageIds;
|
2015-02-25 13:21:36 +00:00
|
|
|
wxTextValidator* m_vTimeValidator;
|
2015-02-14 13:50:07 +00:00
|
|
|
wxCheckBox* procDayChks[7];
|
2015-02-25 13:21:36 +00:00
|
|
|
wxTextCtrl* procDayStartTxts[7];
|
|
|
|
wxTextCtrl* procDayStopTxts[7];
|
2015-02-14 13:50:07 +00:00
|
|
|
wxCheckBox* netDayChks[7];
|
2015-02-25 13:21:36 +00:00
|
|
|
wxTextCtrl* netDayStartTxts[7];
|
|
|
|
wxTextCtrl* netDayStopTxts[7];
|
2015-04-08 10:03:26 +00:00
|
|
|
bool m_bOKToShow;
|
2007-01-17 18:13:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _DLGADVPREFERENCES_H_
|
2007-03-27 17:42:45 +00:00
|
|
|
|