0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

UI: Translate Multitrack Video error dialog buttons

The Yes and No standard buttons are not translated unless we manually
set the translated text ourselves.
This commit is contained in:
Ryan Foster 2024-06-10 18:43:51 -04:00
parent e774bd90b8
commit 051c11e7b2

View File

@ -1,6 +1,7 @@
#include "multitrack-video-error.hpp"
#include <QMessageBox>
#include <QPushButton>
#include "obs-app.hpp"
MultitrackVideoError MultitrackVideoError::critical(QString error)
@ -31,9 +32,12 @@ bool MultitrackVideoError::ShowDialog(
QTStr("FailedToStartStream.WarningRetryNonMultitrackVideo")
.arg(multitrack_video_name));
mb.setIcon(QMessageBox::Warning);
mb.setStandardButtons(QMessageBox::StandardButton::Yes |
QMessageBox::StandardButton::No);
return mb.exec() == QMessageBox::StandardButton::Yes;
QAbstractButton *yesButton =
mb.addButton(QTStr("Yes"), QMessageBox::YesRole);
mb.addButton(QTStr("No"), QMessageBox::NoRole);
mb.exec();
return mb.clickedButton() == yesButton;
} else if (type == Type::Critical) {
mb.setText(error);
mb.setIcon(QMessageBox::Critical);