diff --git a/app/common/qtutils.cpp b/app/common/qtutils.cpp index 1edf6448c..bb6c23de1 100644 --- a/app/common/qtutils.cpp +++ b/app/common/qtutils.cpp @@ -47,7 +47,7 @@ QFrame *QtUtils::CreateVerticalLine() return l; } -int QtUtils::MessageBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &message, QMessageBox::StandardButtons buttons) +int QtUtils::MsgBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &message, QMessageBox::StandardButtons buttons) { QMessageBox b(parent); b.setIcon(icon); diff --git a/app/common/qtutils.h b/app/common/qtutils.h index fee21e596..19e2ea68c 100644 --- a/app/common/qtutils.h +++ b/app/common/qtutils.h @@ -33,12 +33,6 @@ #include #include -#include "common/define.h" - -#ifdef MessageBox -#undef MessageBox -#endif - namespace olive { class QtUtils { @@ -56,7 +50,7 @@ public: static QFrame* CreateVerticalLine(); - static int MessageBox(QWidget *parent, QMessageBox::Icon icon, const QString& title, const QString& message, QMessageBox::StandardButtons buttons = QMessageBox::Ok); + static int MsgBox(QWidget *parent, QMessageBox::Icon icon, const QString& title, const QString& message, QMessageBox::StandardButtons buttons = QMessageBox::Ok); static QDateTime GetCreationDate(const QFileInfo &info); diff --git a/app/dialog/export/export.cpp b/app/dialog/export/export.cpp index 8797b3caa..d47ff3eab 100644 --- a/app/dialog/export/export.cpp +++ b/app/dialog/export/export.cpp @@ -259,7 +259,7 @@ rational ExportDialog::GetSelectedTimebase() const void ExportDialog::StartExport() { if (!video_enabled_->isChecked() && !audio_enabled_->isChecked() && !subtitles_enabled_->isChecked()) { - QtUtils::MessageBox(this, QMessageBox::Critical, tr("Invalid parameters"), + QtUtils::MsgBox(this, QMessageBox::Critical, tr("Invalid parameters"), tr("Video, audio, and subtitles are disabled. There's nothing to export.")); return; } @@ -271,7 +271,7 @@ void ExportDialog::StartExport() // If it doesn't, see if the user wants to append it automatically. If not, we don't abort the export. if (!proposed_filename.endsWith(necessary_ext, Qt::CaseInsensitive)) { - if (QtUtils::MessageBox(this, QMessageBox::Warning, tr("Invalid filename"), + if (QtUtils::MsgBox(this, QMessageBox::Warning, tr("Invalid filename"), tr("The filename must contain the extension \"%1\". Would you like to append it " "automatically?").arg(necessary_ext), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { @@ -288,7 +288,7 @@ void ExportDialog::StartExport() // If the directory does not exist, try to create it QDir dest_dir(file_info.path()); if (!FileFunctions::DirectoryIsValid(dest_dir)) { - QtUtils::MessageBox(this, QMessageBox::Critical, tr("Failed to create output directory"), + QtUtils::MsgBox(this, QMessageBox::Critical, tr("Failed to create output directory"), tr("The intended output directory doesn't exist and Olive couldn't create it. " "Please choose a different filename.")); return; @@ -298,7 +298,7 @@ void ExportDialog::StartExport() if (video_tab_->IsImageSequenceSet()) { // Ensure filename contains digits if (!Encoder::FilenameContainsDigitPlaceholder(proposed_filename)) { - QtUtils::MessageBox(this, QMessageBox::Critical, tr("Invalid filename"), + QtUtils::MsgBox(this, QMessageBox::Critical, tr("Invalid filename"), tr("Export is set to an image sequence, but the filename does not have a section for digits " "(formatted as [#####] where the amount of # is the amount of digits).")); return; @@ -308,7 +308,7 @@ void ExportDialog::StartExport() int64_t needed_digit_count = GetDigitCount(frame_count); int current_digit_count = Encoder::GetImageSequencePlaceholderDigitCount(proposed_filename); if (current_digit_count < needed_digit_count) { - QtUtils::MessageBox(this, QMessageBox::Critical, tr("Invalid filename"), + QtUtils::MsgBox(this, QMessageBox::Critical, tr("Invalid filename"), tr("Filename doesn't contain enough digits for the amount of frames " "this export will need (need %1 for %n frame(s)).", nullptr, frame_count) .arg(QString::number(needed_digit_count))); @@ -318,7 +318,7 @@ void ExportDialog::StartExport() // Validate if the file exists and whether the user wishes to overwrite it if (file_info.exists()) { - if (QtUtils::MessageBox(this, QMessageBox::Warning, tr("Confirm Overwrite"), + if (QtUtils::MsgBox(this, QMessageBox::Warning, tr("Confirm Overwrite"), tr("The file \"%1\" already exists. Do you want to overwrite it?") .arg(proposed_filename), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) { @@ -330,7 +330,7 @@ void ExportDialog::StartExport() if (video_enabled_->isChecked() && (video_tab_->GetSelectedCodec() == ExportCodec::kCodecH264 || video_tab_->GetSelectedCodec() == ExportCodec::kCodecH265) && (video_tab_->width_slider()->GetValue()%2 != 0 || video_tab_->height_slider()->GetValue()%2 != 0)) { - QtUtils::MessageBox(this, QMessageBox::Critical, tr("Invalid Parameters"), + QtUtils::MsgBox(this, QMessageBox::Critical, tr("Invalid Parameters"), tr("Width and height must be multiples of 2.")); return; } diff --git a/app/dialog/sequence/sequence.cpp b/app/dialog/sequence/sequence.cpp index 28f8f98e6..35b8f311e 100644 --- a/app/dialog/sequence/sequence.cpp +++ b/app/dialog/sequence/sequence.cpp @@ -102,7 +102,7 @@ void SequenceDialog::SetNameIsEditable(bool e) void SequenceDialog::accept() { if (name_field_->isEnabled() && name_field_->text().isEmpty()) { - QtUtils::MessageBox(this, QMessageBox::Critical, tr("Error editing Sequence"), tr("Please enter a name for this Sequence.")); + QtUtils::MsgBox(this, QMessageBox::Critical, tr("Error editing Sequence"), tr("Please enter a name for this Sequence.")); return; } @@ -167,7 +167,7 @@ void SequenceDialog::accept() void SequenceDialog::SetAsDefaultClicked() { - if (QtUtils::MessageBox(this, QMessageBox::Question, tr("Confirm Set As Default"), + if (QtUtils::MsgBox(this, QMessageBox::Question, tr("Confirm Set As Default"), tr("Are you sure you want to set the current parameters as defaults?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { // Maybe replace with Preset system