From 7b88dd9cebdf93433bf701292438d1a34cfd1635 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 14 Apr 2018 23:09:01 +0200 Subject: [PATCH] Implemented better method to avoid unwanted line-breaks. --- src/Dialog_About.cpp | 51 ++++++++------- src/Dialog_MainWindow.cpp | 126 +++++++++++++++++++------------------- src/Global.h | 2 +- 3 files changed, 89 insertions(+), 90 deletions(-) diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp index 46a4b418..9b54379e 100644 --- a/src/Dialog_About.cpp +++ b/src/Dialog_About.cpp @@ -561,41 +561,41 @@ void AboutDialog::initInformationTab(void) QString aboutText; - aboutText += QString("

%1

").arg(NOBR(tr("LameXP - Audio Encoder Front-end"))); - aboutText += QString("%1
").arg(NOBR(copyrightStr)); - aboutText += QString("%1
").arg(NOBR(versionStr)); - aboutText += QString("%1

").arg(NOBR(platformStr)); - aboutText += QString("%1
").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url())))); + aboutText += QString("

%1

").arg(tr("LameXP - Audio Encoder Front-end")); + aboutText += QString("%1
").arg(copyrightStr); + aboutText += QString("%1
").arg(versionStr); + aboutText += QString("%1

").arg(platformStr); + aboutText += QString("%1
").arg(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))); #if QT_VERSION < QT_VERSION_CHECK(5,0,0) const QDate currentDate = MUtils::OS::current_date(); if(MUTILS_DEBUG) { int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0); - aboutText += QString("
%1").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft)))); + aboutText += QString("
%1").arg(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))); } else if(lamexp_version_demo()) { int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0); - aboutText += QString("
%1").arg(NOBR(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft)))); + aboutText += QString("
%1").arg(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))); } #else const QDate currentDate = lamexp_current_date_safe(); if(LAMEXP_DEBUG) { int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0i64); - aboutText += QString("
%1").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft)))); + aboutText += QString("
%1").arg(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))); } else if(lamexp_version_demo()) { int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0i64); - aboutText += QString("
%1").arg(NOBR(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft)))); + aboutText += QString("
%1").arg(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))); } #endif aboutText += "

"; - aboutText += "This program is free software; you can redistribute it and/or modify
"; + aboutText += "This program is free software; you can redistribute it and/or modify
"; aboutText += "it under the terms of the GNU General Public License as published by
"; aboutText += "the Free Software Foundation; either version 2 of the License, or
"; aboutText += "(at your option) any later version, but always including the *additional*
"; @@ -606,13 +606,13 @@ void AboutDialog::initInformationTab(void) aboutText += "GNU General Public License for more details.

"; aboutText += "You should have received a copy of the GNU General Public License
"; aboutText += "along with this program; if not, write to the Free Software
"; - aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.

"; + aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.

"; aboutText += "
"; aboutText += ""; - aboutText += QString("").arg(tr("Note: LameXP is free software. Do not pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should not respond to the offer !!!")); + aboutText += QString("").arg(tr("Note: LameXP is free software. Do not pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should not respond to the offer !!!")); aboutText += "
 %1%1
"; - ui->infoLabel->setText(aboutText); + ui->infoLabel->setText(NOBREAK(aboutText)); ui->infoIcon->setPixmap(lamexp_app_icon().pixmap(QSize(72,72))); connect(ui->infoLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString))); } @@ -623,7 +623,7 @@ void AboutDialog::initContributorsTab(void) const QString extraVSpace("
 
"); QString contributorsAboutText; - contributorsAboutText += QString("

%1

").arg(NOBR(tr("The following people have contributed to LameXP:"))); + contributorsAboutText += QString("

%1

").arg(tr("The following people have contributed to LameXP:")); contributorsAboutText += ""; contributorsAboutText += QString("").arg(tr("Programmers:"), extraVSpace); @@ -663,9 +663,9 @@ void AboutDialog::initContributorsTab(void) } contributorsAboutText += "
%1%2



"; - contributorsAboutText += QString("%1
").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!"))); + contributorsAboutText += QString("%1
").arg(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")); - ui->contributorsLabel->setText(contributorsAboutText); + ui->contributorsLabel->setText(NOBREAK(contributorsAboutText)); ui->contributorsIcon->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84))); connect(ui->contributorsLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString))); } @@ -675,7 +675,7 @@ void AboutDialog::initSoftwareTab(void) QString moreAboutText; moreAboutText += QString("

%1

").arg(tr("The following third-party software is used in LameXP:")); - moreAboutText += "
    "; //;font-size:7pt + moreAboutText += "
      "; //;font-size:7pt moreAboutText += makeToolText ( @@ -801,14 +801,14 @@ void AboutDialog::initSoftwareTab(void) ( tr("wma2wav - Dump WMA files to Wave Audio"), "wma2wav.exe", "????-??-??", - tr("Copyright (c) 2011 LoRd_MuldeR . Some rights reserved."), + tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."), "http://forum.doom9.org/showthread.php?t=140273" ); moreAboutText += makeToolText ( tr("avs2wav - Avisynth to Wave Audio converter"), "avs2wav.exe", "v?.?", - tr("By Jory Stone and LoRd_MuldeR ."), + tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."), "http://forum.doom9.org/showthread.php?t=70882" ); moreAboutText += makeToolText @@ -867,12 +867,12 @@ void AboutDialog::initSoftwareTab(void) tr("By Alexander, released under the Creative Commons 'BY' License."), "http://www.orangefreesounds.com/" ); - moreAboutText += QString("
 

%1
").arg + moreAboutText += QString("
%1
").arg ( tr("The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors.") ); - ui->softwareLabel->setText(moreAboutText); + ui->softwareLabel->setText(NOBREAK(moreAboutText)); ui->softwareIcon->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65))); connect(ui->softwareLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString))); } @@ -917,7 +917,6 @@ void AboutDialog::initLicenseTab(void) connect(ui->licenseLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString))); } - QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo) { QString toolText, toolTag, verStr(toolVerFmt); @@ -928,10 +927,10 @@ QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBi verStr = lamexp_version2string(toolVerFmt, version, tr("n/a"), toolTag); } - toolText += QString("
  • %1
    ").arg(NOBR(QString("%1 (%2)").arg(toolName, verStr))); - toolText += QString("%1
    ").arg(NOBR(toolLicense)); - if(!extraInfo.isEmpty()) toolText += QString("%1
    ").arg(NOBR(extraInfo)); - toolText += QString("%1").arg(LINK(toolWebsite)); + toolText += QString("
  • %1
    ").arg(QString("%1 (%2)").arg(toolName, verStr)); + toolText += QString("%1
    ").arg(toolLicense); + if(!extraInfo.isEmpty()) toolText += QString("%1
    ").arg(extraInfo); + toolText += LINK(toolWebsite); toolText += QString("
     
    "); return toolText; diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index d17aa718..53c85859 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -856,19 +856,19 @@ void MainWindow::addFiles(const QStringList &files) if(analyzer->filesDenied()) { - QMessageBox::warning(this, tr("Access Denied"), QString("%1
    %2").arg(NOBR(tr("%n file(s) have been rejected, because read access was not granted!", "", analyzer->filesDenied())), NOBR(tr("This usually means the file is locked by another process.")))); + QMessageBox::warning(this, tr("Access Denied"), NOBREAK(QString("%1
    %2").arg(tr("%n file(s) have been rejected, because read access was not granted!", "", analyzer->filesDenied()), tr("This usually means the file is locked by another process.")))); } if(analyzer->filesDummyCDDA()) { - QMessageBox::warning(this, tr("CDDA Files"), QString("%1

    %2
    %3").arg(NOBR(tr("%n file(s) have been rejected, because they are dummy CDDA files!", "", analyzer->filesDummyCDDA())), NOBR(tr("Sorry, LameXP cannot extract audio tracks from an Audio-CD at present.")), NOBR(tr("We recommend using %1 for that purpose.").arg("Exact Audio Copy")))); + QMessageBox::warning(this, tr("CDDA Files"), NOBREAK(QString("%1

    %2
    %3").arg(tr("%n file(s) have been rejected, because they are dummy CDDA files!", "", analyzer->filesDummyCDDA()), tr("Sorry, LameXP cannot extract audio tracks from an Audio-CD at present."), tr("We recommend using %1 for that purpose.").arg("Exact Audio Copy")))); } if(analyzer->filesCueSheet()) { - QMessageBox::warning(this, tr("Cue Sheet"), QString("%1
    %2").arg(NOBR(tr("%n file(s) have been rejected, because they appear to be Cue Sheet images!", "",analyzer->filesCueSheet())), NOBR(tr("Please use LameXP's Cue Sheet wizard for importing Cue Sheet files.")))); + QMessageBox::warning(this, tr("Cue Sheet"), NOBREAK(QString("%1
    %2").arg(tr("%n file(s) have been rejected, because they appear to be Cue Sheet images!", "",analyzer->filesCueSheet()), tr("Please use LameXP's Cue Sheet wizard for importing Cue Sheet files.")))); } if(analyzer->filesRejected()) { - QMessageBox::warning(this, tr("Files Rejected"), QString("%1
    %2").arg(NOBR(tr("%n file(s) have been rejected, because the file format could not be recognized!", "", analyzer->filesRejected())), NOBR(tr("This usually means the file is damaged or the file format is not supported.")))); + QMessageBox::warning(this, tr("Files Rejected"), NOBREAK(QString("%1
    %2").arg(tr("%n file(s) have been rejected, because the file format could not be recognized!", "", analyzer->filesRejected()), tr("This usually means the file is damaged or the file format is not supported.")))); } m_banner->close(); @@ -1515,7 +1515,7 @@ void MainWindow::windowShown(void) { qWarning("Binary has expired !!!"); MUtils::Sound::play_sound("whammy", false); - if(QMessageBox::warning(this, tr("LameXP - Expired"), QString("%1
    %2").arg(NOBR(tr("This demo (pre-release) version of LameXP has expired at %1.").arg(lamexp_version_expires().toString(Qt::ISODate))), NOBR(tr("LameXP is free software and release versions won't expire."))), tr("Check for Updates"), tr("Exit Program")) == 0) + if(QMessageBox::warning(this, tr("LameXP - Expired"), NOBREAK(QString("%1
    %2").arg(tr("This demo (pre-release) version of LameXP has expired at %1.").arg(lamexp_version_expires().toString(Qt::ISODate)), tr("LameXP is free software and release versions won't expire."))), tr("Check for Updates"), tr("Exit Program")) == 0) { checkForUpdates(); } @@ -1528,9 +1528,9 @@ void MainWindow::windowShown(void) if(m_settings->slowStartup() && m_settings->antivirNotificationsEnabled()) { QString message; - message += NOBR(tr("It seems that a bogus anti-virus software is slowing down the startup of LameXP.")).append("
    "); - message += NOBR(tr("Please refer to the %1 document for details and solutions!")).arg(LINK_EX(QString("%1/Manual.html#performance-issues").arg(g_documents_base_url), tr("Manual"))).append("
    "); - if(QMessageBox::warning(this, tr("Slow Startup"), message, tr("Discard"), tr("Don't Show Again")) == 1) + message += tr("It seems that a bogus anti-virus software is slowing down the startup of LameXP.").append("
    "); + message += tr("Please refer to the %1 document for details and solutions!").arg(LINK_EX(QString("%1/Manual.html#performance-issues").arg(g_documents_base_url), tr("Manual"))).append("
    "); + if(QMessageBox::warning(this, tr("Slow Startup"), NOBREAK(message), tr("Discard"), tr("Don't Show Again")) == 1) { m_settings->antivirNotificationsEnabled(false); ui->actionDisableSlowStartupNotifications->setChecked(!m_settings->antivirNotificationsEnabled()); @@ -1542,7 +1542,7 @@ void MainWindow::windowShown(void) { qWarning("Binary is more than a year old, time to update!"); SHOW_CORNER_WIDGET(true); - int ret = QMessageBox::warning(this, tr("Urgent Update"), NOBR(tr("Your version of LameXP is more than a year old. Time for an update!")), tr("Check for Updates"), tr("Exit Program"), tr("Ignore")); + int ret = QMessageBox::warning(this, tr("Urgent Update"), NOBREAK(tr("Your version of LameXP is more than a year old. Time for an update!")), tr("Check for Updates"), tr("Exit Program"), tr("Ignore")); switch(ret) { case 0: @@ -1570,7 +1570,7 @@ void MainWindow::windowShown(void) SHOW_CORNER_WIDGET(true); if(m_settings->autoUpdateEnabled()) { - if(QMessageBox::information(this, tr("Update Reminder"), NOBR(lastUpdateCheck.isValid() ? tr("Your last update check was more than 14 days ago. Check for updates now?") : tr("Your did not check for LameXP updates yet. Check for updates now?")), tr("Check for Updates"), tr("Postpone")) == 0) + if(QMessageBox::information(this, tr("Update Reminder"), NOBREAK(lastUpdateCheck.isValid() ? tr("Your last update check was more than 14 days ago. Check for updates now?") : tr("Your did not check for LameXP updates yet. Check for updates now?")), tr("Check for Updates"), tr("Postpone")) == 0) { if(checkForUpdates()) { @@ -1588,14 +1588,14 @@ void MainWindow::windowShown(void) QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath(); if(appPath.isEmpty()) appPath = QCoreApplication::applicationDirPath(); QString messageText; - messageText += NOBR(tr("The Nero AAC encoder could not be found. AAC encoding support will be disabled.")).append("
    "); - messageText += NOBR(tr("Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!")).append("

    "); - messageText += QString("").append(NOBR(tr("Your LameXP install directory is located here:"))).append("
    "); - messageText += QString("%1

    ").arg(FSLINK(QDir::toNativeSeparators(appPath))); - messageText += QString("").append(NOBR(tr("You can download the Nero AAC encoder for free from this website:"))).append("
    "); - messageText += QString("").append(LINK(AboutDialog::neroAacUrl)).append("

    "); - messageText += QString("").append(NOBR(tr("Note: Nero AAC encoder version %1 or newer is required to enable AAC encoding support!").arg(lamexp_version2string("v?.?.?.?", lamexp_toolver_neroaac(), "n/a")))).append("
    "); - if(QMessageBox::information(this, tr("AAC Support Disabled"), messageText, tr("Discard"), tr("Don't Show Again")) == 1) + messageText += tr("The Nero AAC encoder could not be found. AAC encoding support will be disabled.").append("
    "); + messageText += tr("Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!").append("

    "); + messageText += QString("").append(tr("Your LameXP install directory is located here:")).append("
    "); + messageText += QString("%1

    ").arg(FSLINK(QDir::toNativeSeparators(appPath))); + messageText += QString("").append(tr("You can download the Nero AAC encoder for free from this website:")).append("
    "); + messageText += QString("").append(LINK(AboutDialog::neroAacUrl)).append("

    "); + messageText += QString("").append(tr("Note: Nero AAC encoder version %1 or newer is required to enable AAC encoding support!").arg(lamexp_version2string("v?.?.?.?", lamexp_toolver_neroaac(), "n/a"))).append("
    "); + if(QMessageBox::information(this, tr("AAC Support Disabled"), NOBREAK(messageText), tr("Discard"), tr("Don't Show Again")) == 1) { m_settings->neroAacNotificationsEnabled(false); ui->actionDisableNeroAacNotifications->setChecked(!m_settings->neroAacNotificationsEnabled()); @@ -1658,14 +1658,14 @@ void MainWindow::showAnnounceBox(void) { const unsigned int timeout = 8U; - const QString announceText = QString("%1

    %2
    %3
    ").arg + const QString announceText = QString("%1

    %2
    %3
    ").arg ( - NOBR("We are still looking for LameXP translators!"), - NOBR("If you are willing to translate LameXP to your language or to complete an existing translation, please refer to:"), + "We are still looking for LameXP translators!", + "If you are willing to translate LameXP to your language or to complete an existing translation, please refer to:", LINK("http://lamexp.sourceforge.net/doc/Translate.html") ); - QMessageBox *announceBox = new QMessageBox(QMessageBox::Warning, "We want you!", announceText, QMessageBox::NoButton, this); + QMessageBox *announceBox = new QMessageBox(QMessageBox::Warning, "We want you!", NOBREAK(announceText), QMessageBox::NoButton, this); announceBox->setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); announceBox->setIconPixmap(QIcon(":/images/Announcement.png").pixmap(64,79)); @@ -1726,7 +1726,7 @@ void MainWindow::encodeButtonClicked(void) if(m_fileListModel->rowCount() < 1) { - QMessageBox::warning(this, tr("LameXP"), NOBR(tr("You must add at least one file to the list before proceeding!"))); + QMessageBox::warning(this, tr("LameXP"), NOBREAK(tr("You must add at least one file to the list before proceeding!"))); ui->tabWidget->setCurrentIndex(0); return; } @@ -1734,7 +1734,7 @@ void MainWindow::encodeButtonClicked(void) QString tempFolder = m_settings->customTempPathEnabled() ? m_settings->customTempPath() : MUtils::temp_folder(); if(!QFileInfo(tempFolder).exists() || !QFileInfo(tempFolder).isDir()) { - if(QMessageBox::warning(this, tr("Not Found"), QString("%1
    %2").arg(NOBR(tr("Your currently selected TEMP folder does not exist anymore:")), NOBR(QDir::toNativeSeparators(tempFolder))), tr("Restore Default"), tr("Cancel")) == 0) + if(QMessageBox::warning(this, tr("Not Found"), NOBREAK(QString("%1
    %2").arg(tr("Your currently selected TEMP folder does not exist anymore:"), QDir::toNativeSeparators(tempFolder))), tr("Restore Default"), tr("Cancel")) == 0) { SET_CHECKBOX_STATE(ui->checkBoxUseSystemTempFolder, (!m_settings->customTempPathEnabledDefault())); } @@ -1751,12 +1751,12 @@ void MainWindow::encodeButtonClicked(void) PLAY_SOUND_OPTIONAL("whammy", false); QString lowDiskspaceMsg = QString("%1
    %2

    %3
    %4
    ").arg ( - NOBR(tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.").arg(QString::number(minimumFreeDiskspaceMultiplier))), - NOBR(tr("It is highly recommend to free up more diskspace before proceeding with the encode!")), - NOBR(tr("Your TEMP folder is located at:")), - QString("%1").arg(FSLINK(tempFolderParts.join("\\"))) + tr("There are less than %1 GB of free diskspace available on your system's TEMP folder.").arg(QString::number(minimumFreeDiskspaceMultiplier)), + tr("It is highly recommend to free up more diskspace before proceeding with the encode!"), + tr("Your TEMP folder is located at:"), + QString("%1").arg(FSLINK(tempFolderParts.join("\\"))) ); - switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), lowDiskspaceMsg, tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore"))) + switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), NOBREAK(lowDiskspaceMsg), tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore"))) { case 1: QProcess::startDetached(QString("%1/cleanmgr.exe").arg(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEMFOLDER)), QStringList() << "/D" << tempFolderParts.first()); @@ -1764,7 +1764,7 @@ void MainWindow::encodeButtonClicked(void) return; break; default: - QMessageBox::warning(this, tr("Low Diskspace"), NOBR(tr("You are proceeding with low diskspace. Problems might occur!"))); + QMessageBox::warning(this, tr("Low Diskspace"), NOBREAK(tr("You are proceeding with low diskspace. Problems might occur!"))); break; } } @@ -1793,7 +1793,7 @@ void MainWindow::encodeButtonClicked(void) QFile writeTest(QString("%1/~%2.txt").arg(m_settings->outputDir(), MUtils::next_rand_str())); if(!(writeTest.open(QIODevice::ReadWrite) && (writeTest.write(writeTestBuffer) == strlen(writeTestBuffer)))) { - QMessageBox::warning(this, tr("LameXP"), QString("%1
    %2

    %3").arg(tr("Cannot write to the selected output directory."), m_settings->outputDir(), tr("Please choose a different directory!"))); + QMessageBox::warning(this, tr("LameXP"), NOBREAK(QString("%1
    %2

    %3").arg(tr("Cannot write to the selected output directory."), m_settings->outputDir(), tr("Please choose a different directory!")))); ui->tabWidget->setCurrentIndex(1); return; } @@ -2072,9 +2072,9 @@ void MainWindow::disableUpdateReminderActionTriggered(bool checked) { if(checked) { - if(0 == QMessageBox::question(this, tr("Disable Update Reminder"), NOBR(tr("Do you really want to disable the update reminder?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Disable Update Reminder"), NOBREAK(tr("Do you really want to disable the update reminder?")), tr("Yes"), tr("No"), QString(), 1)) { - QMessageBox::information(this, tr("Update Reminder"), QString("%1
    %2").arg(NOBR(tr("The update reminder has been disabled.")), NOBR(tr("Please remember to check for updates at regular intervals!")))); + QMessageBox::information(this, tr("Update Reminder"), NOBREAK(QString("%1
    %2").arg(tr("The update reminder has been disabled."), tr("Please remember to check for updates at regular intervals!")))); m_settings->autoUpdateEnabled(false); } else @@ -2084,7 +2084,7 @@ void MainWindow::disableUpdateReminderActionTriggered(bool checked) } else { - QMessageBox::information(this, tr("Update Reminder"), NOBR(tr("The update reminder has been re-enabled."))); + QMessageBox::information(this, tr("Update Reminder"), NOBREAK(tr("The update reminder has been re-enabled."))); m_settings->autoUpdateEnabled(true); } @@ -2098,9 +2098,9 @@ void MainWindow::disableSoundsActionTriggered(bool checked) { if(checked) { - if(0 == QMessageBox::question(this, tr("Disable Sound Effects"), NOBR(tr("Do you really want to disable all sound effects?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Disable Sound Effects"), NOBREAK(tr("Do you really want to disable all sound effects?")), tr("Yes"), tr("No"), QString(), 1)) { - QMessageBox::information(this, tr("Sound Effects"), NOBR(tr("All sound effects have been disabled."))); + QMessageBox::information(this, tr("Sound Effects"), NOBREAK(tr("All sound effects have been disabled."))); m_settings->soundsEnabled(false); } else @@ -2110,7 +2110,7 @@ void MainWindow::disableSoundsActionTriggered(bool checked) } else { - QMessageBox::information(this, tr("Sound Effects"), NOBR(tr("The sound effects have been re-enabled."))); + QMessageBox::information(this, tr("Sound Effects"), NOBREAK(tr("The sound effects have been re-enabled."))); m_settings->soundsEnabled(true); } @@ -2124,9 +2124,9 @@ void MainWindow::disableNeroAacNotificationsActionTriggered(bool checked) { if(checked) { - if(0 == QMessageBox::question(this, tr("Nero AAC Notifications"), NOBR(tr("Do you really want to disable all Nero AAC Encoder notifications?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Nero AAC Notifications"), NOBREAK(tr("Do you really want to disable all Nero AAC Encoder notifications?")), tr("Yes"), tr("No"), QString(), 1)) { - QMessageBox::information(this, tr("Nero AAC Notifications"), NOBR(tr("All Nero AAC Encoder notifications have been disabled."))); + QMessageBox::information(this, tr("Nero AAC Notifications"), NOBREAK(tr("All Nero AAC Encoder notifications have been disabled."))); m_settings->neroAacNotificationsEnabled(false); } else @@ -2136,8 +2136,8 @@ void MainWindow::disableNeroAacNotificationsActionTriggered(bool checked) } else { - QMessageBox::information(this, tr("Nero AAC Notifications"), NOBR(tr("The Nero AAC Encoder notifications have been re-enabled."))); - m_settings->neroAacNotificationsEnabled(true); + QMessageBox::information(this, tr("Nero AAC Notifications"), NOBREAK(tr("The Nero AAC Encoder notifications have been re-enabled."))); + m_settings->neroAacNotificationsEnabled(true); } ui->actionDisableNeroAacNotifications->setChecked(!m_settings->neroAacNotificationsEnabled()); @@ -2150,9 +2150,9 @@ void MainWindow::disableSlowStartupNotificationsActionTriggered(bool checked) { if(checked) { - if(0 == QMessageBox::question(this, tr("Slow Startup Notifications"), NOBR(tr("Do you really want to disable the slow startup notifications?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Slow Startup Notifications"), NOBREAK(tr("Do you really want to disable the slow startup notifications?")), tr("Yes"), tr("No"), QString(), 1)) { - QMessageBox::information(this, tr("Slow Startup Notifications"), NOBR(tr("The slow startup notifications have been disabled."))); + QMessageBox::information(this, tr("Slow Startup Notifications"), NOBREAK(tr("The slow startup notifications have been disabled."))); m_settings->antivirNotificationsEnabled(false); } else @@ -2162,7 +2162,7 @@ void MainWindow::disableSlowStartupNotificationsActionTriggered(bool checked) } else { - QMessageBox::information(this, tr("Slow Startup Notifications"), NOBR(tr("The slow startup notifications have been re-enabled."))); + QMessageBox::information(this, tr("Slow Startup Notifications"), NOBREAK(tr("The slow startup notifications have been re-enabled."))); m_settings->antivirNotificationsEnabled(true); } @@ -2243,9 +2243,9 @@ void MainWindow::checkForBetaUpdatesActionTriggered(bool checked) if(checked) { - if(0 == QMessageBox::question(this, tr("Beta Updates"), NOBR(tr("Do you really want LameXP to check for Beta (pre-release) updates?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Beta Updates"), NOBREAK(tr("Do you really want LameXP to check for Beta (pre-release) updates?")), tr("Yes"), tr("No"), QString(), 1)) { - if(0 == QMessageBox::information(this, tr("Beta Updates"), NOBR(tr("LameXP will check for Beta (pre-release) updates from now on.")), tr("Check Now"), tr("Discard"))) + if(0 == QMessageBox::information(this, tr("Beta Updates"), NOBREAK(tr("LameXP will check for Beta (pre-release) updates from now on.")), tr("Check Now"), tr("Discard"))) { checkUpdatesNow = true; } @@ -2258,7 +2258,7 @@ void MainWindow::checkForBetaUpdatesActionTriggered(bool checked) } else { - QMessageBox::information(this, tr("Beta Updates"), NOBR(tr("LameXP will not check for Beta (pre-release) updates from now on."))); + QMessageBox::information(this, tr("Beta Updates"), NOBREAK(tr("LameXP will not check for Beta (pre-release) updates from now on."))); m_settings->autoUpdateCheckBeta(false); } @@ -2280,9 +2280,9 @@ void MainWindow::hibernateComputerActionTriggered(bool checked) { if(checked) { - if(0 == QMessageBox::question(this, tr("Hibernate Computer"), NOBR(tr("Do you really want the computer to be hibernated on shutdown?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Hibernate Computer"), NOBREAK(tr("Do you really want the computer to be hibernated on shutdown?")), tr("Yes"), tr("No"), QString(), 1)) { - QMessageBox::information(this, tr("Hibernate Computer"), NOBR(tr("LameXP will hibernate the computer on shutdown from now on."))); + QMessageBox::information(this, tr("Hibernate Computer"), NOBREAK(tr("LameXP will hibernate the computer on shutdown from now on."))); m_settings->hibernateComputer(true); } else @@ -2292,7 +2292,7 @@ void MainWindow::hibernateComputerActionTriggered(bool checked) } else { - QMessageBox::information(this, tr("Hibernate Computer"), NOBR(tr("LameXP will not hibernate the computer on shutdown from now on."))); + QMessageBox::information(this, tr("Hibernate Computer"), NOBREAK(tr("LameXP will not hibernate the computer on shutdown from now on."))); m_settings->hibernateComputer(false); } @@ -2306,10 +2306,10 @@ void MainWindow::disableShellIntegrationActionTriggered(bool checked) { if(checked) { - if(0 == QMessageBox::question(this, tr("Shell Integration"), NOBR(tr("Do you really want to disable the LameXP shell integration?")), tr("Yes"), tr("No"), QString(), 1)) + if(0 == QMessageBox::question(this, tr("Shell Integration"), NOBREAK(tr("Do you really want to disable the LameXP shell integration?")), tr("Yes"), tr("No"), QString(), 1)) { ShellIntegration::remove(); - QMessageBox::information(this, tr("Shell Integration"), NOBR(tr("The LameXP shell integration has been disabled."))); + QMessageBox::information(this, tr("Shell Integration"), NOBREAK(tr("The LameXP shell integration has been disabled."))); m_settings->shellIntegrationEnabled(false); } else @@ -2320,7 +2320,7 @@ void MainWindow::disableShellIntegrationActionTriggered(bool checked) else { ShellIntegration::install(); - QMessageBox::information(this, tr("Shell Integration"), NOBR(tr("The LameXP shell integration has been re-enabled."))); + QMessageBox::information(this, tr("Shell Integration"), NOBREAK(tr("The LameXP shell integration has been re-enabled."))); m_settings->shellIntegrationEnabled(true); } @@ -2791,16 +2791,16 @@ void MainWindow::exportCsvContextActionTriggered(void) switch(m_fileListModel->exportToCsv(selectedCsvFile)) { case FileListModel::CsvError_NoTags: - QMessageBox::critical(this, tr("CSV Export"), NOBR(tr("Sorry, there are no meta tags that can be exported!"))); + QMessageBox::critical(this, tr("CSV Export"), NOBREAK(tr("Sorry, there are no meta tags that can be exported!"))); break; case FileListModel::CsvError_FileOpen: - QMessageBox::critical(this, tr("CSV Export"), NOBR(tr("Sorry, failed to open CSV file for writing!"))); + QMessageBox::critical(this, tr("CSV Export"), NOBREAK(tr("Sorry, failed to open CSV file for writing!"))); break; case FileListModel::CsvError_FileWrite: - QMessageBox::critical(this, tr("CSV Export"), NOBR(tr("Sorry, failed to write to the CSV file!"))); + QMessageBox::critical(this, tr("CSV Export"), NOBREAK(tr("Sorry, failed to write to the CSV file!"))); break; case FileListModel::CsvError_OK: - QMessageBox::information(this, tr("CSV Export"), NOBR(tr("The CSV files was created successfully!"))); + QMessageBox::information(this, tr("CSV Export"), NOBREAK(tr("The CSV files was created successfully!"))); break; default: qWarning("exportToCsv: Unknown return code!"); @@ -2840,19 +2840,19 @@ void MainWindow::importCsvContextActionTriggered(void) switch(m_fileListModel->importFromCsv(this, selectedCsvFile)) { case FileListModel::CsvError_FileOpen: - QMessageBox::critical(this, tr("CSV Import"), NOBR(tr("Sorry, failed to open CSV file for reading!"))); + QMessageBox::critical(this, tr("CSV Import"), NOBREAK(tr("Sorry, failed to open CSV file for reading!"))); break; case FileListModel::CsvError_FileRead: - QMessageBox::critical(this, tr("CSV Import"), NOBR(tr("Sorry, failed to read from the CSV file!"))); + QMessageBox::critical(this, tr("CSV Import"), NOBREAK(tr("Sorry, failed to read from the CSV file!"))); break; case FileListModel::CsvError_NoTags: - QMessageBox::critical(this, tr("CSV Import"), NOBR(tr("Sorry, the CSV file does not contain any known fields!"))); + QMessageBox::critical(this, tr("CSV Import"), NOBREAK(tr("Sorry, the CSV file does not contain any known fields!"))); break; case FileListModel::CsvError_Incomplete: - QMessageBox::warning(this, tr("CSV Import"), NOBR(tr("CSV file is incomplete. Not all files were updated!"))); + QMessageBox::warning(this, tr("CSV Import"), NOBREAK(tr("CSV file is incomplete. Not all files were updated!"))); break; case FileListModel::CsvError_OK: - QMessageBox::information(this, tr("CSV Import"), NOBR(tr("The CSV files was imported successfully!"))); + QMessageBox::information(this, tr("CSV Import"), NOBREAK(tr("The CSV files was imported successfully!"))); break; case FileListModel::CsvError_Aborted: /* User aborted, ignore! */ @@ -3109,7 +3109,7 @@ void MainWindow::makeFolderButtonClicked(void) } else { - QMessageBox::warning(this, tr("Failed to create folder"), QString("%1
    %2

    %3").arg(tr("The new folder could not be created:"), basePath.absoluteFilePath(newFolder), tr("Drive is read-only or insufficient access rights!"))); + QMessageBox::warning(this, tr("Failed to create folder"), NOBREAK(QString("%1
    %2

    %3").arg(tr("The new folder could not be created:"), basePath.absoluteFilePath(newFolder), tr("Drive is read-only or insufficient access rights!")))); } } break; diff --git a/src/Global.h b/src/Global.h index cd23bc6a..1a84ec64 100644 --- a/src/Global.h +++ b/src/Global.h @@ -88,4 +88,4 @@ const QString lamexp_version2string(const QString &pattern, unsigned int version /////////////////////////////////////////////////////////////////////////////// #define L1S(STR) (QLatin1String((STR))) -#define NOBR(STR) (QString("%1").arg((STR)).replace(L1S("-"), L1S("‑"))) +#define NOBREAK(STR) (QString("
    %1
    ").arg((STR)))