varenius / salsa

Code developed for the 2.3m radio telescopes SALSA in Onsala, Sweden
MIT License
16 stars 6 forks source link

SALSA app doesn't remember last settings #74

Closed maltesk closed 2 years ago

maltesk commented 2 years ago

Describe the bug After using SALSA in Swedish and Simple mode, I close the app. Later, I restart it again from the desktop. I have to change manually to Simple mode and switch language every time.

To Reproduce Start SALSA app. Change language and/or tab (from Advanced to Simple). Close the SALSA app. Open the app again.

Expected behavior Expect same language as before, same tab visible as before.

Desktop (please complete the following information): Windows 10, Chrome 95.0.4638.69

varenius commented 2 years ago

This was thought to be a feature, i.e. that you always get the same settings when you start it. So, if you get confused, you can just re-open and start again. But, I see the point of being able to save settings. I would then imagine the user is asked upon closing time if the settings should be saved or not. Same at startup time, if the settings should be read from file or not.

The way to do this appears to be using the QSettings class, see e.g. https://www.youtube.com/watch?v=YUuGAf4jwWo. However, it seems one has to store and restore each property separately. Doing this for ALL the SALSA UI parameters is quite some work. Before we do this, I wonder: Is there any specific parts of the UI that you would like to be remembered? For example, if we only want to remember the tab (simple/advanced), this is a much smaller task than saving the full UI state. So, could you elaborate on what you would like to save and restore? Could we start with something (e.g. tab) and then add more later?

maltesk commented 2 years ago

Prio (1) tab and (2) language, please.

varenius commented 2 years ago

Great. Tab and language should be doable without too much work. I'll try to look at this next week.

varenius commented 2 years ago

Last used tab and language is now remembered after dbd45533d7b33eb0cec7687c990186f1b45c66fe

maltesk commented 2 years ago

looks good, verified on torre