MGR: minor tweak to new Advanced Preferences dialog: put "leave apps in memory" checkbox above page/swap file size to match the order in the web prefs.

This commit is contained in:
Charlie Fenton 2015-02-27 02:55:39 -08:00
parent 448b88fc5f
commit cb3a0140f9
2 changed files with 14 additions and 11 deletions

View File

@ -371,11 +371,11 @@ void CDlgAdvPreferences::ReadPreferenceSettings() {
// max VM idle
buffer.Printf(wxT("%.2f"),prefs.ram_max_used_idle_frac*100.0);
*m_txtMemoryMaxOnIdle << buffer;
// suspend to memory
m_chkMemoryWhileSuspended->SetValue(prefs.leave_apps_in_memory);
// max swap space (virtual memory)
buffer.Printf(wxT("%.2f"),prefs.vm_max_used_frac*100.0);
*m_txtDiskMaxSwap << buffer;
// suspend to memory
m_chkMemoryWhileSuspended->SetValue(prefs.leave_apps_in_memory);
// ######### daily schedules page
// do work between
@ -557,14 +557,14 @@ bool CDlgAdvPreferences::SavePreferencesSettings() {
prefs.ram_max_used_idle_frac=td;
mask.ram_max_used_idle_frac=true;
//
prefs.leave_apps_in_memory = m_chkMemoryWhileSuspended->GetValue();
mask.leave_apps_in_memory=true;
//
m_txtDiskMaxSwap->GetValue().ToDouble(&td);
td = RoundToHundredths(td);
td = td / 100.0 ;
prefs.vm_max_used_frac=td;
mask.vm_max_used_frac=true;
//
prefs.leave_apps_in_memory = m_chkMemoryWhileSuspended->GetValue();
mask.leave_apps_in_memory=true;
// ######### daily schedules page

View File

@ -623,7 +623,7 @@ wxPanel* CDlgAdvPreferencesBase::createDiskAndMemoryTab(wxNotebook* notebook)
wxStaticBoxSizer* memoryUsageBoxSizer = new wxStaticBoxSizer( memoryUsageStaticBox, wxVERTICAL );
makeStaticBoxLabelItalic(memoryUsageStaticBox);
wxFlexGridSizer* memoryUsageGridSizer = new wxFlexGridSizer( 3, 3, 0, 0 );
wxFlexGridSizer* memoryUsageGridSizer = new wxFlexGridSizer( 3, 0, 0 );
memoryUsageGridSizer->AddGrowableCol( 2 );
memoryUsageGridSizer->SetFlexibleDirection( wxHORIZONTAL );
memoryUsageGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@ -661,6 +661,14 @@ wxPanel* CDlgAdvPreferencesBase::createDiskAndMemoryTab(wxNotebook* notebook)
staticText53->SetToolTip(MemoryMaxOnIdleTT);
memoryUsageGridSizer->Add( staticText53, 0, wxALL, 5 );
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.") );
memoryUsageGridSizer->Add( m_chkMemoryWhileSuspended, 0, wxALL, 5 );
memoryUsageGridSizer->AddSpacer(1);
memoryUsageGridSizer->AddSpacer(1);
wxString DiskMaxSwapTT = wxEmptyString;
DiskMaxSwapTT.Printf(_("Limit the swap space (page file) used by %s."), pSkinAdvanced->GetApplicationShortName().c_str());
@ -679,11 +687,6 @@ wxPanel* CDlgAdvPreferencesBase::createDiskAndMemoryTab(wxNotebook* notebook)
memoryUsageBoxSizer->Add( memoryUsageGridSizer, 0, wxEXPAND, 1 );
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.") );
memoryUsageBoxSizer->Add( m_chkMemoryWhileSuspended, 0, wxALL, 5 );
diskAndMemoryBoxSizer->Add( memoryUsageBoxSizer, 0, wxALL|wxEXPAND, 1 );
diskMemoryTab->SetSizer( diskAndMemoryBoxSizer );