Proposal Easy cfg Reset

From Audacity Wiki
Jump to: navigation, search
Proposal pages help us get from feature requests into actual plans. This proposal page is about adding a "Reset Preferences" command to Audacity.
Proposal pages are used on an ongoing basis by the Audacity development team and are open to edits from visitors to the wiki. They are a good way to get community feedback on a proposal.


  • Note: Proposals for Google Summer of Code projects are significantly different in structure, are submitted via Google's web app and may or may not have a corresponding proposal page.




Contents


The Problem

The audacity.cfg file can become corrupt leading to unexpected behaviours in Audacity that can only be fixed by "initializing" the contents of that file to NewPrefsInitialized=1. Trashing the file is not an option as Audacity may read previously-installed 1.2.x preferences and that preferences file may be corrupt. So the user must edit the audacity.cfg in a plain text editor and overwrite the file in its original location without changing the file extension. On Windows and Linux the user must show hidden files in order to open audacity.cfg.

Peter 12Nov14: Actually with the 2.0/7/2.1.0 now it is a valid option just to trash the .cfg file as we no longer try to inherit obsolete settings from any previous use of 1.2.x

Additionally:

  • VST plugins can stop Audacity starting properly, so a feature within Audacity, for example menu item or preferences reset-button might not work.
  • Display preferences can leave Audacity not appearing, i.e. underneath other windows, so again features to resolve this within Audacity might not be enough.


The Proposal

An easy way for users to reset the audacity.cfg file to a clean state - in effect setting the contents to "NewPrefsInitialized=1" or filling it with the default values that Audacity would use on first launch when it finds an audacity.cfg file that contains only "NewPrefsInitialized=1".

This is listed as #363 P4 enhancement on Bugzilla.

  • Two buttons within Audacity on each Preferences pane
    • a) reset audacity.cfg - a global Preferences reset
    • b) "Reset" or "Defaults" button to reset only Preferences shown on than pane
  • or, a new "Reset" Preferences pane (with partial or full wipe)
  • A method for both Mac and Windows including zip users to reset .cfg when Audacity won't launch/visibly crashes on launch.

Developer/QA Backing

  • Peter 14Apr11: this was discussed earlier by QA folk on the Forum where there was almost unanimous support for this (with a couple of partial votes): Bill, Koz, Bruno, Peter, Ed 0.75, Steve 0.5 - see this forum thread: http://forum.audacityteam.org/viewtopic.php?f=20&t=55282&hilit=reset
    • Peter 12Nov14: +1 for a new "Reset" Preferences pane (with partial or full wipe) - but also +1 for two buttons within Audacity a) reset audacity.cfg b) "Defaults" button to reset listed Preferences only (especially if that is easier and quicker to do).
      • +1 for a method for both Mac and Windows including zip users to reset .cfg when Audacity won't launch/visibly crashes on launch. This has been discussed before that thread above as well.
      • -1 for a new menu item to reset
  • Gale: +1 for two buttons within Audacity a) reset audacity.cfg b) "Defaults" button to reset listed Preferences only, combined with a method for both Mac and Windows including zip users to reset .cfg when Audacity won't launch/visibly crashes on launch. This has been discussed before that thread above as well.
  • James: +1 on a reset button.
    • Also +1 on making VST safer and +1 on safe-mode after an abnormal terminate or on special-launch.
  • Ed: +1 on the general concept (the +.75 was for the offered implementation)
  • Bill Wharrie:
    • +1 for a flexible reset system i.e. one where the user can choose a complete wipe, or remove/reset-to-default some defined subset of preferences
    • +1 for being able to start Audacity in "safe" mode or similar, which would involve launching with a modifier key held down and would temporarily or permanently reset preferences.

Details

An external reset app

A small app that we can ship alongside Audacity that the user can run to force a total reset (needed sometimes as explained above "Display preferences can leave Audacity not appearing") and thus the user would never see Audacity running, let alone get access to Preferences.

As of 26 November 2014 there are two configuration files which seem to have the possibility of causing Audacity to not launch (or launch in an unusable condition): audacity.cfg & pluginregistry.cfg. These configuration files can be stored in either or both of two filesystem locations (the default or in a Portable Settings folder).

Given that these files are tiny, the external application could create a date-named (audacity26November2014.cfg) backup by renaming the current file instead of deleting it.

Ed 14Nov14 : an alternate possible solution for the cases where Audacity opens but is invisible, opens but its title bar is hidden behind the Mac title bar or Windows taskbar when docked at the top or opens briefly but self-terminates, would be to use a new command line switch (or maybe 2 - one to restore to defaults and another to allow the user to control the effects).

  • Gale 14Nov14: Does the user trigger the switch with a modified click on the executable? That saves a second app, but is probably undiscoverable by "normal" users without reading the docs.
    • Ed 26Nov14 : Not triggered by a modified click on the executable - requires Audacity to be started from a terminal/command line.
      • Gale 28Nov14: Which means most users can't use it. Have a look at the dialogue when you SHIFT-click on the Firefox executable.

External application design details

