mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixed "Yes, don't ask again" image uploader prompt not working on macOS (#5011)
This commit is contained in:
parent
13dc306506
commit
e4258160cd
2 changed files with 28 additions and 9 deletions
|
@ -46,6 +46,7 @@
|
|||
- Bugfix: Fixed lookahead/-behind not working in _Ignores_. (#4965)
|
||||
- Bugfix: Fixed Image Uploader accidentally deleting images with some hosts when link resolver was enabled. (#4971)
|
||||
- Bugfix: Fixed rare crash with Image Uploader when closing a split right after starting an upload. (#4971)
|
||||
- Bugfix: Fixed an issue on macOS where the image uploader would keep prompting the user even after they clicked "Yes, don't ask again". (#5011)
|
||||
- Bugfix: Hide the Usercard button in the User Info Popup when in special channels. (#4972)
|
||||
- Bugfix: Fixed support for Windows 11 Snap layouts. (#4994)
|
||||
- Bugfix: Fixed some windows appearing between screens. (#4797)
|
||||
|
|
|
@ -381,7 +381,9 @@ Split::Split(QWidget *parent)
|
|||
std::ignore = this->input_->ui_.textEdit->imagePasted.connect(
|
||||
[this](const QMimeData *source) {
|
||||
if (!getSettings()->imageUploaderEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSettings()->askOnImageUpload.getValue())
|
||||
{
|
||||
|
@ -392,21 +394,37 @@ Split::Split(QWidget *parent)
|
|||
"You are uploading an image to a 3rd party service not in "
|
||||
"control of the Chatterino team. You may not be able to "
|
||||
"remove the image from the site. Are you okay with this?");
|
||||
msgBox.addButton(QMessageBox::Cancel);
|
||||
msgBox.addButton(QMessageBox::Yes);
|
||||
msgBox.addButton("Yes, don't ask again", QMessageBox::YesRole);
|
||||
auto *cancel = msgBox.addButton(QMessageBox::Cancel);
|
||||
auto *yes = msgBox.addButton(QMessageBox::Yes);
|
||||
auto *yesDontAskAgain = msgBox.addButton("Yes, don't ask again",
|
||||
QMessageBox::YesRole);
|
||||
|
||||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
auto picked = msgBox.exec();
|
||||
if (picked == QMessageBox::Cancel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (picked == 0) // don't ask again button
|
||||
msgBox.exec();
|
||||
|
||||
auto *clickedButton = msgBox.clickedButton();
|
||||
if (clickedButton == yesDontAskAgain)
|
||||
{
|
||||
getSettings()->askOnImageUpload.setValue(false);
|
||||
}
|
||||
else if (clickedButton == yes)
|
||||
{
|
||||
// Continue with image upload
|
||||
}
|
||||
else if (clickedButton == cancel)
|
||||
{
|
||||
// Not continuing with image upload
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// An unknown "button" was pressed - handle it as if cancel was pressed
|
||||
// cancel is already handled as the "escape" option, so this should never happen
|
||||
qCWarning(chatterinoImageuploader)
|
||||
<< "Unhandled button pressed:" << clickedButton;
|
||||
return;
|
||||
}
|
||||
}
|
||||
QPointer<ResizingTextEdit> edit = this->input_->ui_.textEdit;
|
||||
getApp()->imageUploader->upload(source, this->getChannel(), edit);
|
||||
|
|
Loading…
Reference in a new issue