michalpolkowski / alt-f

Automatically exported from code.google.com/p/alt-f
0 stars 0 forks source link

No warning issued if not saving settings #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Change a setting
2. Select another menu entry. No warning is given
3. Leave Web gui without saving settings
4. Reboot
5. Your change is lost

What is the expected output? What do you see instead?
A warning should be issued when leaving a page wothout saving settings.
In particular, if you create a user, changes will belost if not saved.
It should be good to have a "save settings button" on evry page, and test 
exiting the page without saving.

What version of the product are you using? On what operating system?
0.1B7

Please provide any additional information below.

Original issue reported on code.google.com by gabriele...@gmail.com on 15 Sep 2011 at 9:36

GoogleCodeExporter commented 9 years ago
> A warning should be issued when leaving a page wothout saving settings

And it is, in big red letter under the page title: "When done you should save 
settings", and if keeping the mouse over the warning the list of changed files 
is shown (at least in Firefox).

Original comment by whoami.j...@gmail.com on 16 Sep 2011 at 4:08

GoogleCodeExporter commented 9 years ago
I saw it. Really :)
But I think it should be better to pupup a Javascript warning on every page 
change if settings are not saved.

And provide a "Save Changes" "Discard Changes" on every page.

In these way no one can forget to save the damn settings ;)

Something like (I'm not a coder ...) :

<body onUnload="checkSavedsettings()">

<script type="text/javascript">
function checkSavedsettings() {
    // place your code here ...

    if (settingsNotSaved()) {
        var r=confirm("Do you want to save changes before leaving this page ?");
        if (r==true) {
            //alert("You pressed OK!");
            saveSettings();
        }
        else {
            // alert("You pressed Cancel!");
            // Do nothing and go back to the page.
            // You can choose discard or save directly on the page
        }
    }

}
</script>

<!-- blah blah ..->

</body>

Cheers,
Gabriele

Original comment by gabriele...@gmail.com on 16 Sep 2011 at 4:37