Settings/preferences menu

The need for a settings dialog in Avogadro has been discussed several times recently. It would be good to collect together a list of what should be put into it from the various threads mentioning the idea.

Please comment with any ideas!

Things that come to mind:

  • User-interface language
  • Python path, environment settings
  • Rendering options
  • Atom indexing from 0 or 1
  • Element colours
  • Scroll wheel/gesture inversion

Other possible options, but maybe preferable to keep elsewhere:

  • Background colour

Edit: additions:

  • Preferred unit of energy (Hartree, eV, kJ/mol, kcal/mol)
  • Preferred unit of length (Angstrom, pm, nm)
  • Light/dark mode switch

Downloading / installing / activating scripts seems like it would be useful too

Do you mean what is currently under Extensions > Download plugins...?

I added an issue to the tracker:

Seems like I can’t edit the original post any more.

Additional settings ideas:

  • Preferred units for IR frequencies (wavenumber in cm-1, wavelength in µm)
  • Preferred units for UV-vis absorptions (wavelength in nm, energy in eV)

The light/dark mode switch would be a manual switch to override the automatic switching that Avogadro now successfully does by itself. Maybe it isn’t necessary. Though it is useful failsafe behaviour.

The unit preferences would need to permeate to various other parts of the interface. I’ll start making notes of those places on the GitHub issue as I spot them, else I’ll forget them again.

I guess there will need to be some sort of object that contains the user’s configuration that other parts of the code can import and read. Does that already exist @ghutchis and if so where is it? E.g. for the Python settings that are already implemented.

It would be good if the user’s config could also be passed to extensions as a dictionary, as part of the stuff sent via stdin. Minus any sensitive information that could be abused by plugins, I guess.

I think these need to be added to the spectra dialog itself. (For example NMR visualization needs a popup to pick \ce{^1H} or \ce{^{13}C} etc.

This is handled by Qt. Anytime you create a QSettings object, it grabs the correct settings automatically. These are key / value pairs, although you can add contexts (e.g. spectra/units/ir or similar).

I guess the next step is whether this is a dialog with sections / tabs (like Avo 1.2) or a menu with options.

I’d generally prefer the dialog, since most programs have Settings / Preferences dialogs, although it may be easier to move some existing menu commands (e.g., UI language) into a submenu.

So … if there’s a new menu item for the dialog (and maybe a submenu) where do they live?