From 6756c75ad584ee6b9a0f847423841c19f56460e6 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 7 Nov 2006 20:29:20 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11493 --- checkin_notes | 10 +++++ clientgui/MainDocument.cpp | 4 -- clientgui/sg_DlgPreferences.cpp | 68 ++++++++++----------------------- clientgui/sg_DlgPreferences.h | 4 +- 4 files changed, 31 insertions(+), 55 deletions(-) diff --git a/checkin_notes b/checkin_notes index df8259e178..761bc01520 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12383,3 +12383,13 @@ David 7 Nov 2006 sched_send.C,h server_types.C,h validate_util.C + +Rom 7 Nov 2006 + - MGR: David and I got our wires cross, the global prefs mask is now set for all + values in the preferences dialog when the selection has been made to override + anything. + + clientgui/ + sg_DlgPreferences.cpp, .h + + diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index d0186d909d..0ff5e65067 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -323,10 +323,6 @@ int CMainDocument::CachedStateUpdate() { wxLogTrace(wxT("Function Status"), wxT("CMainDocument::CachedStateUpdate - Get State Failed '%d'"), retval); m_pNetworkConnection->SetStateDisconnected(); } - wxTimeSpan tsStateParseDuration(wxDateTime::Now() - m_dtCachedStateTimestamp); -// This causes a crash on Macintosh -// wxLogTrace(wxT("Function Status"), wxT("CMainDocument::CachedStateUpdate - State Update Time (Milliseconds) '%d'"), tsStateParseDuration.GetMilliseconds()); - pFrame->UpdateStatusText(_("Retrieving host information; please wait...")); retval = rpc.get_host_info(host); diff --git a/clientgui/sg_DlgPreferences.cpp b/clientgui/sg_DlgPreferences.cpp index 57668ef6c8..d337ae6141 100644 --- a/clientgui/sg_DlgPreferences.cpp +++ b/clientgui/sg_DlgPreferences.cpp @@ -694,12 +694,11 @@ bool CPanelPreferences::ReadPreferenceSettings() { // Populate values and arrays from preferences - current_global_preferences = pDoc->state.global_prefs; if (pDoc->rpc.get_global_prefs_override_struct(display_global_preferences) == 0) { m_bCustomizedPreferences = true; } else { m_bCustomizedPreferences = false; - display_global_preferences = current_global_preferences; + display_global_preferences = pDoc->state.global_prefs; } @@ -863,74 +862,47 @@ bool CPanelPreferences::SavePreferenceSettings() { CMainDocument* pDoc = wxGetApp().GetDocument(); GLOBAL_PREFS global_preferences_override; GLOBAL_PREFS_MASK global_preferences_mask; - int iTest = 0; - double dTest = 0.0; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); // Do work only between: - m_strWorkBetweenBegin.ToLong((long*)&iTest); - if (iTest != current_global_preferences.start_hour) { - global_preferences_override.start_hour = iTest; - global_preferences_mask.start_hour = true; - } + m_strWorkBetweenBegin.ToLong((long*)&global_preferences_override.start_hour); + global_preferences_mask.start_hour = true; - m_strWorkBetweenEnd.ToLong((long*)&iTest); - if (iTest != current_global_preferences.end_hour) { - global_preferences_override.end_hour = iTest; - global_preferences_mask.end_hour = true; - } + m_strWorkBetweenEnd.ToLong((long*)&global_preferences_override.end_hour); + global_preferences_mask.end_hour = true; // Connect to internet only between: - m_strConnectBetweenBegin.ToLong((long*)&iTest); - if (iTest != current_global_preferences.net_start_hour) { - global_preferences_override.net_start_hour = iTest; - global_preferences_mask.net_start_hour = true; - } + m_strConnectBetweenBegin.ToLong((long*)&global_preferences_override.net_start_hour); + global_preferences_mask.net_start_hour = true; - m_strConnectBetweenEnd.ToLong((long*)&iTest); - if (iTest != current_global_preferences.net_end_hour) { - global_preferences_override.net_end_hour = iTest; - global_preferences_mask.net_end_hour = true; - } + m_strConnectBetweenEnd.ToLong((long*)&global_preferences_override.net_end_hour); + global_preferences_mask.net_end_hour = true; // Use no more than %s of disk space - m_strMaxDiskUsage.ToDouble((double*)&dTest); + m_strMaxDiskUsage.ToDouble((double*)&global_preferences_override.disk_max_used_gb); if (m_strMaxDiskUsage.Find(wxT("MB")) != -1) { - dTest /= 1000; - } - if (dTest != current_global_preferences.disk_max_used_gb) { - global_preferences_override.disk_max_used_gb = dTest; - global_preferences_mask.disk_max_used_gb = true; + global_preferences_override.disk_max_used_gb /= 1000; } + global_preferences_mask.disk_max_used_gb = true; // Use no more than %s of the processor - m_strMaxCPUUsage.ToDouble((double*)&dTest); - if (dTest != current_global_preferences.cpu_usage_limit) { - global_preferences_override.cpu_usage_limit = dTest; - global_preferences_mask.cpu_usage_limit = true; - } + m_strMaxCPUUsage.ToDouble((double*)&global_preferences_override.cpu_usage_limit); + global_preferences_mask.cpu_usage_limit = true; // Do work while computer is in use? - if (m_bWorkWhileInUse != current_global_preferences.run_if_user_active) { - global_preferences_override.run_if_user_active = m_bWorkWhileInUse; - global_preferences_mask.run_if_user_active = true; - } + global_preferences_override.run_if_user_active = m_bWorkWhileInUse; + global_preferences_mask.run_if_user_active = true; // Do work while computer is on battery? - if (m_bWorkWhileOnBattery != current_global_preferences.run_on_batteries) { - global_preferences_override.run_on_batteries = m_bWorkWhileOnBattery; - global_preferences_mask.run_on_batteries = true; - } + global_preferences_override.run_on_batteries = m_bWorkWhileOnBattery; + global_preferences_mask.run_on_batteries = true; // Do work after computer is idle for: - m_strWorkWhenIdle.ToDouble((double*)&dTest); - if (dTest != current_global_preferences.idle_time_to_run) { - global_preferences_override.idle_time_to_run = dTest; - global_preferences_mask.idle_time_to_run = true; - } + m_strWorkWhenIdle.ToDouble((double*)&global_preferences_override.idle_time_to_run); + global_preferences_mask.idle_time_to_run = true; pDoc->rpc.set_global_prefs_override_struct(global_preferences_override, global_preferences_mask); pDoc->rpc.read_global_prefs_override(); diff --git a/clientgui/sg_DlgPreferences.h b/clientgui/sg_DlgPreferences.h index ba2b14a925..e1385e3049 100644 --- a/clientgui/sg_DlgPreferences.h +++ b/clientgui/sg_DlgPreferences.h @@ -165,6 +165,7 @@ private: wxCheckBox* m_WorkWhileOnBatteryCtrl; wxComboBox* m_WorkWhenIdleCtrl; wxString m_strSkinSelector; + bool m_bCustomizedPreferences; wxString m_strWorkBetweenBegin; wxString m_strWorkBetweenEnd; wxString m_strConnectBetweenBegin; @@ -175,9 +176,6 @@ private: bool m_bWorkWhileOnBattery; wxString m_strWorkWhenIdle; ////@end CPanelPreferences member variables - GLOBAL_PREFS current_global_preferences; - bool m_bCustomizedPreferences; - };