Changeset 113:d1a1981520f5 for source


Ignore:
Timestamp:
Jan 19, 2009, 1:23:03 PM (15 years ago)
Author:
fnevgeny
Branch:
default
Phase:
public
Message:

Added pref to warn on exit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/class/pf/Application.js

    r112 r113  
    21332133            q = new qx.event.Command("Ctrl+R");
    21342134            q.addListener("execute", function(ev) {
    2135                 location.reload(true);
    2136             });
     2135                    if (!this.prefs.warnOnExit ||
     2136                        confirm("Restart Plasma Formulary?")) {
     2137                        this.intendedExit = true;
     2138                        location.reload(true);
     2139                    }
     2140                }, this);
    21372141            btn = new qx.legacy.ui.menu.Button("Restart", "pf/image/reset.png", q);
    21382142            submenu.add(btn);
     
    21402144            q = new qx.event.Command("Ctrl+Q");
    21412145            q.addListener("execute", function(ev) {
    2142                 window.close();
    2143             });
     2146                    if (!this.prefs.warnOnExit ||
     2147                        confirm("Quit Plasma Formulary?")) {
     2148                        this.intendedExit = true;
     2149                        window.close();
     2150                    }
     2151                }, this);
    21442152            btn = new qx.legacy.ui.menu.Button("Quit", "pf/image/exit.png", q);
    21452153            submenu.add(btn);
     
    23292337            }
    23302338           
     2339            if (undefined === this.prefs.warnOnExit) {
     2340                this.prefs.warnOnExit = true;
     2341            }
     2342           
    23312343            if (!this.prefs.units) {
    23322344                this.prefs.units = new Object;
     
    27082720            rc.add(e);
    27092721
     2722            e = new qx.legacy.ui.form.CheckBox("Warn on exit or restart");
     2723            e.setChecked(this.prefs.warnOnExit);
     2724            e.addListener("changeChecked", function(ev) {
     2725                this.prefs.warnOnExit = ev.getTarget().getChecked();
     2726            }, this);
     2727            rc.add(e);
     2728
    27102729            this.doc.add(w);
    27112730            this.prefsWindow = w;
     
    28652884           
    28662885            // Prompt user
    2867             // return "Do you really want to close the application?";
     2886            if (this.prefs.warnOnExit && !this.intendedExit) {
     2887                return "This will end your Plasma Formulary session.";
     2888            }
    28682889        }
    28692890    }
Note: See TracChangeset for help on using the changeset viewer.