Fix date and time handling for custom RTC in WX.

The actual problem was combining the values from the date and time
pickers incorrectly. The uninteresting parts of the returned wxDateTime
need to be ignored and the WX documentation says so for the time picker.

I also cleaned up the handling of both widgets a bit, removing redundant
member variables in the process, in order to not risk correctness.
This commit is contained in:
Niels Boehm
2017-07-06 16:19:08 +02:00
parent 29cc009706
commit ee9fb47c53
2 changed files with 45 additions and 28 deletions

View File

@ -11,6 +11,8 @@
class DolphinSlider;
class wxCheckBox;
class wxDateEvent;
class wxDateTime;
class wxDatePickerCtrl;
class wxStaticText;
class wxTimePickerCtrl;
@ -31,16 +33,14 @@ private:
void OnClockOverrideCheckBoxChanged(wxCommandEvent&);
void OnClockOverrideSliderChanged(wxCommandEvent&);
void OnCustomRTCCheckBoxChanged(wxCommandEvent&);
void OnCustomRTCDateChanged(wxCommandEvent&);
void OnCustomRTCTimeChanged(wxCommandEvent&);
void OnCustomRTCDateChanged(wxDateEvent&);
void OnCustomRTCTimeChanged(wxDateEvent&);
void UpdateCPUClock();
// Custom RTC
void LoadCustomRTC();
void UpdateCustomRTC(time_t date, time_t time);
u32 m_temp_date;
u32 m_temp_time;
void UpdateCustomRTC(const wxDateTime&);
wxCheckBox* m_clock_override_checkbox;
DolphinSlider* m_clock_override_slider;