[yast-devel] Inconsistent behavior of YaST Modules when closing without changes
This started as a discussion in https://bugzilla.suse.com/show_bug.cgi?id=1161460 which leads me to realize we have the same "hack" repeated in dozens of YaST modules. The point is that there is a function called `Popup::ReallyAbort` that all YaST modules call when asked to quit. The only argument of that function is a boolean saying whether something has changed. If nothing has changed, the function displays a "Really abort?" pop-up. But if some change has been made (i.e. the argument is true), it will add "All changes will be lost!" So we have a common API used by all modules to show a consistent behavior. So far, so good... Or not? Of course, not. This was surely conceived to be used like this: Popup.ReallyAbort(TheModule.modified?) But in practice most modules (all except 4 or 5, as far as I can say) use that function like this: def ReallyAbort !TheModule.modified? || Popup.ReallyAbort(true) end Which actually invalidates the logic of the function and simply shows nothing when quiting without changes. And that very same code is repeated over and over in a dozen of YaST modules. See [1]. Did we at some point decided that quiting without changes should not ask for confirmation? If so, why did we implement the very same bypass for the `Popup.ReallyAbort` logic in dozens of modules instead of changing the behavior of the function (or providing an alternative function)? We should agreed on which is the desired behavior and then implement it by using whatever common function (ReallyAbort or a new one) in an honest way. I created a card for that[2] but I wanted to start the discussion here first. Cheers [1] https://github.com/search?q=org%3Ayast+reallyabort&type=Code [2] https://trello.com/c/UlVLiDTU/ -- Ancor González Sosa YaST Team at SUSE Software Solutions -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Hi! On 3/2/20 15:26, Ancor Gonzalez Sosa wrote:
This started as a discussion in https://bugzilla.suse.com/show_bug.cgi?id=1161460 which leads me to realize we have the same "hack" repeated in dozens of YaST modules.
The point is that there is a function called `Popup::ReallyAbort` that all YaST modules call when asked to quit. The only argument of that function is a boolean saying whether something has changed. If nothing has changed, the function displays a "Really abort?" pop-up. But if some change has been made (i.e. the argument is true), it will add "All changes will be lost!"
So we have a common API used by all modules to show a consistent behavior. So far, so good... Or not? Of course, not. This was surely conceived to be used like this:
Popup.ReallyAbort(TheModule.modified?)
But in practice most modules (all except 4 or 5, as far as I can say) use that function like this:
def ReallyAbort !TheModule.modified? || Popup.ReallyAbort(true) end
Which actually invalidates the logic of the function and simply shows nothing when quiting without changes. And that very same code is repeated over and over in a dozen of YaST modules. See [1].
Did we at some point decided that quiting without changes should not ask for confirmation? If so, why did we implement the very same bypass for the `Popup.ReallyAbort` logic in dozens of modules instead of changing the behavior of the function (or providing an alternative function)?
We should agreed on which is the desired behavior
As user, I prefer to see confirmation popups only when needed. If I did not any change, there is nothing to worry about if I quit the module by mistake. I just need to run the module again. So, I vote for not displaying the "Really abort?" pop up if nothing changed.
and then implement it by using whatever common function (ReallyAbort or a new one) in an honest way. I created a card for that[2] but I wanted to start the discussion here first.
Thanks
Cheers
[1] https://github.com/search?q=org%3Ayast+reallyabort&type=Code [2] https://trello.com/c/UlVLiDTU/
-- David Díaz González YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Ancor Gonzalez Sosa
-
David Díaz