rename Halt to Shutdown

Paul Ivanov 9 years ago
parent 95790be956
commit 03e410ba61

@ -75,18 +75,18 @@ define(function(require){
env.notebook.show_shortcuts_editor();
}
},
'halt-kernel': {
help: 'Halt the kernel (no confirmation dialog)',
'shutdown-kernel': {
help: 'Shutdownthe kernel (no confirmation dialog)',
handler: function (env) {
env.notebook.halt_kernel({confirm: false});
env.notebook.shutdown_kernel({confirm: false});
}
},
'confirm-halt-kernel':{
'confirm-shutdown-kernel':{
icon: 'fa-repeat',
help_index : 'hb',
help: 'Shutdown the kernel (with confirmation dialog)',
handler : function (env) {
env.notebook.halt_kernel();
env.notebook.shutdown_kernel();
}
},
'restart-kernel': {

@ -250,7 +250,7 @@ define([
'#rename_notebook' : 'rename-notebook',
'#find_and_replace' : 'find-and-replace',
'#save_checkpoint': 'save-notebook',
'#halt_kernel': 'confirm-halt-kernel',
'#shutdown_kernel': 'confirm-shutdown-kernel',
'#restart_kernel': 'confirm-restart-kernel',
'#restart_clear_output': 'confirm-restart-kernel-and-clear-output',
'#restart_run_all': 'confirm-restart-kernel-and-run-all-cells',

@ -2262,26 +2262,26 @@ define([
* Prompt the user to restart the kernel.
* if options.confirm === false, no confirmation dialog is shown.
*/
Notebook.prototype.halt_kernel = function (options) {
Notebook.prototype.shutdown_kernel = function (options) {
var that = this;
var halt_options = {};
halt_options.confirm = (options || {}).confirm;
halt_options.dialog = {
title : "Halt kernel?",
var shutdown_options = {};
shutdown_options.confirm = (options || {}).confirm;
shutdown_options.dialog = {
title : "Shutdown kernel?",
body : $("<p/>").text(
'Do you want to halt the current kernel? All variables will be lost.'
'Do you want to shutdown the current kernel? All variables will be lost.'
),
buttons : {
"Halt" : {
"Shutdown" : {
"class" : "btn-danger",
"click" : function () {},
},
}
};
halt_options.kernel_action = function() {
shutdown_options.kernel_action = function() {
that.session.delete();
};
return this._restart_kernel(halt_options);
return this._restart_kernel(shutdown_options);
};
Notebook.prototype.restart_kernel = function (options) {

@ -270,7 +270,7 @@ data-notebook-path="{{notebook_path | urlencode}}"
title="Reconnect to the Kernel">
<a href="#">Reconnect</a>
</li>
<li id="halt_kernel"
<li id="shutdown_kernel"
title="Shutdown the Kernel">
<a href="#">Shutdown</a>
</li>

@ -2,7 +2,7 @@
casper.notebook_test(function () {
var that = this;
var menuItems = ['#restart_kernel', '#restart_clear_output', '#restart_run_all', '#halt_kernel']
var menuItems = ['#restart_kernel', '#restart_clear_output', '#restart_run_all', '#shutdown_kernel']
var cancelSelector = ".modal-footer button:first-of-type"
menuItems.forEach( function(selector) {
@ -15,11 +15,11 @@ casper.notebook_test(function () {
});
});
var haltSelector = menuItems.pop();
var shutdownSelector = menuItems.pop();
var confirmSelector = ".modal-footer .btn-danger"
menuItems.forEach( function(selector) {
that.thenClick(haltSelector);
that.thenClick(shutdownSelector);
that.waitForSelector(confirmSelector);
that.thenClick(confirmSelector);
@ -36,7 +36,7 @@ casper.notebook_test(function () {
return IPython.notebook.kernel.is_connected() === true;
})});
that.then(function() {
that.test.assert(true, "no confirmation for " + selector + " after session halted")
that.test.assert(true, "no confirmation for " + selector + " after session shutdown")
})
});

Loading…
Cancel
Save