diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index beab952de..6a740bcff 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -390,6 +390,7 @@ void SaveWindowSize() gPrefs->Write(wxT("/Window/Iconized"), FALSE); } } + gPrefs->Flush(); wxGetApp().SetWindowRectAlreadySaved(TRUE); } @@ -754,7 +755,9 @@ bool AudacityApp::MRUOpen(wxString fullPathStr) { // verify that the file exists if (wxFile::Exists(fullPathStr)) { - gPrefs->Write(wxT("/DefaultOpenPath"), wxPathOnly(fullPathStr)); + if (!gPrefs->Write(wxT("/DefaultOpenPath"), wxPathOnly(fullPathStr)) || + !gPrefs->Flush()) + return false; // Make sure it isn't already open. // Test here even though AudacityProject::OpenFile() also now checks, because @@ -1486,8 +1489,7 @@ bool AudacityApp::InitCleanSpeech() chmod(OSFILENAME(presets), 0755); #endif - gPrefs->Write(wxT("/Directories/PresetsDir"), presets); - return true; + return (gPrefs->Write(wxT("/Directories/PresetsDir"), presets) && gPrefs->Flush()); } #endif // CLEANSPEECH @@ -1558,14 +1560,14 @@ bool AudacityApp::InitTempDir() chmod(OSFILENAME(temp), 0755); #endif - gPrefs->Write(wxT("/Directories/TempDir"), temp); + bool bSuccess = gPrefs->Write(wxT("/Directories/TempDir"), temp) && gPrefs->Flush(); DirManager::SetTempDir(temp); // Make sure the temp dir isn't locked by another process. if (!CreateSingleInstanceChecker(temp)) return false; - return true; + return bSuccess; } // Return true if there are no other instances of Audacity running, @@ -1826,6 +1828,7 @@ int AudacityApp::OnExit() { gPrefs->DeleteEntry(wxT("/QDeleteCmdCfgLocation")); gPrefs->Write(wxT("/DeleteCmdCfgLocation"), true); + gPrefs->Flush(); } } @@ -1980,6 +1983,7 @@ void AudacityApp::AssociateFileTypes() wxYES_NO | wxICON_QUESTION); if (wantAssoc == wxYES) { gPrefs->Write(wxT("/WantAssociateFiles"), true); + gPrefs->Flush(); wxString root_key; @@ -2053,6 +2057,7 @@ void AudacityApp::AssociateFileTypes() } else { // User said no. Set a pref so we don't keep asking. gPrefs->Write(wxT("/WantAssociateFiles"), false); + gPrefs->Flush(); } } } diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index ebb89aa48..a8c070c26 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -470,6 +470,8 @@ void InitAudioIO() gPrefs->Write(wxT("/AudioIO/Host"), HostName(info)); } } + + gPrefs->Flush(); } void DeinitAudioIO() @@ -1146,6 +1148,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, { silenceLevelDB = -dBRange + 3; // meter range was made smaller than SilenceLevel gPrefs->Write(wxT("/GUI/EnvdBRange"), dBRange); // so set SilenceLevel reasonable + gPrefs->Flush(); } mSilenceLevel = (silenceLevelDB + dBRange)/(double)dBRange; // meter goes -dBRange dB -> 0dB diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index 4a47c1c9a..cf6ac3882 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -408,6 +408,7 @@ bool BatchCommands::WriteMp3File( const wxString Name, int bitrate ) // Use Mp3Stereo to control if export is to a stereo or mono file rc = mExporter.Process(project, numChannels, wxT("MP3"), Name, false, 0.0, endTime); gPrefs->Write(wxT("/FileFormats/MP3Bitrate"), prevBitRate); + gPrefs->Flush(); return rc; } diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 6b2066133..937d4c801 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -188,6 +188,7 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent &event) wxWindowDisabler wd; gPrefs->Write(wxT("/Batch/ActiveChain"), name); + gPrefs->Flush(); mBatchCommands.ReadChain(name); if (!mBatchCommands.ApplyChain()) { @@ -207,6 +208,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent &event) wxString name = mChains->GetItemText(item); gPrefs->Write(wxT("/Batch/ActiveChain"), name); + gPrefs->Flush(); AudacityProject *project = GetActiveProject(); if (!project->GetIsEmpty()) { @@ -901,6 +903,7 @@ void EditChainsDialog::OnDefaults(wxCommandEvent &event) void EditChainsDialog::OnOK(wxCommandEvent &event) { gPrefs->Write(wxT("/Batch/ActiveChain"), mActiveChain); + gPrefs->Flush(); if (mChanged) { if (!mBatchCommands.WriteChain(mActiveChain)) { diff --git a/src/Benchmark.cpp b/src/Benchmark.cpp index c257b5e2c..0df79cf88 100644 --- a/src/Benchmark.cpp +++ b/src/Benchmark.cpp @@ -324,6 +324,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) bool editClipCanMove = true; gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove); gPrefs->Write(wxT("/GUI/EditClipCanMove"), false); + gPrefs->Flush(); // Rememebr the old blocksize, so that we can restore it later. int oldBlockSize = Sequence::GetMaxDiskBlockSize(); @@ -538,6 +539,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) HoldPrint(false); gPrefs->Write(wxT("/GUI/EditClipCanMove"), editClipCanMove); + gPrefs->Flush(); } diff --git a/src/Dependencies.cpp b/src/Dependencies.cpp index 6d32f7fe0..ebccf0086 100644 --- a/src/Dependencies.cpp +++ b/src/Dependencies.cpp @@ -532,6 +532,7 @@ void DependencyDialog::SaveFutureActionChoice() } gPrefs->Write(wxT("/FileFormats/SaveProjectWithDependencies"), savePref); + gPrefs->Flush(); } } diff --git a/src/FFmpeg.cpp b/src/FFmpeg.cpp index 8c4d8c1b0..da9308a8a 100644 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -88,11 +88,13 @@ bool LoadFFmpeg(bool showerror) { DropFFmpegLibs(); gPrefs->Write(wxT("/FFmpeg/Enabled"), false); + gPrefs->Flush(); return false; } else { gPrefs->Write(wxT("/FFmpeg/Enabled"), true); + gPrefs->Flush(); return true; } } @@ -745,6 +747,7 @@ bool FFmpegLibs::FindLibs(wxWindow *parent) wxLogMessage(wxT("User-specified FFmpeg file exists. Success.")); mLibAVFormatPath = path; gPrefs->Write(wxT("/FFmpeg/FFmpegLibPath"), mLibAVFormatPath); + gPrefs->Flush(); return true; } diff --git a/src/FFmpeg.h b/src/FFmpeg.h index dd6ebacae..e89cb0474 100644 --- a/src/FFmpeg.h +++ b/src/FFmpeg.h @@ -155,6 +155,7 @@ to download or locate the FFmpeg libraries." if (mDontShow->GetValue()) { gPrefs->Write(wxT("/FFmpeg/NotFoundDontShow"),1); + gPrefs->Flush(); } this->EndModal(0); } diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index ad7b9b310..1871871c3 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -908,6 +908,7 @@ void FreqWindow::OnCloseButton(wxCommandEvent & WXUNUSED(event)) gPrefs->Write(wxT("/FreqWindow/AlgChoice"), mAlgChoice->GetSelection()); gPrefs->Write(wxT("/FreqWindow/FuncChoice"), mFuncChoice->GetSelection()); gPrefs->Write(wxT("/FreqWindow/AxisChoice"), mAxisChoice->GetSelection()); + gPrefs->Flush(); this->Show(FALSE); } diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 527ae1389..a4d7ea8b6 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -528,6 +528,7 @@ void LabelDialog::OnImport(wxCommandEvent &event) if (fileName != wxT("")) { path =::wxPathOnly(fileName); gPrefs->Write(wxT("/DefaultOpenPath"), path); + gPrefs->Flush(); wxTextFile f; diff --git a/src/Menus.cpp b/src/Menus.cpp index 1a1e11a91..48390f331 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -2359,6 +2359,7 @@ void AudacityProject::OnToggleSoundActivated() bool pause; gPrefs->Read(wxT("/AudioIO/SoundActivatedRecord"), &pause, false); gPrefs->Write(wxT("/AudioIO/SoundActivatedRecord"), !pause); + gPrefs->Flush(); ModifyAllProjectToolbarMenus(); } @@ -2367,6 +2368,7 @@ void AudacityProject::OnTogglePlayRecording() bool Duplex; gPrefs->Read(wxT("/AudioIO/Duplex"), &Duplex, false); gPrefs->Write(wxT("/AudioIO/Duplex"), !Duplex); + gPrefs->Flush(); ModifyAllProjectToolbarMenus(); } @@ -2375,6 +2377,7 @@ void AudacityProject::OnToggleSWPlaythrough() bool SWPlaythrough; gPrefs->Read(wxT("/AudioIO/SWPlaythrough"), &SWPlaythrough, false); gPrefs->Write(wxT("/AudioIO/SWPlaythrough"), !SWPlaythrough); + gPrefs->Flush(); ModifyAllProjectToolbarMenus(); } @@ -2384,6 +2387,7 @@ void AudacityProject::OnToogleAutomatedInputLevelAdjustment() bool AVEnabled; gPrefs->Read(wxT("/AudioIO/AutomatedInputLevelAdjustment"), &AVEnabled, false); gPrefs->Write(wxT("/AudioIO/AutomatedInputLevelAdjustment"), !AVEnabled); + gPrefs->Flush(); ModifyAllProjectToolbarMenus(); } #endif @@ -4950,6 +4954,7 @@ void AudacityProject::OnShowClipping() { bool checked = !gPrefs->Read(wxT("/GUI/ShowClipping"), 0L); gPrefs->Write(wxT("/GUI/ShowClipping"), checked); + gPrefs->Flush(); mCommandManager.Check(wxT("ShowClipping"), checked); mTrackPanel->UpdatePrefs(); mTrackPanel->Refresh(false); @@ -5084,10 +5089,12 @@ void AudacityProject::OnImport() wxArrayString selectedFiles = ShowOpenDialog(wxT("")); if (selectedFiles.GetCount() == 0) { gPrefs->Write(wxT("/LastOpenType"),wxT("")); + gPrefs->Flush(); return; } gPrefs->Write(wxT("/NewImportingSession"), true); + //sort selected files by OD status. Load non OD first so user can edit asap. //first sort selectedFiles. selectedFiles.Sort(CompareNoCaseFileName); @@ -5103,6 +5110,9 @@ void AudacityProject::OnImport() } gPrefs->Write(wxT("/LastOpenType"),wxT("")); + + gPrefs->Flush(); + HandleResize(); // Adjust scrollers for new track sizes. ODManager::Resume(); } @@ -5123,6 +5133,7 @@ void AudacityProject::OnImportLabels() if (fileName != wxT("")) { path =::wxPathOnly(fileName); gPrefs->Write(wxT("/DefaultOpenPath"), path); + gPrefs->Flush(); wxTextFile f; @@ -5167,6 +5178,7 @@ void AudacityProject::OnImportMIDI() if (fileName != wxT("")) { path =::wxPathOnly(fileName); gPrefs->Write(wxT("/DefaultOpenPath"), path); + gPrefs->Flush(); NoteTrack *newTrack = new NoteTrack(mDirManager); @@ -5204,7 +5216,8 @@ void AudacityProject::OnImportRaw() path =::wxPathOnly(fileName); gPrefs->Write(wxT("/DefaultOpenPath"), path); - + gPrefs->Flush(); + Track **newTracks; int numTracks; @@ -5939,6 +5952,7 @@ void AudacityProject::OnSyncLock() bool bSyncLockTracks; gPrefs->Read(wxT("/GUI/SyncLockTracks"), &bSyncLockTracks, false); gPrefs->Write(wxT("/GUI/SyncLockTracks"), !bSyncLockTracks); + gPrefs->Flush(); // Toolbar, project sync-lock handled within ModifyAllProjectToolbarMenus(); @@ -6046,6 +6060,7 @@ void AudacityProject::OnExportCleanSpeechPresets() int noiseCheckSum = abs((int)noiseGateSum); preset[13] = noiseCheckSum; gPrefs->Write(wxT("/Validate/NoiseGateSum"), noiseCheckSum); + gPrefs->Flush(); int lenPreset = sizeof(preset); int count = presetsFile.Write(preset, lenPreset); @@ -6123,6 +6138,7 @@ void AudacityProject::OnImportCleanSpeechPresets() gPrefs->Write(wxT("/Effects/TruncateSilence/LongestAllowedSilentMs"), preset[12]); // gPrefs->Write(wxT("/GUI/Save128HqMasterAfter"), preset[14]); // gPrefs->Write(wxT("/GUI/Save128HqMasterBefore"), preset[15]); + gPrefs->Flush(); double noiseGateSum = 0.0; int lenNoiseGate = expectedCount / sizeof(float); diff --git a/src/Prefs.cpp b/src/Prefs.cpp index 4615fd98a..75c31534b 100644 --- a/src/Prefs.cpp +++ b/src/Prefs.cpp @@ -162,7 +162,6 @@ void InitPreferences() { gPrefs->DeleteAll(); gPrefs->Write(wxT("/NewPrefsInitialized"), true); - gPrefs->Flush(); } bool gone = wxRemoveFile(fn.GetFullPath()); // remove resetPrefs.txt if(!gone) @@ -233,7 +232,9 @@ void InitPreferences() gPrefs->Write(wxT("/Version/Major"), AUDACITY_VERSION); gPrefs->Write(wxT("/Version/Minor"), AUDACITY_RELEASE); - gPrefs->Write(wxT("/Version/Micro"), AUDACITY_REVISION); + gPrefs->Write(wxT("/Version/Micro"), AUDACITY_REVISION); + + gPrefs->Flush(); } void FinishPreferences() diff --git a/src/Project.cpp b/src/Project.cpp index fb25093ae..1833c43bc 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2191,6 +2191,7 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext } gPrefs->Write(wxT("/DefaultOpenType"), mask.BeforeFirst(wxT('|'))); gPrefs->Write(wxT("/LastOpenType"), mask.BeforeFirst(wxT('|'))); + gPrefs->Flush(); if (dialogResult == wxID_OK) { // Return the selected files @@ -2229,10 +2230,10 @@ void AudacityProject::OpenFiles(AudacityProject *proj) wxArrayString selectedFiles = ShowOpenDialog(_("Audacity projects"), wxT("*.aup")); if (selectedFiles.GetCount() == 0) { gPrefs->Write(wxT("/LastOpenType"),wxT("")); + gPrefs->Flush(); return; } - //sort selected files by OD status. //For the open menu we load OD first so user can edit asap. //first sort selectedFiles. @@ -2247,6 +2248,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj) continue; // Skip ones that are already open. gPrefs->Write(wxT("/DefaultOpenPath"), wxPathOnly(fileName)); + gPrefs->Flush(); // DMM: If the project is dirty, that means it's been touched at // all, and it's not safe to open a new project directly in its @@ -2269,7 +2271,8 @@ void AudacityProject::OpenFiles(AudacityProject *proj) } gPrefs->Write(wxT("/LastOpenType"),wxT("")); - + gPrefs->Flush(); + ODManager::Resume(); } @@ -4587,6 +4590,7 @@ void AudacityProject::SetSnapTo(bool state) mSnapTo = state; mCommandManager.Check(wxT("Snap"), mSnapTo); gPrefs->Write(wxT("/SnapTo"), mSnapTo); + gPrefs->Flush(); if (GetSelectionBar()) { GetSelectionBar()->SetSnapTo(state); diff --git a/src/Resample.cpp b/src/Resample.cpp index 106fcc18f..8b92cbe0a 100644 --- a/src/Resample.cpp +++ b/src/Resample.cpp @@ -41,11 +41,13 @@ int Resample::GetBestMethod() void Resample::SetFastMethod(int index) { gPrefs->Write(GetFastMethodKey(), (long)index); + gPrefs->Flush(); } void Resample::SetBestMethod(int index) { gPrefs->Write(GetBestMethodKey(), (long)index); + gPrefs->Flush(); } #if USE_LIBRESAMPLE diff --git a/src/Screenshot.cpp b/src/Screenshot.cpp index 3de679294..79cabbed1 100644 --- a/src/Screenshot.cpp +++ b/src/Screenshot.cpp @@ -519,6 +519,7 @@ void ScreenFrame::OnDirChoose(wxCommandEvent & e) wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR); mDirectoryTextBox->SetValue(path); gPrefs->Write(wxT("/ScreenshotPath"), path); + gPrefs->Flush(); } } diff --git a/src/ShuttlePrefs.cpp b/src/ShuttlePrefs.cpp index 1603b221a..b655adf1c 100644 --- a/src/ShuttlePrefs.cpp +++ b/src/ShuttlePrefs.cpp @@ -43,7 +43,7 @@ bool ShuttlePrefs::TransferBool( const wxString & Name, bool & bValue, const boo } else { - return gPrefs->Write( Name, bValue ); + return (gPrefs->Write( Name, bValue ) && gPrefs->Flush()); } return true; } @@ -57,7 +57,7 @@ bool ShuttlePrefs::TransferDouble( const wxString & Name, double & dValue, const } else { - return gPrefs->Write( Name, dValue ); + return (gPrefs->Write( Name, dValue ) && gPrefs->Flush()); } return true; } @@ -71,7 +71,7 @@ bool ShuttlePrefs::TransferInt( const wxString & Name, int & iValue, const int & } else { - return gPrefs->Write( Name, iValue ); + return (gPrefs->Write( Name, iValue ) && gPrefs->Flush()); } return true; } @@ -85,7 +85,7 @@ bool ShuttlePrefs::TransferString( const wxString & Name, wxString & strValue, c } else { - return gPrefs->Write( Name, strValue ); + return (gPrefs->Write( Name, strValue ) && gPrefs->Flush()); } return true; } diff --git a/src/SplashDialog.cpp b/src/SplashDialog.cpp index 3a93242bb..a1fb267a3 100644 --- a/src/SplashDialog.cpp +++ b/src/SplashDialog.cpp @@ -131,6 +131,7 @@ void SplashDialog::OnDontShow( wxCommandEvent & Evt ) { bool bShow = !Evt.IsChecked(); gPrefs->Write(wxT("/GUI/ShowSplashScreen"), bShow ); + gPrefs->Flush(); } void SplashDialog::OnOK(wxCommandEvent & WXUNUSED(event)) diff --git a/src/Tags.cpp b/src/Tags.cpp index 084df60f3..a0727ec86 100644 --- a/src/Tags.cpp +++ b/src/Tags.cpp @@ -1203,6 +1203,7 @@ void TagsEditor::OnSaveDefaults(wxCommandEvent & event) for (bool cont = mLocal.GetFirst(n, v); cont; cont = mLocal.GetNext(n, v)) { gPrefs->Write(wxT("/Tags/") + n, v); } + gPrefs->Flush(); // Restore title if (!mEditTitle) { @@ -1257,6 +1258,7 @@ void TagsEditor::OnOk(wxCommandEvent & event) gPrefs->Write(wxT("/TagsEditor/y"), r.y); gPrefs->Write(wxT("/TagsEditor/width"), r.width); gPrefs->Write(wxT("/TagsEditor/height"), r.height); + gPrefs->Flush(); EndModal(wxID_OK); } diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index 20bcc5277..c059d1959 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -216,6 +216,7 @@ void TimerRecordDialog::OnOK(wxCommandEvent& event) wxLongLong duration = m_TimeSpan_Duration.GetSeconds(); // this will assert if the duration won't fit in a long gPrefs->Write(wxT("/TimerRecord/LastDuration"), duration.ToLong()); + gPrefs->Flush(); } ///Runs the wait for start dialog. Returns false if the user clicks stop while we are recording diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index fa9f0a06b..d81b546d6 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -2843,6 +2843,8 @@ void TrackArtist::UpdatePrefs() #ifdef EXPERIMENTAL_FFT_SKIP_POINTS mFftSkipPoints = gPrefs->Read(wxT("/Spectrum/FFTSkipPoints"), 0L); #endif //EXPERIMENTAL_FFT_SKIP_POINTS + + gPrefs->Flush(); } // Get various preference values diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index c91f9c0dc..9658cbb3c 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -7553,6 +7553,7 @@ void TrackPanel::OnSetFont(wxCommandEvent &event) gPrefs->Write(wxT("/GUI/LabelFontFacename"), lb->GetStringSelection()); gPrefs->Write(wxT("/GUI/LabelFontSize"), sc->GetValue()); + gPrefs->Flush(); LabelTrack::ResetFont(); diff --git a/src/commands/PreferenceCommands.cpp b/src/commands/PreferenceCommands.cpp index c221c828d..09c0066ef 100644 --- a/src/commands/PreferenceCommands.cpp +++ b/src/commands/PreferenceCommands.cpp @@ -74,7 +74,7 @@ bool SetPreferenceCommand::Apply(CommandExecutionContext context) { wxString prefName = GetString(wxT("PrefName")); wxString prefValue = GetString(wxT("PrefValue")); - return gPrefs->Write(prefName, prefValue); + return (gPrefs->Write(prefName, prefValue) && gPrefs->Flush()); } SetPreferenceCommand::~SetPreferenceCommand() diff --git a/src/effects/AutoDuck.cpp b/src/effects/AutoDuck.cpp index fc11ae25b..e4caf068f 100644 --- a/src/effects/AutoDuck.cpp +++ b/src/effects/AutoDuck.cpp @@ -207,6 +207,7 @@ bool EffectAutoDuck::PromptUser() gPrefs->Write(wxT("/Effects/AutoDuck/InnerFadeUpLen"), mInnerFadeUpLen); gPrefs->Write(wxT("/Effects/AutoDuck/ThresholdDb"), mThresholdDb); gPrefs->Write(wxT("/Effects/AutoDuck/MaximumPause"), mMaximumPause); + gPrefs->Flush(); return true; } diff --git a/src/effects/ClickRemoval.cpp b/src/effects/ClickRemoval.cpp index 3b88a4b6d..25eb2c9ac 100644 --- a/src/effects/ClickRemoval.cpp +++ b/src/effects/ClickRemoval.cpp @@ -98,7 +98,7 @@ bool EffectClickRemoval::Init() gPrefs->Write(wxT("/Effects/ClickRemoval/ClickWidth"), mClickWidth); } #endif // CLEANSPEECH - return true; + return gPrefs->Flush(); } bool EffectClickRemoval::CheckWhetherSkipEffect() @@ -131,7 +131,7 @@ bool EffectClickRemoval::PromptUser() gPrefs->Write(wxT("/Effects/ClickRemoval/ClickWidth"), mClickWidth); #endif // CLEANSPEECH - return true; + return gPrefs->Flush(); } bool EffectClickRemoval::TransferParameters( Shuttle & shuttle ) { diff --git a/src/effects/Compressor.cpp b/src/effects/Compressor.cpp index a3f03661b..5682db167 100644 --- a/src/effects/Compressor.cpp +++ b/src/effects/Compressor.cpp @@ -143,7 +143,7 @@ bool EffectCompressor::PromptUser() gPrefs->Write(wxT("/Effects/Compressor/Normalize"), mNormalize); gPrefs->Write(wxT("/Effects/Compressor/UsePeak"), mUsePeak); - return true; + return gPrefs->Flush(); } bool EffectCompressor::NewTrackPass1() diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp index 095f3e4e9..8126a3010 100644 --- a/src/effects/DtmfGen.cpp +++ b/src/effects/DtmfGen.cpp @@ -380,6 +380,7 @@ void EffectDtmf::Success() gPrefs->Write(wxT("/Effects/DtmfGen/String"), dtmfString); gPrefs->Write(wxT("/Effects/DtmfGen/DutyCycle"), dtmfDutyCycle); gPrefs->Write(wxT("/Effects/DtmfGen/Amplitude"), dtmfAmplitude); + gPrefs->Flush(); } //---------------------------------------------------------------------------- diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index c1b901235..8fb3f0b61 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -215,6 +215,8 @@ void EffectEqualization::ReadPrefs() gPrefs->Read(wxT("/Effects/Equalization/DrawMode"), &mDrawMode, true); gPrefs->Read(wxT("/Effects/Equalization/Interp"), &mInterp, 0); gPrefs->Read(wxT("/Effects/Equalization/DrawGrid"), &mDrawGrid, true); + + gPrefs->Flush(); } EffectEqualization::EffectEqualization() @@ -312,6 +314,7 @@ bool EffectEqualization::PromptUser() gPrefs->Write(wxT("/Effects/Equalization/DrawMode"),mDrawMode); gPrefs->Write(wxT("/Effects/Equalization/Interp"), mInterp); gPrefs->Write(wxT("/Effects/Equalization/DrawGrid"), mDrawGrid); + gPrefs->Flush(); } return true; diff --git a/src/effects/Leveller.cpp b/src/effects/Leveller.cpp index d68af1b93..e9c3385ee 100644 --- a/src/effects/Leveller.cpp +++ b/src/effects/Leveller.cpp @@ -70,6 +70,8 @@ bool EffectLeveller::Init() gPrefs->Write(wxT("/Effects/Leveller/LevellerDbChoiceIndex"), mLevellerDbChoiceIndex); } #endif // CLEANSPEECH + gPrefs->Flush(); + mLevellerDbSilenceThreshold = Enums::Db2Signal[mLevellerDbChoiceIndex]; CalcLevellerFactors(); @@ -86,6 +88,7 @@ void EffectLeveller::End() { int frameSum = (int)mFrameSum; gPrefs->Write(wxT("/Validate/LevellerFrameSum"), frameSum); + gPrefs->Flush(); } #define LEVELER_FACTORS 6 @@ -149,6 +152,7 @@ bool EffectLeveller::PromptUser() gPrefs->Write(wxT("/Effects/Leveller/LevellerDbChoiceIndex"), mLevellerDbChoiceIndex); gPrefs->Write(wxT("/Effects/Leveller/LevellerNumPasses"), mLevellerNumPasses); #endif // CLEANSPEECH + gPrefs->Flush(); CalcLevellerFactors(); diff --git a/src/effects/Noise.cpp b/src/effects/Noise.cpp index b6eff46e8..55f310dce 100644 --- a/src/effects/Noise.cpp +++ b/src/effects/Noise.cpp @@ -161,6 +161,7 @@ void EffectNoise::Success() gPrefs->Write(wxT("/Effects/Noise/Type"), noiseType); gPrefs->Write(wxT("/Effects/Noise/Amplitude"), noiseAmplitude); + gPrefs->Flush(); } //---------------------------------------------------------------------------- diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index ee72b8a73..7300bc64a 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -238,7 +238,7 @@ bool EffectNoiseRemoval::Init() gPrefs->Write(wxT("/Effects/NoiseRemoval/Noise_Level"), mLevel); } #endif // CLEANSPEECH - return true; + return gPrefs->Flush(); } bool EffectNoiseRemoval::CheckWhetherSkipEffect() @@ -309,7 +309,7 @@ bool EffectNoiseRemoval::PromptUser() #endif // CLEANSPEECH mDoProfile = (dlog.GetReturnCode() == 1); - return true; + return gPrefs->Flush(); } bool EffectNoiseRemoval::TransferParameters( Shuttle & shuttle ) diff --git a/src/effects/Normalize.cpp b/src/effects/Normalize.cpp index 07e05882f..f512afd96 100644 --- a/src/effects/Normalize.cpp +++ b/src/effects/Normalize.cpp @@ -111,6 +111,7 @@ void EffectNormalize::End() gPrefs->Write(wxT("/Validate/Norm_Multiplier"), checkMultiplier); int checkFrameSum = (int)gFrameSum; gPrefs->Write(wxT("/Validate/Norm_FrameSum"), checkFrameSum); + gPrefs->Flush(); } } @@ -138,7 +139,7 @@ bool EffectNormalize::PromptUser() gPrefs->Write(wxT("/Effects/Normalize/Level"), mLevel); gPrefs->Write(wxT("/Effects/Normalize/StereoIndependent"), mStereoInd); - return true; + return gPrefs->Flush(); } bool EffectNormalize::Process() diff --git a/src/effects/ScoreAlignDialog.cpp b/src/effects/ScoreAlignDialog.cpp index 706d444a4..7d41614e0 100644 --- a/src/effects/ScoreAlignDialog.cpp +++ b/src/effects/ScoreAlignDialog.cpp @@ -205,6 +205,8 @@ ScoreAlignDialog::ScoreAlignDialog(wxWindow *parent, ScoreAlignParams ¶ms) p.mPresmoothTime); gPrefs->Write(wxT("/Tracks/Synchronize/LineTime"), p.mLineTime); gPrefs->Write(wxT("/Tracks/Synchronize/SmoothTime"), p.mSmoothTime); + gPrefs->Flush(); + params = p; // return all parameters through params } } diff --git a/src/effects/Silence.cpp b/src/effects/Silence.cpp index 43427cc08..4c125581c 100644 --- a/src/effects/Silence.cpp +++ b/src/effects/Silence.cpp @@ -53,7 +53,10 @@ bool EffectSilence::PromptUser() Save duration unless value was got from selection, so we save only when user explicitly set up a value */ if (mT1 == mT0) + { gPrefs->Write(wxT("/Effects/SilenceGen/Duration"), mDuration); + gPrefs->Flush(); + } return true; } diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp index d3335388e..7c1feab04 100644 --- a/src/effects/ToneGen.cpp +++ b/src/effects/ToneGen.cpp @@ -122,8 +122,11 @@ bool EffectToneGen::PromptUser() /* Save last used values. Save duration unless value was got from selection, so we save only when user explicitly set up a value */ - if (mT1 == mT0) - gPrefs->Write(wxT("/Effects/ToneGen/Duration"), mDuration); + if (mT1 == mT0) // ANSWER ME: Only if end time equals start time? + { + return (gPrefs->Write(wxT("/Effects/ToneGen/Duration"), mDuration) && + gPrefs->Flush()); + } return true; } diff --git a/src/effects/TruncSilence.cpp b/src/effects/TruncSilence.cpp index 65ab2d49c..dc8fc8113 100644 --- a/src/effects/TruncSilence.cpp +++ b/src/effects/TruncSilence.cpp @@ -78,7 +78,7 @@ bool EffectTruncSilence::Init() mSilenceCompressRatio = 4.0; gPrefs->Write(wxT("/Effects/TruncateSilence/CompressRatio"), 40L); } - return true; + return gPrefs->Flush(); } bool EffectTruncSilence::CheckWhetherSkipEffect() @@ -105,6 +105,7 @@ bool EffectTruncSilence::PromptUser() gPrefs->Write(wxT("/Effects/TruncateSilence/LongestAllowedSilentMs"), mTruncLongestAllowedSilentMs); gPrefs->Write(wxT("/Effects/TruncateSilence/DbChoiceIndex"), mTruncDbChoiceIndex); gPrefs->Write(wxT("/Effects/TruncateSilence/CompressRatio"), (int)floor(10.0*mSilenceCompressRatio+0.5)); + gPrefs->Flush(); return true; } diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 3b87de3c8..f4ab22a39 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -76,6 +76,7 @@ void RegisterVSTEffects() if (gPrefs->Read(wxT("/VST/Rescan"), (long) false) != false) { pm.PurgeType(VSTPLUGINTYPE); gPrefs->Write(wxT("/VST/Rescan"), false); + gPrefs->Flush(); } if (!pm.HasType(VSTPLUGINTYPE)) { diff --git a/src/export/Export.cpp b/src/export/Export.cpp index e5d8ef3eb..b1708ae42 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -701,6 +701,7 @@ bool Exporter::CheckFilename() gPrefs->Write(wxT("/Export/Format"), mPlugins[mFormat]->GetFormat(mSubFormat)); gPrefs->Write(wxT("/Export/Path"), mFilename.GetPath()); + gPrefs->Flush(); // // To be even safer, return a temporary file name based diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index 145592099..806ab0a54 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -136,6 +136,7 @@ void ExportCLOptions::OnOK(wxCommandEvent& event) wxString cmd = mCmd->GetValue(); gPrefs->Write(wxT("/FileFormats/ExternalProgramExportCommand"), cmd); + gPrefs->Flush(); PopulateOrExchange(S); diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index a9277b45e..7c979ba92 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -1900,6 +1900,7 @@ void ExportFFmpegOptions::OnOK(wxCommandEvent& event) int selfmt = mFormatList->GetSelection(); if (selcdc > -1) gPrefs->Write(wxT("/FileFormats/FFmpegCodec"),(long)avcodec_find_encoder_by_name(mCodecList->GetString(selcdc).ToUTF8())->id); if (selfmt > -1) gPrefs->Write(wxT("/FileFormats/FFmpegFormat"),mFormatList->GetString(selfmt)); + gPrefs->Flush(); ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index 669fc60b6..3582085f1 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -444,6 +444,7 @@ void ExportMP3Options::OnOK(wxCommandEvent& event) gPrefs->Write(wxT("/FileFormats/MP3VbrRate"), mVbrRate); gPrefs->Write(wxT("/FileFormats/MP3AbrRate"), mAbrRate); gPrefs->Write(wxT("/FileFormats/MP3CbrRate"), mCbrRate); + gPrefs->Flush(); EndModal(wxID_OK); @@ -959,9 +960,8 @@ bool MP3Exporter::FindLibrary(wxWindow *parent) } mLibPath = path; - gPrefs->Write(wxT("/MP3/MP3LibPath"), mLibPath); - return true; + return (gPrefs->Write(wxT("/MP3/MP3LibPath"), mLibPath) && gPrefs->Flush()); } bool MP3Exporter::LoadLibrary(wxWindow *parent, AskUser askuser) @@ -1626,6 +1626,7 @@ int ExportMP3::Export(AudacityProject *project, if (!exporter.InitLibrary(wxT(""))) { wxMessageBox(_("Could not initialize MP3 encoding library!")); gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT(""))); + gPrefs->Flush(); return false; } @@ -1633,6 +1634,7 @@ int ExportMP3::Export(AudacityProject *project, if (!exporter.LoadLibrary(parent, MP3Exporter::Maybe)) { wxMessageBox(_("Could not open MP3 encoding library!")); gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT(""))); + gPrefs->Flush(); return false; } @@ -1640,6 +1642,7 @@ int ExportMP3::Export(AudacityProject *project, if (!exporter.ValidLibraryLoaded()) { wxMessageBox(_("Not a valid or supported MP3 encoding library!")); gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT(""))); + gPrefs->Flush(); return false; } diff --git a/src/export/ExportOGG.cpp b/src/export/ExportOGG.cpp index 71d5115c9..cb3fdbbab 100644 --- a/src/export/ExportOGG.cpp +++ b/src/export/ExportOGG.cpp @@ -107,6 +107,7 @@ void ExportOGGOptions::OnOK(wxCommandEvent& event) PopulateOrExchange(S); gPrefs->Write(wxT("/FileFormats/OggExportQuality"),mOggQualityUnscaled * 10); + gPrefs->Flush(); EndModal(wxID_OK); diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 54fa73862..d2c12e097 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -67,6 +67,7 @@ static int ReadExportFormatPref() static void WriteExportFormatPref(int format) { gPrefs->Write(wxT("/FileFormats/ExportFormat_SF1"), (long int)format); + gPrefs->Flush(); } //---------------------------------------------------------------------------- diff --git a/src/import/Import.cpp b/src/import/Import.cpp index 115a50301..ec65354a0 100644 --- a/src/import/Import.cpp +++ b/src/import/Import.cpp @@ -280,6 +280,7 @@ void Importer::WriteImportItems() } name.Printf (wxT("/ExtImportItems/Item%d"), i); gPrefs->Write (name, val); + gPrefs->Flush(); } /* If we used to have more items than we have now, delete the excess items. We just keep deleting items and incrementing until we find there aren't any diff --git a/src/import/ImportFFmpeg.cpp b/src/import/ImportFFmpeg.cpp index 41586b5d2..2124572dd 100644 --- a/src/import/ImportFFmpeg.cpp +++ b/src/import/ImportFFmpeg.cpp @@ -313,6 +313,7 @@ ImportFileHandle *FFmpegImportPlugin::Open(wxString filename) if (dontShowDlg == 0 && newsession) { gPrefs->Write(wxT("/NewImportingSession"), false); + gPrefs->Flush(); dlg = new FFmpegNotFoundDialog(NULL); dlg->ShowModal(); delete dlg; diff --git a/src/import/ImportPCM.cpp b/src/import/ImportPCM.cpp index 4ca39f9e4..59f4893be 100644 --- a/src/import/ImportPCM.cpp +++ b/src/import/ImportPCM.cpp @@ -229,6 +229,7 @@ static wxString AskCopyOrEdit() oldCopyPref = wxT("copy"); } gPrefs->Write(wxT("/Warnings/CopyOrEditUncompressedDataFirstAsk"), (long) false); + gPrefs->Flush(); } // check the current preferences for whether or not we should ask the user about this. @@ -284,6 +285,7 @@ How do you want to import the current file(s)?"), oldCopyPref == wxT("copy") ? _ } if (dontAskNextTimeBox->IsChecked()) { gPrefs->Write(wxT("/Warnings/CopyOrEditUncompressedDataAsk"), (long) false); + gPrefs->Flush(); } } else { return wxT("cancel"); @@ -292,6 +294,7 @@ How do you want to import the current file(s)?"), oldCopyPref == wxT("copy") ? _ // if the preference changed, save it. if (newCopyPref != oldCopyPref) { gPrefs->Write(wxT("/FileFormats/CopyOrEditUncompressedData"), newCopyPref); + gPrefs->Flush(); } oldCopyPref = newCopyPref; } diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index bb57d0070..b18d806ca 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -347,6 +347,7 @@ bool DevicePrefs::Apply() } if (map) { gPrefs->Write(wxT("/AudioIO/PlaybackDevice"), map->deviceString); + gPrefs->Flush(); } map = NULL; @@ -365,9 +366,9 @@ bool DevicePrefs::Apply() gPrefs->Write(wxT("/AudioIO/RecordingSource"), wxT("")); } - gPrefs->Write(wxT("/AudioIO/RecordChannels"), mChannels->GetSelection() + 1); + return gPrefs->Flush(); } return true; diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index 048507658..cd015ece9 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -293,6 +293,7 @@ void KeyConfigPrefs::OnImport(wxCommandEvent & e) path = wxPathOnly(file); gPrefs->Write(wxT("/DefaultOpenPath"), path); + gPrefs->Flush(); XMLFileReader reader; if (!reader.Parse(mManager, file)) { @@ -324,6 +325,7 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & e) path = wxPathOnly(file); gPrefs->Write(wxT("/DefaultExportPath"), path); + gPrefs->Flush(); XMLFileWriter prefFile; @@ -558,9 +560,10 @@ bool KeyConfigPrefs::Apply() gPrefs->Write(name, key); } } + gPrefs->Flush(); } - return true; + return gPrefs->Flush(); } void KeyConfigPrefs::Cancel() diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 1e23a26c0..29add4b0b 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -271,7 +271,7 @@ bool MidiIOPrefs::Apply() wxString(info->name, wxConvLocal).c_str())); } #endif - return true; + return gPrefs->Flush(); } bool MidiIOPrefs::Validate() diff --git a/src/prefs/PrefsDialog.cpp b/src/prefs/PrefsDialog.cpp index 708566b3f..9fd3b2578 100644 --- a/src/prefs/PrefsDialog.cpp +++ b/src/prefs/PrefsDialog.cpp @@ -245,6 +245,7 @@ void PrefsDialog::OnOK(wxCommandEvent & event) } gPrefs->Write(wxT("/Prefs/PrefsCategory"), (long)mCategories->GetSelection()); + gPrefs->Flush(); #if USE_PORTMIXER if (gAudioIO) { diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index 0820582b8..029bb7396 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -226,6 +226,7 @@ bool QualityPrefs::Apply() // value in prefs comes from the second field. if (mOtherSampleRate->IsEnabled()) { gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mOtherSampleRateValue); + gPrefs->Flush(); } // Tell CopySamples() to use these ditherers now diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index 07833b775..a612525ca 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -185,8 +185,11 @@ bool RecordingPrefs::Apply() double targetpeak, deltapeak; gPrefs->Read(wxT("/AudioIO/TargetPeak"), &targetpeak); gPrefs->Read(wxT("/AudioIO/DeltaPeakVolume"), &deltapeak); - if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0) + if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0) + { gPrefs->Write(wxT("/AudioIO/DeltaPeakVolume"), min(100.0 - targetpeak, targetpeak)); + gPrefs->Flush(); + } int value; gPrefs->Read(wxT("/AudioIO/AnalysisTime"), &value); @@ -197,7 +200,7 @@ bool RecordingPrefs::Apply() if (value < 0) gPrefs->Write(wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS); #endif - return true; + return gPrefs->Flush(); } diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index ba8ea58f2..70cb07fba 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -560,6 +560,7 @@ void DeviceToolBar::FillHostDevices() if (host == wxT("")) { host = outMaps[i].hostString; gPrefs->Write(wxT("/AudioIO/Host"), host); + gPrefs->Flush(); mHost->SetStringSelection(host); } } @@ -584,6 +585,8 @@ int DeviceToolBar::ChangeHost() //change the host and switch to correct devices. gPrefs->Write(wxT("/AudioIO/Host"), newHost); + gPrefs->Flush(); + // populate the devices FillHostDevices(); @@ -646,6 +649,8 @@ void DeviceToolBar::SetDevices(const DeviceSourceMap *in, const DeviceSourceMap } else { gPrefs->Write(wxT("/AudioIO/RecordingSource"), wxT("")); } + gPrefs->Flush(); + FillInputChannels(); } @@ -656,6 +661,7 @@ void DeviceToolBar::SetDevices(const DeviceSourceMap *in, const DeviceSourceMap } else { gPrefs->Write(wxT("/AudioIO/PlaybackSource"), wxT("")); } + gPrefs->Flush(); } } diff --git a/src/toolbars/SelectionBar.cpp b/src/toolbars/SelectionBar.cpp index 3143b75dc..fc4bac153 100644 --- a/src/toolbars/SelectionBar.cpp +++ b/src/toolbars/SelectionBar.cpp @@ -337,6 +337,7 @@ void SelectionBar::OnRightTime(wxCommandEvent &evt) void SelectionBar::OnLengthRadio(wxCommandEvent &evt) { gPrefs->Write(wxT("/ShowSelectionLength"), true); + gPrefs->Flush(); mRightTime->SetName(wxString(_("Selection Length"))); ValuesToControls(); @@ -366,6 +367,7 @@ void SelectionBar::OnUpdate(wxCommandEvent &evt) TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, mRate); wxString formatName(ttc->GetBuiltinName(index)); gPrefs->Write(wxT("/SelectionFormat"), formatName); + gPrefs->Flush(); #if wxUSE_TOOLTIPS mSnapTo->SetToolTip(wxString::Format(_("Snap Clicks/Selections to %s"), formatName.c_str())); #endif diff --git a/src/toolbars/ToolManager.cpp b/src/toolbars/ToolManager.cpp index fec4042ed..d3942140c 100644 --- a/src/toolbars/ToolManager.cpp +++ b/src/toolbars/ToolManager.cpp @@ -769,6 +769,7 @@ void ToolManager::WriteConfig() // Restore original config path gPrefs->SetPath( oldpath ); + gPrefs->Flush(); } // diff --git a/src/widgets/ErrorDialog.cpp b/src/widgets/ErrorDialog.cpp index 612fa25ea..40cb29314 100644 --- a/src/widgets/ErrorDialog.cpp +++ b/src/widgets/ErrorDialog.cpp @@ -389,6 +389,7 @@ void ShowHelpDialog(wxWindow *parent, HelpMode = wxT("Local"); pProj->mHelpPref = HelpMode; gPrefs->Write(wxT("/GUI/Help"), HelpMode); + gPrefs->Flush(); } } diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index e4257ef41..b99b0d204 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -1215,7 +1215,7 @@ void Meter::OnDisableMeter(wxCommandEvent &evt) { gPrefs->Write(wxT("/Meter/MeterOutputDisabled"), mMeterDisabled); } - + gPrefs->Flush(); } void Meter::OnHorizontal(wxCommandEvent &evt) @@ -1309,21 +1309,8 @@ void Meter::OnPreferences(wxCommandEvent &evt) if (d.ShowModal() == wxID_OK) { mMeterRefreshRate = d.GetValue(); gPrefs->Write(wxT("/Meter/MeterRefreshRate"), mMeterRefreshRate); + gPrefs->Flush(); } mTimer.Start(1000 / mMeterRefreshRate); } - -// Indentation settings for Vim and Emacs. -// Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// - - - diff --git a/src/widgets/Warning.cpp b/src/widgets/Warning.cpp index 2330fd901..866275db8 100644 --- a/src/widgets/Warning.cpp +++ b/src/widgets/Warning.cpp @@ -87,6 +87,7 @@ void ShowWarningDialog(wxWindow *parent, WarningDialog dlog(parent, message); gPrefs->Write(key, dlog.ShowModal()); + gPrefs->Flush(); } // Indentation settings for Vim and Emacs and unique identifier for Arch, a