add a dropdown button action to save and exit prefs (closes #660)

This commit is contained in:
Andrew Dolgov 2013-04-04 14:53:36 +04:00
parent e6cdbaec9f
commit 122e9d788e
1 changed files with 11 additions and 4 deletions

View File

@ -429,8 +429,8 @@ class Pref_Prefs extends Handler_Protected {
print "<form dojoType=\"dijit.form.Form\" id=\"changeSettingsForm\">"; print "<form dojoType=\"dijit.form.Form\" id=\"changeSettingsForm\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt, quit\">
evt.preventDefault(); if (evt) evt.preventDefault();
if (this.validate()) { if (this.validate()) {
console.log(dojo.objectToQuery(this.getValues())); console.log(dojo.objectToQuery(this.getValues()));
@ -439,6 +439,7 @@ class Pref_Prefs extends Handler_Protected {
onComplete: function(transport) { onComplete: function(transport) {
var msg = transport.responseText; var msg = transport.responseText;
notify_info(msg); notify_info(msg);
if (quit) gotoMain();
} }); } });
} }
</script>"; </script>";
@ -644,8 +645,14 @@ class Pref_Prefs extends Handler_Protected {
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">"; print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"saveconfig\">"; print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"saveconfig\">";
print "<button dojoType=\"dijit.form.Button\" type=\"submit\">". print "<div dojoType=\"dijit.form.ComboButton\" type=\"submit\">
__('Save configuration')."</button> "; <span>".__('Save configuration')."</span>
<div dojoType=\"dijit.DropDownMenu\">
<div dojoType=\"dijit.MenuItem\"
onclick=\"dijit.byId('changeSettingsForm').onSubmit(null, true)\">".
__("Save and exit preferences")."</div>
</div>
</div>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return editProfiles()\">". print "<button dojoType=\"dijit.form.Button\" onclick=\"return editProfiles()\">".
__('Manage profiles')."</button> "; __('Manage profiles')."</button> ";