The original design criterion was a single button which deleted the default location (e.g. C:\Users\UserName\AppData\Roaming\Audacity) audacity.cfg file; at that time there was no such thing as pluginregistry.cfg. This design (as well as an expansion to three buttons: "both", "audacity" & "pluginregistry") with two wxWidgets-based applications to test is discussed in this forum thread: http://forum.audacityteam.org/viewtopic.php?f=20&t=63514 Until page 10 of that thread no consideration was given for Portable Settings.

  • Gale 28Nov14: IMHO we should not design this for bugs in pluginregistry.cfg. If audacity.cfg is deleted or initialised, the user is offered a plugin rescan. In that dialogue, the checkmarked effects only should be loaded, unless user presses Cancel. Pluginregistry.cfg should not continue to enable all its cached plugins as if Register Effects had not appeared. We may want to store a list of "bad" plug-ins somewhere however.

This external application could also be made more "surgical"; an early example was given which had panes for each of the Preferences pages allowing the user to reset only specified items to default. This was considered way too complicated, especially for an external application. However, given that one of the easiest ways to cause Audacity to be unavailable even though it launches successfully is to close it while its last open Project is on a secondary monitor then disconnect that secondary monitor, having a button which does nothing but cause Audacity to open in its default size and location might make sense.

  • Gale 28Nov14: Yes that might make sense, but the case for a button to set Language to English is probably equal or higher priority: http://bugzilla.audacityteam.org/show_bug.cgi?id=673.
  • Gale 28Nov14: Another option not raised elsewhere in this Proposal is to use the existing Windows installer feature to reset Audacity by writing "resetPrefs.txt" to the folder the external reset app runs from. This seems quite attractive for Windows. If on Mac we can write inside the folder the app runs from, it will work there too.
    • We can run the appropriate reset for the version of Audacity, so if run in 2.0.6 or earlier the replaced audacity.cfg will have "NewPrefsInitialized=1", otherwise not.
    • If there is a "Portable Settings folder", the audacity.cfg in that (which is the one that matters) gets reset, though not the one in the application data folder.
    • We get a ready-made prompt dialogue (Yes or No to reset Prefs when restarting Audacity) that should work cross-platform. I've tested it on Mac by adding resetPrefs.txt to the "Resources" folder in the Audacity.app bundle, and it seems to work fine.
    • We can change the current code in Prefs.cpp to do what we like if Audacity finds resetPrefs.txt, then the Windows installer would do the same as the external app (assuming we want consistency between the two).

A "Reset" button in Preferences panes

Rds.png Credits: Image by Ed

A "Reset" pane in Preferences

The avoids adding another menu command at the expense of a new prefs pane. What would this pane look like? What would it say and what steps would the user need to perform in order to reset preferences.

  • Gale: I think a Prefs pane would look pretty bare with just that. If we want more than an Edit menu button, then this Prefs pane could have e.g. save a copy of current .cfg. (and reload it), a bit like a "Theme" - could be e.g. a particular set of floated toolbars; or direct editing of .cfg.
    • James: Another option, we could put it on a general panel.
  • Peter 13Nov14: I would also support James' idea of a General Panel carrying a reset which would reset all Prefs (The problem with this approach would be that it would only be a Preferences reset and not a full reset to "factory settings" as the Toolbars would not be reset). Building on James' idea I would propose a "Reset" pane in Preferences with checkboxes for each Preference (by pane name). Such a pane would look far from bare like that, countering Gales's misgivings. This could avoid us having to put a Reset button on each individual pane.
    • Though I still like the possible option of additionally having Reset button on each of the Preferences dialogs as the user could then observe the default values being reset. We could avoid wordiness on the pane by having hover-help pop-ups with any dire warnings we want (is that possible with buttons?)

A "Reset Preferences" menu command

  • Peter 13Nov14: -1 I do not support a new Menu command for this, for a start it would end up being too blunt a tool and furthermore it would add unnecessarily to the Menu structure (which is almost somewhat over-burdened). Plus I don't se a logical place for it to live in the current menu tree.

Where does it go in the menu structure and how does it behave? What warnings are given and how are they worded?

  • There is consensus that some warning at least should be given.
    • A UI Q&A site has some recommendations about 'are you sure' wording. The gist is to keep it short, be specific and label the buttons specifically, not just Yes/No.

Current suggested wording:

Title: Reset Audacity Preferences?
Reset Preferences?  
[Reset|Cancel]

We could have a hyperlink to online help. Specifically NOT local help in case the location for that is messed up. Hyperlink won't help if the user does not have a normal browser, but could help many users.

  • Bill: I prefer "Reset" over "Delete". It's what we're doing, and I believe most apps use that word.
    • +1. So do I. James 16:53, 14 April 2011 (UTC)
    • +1 Ed
    • +1 Peter

Alternative suggested wording:

Title: Reset Audacity Preferences?
Reset Audacity preferences to default values?
[Reset|Cancel] where Cancel is the default
  • James: A bit wordy? 'Audacity' becomes 'verbosity'? See the tip in the UX link.
    • Gale: I think a little "verbosity" could be needed until we have a help system or specific help button. Thinking about it, "Preferences" is a little misleading. Cfg covers more than what is exposed in the Preferences. "Restore default settings?"
    • James: Then for consistency we should change 'preferences' to 'settings' throughout.... to me there is not enough in it to make the change. Would having the help hyperlink I suggested be enough to mollify you over the shorter prompt?
      • Gale: Hyperlink and shorter text and not in its own pane are all OK for me.
      • Ed: +1 hyperlink. +1 "settings" over "preferences"
Personal tools

Donate securely by PayPal, using your credit card or PayPal account!