New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confirm restart (configuration option, and checkbox UI) #1746
Conversation
As with the other PR, I think the idea is useful, but I'm not convinced we should add ever more menu entries. Also, thanks for the spelling & grammar fixes, but in future, can you do them separately from functional pull requests? It makes the diff much bigger, so it's harder to see what's really changed. For that sort of straightforward clean up, I think it's OK to push straight to master - or if you do a typo-fixing pull request, we'll fast-track it in. |
@ivanov, Or we should do it an the whole qtconsole as 1 option, not per tab. As for the UI, the kernel menu is light now, and I think beeing able to toggle without restarting the qtconsole makes sens. You can also bind a force restart to a much more complicated shortcut that people won't hit by mistake (not ctrl+shift+dot, as dot is accessed by pressing shift on some non-english keyboard, |
@ivanov, do you think the status mismatch is fixable? I'm leery of committing code we know can potentially expose inconsistencies like this. As always, better not to have a feature than to have a half-working one... |
Now, one can use the following to not get nagged for confirmation every kernel restart: ipython qtconsole --IPythonWidget.confirm_restart=False As with all configuration setting, setting this permanently requires editing one's profile.
There's a limitation to this implementation where the checkbox may not represent the state of confirm_restart for the current tab, but it does get set the appropriate value if it is ever toggled.
ok, i pushed the typo commit straight to master, so the non-trivial hanges should be clearer now. I'll work on the status mismatch |
The way I originally wrote the code, it was possible for the "Kernel" -> "Confirm kernel restart" checkbox to get out of sync with the currently active tab. It turns out that QTabWidget has a 'currentChanged' slot that can be leveraged to update the checkbox to properly reflect the currently active tab widget.
Ok, this PR is now fully ready. @fperez: turns out it was fixable. The checkbox gets updated whenever the active tab is switched, so there will not be any inconsistencies. @Carreau: it is a per-tab option. the menu will update properly now as you change between tabs. @takluyver: I don't think it clutters up the menu, since the |
got this at startup, but it seem to work though :
|
This works well for multiple kernels, and the UI makes sense, so I am going ahead with merge. |
Confirm kernel restart in QtConsole (configuration option, and checkbox UI)
Confirm kernel restart in QtConsole (configuration option, and checkbox UI)
Now, one can use the following to not get nagged for confirmation every
kernel restart:
As with all configuration settings, setting this permanently requires editing one's profile.
I also added code to expose
confirm_restart
via checkbox menu item in the Kernel menu.Note: There's a limitation to this implementation where the checkbox may not represent the state of confirm_restart for the current tab, but it does get set to the appropriate value if it is ever toggled.
update: This issue was fixed in a41db72
Finally, I did a bunch of typo clean up in the two related files.update: these were committed directly to master, so now this PR is only the relevant code