Page 1 of 15
reset Preferences CFG file
Posted: Sat Feb 04, 2012 6:47 pm
by Edgar
Forum elves often need to have users reset their Preferences configuration (audacity.cfg) file. Doing so is often difficult (explaining "how to" as well as actually doing it) and there has been a call for a method of resetting this file from within Audacity. Here is a solution:
it looks like:

- resetCFG.png (43.69 KiB) Viewed 5627 times
(note--the "Save" and "Load" buttons are currently NOP as the current design only calls for "Reset" but I often see users asking to be able to backup/save/load Prefs)
Re: reset Preferences CFG file
Posted: Sat Feb 04, 2012 7:43 pm
by kozikowski
Certainly. Save it before you Reset it against the time you blow the old one away and you can't remember how you set up your system -- and there's something critical missing.
Are you proposing a Universal config reset -- including that Windows Registry thing? I can hear Gale objecting to a partial solution.
Koz
Re: reset Preferences CFG file
Posted: Sat Feb 04, 2012 8:30 pm
by Edgar
kozikowski wrote:
Edgar wrote:
I often see users asking to be able to backup/save/load Prefs
Certainly. Save it before you Reset it against the time you blow the old one away and you can't remember how you set up your system -- and there's something critical missing.
If the buttons were "Backup" & "Restore" (not "Save" & ""Load")--i.e. only one level of storage, the code would be easy. Just copy audacity.cfg as audacity.cfg.bak for "Backup" (overwriting any existing--maybe with back-out warning or some incremental naming scheme--but incremental is getting too complicated). "Restore" would reverse that, deleting the old .bak file (doing nothing if audacity.cfg.bak was missing--maybe with warning) although the button itself could be disabled if the .bak file did not exist.
kozikowski wrote:
Are you proposing a Universal config reset -- including that Windows Registry thing? I can hear Gale objecting to a partial solution.
As originally designed it was only to set audacity.cfg to the single line "NewPrefsInitialized=1" which, AFAIK, forces Audacity to ignore any Registry setting. To change the Registry one could write a REG script (a file of textual instructions with a .reg extension) which can be executed by double-click or via the CLI. Since 1.2.6 wrote the Registry entries, one might examine that code to see where said entries were written and use that information to add a function to current Audacity which would comb through the Registry removing them as needed. I could do either the REG script or add a function to Audacity to do the job but since I think it a moot point I am not to thrilled about spending the programming time doing so.
Re: reset Preferences CFG file
Posted: Tue Feb 07, 2012 9:42 am
by Edgar
resetPrefs3 now does incremental backup of the current Prefs CFG file before initializing. You will have files with names like:
audacityCFG7Feb2012_01_36_46.bak
with the part:
7Feb2012_01_36_46
being:
day-of-the-month_month_year_hour_minute_second
which should give us sufficient granularity.
Save & Load are not yet implemented but should be fairly easy. I might end up changing the extension to:
.CFGbak
so it is easy to filter for .cfg & .CFGbak in the Save & Load file dialogs.
Re: reset Preferences CFG file
Posted: Tue Feb 07, 2012 2:00 pm
by steve
A standalone "Audacity 1.2.x registry restore.reg" utility could be useful for anyone wanting to fully and permanently nuke Audacity 1.2.x from their system.
It looks like it would probably be fairly simple too:
http://support.microsoft.com/kb/310516
(though "tampering" with the Windows Registry is not without risk).
This may be a preferable "reset" for 1.2.x than the current "Audacity 1.2.6 reset Preferences .reg file for Windows"
http://wiki.audacityteam.org/wiki/Audac ... o_defaults
Re: reset Preferences CFG file
Posted: Tue Feb 07, 2012 2:13 pm
by waxcylinder
Gale already has a 1.2 reset at the bottom of this page on his website:
http://www.gaclrecords.org.uk/audacity.html
WC
Re: reset Preferences CFG file
Posted: Tue Feb 07, 2012 2:32 pm
by steve
I like the simplicity of just one "Reset" button, and the simplicity of just "updating" the audacity.cfg with "NewPrefsInitialized=1".
(this
does stop Audacity on Windows from inheriting settings from the registry).
Suggested alternative wording for the "are you sure" screen:
Reseting Audacity's Preferences cannot be undone!
It might be wise to make a backup copy first.
Resetting Audacity will also clear the Recent File list
and force Audacity to immediately shut down.
Select "Yes" to reset Audacity to factory defaults
and AUTOMATICALLY SHUT DOWN Audacity.
Select "No" if you do not wish to proceed.
Do you really want to reset Audacity?
.............[ No ]..[ Yes ]
Re: reset Preferences CFG file
Posted: Tue Feb 07, 2012 2:44 pm
by steve
Edgar wrote:resetPrefs3 now does incremental backup of the current Prefs CFG file before initializing.
I think that if we want to go down this road, we really need a full "Preferences Manager" (something along the lines of the "Equalization Preset Manager").
I'm not sure that we need to go down this route at all. I'd be happy with a simple Reset button as a kind of "Get out of Jail Free Card".
On the other hand, there is some demand for being able to manage Preferences:
http://forum.audacityteam.org/viewtopic ... 16&t=63358
Re: reset Preferences CFG file
Posted: Tue Feb 07, 2012 5:18 pm
by Edgar
steve wrote:
Resetting Audacity will also clear the Recent File list
I had to work really hard to figure out how to clear Recent Files and it ends up really simple to keep the Recent File list along with "NewPrefsInitialized=1". Saving it could be a checkbox...

- cbox.png (3.03 KiB) Viewed 5602 times
...but we are getting close to needing:
bgravato wrote:
About the location of the button... there could be another section/tab in Preferences that would say "Reset" or "Factory Defaults" and when the user selects that it would show a small description of what it does and would have the Reset button there following a text saying something like "If you want to reset preferences to factory defaults press this button".
Re: reset Preferences CFG file
Posted: Thu Mar 01, 2012 8:25 pm
by waxcylinder
There is already a formal proposal on the Wiki which BillW kicked off in spring last year - see:
http://wiki.audacityteam.org/wiki/Propo ... _cfg_Reset
Peter.