From e53b2285b2bc8c17a414002213495951d057b522 2014-03-07 19:51:54 From: MinRK Date: 2014-03-07 19:51:54 Subject: [PATCH] Correct initial state of kernel status indicator - start as busy, since we don't know - send a kernel_info request once connections are established - set idle on reply to the to the kernel_info request --- diff --git a/IPython/html/static/notebook/js/notificationarea.js b/IPython/html/static/notebook/js/notificationarea.js index 8656b49..120c5d9 100644 --- a/IPython/html/static/notebook/js/notificationarea.js +++ b/IPython/html/static/notebook/js/notificationarea.js @@ -102,6 +102,16 @@ var IPython = (function (IPython) { $([IPython.events]).on('status_interrupting.Kernel',function () { knw.set_message("Interrupting kernel", 2000); }); + + // Start the kernel indicator in the busy state, and send a kernel_info request. + // When the kernel_info reply arrives, the kernel is idle. + $kernel_ind_icon.attr('class','icon-circle').attr('title','Kernel Busy'); + + $([IPython.events]).on('status_started.Kernel', function (evt, data) { + data.kernel.kernel_info(function () { + $([IPython.events]).trigger('status_idle.Kernel'); + }); + }); $([IPython.events]).on('status_dead.Kernel',function () { var msg = 'The kernel has died, and the automatic restart has failed.' +