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
Provide means for starting the Qt console maximized and with the menu bar hidden #3431
Conversation
Hi @dankilman - thanks for your contribution. I haven't checked if the implementation you provide works, but here's a simple patch that demonstrates how you can integrate with the config system, and get the documentation / help string to show up when a user would do diff --git a/IPython/frontend/qt/console/qtconsoleapp.py b/IPython/frontend/qt/console/qtconsoleapp.py
index 3aba384..cfe140e 100644
--- a/IPython/frontend/qt/console/qtconsoleapp.py
+++ b/IPython/frontend/qt/console/qtconsoleapp.py
@@ -166,6 +166,8 @@ class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):
stylesheet = Unicode('', config=True,
help="path to a custom CSS stylesheet")
+ weirdo_option = CBool(False, config=True, help="this is a weirdo option")
+
plain = CBool(False, config=True,
help="Use a plaintext widget instead of rich text (plain can't print/save).") and with a change like that, the docs show up when you run: $ ipython qtconsole --help-all | grep -A1 weirdo
--IPythonQtConsoleApp.weirdo_option=<CBool>
Default: False
this is a weirdo option So go ahead and add another commit (or better yet, if you're feeling adventures, make the changes and then |
Thanks. Looks better now. |
@@ -113,6 +113,9 @@ def gui_excepthook(exctype, value, tb): | |||
|
|||
editor = 'IPythonWidget.editor', | |||
paging = 'ConsoleWidget.paging', | |||
|
|||
hide_menubar = 'IPythonQtConsoleApp.hide_menubar', | |||
start_maximized = 'IPythonQtConsoleApp.start_maximized', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these need aliases. Everything is still configurable, even without aliases.
What exactly does Also, maybe the simpler name |
@ellisonbg It silently ignores hide_menubar configuration on OSX. I tested this on linux. |
Ahh, great I missed the skip logic on OS X. Once you change the name I will give it another review and merge. Thanks! |
@ellisonbg Done. |
|
||
maximize = CBool(False, config=True, | ||
help="Start the console window maximized.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need these aliases, every configurable is always available, even if they aren't added to the shortlist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a duplicate of your previous comment?
I removed the aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, yes. I thought I forgot to make that comment. Please ignore me :)
Looks great, merging. |
Provide means for starting the Qt console maximized and with the menu bar hidden
Provide means for starting the Qt console maximized and with the menu bar hidden
Not sure if this is exactly the correct approach to using the config, but what I wanted was the option to start the Qt console as mentioned above.
to use:
IPythonQtConsoleApp.hide_menubar = True
IPythonQtConsoleApp.start_maximized = True
I'm also not sure where should the documentation for these be put.