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: Show internal errors in a QMessageBox #4040

Merged

Conversation

rlaverde
Copy link
Member

@rlaverde rlaverde commented Jan 24, 2017

Fixes: #1525

This isn't ready, I implemented but the behavior isn't the expected, the QMessageBox is shown but for every single line of the traceback (because traceback_available signal is emitted for every line).

any ideas of how I could fix this?

I implemented using a QMessageBox with non modal behavior

traceback_box

@rlaverde rlaverde added this to the v3.2 milestone Jan 24, 2017
@rlaverde rlaverde self-assigned this Jan 24, 2017
@goanpeca
Copy link
Member

I dont think a QMessageBox will do then, you could create a custom dialog with a QTableView or something that would keep growing as more messages keep coming.

@rlaverde rlaverde force-pushed the enhancement/internal-errors-qmessage branch from 1b379f4 to 7f2ad4c Compare January 25, 2017 02:09
@rlaverde
Copy link
Member Author

@goanpeca Following your idea I found a way QMessageBox could be updated continuously 😄

@goanpeca
Copy link
Member

👍

@goanpeca
Copy link
Member

@ccordoba12 do we want rich text on the details or not? and should they be links to the actual files?

Do we want to add a submit button so users can submit that error directly?

With that is that the issue tracker can start to grow a lot, which is good and bad at the same time!

@ccordoba12
Copy link
Member

do we want rich text on the details or not? and should they be links to the actual files?

Perhaps not because that could confuse users. Besides, clickable links are already available in the internal console and that's mostly useful for us ;-)

What we could have is highlighted tracebacks, but we could leave that for another PR.

Do we want to add a submit button so users can submit that error directly?

Yep, that's really important to have ;-)

@ccordoba12 ccordoba12 modified the milestones: v3.2, v3.3 Feb 14, 2017
@rlaverde rlaverde force-pushed the enhancement/internal-errors-qmessage branch 2 times, most recently from 8ba3cca to 3d2dd80 Compare May 15, 2017 20:37
@rlaverde
Copy link
Member Author

rlaverde commented May 15, 2017

I added the submit button, and rebased it

spectacle m19702

@rlaverde rlaverde changed the title [WIP] PR: Show Internal errors in QMessage PR: Show Internal errors in QMessage May 15, 2017
@rlaverde rlaverde requested review from goanpeca and ccordoba12 May 15, 2017 21:25
@@ -2425,6 +2425,7 @@ def __get_current_color(self, cursor=None):

def in_comment_or_string(self, cursor=None):
"""Is the cursor inside or next to a comment or string?"""
raise Exception
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 making our tests to fail. It seems an artifact of the rebase, so please remove it.

Copy link
Member Author

@rlaverde rlaverde May 16, 2017

Choose a reason for hiding this comment

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

Ohhh! sorry, that was for testing, I didn't mean to commit that 🙈

@ccordoba12
Copy link
Member

ccordoba12 commented May 15, 2017

@rlaverde, could we use an instance of CodeEditor to show the tracebacks? I think that would make the dialog more useful :-)

@rlaverde rlaverde force-pushed the enhancement/internal-errors-qmessage branch from 1211dc4 to b9edcb0 Compare May 16, 2017 13:29
@rlaverde
Copy link
Member Author

Could we use an instance of CodeEditor to show the tracebacks? I think that would make the dialog more useful :-)

I used a customized QMessageBox, for embedding the CodeEditor I will have to rewrite it using a Dialog and implement the layout and functionality

@goanpeca
Copy link
Member

@rlaverde, could we use an instance of CodeEditor to show the tracebacks? I think that would make the dialog more useful :-)

@ccordoba12 I would say for now this is good enough and as @rlaverde he would have to basically redo all his PR for what you are asking

@ccordoba12
Copy link
Member

I would say for now this is good enough and as @rlaverde he would have to basically redo all his PR for what you are asking

Ok, no problem, let's leave things as they are.

One more thing: we need to preserve the old behavior when DEV is active. That's way more practical for us developers because traceback links are clickable in the Internal console.

@rlaverde rlaverde force-pushed the enhancement/internal-errors-qmessage branch from 7ff4c1f to 46e2ee4 Compare May 31, 2017 20:39
@rlaverde
Copy link
Member Author

One more thing: we need to preserve the old behavior when DEV is active. That's way more practical for us developers because traceback links are clickable in the Internal console.

Done, also when DEBUG or PYTEST is activated

@rlaverde rlaverde force-pushed the enhancement/internal-errors-qmessage branch 2 times, most recently from 62fba7c to 0325c46 Compare June 1, 2017 19:30
@rlaverde rlaverde force-pushed the enhancement/internal-errors-qmessage branch from 0325c46 to a4bba99 Compare June 6, 2017 16:16
self.msgbox_traceback = QMessageBox(
QMessageBox.Critical,
_('Error'),
_("<b>Spyder-IDE has encountered a problem.</b>"
Copy link
Member

Choose a reason for hiding this comment

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

Remove the -IDE here.

Copy link
Member

Choose a reason for hiding this comment

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

Also add a <br> at the end.

"Sorry for the inconvenience."
"<b>Please tell us about this problem.</b>"
"<br><br>"
"You can submit this error to the github issue tracker"),
Copy link
Member

Choose a reason for hiding this comment

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

Let's change this to

You can automatically submit this error to our Github issues tracker.

Note: You need a Github account for that.

parent=self)

self.submit_btn = self.msgbox_traceback.addButton(
_('Submit to github'), QMessageBox.YesRole)
Copy link
Member

Choose a reason for hiding this comment

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

github -> Github

_('Error'),
_("<b>Spyder-IDE has encountered a problem.</b>"
"Sorry for the inconvenience."
"<b>Please tell us about this problem.</b>"
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this line.

@ccordoba12
Copy link
Member

I added some minor formatting comments. After that, I think this is ready!

@rlaverde
Copy link
Member Author

I just addressed your comments, this is how it looks like:

spectacle jg8171

@ccordoba12
Copy link
Member

I like it a lot, thanks!

@goanpeca, what do you say?

@ccordoba12 ccordoba12 changed the title PR: Show Internal errors in QMessage PR: Show internal errors in a QMessageBox Jun 18, 2017
@ccordoba12 ccordoba12 merged commit 6b3d177 into spyder-ide:3.x Jun 18, 2017
ccordoba12 added a commit that referenced this pull request Jun 18, 2017
@rlaverde rlaverde deleted the enhancement/internal-errors-qmessage branch June 20, 2017 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants