Anyone got a way to prevent multiple message boxes at the same time?
-
I'm working on my download manager and when a download fails it pops up with a message to let the user know - using
Engine.showMessageBox()
The problem is if one file in a download fails, usually they all fail and so multiple messages are shown which is annoying, especially when there are a lot of downloads.
-
@d-healey Maybe a solution could be to run your own modal so you can keep track of its state.
Or could the MultiPage system be of any use here? -
@ustk I want to avoid building my own system for this single use-case. Not sure how the multipage thingy could help, I haven't used it before.
-
Is that the only place you're calling it? You could have a counter along with it, and a check for the overall execution. Decrease the counter when pressing ok or whatever.
Settle on a variable name and check for it anywhere you make that call. Good thing about if checks is that they don't require a variable to be defined to check, it'll just return false, so it doesn't compromise your modular focus.
-
@aaronventure said in Anyone got a way to prevent multiple message boxes at the same time?:
Decrease the counter when pressing ok or whatever.
How?
-
@d-healey Isn't there a callback, like a function for when you hit ok?
EDIT: Ah, that's the showYesNoWindow method.
-
Your own solution for this is just a panel that you're calling with showAsPopup, You can ignore hierarchy with the setZLevel method, although it doesn't work in on init, so you need to call it whenever you're showing the panel.
Other than that it's pretty much self contained, it'll just appear in your component list whenever you include that module. But unlike the ok popup, you get to do whatever you want with it, and without having to adjust the global LAF.
HiseSnippet 1046.3ocsV0saaaCElxwJq1qsncnO.B9J0gfB6XWmDLLzl3jzYzlDg4zhgdSAsHULgoHEDoRiaQtaOO6UXOK6MXuAaGJJYqT6kzZf4KjE44uuygmuCUPpLjpTxTjSyymkPQN22czLgdxfIXl.M7PjyCcOAqzzTO6VGLKAqTTBxwYiWY1voQcT9u+9EGf4XQHcwVHz6jrP5aXwL8hcCd4qYb9wXB8bVbEs68xggRw.IWlA3YC21nDb3T7EzSwF0p4h9ErZBx4Gca+79T5NciHDb2tj986u2t60auN3n18vi6zeuda2ams2cmHjylGQXZY5HMVSUfSOPRlMZh7iBa.dGSwFyolEcPifHa2FMXBiSBJKNJDxodvhR0F1R0SbOgQXy2eQI6Q4B7VXQ0hlSsaCRc9FfjSEHU2BoG6NJLkknWHwfmu2cn.NAivvYSUnX0EU680bGHAMD5mEimRONEVL2B+9saukG73o+Tylv4iR6kH3d+rWoIXBI.Knb+VIl+ZskGnuQaPsmonZ+VLUfLIKInPrNMiZbVg2lJFeSu8ZgbreqovyE9xp5Xs3lpdPlVKE9sFm+OndWCX6ZAKSvYBpWTlHTyjBOovplw9TI2OTFmHEfm1x6RLGvTyO2rAKxy2txqYCXci7r.Nd12lD9EnuP.U+92Puzj76y+Hdl5Lw4xjVF4W2rAkqnU7RHWpnktwpx0.LKSmKn5AkHZdF8TSHJ.7.LmOFXD9eQh.tpRNdpTSOS3mmLMuto2WJJJZkxJ7EmltRwFlZ5sYnuHKdLMsZoznHzYdy18M+5Z2CsEkJJJECEL8YIzh0GK4DSar48kIGnhpJPSpUfPPUcNI4gEjjQbFglhXfS1z0ztgxwd0wWn+KasMd41dOW6owJr9sCODqwFpZAb.HlPS0LSkv4P5kvvQKwsg6gT0TsLAhz7t.jiqMpOnjVaXP4A86byIanq.cbLgZV4KUIal8browbWd+6pHrrKU5YlSnMcMLSTLiP3z.ohY5.pL++OgqIRFw9TdM3yO4Od0e8oe+EwUuh.ghwWU8FCUVTD6p7Y6QLdrRCPZXLLxG47CtuEXODZDNiq8TSA+.z4oTx4xb8qlS0u6Cm7rZKmhrx7BZ4wmvfaIIii02bZt4dtBAlLt5HTyXRATIlUMq9FFw29VGw+0BwG6FvzgSVMFqsBLZnE+OfwhKFef6QQQzP8B.V283eacuE7NB+uJyzLwEmfgdGyg7oYwifOfHjBQW.b.k47tlgCXW2trqdDUPxW7OvuBgcJYLFgcJEBcsgoxODZmEXt58d46.XRj+oIMfuQBV60Y4Y..ag8gvva5pkLb600vtqqg8VWCe95ZX+00vcVWC28tMz7gZ6mokwVZCBcRvQ4yrcbNRfgNv7tUz+ZKlUDH
-
@aaronventure Oh yeah I know several ways to roll my own system, but I'd like to avoid having to do that. I'm also thinking is there any occasion where we would want more than one of these alert windows to be shown at the same time.
-
@d-healey said in Anyone got a way to prevent multiple message boxes at the same time?:
want more than one of these alert windows to be shown at the same time.
Sure, when making a Windows-like UX