-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
wxGUI: Split widget initialization from notebook logic #1591
wxGUI: Split widget initialization from notebook logic #1591
Conversation
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 haven't tested it yet, but in general makes sense, although I am not sure actually how helpful this will be. There are couple things to address.
gui/wxpython/lmgr/frame.py
Outdated
| @@ -149,7 +149,9 @@ def show_menu_errors(messages): | |||
| # create widgets | |||
| self._createMenuBar() | |||
| self.statusbar = self.CreateStatusBar(number=1) | |||
| self.notebook = self._createNoteBook() | |||
| notebook = self._createNotebook() | |||
| self._createWidgets(notebook) | |||
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.
Unless createWidgets is used also elesewhere, I think it's unnecessary function, I would just put there its content directly, it will be more readable.
gui/wxpython/lmgr/frame.py
Outdated
| self.notebook = self._createNoteBook() | ||
| notebook = self._createNotebook() | ||
| self._createWidgets(notebook) | ||
| self.notebook = self._addPagesToNotebook(notebook) |
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.
This function probably shouldn't return the notebook.
gui/wxpython/lmgr/frame.py
Outdated
| self._createDataCatalogWidget(parent) | ||
| self._createDisplayWidget(parent) | ||
| self._createSearchModuleWidget(parent) | ||
| self._createConsoleWidget(parent) | ||
| self._createPythonShellWidget(parent) |
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.
The work widget seems to be redundant in the function names.
Splits widget initialization (data catalog, display etc.) from notebook logic. Makes smaller methods for each widget creation.