-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
PR: Split off part of NotebookPlugin into NotebookTabWidget #283
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This code was left behind when support for Python 2 was dropped.
The code suggests that this function is called when the user moves a tab in order to keep the list in `self.clients` in the same order as the tabs. However, as far as I can tell, this function is never actually called, the order in `self.clients` is not synchronized, and the order is not actually used.
This is going to be the main widget of the plugin. The idea is that you can also use this widget independent of Spyder.
I also removed switching to the plugin whenever a tab is added because I don't see why it is useful: a tab is only added when the user requests it, in which case the plugin already has focus, or at startup, in which case the plugin need not get focus.
Also rename the function from create_welcome_tab to maybe_create_welcome_tab to indicate that the welcome tab is not always created, and change the example app to create a welcome tab.
Update example app to allow opening new and existing notebooks.
Instead, change the test so that it expects the widget to behave as normal.
The function .currentIndex() works just as well.
The new names better reflects their meaning.
Before, if the user closes a tab with a newly created notebook and chooses to save it under a different name when prompted, a new tab would be opened with the new file name. This commit prevents the opening of the new tab.
QTabbedWidget keeks track of all the tabs so there is no need to duplicate that in NotebookTabWidget.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR splits the NotebookPlugin class in two parts: one part which handles the tabbed widget and one part responsible for integrating it into Spyder. There should not be any user visible changes.
I used the occasion to do some general clean up, including:
Fixes #275