More internationalization and localization... (again)
This commit is contained in:
parent
4fb20b9dfc
commit
fdaf1909fc
@ -1208,6 +1208,10 @@
|
||||
<property name="title">
|
||||
<string>Style</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../res/Icons.qrc">
|
||||
<normaloff>:/icons/palette.png</normaloff>:/icons/palette.png</iconset>
|
||||
</property>
|
||||
<addaction name="actionStylePlastique"/>
|
||||
<addaction name="actionStyleCleanlooks"/>
|
||||
<addaction name="actionStyleWindowsVista"/>
|
||||
@ -1218,7 +1222,10 @@
|
||||
<property name="title">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
<addaction name="actionLanguageEnglish"/>
|
||||
<property name="icon">
|
||||
<iconset resource="../res/Icons.qrc">
|
||||
<normaloff>:/icons/font.png</normaloff>:/icons/font.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="actionSourceFiles"/>
|
||||
<addaction name="actionOutputDirectory"/>
|
||||
@ -1458,6 +1465,10 @@
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../res/Flags.qrc">
|
||||
<normaloff>:/flags/gb.png</normaloff>:/flags/gb.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">English</string>
|
||||
</property>
|
||||
@ -1465,113 +1476,7 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Flags.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
<include location="../res/Icons.qrc"/>
|
||||
<include location="../res/Images.qrc"/>
|
||||
|
@ -2,6 +2,8 @@
|
||||
<RCC version="1.0">
|
||||
<qresource>
|
||||
<file>flags/de.png</file>
|
||||
<file>flags/fr.png</file>
|
||||
<file>flags/gb.png</file>
|
||||
<file>flags/it.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -44,6 +44,7 @@
|
||||
<file>icons/folder_go.png</file>
|
||||
<file>icons/folder_image.png</file>
|
||||
<file>icons/folder_page.png</file>
|
||||
<file>icons/font.png</file>
|
||||
<file>icons/house.png</file>
|
||||
<file>icons/hourglass.png</file>
|
||||
<file>icons/information.png</file>
|
||||
@ -51,6 +52,7 @@
|
||||
<file>icons/money_dollar.png</file>
|
||||
<file>icons/monitor.png</file>
|
||||
<file>icons/music.png</file>
|
||||
<file>icons/palette.png</file>
|
||||
<file>icons/package.png</file>
|
||||
<file>icons/page_white_cplusplus.png</file>
|
||||
<file>icons/page_white_add.png</file>
|
||||
|
@ -4,10 +4,10 @@
|
||||
<file>localization/LameXP_DE.qm</file>
|
||||
<file>localization/LameXP_DE.qm.txt</file>
|
||||
<!--
|
||||
<file>localization/LameXP_FR.qm</file>
|
||||
<file>localization/LameXP_FR.qm.txt</file>
|
||||
<file>localization/LameXP_IT.qm</file>
|
||||
<file>localization/LameXP_IT.qm.txt</file>
|
||||
<file>localization/LameXP_FR.qm</file>
|
||||
<file>localization/LameXP_FR.qm.txt</file>
|
||||
-->
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -25,7 +25,7 @@
|
||||
#define VER_LAMEXP_MAJOR 4
|
||||
#define VER_LAMEXP_MINOR_HI 0
|
||||
#define VER_LAMEXP_MINOR_LO 0
|
||||
#define VER_LAMEXP_BUILD 197
|
||||
#define VER_LAMEXP_BUILD 200
|
||||
#define VER_LAMEXP_SUFFIX TechPreview
|
||||
|
||||
/*
|
||||
|
@ -249,22 +249,18 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
||||
|
||||
//Populate the language menu
|
||||
m_languageActionGroup = new QActionGroup(this);
|
||||
m_languageActionGroup->addAction(actionLanguageEnglish);
|
||||
actionLanguageEnglish->setChecked(true);
|
||||
connect(m_languageActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(languageActionActivated(QAction*)));
|
||||
QStringList translations = lamexp_query_translations();
|
||||
while(translations.count() > 0)
|
||||
while(!translations.isEmpty())
|
||||
{
|
||||
QString langId = translations.takeFirst();
|
||||
QAction *currentLanguage = new QAction(this);
|
||||
currentLanguage->setData(langId);
|
||||
currentLanguage->setText(lamexp_translation_name(langId));
|
||||
currentLanguage->setIcon(QIcon(QString(":/flags/%1.png").arg(langId)));
|
||||
currentLanguage->setCheckable(true);
|
||||
currentLanguage->setText(translations.takeFirst());
|
||||
m_languageActionGroup->addAction(currentLanguage);
|
||||
menuLanguage->addAction(currentLanguage);
|
||||
if(currentLanguage->text().compare(m_settings->currentLanguage(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
currentLanguage->setChecked(true);
|
||||
languageActionActivated(currentLanguage);
|
||||
}
|
||||
}
|
||||
|
||||
//Activate tools menu actions
|
||||
@ -311,8 +307,17 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
||||
//Enable Drag & Drop
|
||||
this->setAcceptDrops(true);
|
||||
|
||||
//Finally re-translate the UI
|
||||
retranslateUi(this);
|
||||
//Load translation & re-translate
|
||||
QList<QAction*> languageActions = m_languageActionGroup->actions();
|
||||
while(!languageActions.isEmpty())
|
||||
{
|
||||
QAction *currentLanguage = languageActions.takeFirst();
|
||||
if(currentLanguage->data().toString().compare(m_settings->currentLanguage(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
currentLanguage->setChecked(true);
|
||||
languageActionActivated(currentLanguage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -630,9 +635,9 @@ void MainWindow::windowShown(void)
|
||||
if(lamexp_tool_version("neroAacEnc.exe") < lamexp_toolver_neroaac())
|
||||
{
|
||||
QString messageText;
|
||||
messageText += tr("<nobr>LameXP detected that your version of the Nero AAC encoder is outdated!<br>");
|
||||
messageText += tr("The current version available is %1 (or later), but you still have version %2 installed.<br><br>").arg(lamexp_version2string("?.?.?.?", lamexp_toolver_neroaac()), lamexp_version2string("?.?.?.?", lamexp_tool_version("neroAacEnc.exe")));
|
||||
messageText += tr("You can download the latest version of the Nero AAC encoder from the Nero website at:<br>");
|
||||
messageText += QString("<nobr>%1<br>").arg(tr("LameXP detected that your version of the Nero AAC encoder is outdated!"));
|
||||
messageText += QString("%1<br><br>").arg(tr("The current version available is %1 (or later), but you still have version %2 installed.").arg(lamexp_version2string("?.?.?.?", lamexp_toolver_neroaac()), lamexp_version2string("?.?.?.?", lamexp_tool_version("neroAacEnc.exe"))));
|
||||
messageText += QString("%1<br>").arg(tr("You can download the latest version of the Nero AAC encoder from the Nero website at:"));
|
||||
messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
|
||||
QMessageBox::information(this, tr("AAC Encoder Outdated"), messageText);
|
||||
}
|
||||
@ -641,11 +646,11 @@ void MainWindow::windowShown(void)
|
||||
{
|
||||
radioButtonEncoderAAC->setEnabled(false);
|
||||
QString messageText;
|
||||
messageText += tr("<nobr>The Nero AAC encoder could not be found. AAC encoding support will be disabled.<br>");
|
||||
messageText += tr("Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!<br><br>");
|
||||
messageText += tr("Your LameXP directory is located here:<br>");
|
||||
messageText += QString("<nobr>%1<br>").arg(tr("The Nero AAC encoder could not be found. AAC encoding support will be disabled."));
|
||||
messageText += QString("%1<br><br>").arg(tr("Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!"));
|
||||
messageText += QString("%1<br>").arg(tr("Your LameXP directory is located here:"));
|
||||
messageText += QString("<i><nobr><a href=\"file:///%1\">%1</a></nobr></i><br><br>").arg(QDir::toNativeSeparators(QCoreApplication::applicationDirPath()));
|
||||
messageText += tr("You can download the Nero AAC encoder for free from the official Nero website at:<br>");
|
||||
messageText += QString("%1<br>").arg(tr("You can download the Nero AAC encoder for free from the official Nero website at:"));
|
||||
messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
|
||||
QMessageBox::information(this, tr("AAC Support Disabled"), messageText);
|
||||
}
|
||||
@ -657,8 +662,8 @@ void MainWindow::windowShown(void)
|
||||
if(!lamexp_check_tool("wmawav.exe"))
|
||||
{
|
||||
QString messageText;
|
||||
messageText += tr("<nobr>LameXP has detected that the WMA File Decoder component is not currently installed on your system.<br>");
|
||||
messageText += tr("You won't be able to process WMA files as input unless the WMA File Decoder component is installed!</nobr>");
|
||||
messageText += QString("<nobr>%1<br>").arg(tr("LameXP has detected that the WMA File Decoder component is not currently installed on your system."));
|
||||
messageText += QString("%1</nobr>").arg(tr("You won't be able to process WMA files as input unless the WMA File Decoder component is installed!"));
|
||||
QMessageBox::information(this, tr("WMA Decoder Missing"), messageText);
|
||||
installWMADecoderActionTriggered(rand() % 2);
|
||||
}
|
||||
@ -962,19 +967,11 @@ void MainWindow::styleActionActivated(QAction *action)
|
||||
*/
|
||||
void MainWindow::languageActionActivated(QAction *action)
|
||||
{
|
||||
if(action != actionLanguageEnglish)
|
||||
QString langId = action->data().toString();
|
||||
|
||||
if(lamexp_install_translator(langId))
|
||||
{
|
||||
if(lamexp_install_translator(action->text()))
|
||||
{
|
||||
m_settings->currentLanguage(action->text());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(lamexp_install_translator(QString()))
|
||||
{
|
||||
m_settings->currentLanguage(action->text());
|
||||
}
|
||||
m_settings->currentLanguage(langId);
|
||||
}
|
||||
|
||||
retranslateUi(this);
|
||||
|
@ -121,7 +121,8 @@ static QMap<QString, LockedFile*> g_lamexp_tool_registry;
|
||||
static QMap<QString, unsigned int> g_lamexp_tool_versions;
|
||||
|
||||
//Languages
|
||||
static QMap<QString, QString> g_lamexp_translations;
|
||||
static QMap<QString, QString> g_lamexp_translation_files;
|
||||
static QMap<QString, QString> g_lamexp_translation_names;
|
||||
static QTranslator *g_lamexp_currentTranslator = NULL;
|
||||
|
||||
//Shared memory
|
||||
@ -448,6 +449,44 @@ static bool lamexp_check_elevation(void)
|
||||
return !bIsProcessElevated;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize translation files
|
||||
*/
|
||||
static void lamexp_init_translations(void)
|
||||
{
|
||||
//Add default translations
|
||||
g_lamexp_translation_files.insert(LAMEXP_DEFAULT_LANGID, "");
|
||||
g_lamexp_translation_names.insert(LAMEXP_DEFAULT_LANGID, "English");
|
||||
|
||||
//Search for language files
|
||||
QStringList qmFiles = QDir(":/localization").entryList(QStringList() << "LameXP_??.qm", QDir::Files, QDir::Name);
|
||||
|
||||
//Add all available translations
|
||||
while(!qmFiles.isEmpty())
|
||||
{
|
||||
QString langId, langName;
|
||||
QString qmFile = qmFiles.takeFirst();
|
||||
|
||||
QRegExp langIdExp("LameXP_(\\w\\w)\\.qm", Qt::CaseInsensitive);
|
||||
if(langIdExp.indexIn(qmFile) >= 0)
|
||||
{
|
||||
langId = langIdExp.cap(1).toLower();
|
||||
}
|
||||
|
||||
QResource langNameRes = (QString(":/localization/%1.txt").arg(qmFile));
|
||||
if(langNameRes.isValid() && langNameRes.size() > 0)
|
||||
{
|
||||
langName = QString::fromUtf8(reinterpret_cast<const char*>(langNameRes.data()), langNameRes.size());
|
||||
}
|
||||
|
||||
if(!langId.isEmpty() && !langName.isEmpty())
|
||||
{
|
||||
g_lamexp_translation_files.insert(langId, qmFile);
|
||||
g_lamexp_translation_names.insert(langId, langName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize Qt framework
|
||||
*/
|
||||
@ -520,16 +559,8 @@ bool lamexp_init_qt(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
//Init available translations
|
||||
QStringList qmFiles = QDir(":/localization").entryList(QStringList() << "*.qm", QDir::Files, QDir::Name);
|
||||
for(int i = 0; i < qmFiles.count(); i++)
|
||||
{
|
||||
QResource langName = (QString(":/localization/%1.txt").arg(qmFiles.at(i)));
|
||||
if(langName.isValid() && langName.size() > 0)
|
||||
{
|
||||
g_lamexp_translations.insert(QString::fromUtf8(reinterpret_cast<const char*>(langName.data()), langName.size()), qmFiles.at(i));
|
||||
}
|
||||
}
|
||||
//Init language files
|
||||
lamexp_init_translations();
|
||||
|
||||
//Check for process elevation
|
||||
if(!lamexp_check_elevation())
|
||||
@ -867,17 +898,25 @@ const QString lamexp_version2string(const QString &pattern, unsigned int version
|
||||
}
|
||||
|
||||
/*
|
||||
* Get list of translations
|
||||
* Get list of all translations
|
||||
*/
|
||||
QStringList lamexp_query_translations(void)
|
||||
{
|
||||
return g_lamexp_translations.keys();
|
||||
return g_lamexp_translation_files.keys();
|
||||
}
|
||||
|
||||
/*
|
||||
* Get translation name
|
||||
*/
|
||||
QString lamexp_translation_name(const QString &langId)
|
||||
{
|
||||
return g_lamexp_translation_names.value(langId.toLower(), QString());
|
||||
}
|
||||
|
||||
/*
|
||||
* Install a new translator
|
||||
*/
|
||||
bool lamexp_install_translator(const QString &language)
|
||||
bool lamexp_install_translator(const QString &langId)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
@ -886,14 +925,14 @@ bool lamexp_install_translator(const QString &language)
|
||||
g_lamexp_currentTranslator = new QTranslator();
|
||||
}
|
||||
|
||||
if(language.isEmpty())
|
||||
if(langId.isEmpty() || langId.toLower().compare(LAMEXP_DEFAULT_LANGID) == 0)
|
||||
{
|
||||
QApplication::removeTranslator(g_lamexp_currentTranslator);
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString qmFile = g_lamexp_translations.value(language, QString());
|
||||
QString qmFile = g_lamexp_translation_files.value(langId.toLower(), QString());
|
||||
if(!qmFile.isEmpty())
|
||||
{
|
||||
QApplication::removeTranslator(g_lamexp_currentTranslator);
|
||||
@ -902,7 +941,7 @@ bool lamexp_install_translator(const QString &language)
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning("Translation '%s' not available!", language.toLatin1().constData());
|
||||
qWarning("Translation '%s' not available!", langId.toLatin1().constData());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1080,9 +1119,13 @@ void lamexp_finalization(void)
|
||||
}
|
||||
|
||||
//Clear languages
|
||||
lamexp_install_translator(QString());
|
||||
if(g_lamexp_currentTranslator)
|
||||
{
|
||||
QApplication::removeTranslator(g_lamexp_currentTranslator);
|
||||
LAMEXP_DELETE(g_lamexp_currentTranslator);
|
||||
g_lamexp_translations.clear();
|
||||
}
|
||||
g_lamexp_translation_files.clear();
|
||||
g_lamexp_translation_names.clear();
|
||||
|
||||
//Destroy Qt application object
|
||||
QApplication *application = dynamic_cast<QApplication*>(QApplication::instance());
|
||||
|
@ -91,8 +91,12 @@ const QString &lamexp_temp_folder(void);
|
||||
void lamexp_ipc_read(unsigned int *command, char* message, size_t buffSize);
|
||||
void lamexp_ipc_send(unsigned int command, const char* message);
|
||||
lamexp_cpu_t lamexp_detect_cpu_features(void);
|
||||
|
||||
//Translation support
|
||||
QStringList lamexp_query_translations(void);
|
||||
QString lamexp_translation_name(const QString &language);
|
||||
bool lamexp_install_translator(const QString &language);
|
||||
static const char* LAMEXP_DEFAULT_LANGID = "gb";
|
||||
|
||||
//Auxiliary functions
|
||||
bool lamexp_clean_folder(const QString folderPath);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <QApplication>
|
||||
#include <QString>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
|
||||
//Constants
|
||||
static const char *g_settingsId_versionNumber = "VersionNumber";
|
||||
@ -96,10 +97,12 @@ void SettingsModel::validate(void)
|
||||
{
|
||||
this->compressionEncoder(SettingsModel::MP3Encoder);
|
||||
}
|
||||
|
||||
if(this->compressionRCMode() < SettingsModel::VBRMode || this->compressionRCMode() > SettingsModel::CBRMode)
|
||||
{
|
||||
this->compressionEncoder(SettingsModel::VBRMode);
|
||||
}
|
||||
|
||||
if(!(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")))
|
||||
{
|
||||
if(this->compressionEncoder() == SettingsModel::AACEncoder)
|
||||
@ -108,10 +111,17 @@ void SettingsModel::validate(void)
|
||||
this->compressionEncoder(SettingsModel::MP3Encoder);
|
||||
}
|
||||
}
|
||||
|
||||
if(this->outputDir().isEmpty() || !QFileInfo(this->outputDir()).isDir())
|
||||
{
|
||||
this->outputDir(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
|
||||
}
|
||||
|
||||
if(!lamexp_query_translations().contains(this->currentLanguage(), Qt::CaseInsensitive))
|
||||
{
|
||||
qWarning("Current language is unknown, reverting to default language!");
|
||||
this->currentLanguage(LAMEXP_DEFAULT_LANGID);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -134,4 +144,4 @@ MAKE_OPTION3(soundsEnabled, true)
|
||||
MAKE_OPTION3(neroAacNotificationsEnabled, true)
|
||||
MAKE_OPTION3(wmaDecoderNotificationsEnabled, true)
|
||||
MAKE_OPTION3(dropBoxWidgetEnabled, true)
|
||||
MAKE_OPTION2(currentLanguage, QString());
|
||||
MAKE_OPTION2(currentLanguage, LAMEXP_DEFAULT_LANGID);
|
||||
|
Loading…
Reference in New Issue
Block a user