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

Added confirmation for usercard actions #2629

Closed
wants to merge 3 commits into from
Closed

Added confirmation for usercard actions #2629

wants to merge 3 commits into from

Conversation

MrAuro
Copy link
Contributor

@MrAuro MrAuro commented Apr 15, 2021

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

Asks the user if they want to follow/unfollow or block/unblock someone when in the usercard
Closes #1886.

@MrAuro
Copy link
Contributor Author

MrAuro commented Apr 15, 2021

I found that this crashes Chatterino when any action is confirmed. I'm not sure what causes this, I am new to QT and c++.

QMessageBox::Information, "Chatterino 2",
"Unfollow user?", QMessageBox::Yes | QMessageBox::No);
box->setAttribute(Qt::WA_DeleteOnClose);
if (box->exec() == QMessageBox::Yes)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a QT guru but I suspect blocking the UI with this call is your cause. Try using QObject::connect to connect to the clicked signal. See here for an example.

QT devs correct me if I'm wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

This applies to all 4 usages of exec()

@fourtf
Copy link
Member

fourtf commented Apr 17, 2021

Closing the popup and showing a message box doesn't seem like the best UX to me. How about making a button that needs to be pressed twice instead?

Here's a mock-up of what I mean:
image

@MrAuro
Copy link
Contributor Author

MrAuro commented Jun 28, 2021

Since the create and delete follow endpoints are being deprecated I'm going to close this PR (https://discuss.dev.twitch.tv/t/deprecation-of-create-and-delete-follows-api-endpoints/32351). Went on vacation and completely forgot I made this. I might open another PR with the intended functionality for blocking a user if I have time and learn enough QT & C++ to do so 😄

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.

A confirmation for potentially unwated usercard actions
3 participants