| 1004 | } |
| 1005 | |
| 1006 | bool TimerRecordDialog::TransferDataFromWindow() |
| 1007 | { |
| 1008 | double dTime; |
| 1009 | long hr; |
| 1010 | long min; |
| 1011 | long sec; |
| 1012 | |
| 1013 | m_DateTime_Start = m_pDatePickerCtrl_Start->GetValue(); |
| 1014 | dTime = m_pTimeTextCtrl_Start->GetValue(); |
| 1015 | hr = (long)(dTime / 3600.0); |
| 1016 | min = (long)((dTime - (hr * 3600.0)) / 60.0); |
| 1017 | sec = (long)(dTime - (hr * 3600.0) - (min * 60.0)); |
| 1018 | m_DateTime_Start.SetHour(hr); |
| 1019 | m_DateTime_Start.SetMinute(min); |
| 1020 | m_DateTime_Start.SetSecond(sec); |
| 1021 | |
| 1022 | m_DateTime_End = m_pDatePickerCtrl_End->GetValue(); |
| 1023 | dTime = m_pTimeTextCtrl_End->GetValue(); |
| 1024 | hr = (long)(dTime / 3600.0); |
| 1025 | min = (long)((dTime - (hr * 3600.0)) / 60.0); |
| 1026 | sec = (long)(dTime - (hr * 3600.0) - (min * 60.0)); |
| 1027 | m_DateTime_End.SetHour(hr); |
| 1028 | m_DateTime_End.SetMinute(min); |
| 1029 | m_DateTime_End.SetSecond(sec); |
| 1030 | |
| 1031 | m_TimeSpan_Duration = m_DateTime_End - m_DateTime_Start; |
| 1032 | |
| 1033 | // Pull the settings from the auto save/export controls and write to the pref file |
| 1034 | m_bAutoSaveEnabled = m_pTimerAutoSaveCheckBoxCtrl->GetValue(); |
| 1035 | m_bAutoExportEnabled = m_pTimerAutoExportCheckBoxCtrl->GetValue(); |
| 1036 | |
| 1037 | // MY: Obtain the index from the choice control so we can save to the prefs file |
| 1038 | int iPostRecordAction = m_pTimerAfterCompleteChoiceCtrl->GetSelection(); |
| 1039 | |
| 1040 | // Save the options back to the prefs file |
| 1041 | gPrefs->Write("/TimerRecord/AutoSave", m_bAutoSaveEnabled); |
| 1042 | gPrefs->Write("/TimerRecord/AutoExport", m_bAutoExportEnabled); |
| 1043 | gPrefs->Write("/TimerRecord/PostAction", iPostRecordAction); |
| 1044 | |
| 1045 | return true; |
| 1046 | } |
| 1047 | |
| 1048 | // Update m_TimeSpan_Duration and ctrl based on m_DateTime_Start and m_DateTime_End. |
| 1049 | void TimerRecordDialog::UpdateDuration() |
no test coverage detected