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

Fill in missing global run config options #2198

Merged
merged 3 commits into from
Apr 16, 2015

Conversation

blink1073
Copy link
Contributor

This extends the global Run config to match the file-level one.

screenshot from 2015-02-24 18 09 52

Results in:

screenshot from 2015-02-24 18 10 05

@goanpeca
Copy link
Member

Hi @blink1073 , question,: are the options in both dialog hard/hand coded? If yes would it be possible to reuse the dialog content inside the file level dialog to the one in the config one?, in order to keep things DRY?

@blink1073
Copy link
Contributor Author

@goanpeca, they are hand coded in two places. I did not see a way to reuse the Editor plugin code in the Preferences Page because the preferences page uses the helper methods to create the widgets and register the config/callbacks. There could be work done in the future to make Plugins and Preference Panels play better together.

@goanpeca
Copy link
Member

@blink1073 True!, ok I will test this tomorrow :)

@larsoner
Copy link
Contributor

BTW thanks for doing this, I've wanted to be able to set those options as default for a while now, but never got around to fixing it myself.

@blink1073
Copy link
Contributor Author

@Eric89GXL, my pleasure.

wdir_layout.addWidget(dirname_radio)
wdir_layout.addLayout(thisdir_layout)
wdir_group.setLayout(wdir_layout)
post_mortem = self.create_checkbox(_("Enter post mortem debugging for uncaught exceptions"), 'post_mortem', False)
Copy link
Member

Choose a reason for hiding this comment

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

79 columns here, please :-)

Copy link
Member

Choose a reason for hiding this comment

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

Also, I'd like to reword the message a bit (given that our audience is mostly scientists). What about:

Enter debugging mode when errors appear during execution

@ccordoba12
Copy link
Member

Other than my minor comments, I think this is ok.

@blink1073 do you have something to say about the question @goanpeca asked in the first comment?

@blink1073
Copy link
Contributor Author

@ccordoba12, I did address his comment (I believe), in the comment following his.

@goanpeca
Copy link
Member

goanpeca commented Mar 1, 2015

@ccordoba12, @blink1073 did address the comment, for the moment should be good to go, but it really raises the issue of making different parts inside Spyder reusable.

I have some ideas for this, some refactoring would be needed so that we can have the GUI defined as dics with the info of the widget (organization) and set the defaults and signals (as another dic maybe...) so that the GUI elements could be completely recycled without having to code by hand (in different ways...) in two or more places. Or we could start using *.ui files to define this reusable components inside Spyder.

Opinions?

@blink1073
Copy link
Contributor Author

@goanpeca, we have formlayout which creates a GUI based on dicts, so you could start from there.

@goanpeca
Copy link
Member

goanpeca commented Mar 2, 2015

@blink1073, I will take a look. Just some comments we could elaborate on this

Own solution

Pros

  • We can tailor it to our specific needs
  • Stick to Python

Cons

  • Kinda "reinventing" the wheel?
  • MVC (or at least MV) paradigm is weakly enforced

QtDesigner

Pros

  • Standard tool
  • MVC (or at least MV) paradigm could be enforced more neatly?
  • Qt binding agnostic?

Cons

  • Intermediate compilation step of the .ui file
  • Need for an additional tool (QtDesigner)
  • PyQt is a must

@ccordoba12 ccordoba12 added this to the v2.4 milestone Mar 2, 2015
@blink1073
Copy link
Contributor Author

@goanpeca, I am personally not a fan of QtDesigner.

@ccordoba12
Copy link
Member

@goanpeca, I don't like QtDesigner either. Having our code as pure Python makes it really easy to hack on it.

@goanpeca
Copy link
Member

goanpeca commented Mar 5, 2015

@ccordoba12 , @blink1073 , I understand :), I am myself not a super fan :p. I will look to what Steven suggests and think of something to allow us reuse GUI components more easily.

@ccordoba12
Copy link
Member

@blink1073, is this ready to merge?

@blink1073
Copy link
Contributor Author

Fire away!

@Nodd
Copy link
Contributor

Nodd commented Apr 7, 2015

Am I the only one to like QtDesigner ? It's very good to quickly build interfaces. But it's very bad at handling lots of custom widgets. :( Btw you can load *.ui files from python without converting them first, and it works as well with both PySide and PyQt. Anyway it makes no sense to switch at this state of the project.

@goanpeca I think that in this case using the DRY principle would do more harm than good. The preferences uses the stadard way of setting global options, and the run dialog doesn't have to use it. If every panel was duplicated we would have to reuse more, but that's just a single one...

@goanpeca
Copy link
Member

goanpeca commented Apr 7, 2015

@Nodd I am not a fan of designer but I do not dislike it ;-)

This is maybe a first case, but if a second case shows up... or a third.. well maybe we will have to come back to this one.

The standard way of building stuff for the preferences dialog is not that appealing to me, I know the idea is to have helper functions to add all widgets but at the end it feels that structure is too rigid....

@ccordoba12
Copy link
Member

This seems good, merging.

ccordoba12 added a commit that referenced this pull request Apr 16, 2015
Fill in missing global run config options
@ccordoba12 ccordoba12 merged commit bd3348a into spyder-ide:master Apr 16, 2015
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.

5 participants