Skip to content
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: Do not automatically open Project Explorer when opening project if user closed it #7546

Merged
merged 5 commits into from
Jul 25, 2018

Conversation

jitseniesen
Copy link
Member

Pull Request Checklist

  • Read and followed this repo's Contributing Guidelines
  • Based your PR on the latest version of the correct branch (master or 3.x)
  • Followed PEP8 for code style
  • Ensured your pull request hasn't eliminated unrelated blank lines/spaces,
    modified the spyder/defaults directory, or added new icons/assets
  • Wrote at least one-line docstrings for any new functions
  • Added at least one unit test covering the changes, if at all possible
  • Described your changes and the motivation for them below
  • Noted what issue(s) this pull request resolves, creating one if needed
  • Included a screenshot, if this PR makes any visible changes to the UI N/A

Description of Changes

Create a new config option for the projects plugin called visible_if_project_open, defaulting to True to mimic current behaviour. When closing a project or quitting Spyder with a project open, set or clear this according to whether the Project Explorer is open. When creating a new project or opening an existing project, open the Project Explorer only if the config option is set.

The effect is that if a user opens a project, closes the Project Explorer and then restarts Spyder, the Project Explorer is not opened again, as opposed to the current situation where it is opened.

Issue(s) Resolved

Fixes #6292

@pep8speaks
Copy link

pep8speaks commented Jul 24, 2018

Hello @jitseniesen! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on July 24, 2018 at 14:36 Hours UTC

@ccordoba12 ccordoba12 added this to the v3.3.1 milestone Jul 24, 2018
I used the module name of the master branch instead of the 3.x branch.
@@ -14,6 +14,7 @@
import pytest

# Local imports
import spyder.plugins.base
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only valid in master. For 3.x you need to write:

import spyder.plugins

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tested against master, then rebased against 3.x, but forgot to run the tests again. Stupid.

@ccordoba12
Copy link
Member

ccordoba12 commented Jul 24, 2018

This looks very good, but I have one remark: the project explorer is a good indicator that Spyder is in project mode.

Now, after this, if users create a new project but closed the project explorer while the previous one was active, it won't show up again. So the only indicator left would be the addition of the projects' name to the window title. Is that ok for you @jitseniesen?

@jitseniesen
Copy link
Member Author

For me it's okay. I don't need an indication of project mode. I have half a dozen of projects I work on and I open them immediately when opening Spyder, or I work on single files in which case I don't use a project. The main difference of project mode for me is that the project directory is in the Python path, so my scripts have an ImportError if I run them outside project mode.

To be honest, I don't know what other users think of it, but (barring usability testing) the only way to find out is to try and the current behaviour is annoying several people. If we do need an indicator, surely we can do this with less screen area real estate.

@ccordoba12
Copy link
Member

Ok, in the spirit of "open source is about scratching your own itch", I'm going to merge this one.

Let's see what other users think about it.

@ccordoba12 ccordoba12 merged commit 589c940 into spyder-ide:3.x Jul 25, 2018
ccordoba12 added a commit that referenced this pull request Jul 25, 2018
@jitseniesen jitseniesen deleted the projexp branch July 31, 2018 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants