-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to allow auto save while playing #3088
Conversation
8b6b3a9
to
ec5abd6
Compare
@Umcaruje I turned auto save on by default. I'm trying to do the same for the new "running auto save" setting, but inverting button logic in SetupDialog.cpp has a tendency to mess my mind up. All the way up and every time. 💫 |
1a68220
to
3e4a9b2
Compare
The new LED switch is going to be a bit harder to grey out than the slider. |
3e4a9b2
to
fa15c31
Compare
@zonkmachine is this ready for testing? |
Yes. As I turned off 'disabling the slider' when auto save is off the action is not as clear as it was previously but it will take some effort to give the same functionality to the 'running auto save button'. Testing and feedback is appreciated. |
fa15c31
to
2e32cd5
Compare
All issues solved, ready for review! As the LED checkbox when disabled still displays it's value, and that's surprisingly confusing, I set the second option invisible instead. Works! |
@LMMS/artwork-team Should I move the bottom LED in a bit from the side to show that it's subordinated the Enable LED? |
I would recommend |
2e32cd5
to
d435e76
Compare
d435e76
to
b404109
Compare
Maybe just the word |
If default is on, sure. |
b404109
to
6965774
Compare
@zonkmachine the only thing that's not immediately intuitive is that the slider enables/disables this feature. Perhaps the best of both worlds would be to make the slider and the first LED linked, or labels under the tick marks suggesting. My opinion is that auto-save should be on, always with no option to disable. If there are performance problems, we make those priority but I really don't understand why anyone wouldn't want a recovery option. Telling the software how many seconds/minutes is IMO too granular for the average user. That's my 2 cents. |
It doesn't for me and it isn't supposed to. |
OK I'm confused then. You've replaced a check box with a label so I'm not sure what's going on. |
Or are you hiding the child check box? |
I'll look into it. |
The |
@zonkmachine thanks for the explanation. That makes sense. |
I agree on having auto-save always on. I think the best take on it is what @jasp00 suggests in this comment from issue 181. Then we wouldn't need to bother about saving in a lower priority thread and can just drop the auto-save settings altogether. But for now I think this is probably the best option.
One point in doing it this way is that it becomes manageable for someone who isn't an experienced coder like me. Performance was one of the first things I looked at when I started working on the auto-save function but I dropped it pretty quickly. And fundamentally changing how it's done would take someone more experienced and there are more important things to take on. |
I'm happy with this now. Anything else to be done here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This request is conceptually wrong.
@@ -124,7 +124,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : | |||
#endif | |||
m_backgroundArtwork( QDir::toNativeSeparators( ConfigManager::inst()->backgroundArtwork() ) ), | |||
m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ), | |||
m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() ), | |||
m_disableAutoSave( !ConfigManager::inst()->value( "ui", "disableautosave" ).toInt() ), | |||
m_disableRunningAutoSave( !ConfigManager::inst()->value( "ui", "disablerunningautosave" ).toInt() ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double negations should be avoided; "enable" should be preferred over "disable". This code does not make sense, because it looks like:
m_disableAutoSave = !disableautosave
m_disableRunningAutoSave = !disablerunningautosave
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm looking at clearing this up now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
m_runningAutoSave = new LedCheckBox( | ||
tr( "Allow auto-save while playing" ), auto_save_tw ); | ||
m_runningAutoSave->move( 20, 90 ); | ||
m_runningAutoSave->setChecked( m_disableRunningAutoSave ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem here:
runningAutoSave = disableRunningAutoSave
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ConfigManager::inst()->setValue( "ui", "enableautosave", | ||
QString::number( m_enableAutoSave ) ); | ||
ConfigManager::inst()->setValue( "ui", "disableautosave", | ||
QString::number( !m_disableAutoSave ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem:
disableautosave = !disableAutoSave
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ConfigManager::inst()->setValue( "ui", "saveinterval", | ||
QString::number( m_saveInterval ) ); | ||
ConfigManager::inst()->setValue( "ui", "disablerunningautosave", | ||
QString::number( !m_disableRunningAutoSave ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
void SetupDialog::toggleAutoSave( bool _enabled ) | ||
{ | ||
m_enableAutoSave = _enabled; | ||
m_disableAutoSave = _enabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disable means enable, etc.
What is the reason?
m_saveIntervalLbl->setText( tr( "Auto save interval: %1 %2" ).arg( | ||
QString::number( m_saveInterval ), minutes ) ); | ||
minutes = QString( "%1 %2" ).arg( QString::number( m_saveInterval ), minutes ); | ||
minutes = m_disableAutoSave ? minutes : tr( "Disabled" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not disable, it is disabled.
* Option to allow auto save while playing
Since most systems have no problems saving a project while playing we could add this as an option.
The problem here is that if you edit a project while playing (or just do very short stops so the autosave doesn't have time enough to start) you may end up not getting a backup for a very long time and you wouldn't know about it.