diff --git a/LameXP.vcproj b/LameXP.vcproj index 24e011c3..d0061435 100644 --- a/LameXP.vcproj +++ b/LameXP.vcproj @@ -1711,7 +1711,7 @@ @@ -1722,7 +1722,7 @@ @@ -1733,7 +1733,7 @@ diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 6fad31c2..08f81243 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -166,6 +166,17 @@ + + FileListModel + + Title + + + + Full Path + + + LogViewDialog @@ -707,6 +718,14 @@ Do you really want to disable the update reminder? + + Yes + + + + No + + The update reminder has been disabled. diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 0dd5179d..cd55c977 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -166,6 +166,18 @@ (Rechts-klicken um die DropBox zu schließen) + + FileListModel + + Title + Titel + Titel + + + Full Path + Datei Pfad + + LogViewDialog @@ -811,6 +823,14 @@ Already Running Wird Bereits Ausgeführt + + Yes + Ja + + + No + Nein + MetaInfo diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index 5419e365..e3754a1b 100644 Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ diff --git a/res/localization/LameXP_DE.qm.txt b/res/localization/LameXP_DE.qm.txt index 699c71ba..a4d13650 100644 --- a/res/localization/LameXP_DE.qm.txt +++ b/res/localization/LameXP_DE.qm.txt @@ -1 +1 @@ -7,Deutsch \ No newline at end of file +42,Deutsch \ No newline at end of file diff --git a/res/localization/LameXP_FR.qm.txt b/res/localization/LameXP_FR.qm.txt index 477f0693..17f20699 100644 --- a/res/localization/LameXP_FR.qm.txt +++ b/res/localization/LameXP_FR.qm.txt @@ -1 +1 @@ -12,Française \ No newline at end of file +37,Française \ No newline at end of file diff --git a/res/localization/LameXP_IT.qm.txt b/res/localization/LameXP_IT.qm.txt index 05b34527..4bdd8822 100644 --- a/res/localization/LameXP_IT.qm.txt +++ b/res/localization/LameXP_IT.qm.txt @@ -1 +1 @@ -16,Italiano \ No newline at end of file +58,Italiano \ No newline at end of file diff --git a/src/Config.h b/src/Config.h index 6ba5c1d1..2af39e9c 100644 --- a/src/Config.h +++ b/src/Config.h @@ -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 210 +#define VER_LAMEXP_BUILD 212 #define VER_LAMEXP_SUFFIX TechPreview /* diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index a51a54ff..4dea6fac 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -242,8 +242,8 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S actionStyleWindowsXP->setUserData(0, new Index(3)); actionStyleWindowsClassic->setUserData(0, new Index(4)); actionStylePlastique->setChecked(true); - actionStyleWindowsXP->setEnabled((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_XP); - actionStyleWindowsVista->setEnabled((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_VISTA); + actionStyleWindowsXP->setEnabled((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_XP && lamexp_themes_enabled()); + actionStyleWindowsVista->setEnabled((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_VISTA && lamexp_themes_enabled()); connect(m_styleActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(styleActionActivated(QAction*))); styleActionActivated(NULL); @@ -947,21 +947,33 @@ void MainWindow::styleActionActivated(QAction *action) switch(m_settings->interfaceStyle()) { case 1: - actionStyleCleanlooks->setChecked(true); - QApplication::setStyle(new QCleanlooksStyle()); - break; + if(actionStyleCleanlooks->isEnabled()) + { + actionStyleCleanlooks->setChecked(true); + QApplication::setStyle(new QCleanlooksStyle()); + break; + } case 2: - actionStyleWindowsVista->setChecked(true); - QApplication::setStyle(new QWindowsVistaStyle()); - break; + if(actionStyleWindowsVista->isEnabled()) + { + actionStyleWindowsVista->setChecked(true); + QApplication::setStyle(new QWindowsVistaStyle()); + break; + } case 3: - actionStyleWindowsXP->setChecked(true); - QApplication::setStyle(new QWindowsXPStyle()); - break; + if(actionStyleWindowsXP->isEnabled()) + { + actionStyleWindowsXP->setChecked(true); + QApplication::setStyle(new QWindowsXPStyle()); + break; + } case 4: - actionStyleWindowsClassic->setChecked(true); - QApplication::setStyle(new QWindowsStyle()); - break; + if(actionStyleWindowsClassic->isEnabled()) + { + actionStyleWindowsClassic->setChecked(true); + QApplication::setStyle(new QWindowsStyle()); + break; + } default: actionStylePlastique->setChecked(true); QApplication::setStyle(new QPlastiqueStyle()); @@ -1615,7 +1627,7 @@ void MainWindow::disableUpdateReminderActionTriggered(bool checked) { if(checked) { - if(QMessageBox::Yes == QMessageBox::question(this, tr("Disable Update Reminder"), tr("Do you really want to disable the update reminder?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) + if(0 == QMessageBox::question(this, tr("Disable Update Reminder"), 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(tr("The update reminder has been disabled."), tr("Please remember to check for updates at regular intervals!"))); m_settings->autoUpdateEnabled(false); @@ -1641,7 +1653,7 @@ void MainWindow::disableSoundsActionTriggered(bool checked) { if(checked) { - if(QMessageBox::Yes == QMessageBox::question(this, tr("Disable Sound Effects"), tr("Do you really want to disable all sound effects?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) + if(0 == QMessageBox::question(this, tr("Disable Sound Effects"), tr("Do you really want to disable all sound effects?"), tr("Yes"), tr("No"), QString(), 1)) { QMessageBox::information(this, tr("Sound Effects"), tr("All sound effects have been disabled.")); m_settings->soundsEnabled(false); @@ -1667,7 +1679,7 @@ void MainWindow::disableNeroAacNotificationsActionTriggered(bool checked) { if(checked) { - if(QMessageBox::Yes == QMessageBox::question(this, tr("Nero AAC Notifications"), tr("Do you really want to disable all Nero AAC Encoder notifications?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) + if(0 == QMessageBox::question(this, tr("Nero AAC Notifications"), 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"), tr("All Nero AAC Encoder notifications have been disabled.")); m_settings->neroAacNotificationsEnabled(false); @@ -1693,7 +1705,7 @@ void MainWindow::disableWmaDecoderNotificationsActionTriggered(bool checked) { if(checked) { - if(QMessageBox::Yes == QMessageBox::question(this, tr("WMA Decoder Notifications"), tr("Do you really want to disable all WMA Decoder notifications?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) + if(0 == QMessageBox::question(this, tr("WMA Decoder Notifications"), tr("Do you really want to disable all WMA Decoder notifications?"), tr("Yes"), tr("No"), QString(), 1)) { QMessageBox::information(this, tr("WMA Decoder Notifications"), tr("All WMA Decoder notifications have been disabled.")); m_settings->wmaDecoderNotificationsEnabled(false); diff --git a/src/Global.cpp b/src/Global.cpp index fdaa4c42..c6f20608 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -1081,6 +1081,29 @@ bool lamexp_remove_file(const QString &filename) } } +/* + * Check if visual themes are enabled (WinXP and later) + */ +bool lamexp_themes_enabled(void) +{ + typedef int (WINAPI *IsAppThemedFun)(void); + + bool isAppThemed = false; + QLibrary uxTheme(QString("%1/UxTheme.dll").arg(lamexp_known_folder(lamexp_folder_systemfolder))); + IsAppThemedFun IsAppThemedPtr = (IsAppThemedFun) uxTheme.resolve("IsAppThemed"); + + if(IsAppThemedPtr) + { + isAppThemed = IsAppThemedPtr(); + if(!isAppThemed) + { + qWarning("Theme support is disabled for this process!"); + } + } + + return isAppThemed; +} + /* * Get number of free bytes on disk */ diff --git a/src/Global.h b/src/Global.h index 1869b2fd..926f9bf9 100644 --- a/src/Global.h +++ b/src/Global.h @@ -105,6 +105,7 @@ const QString lamexp_version2string(const QString &pattern, unsigned int version QString lamexp_known_folder(lamexp_known_folder_t folder_id); __int64 lamexp_free_diskspace(const QString &path); bool lamexp_remove_file(const QString &filename); +bool lamexp_themes_enabled(void); //Debug-only functions SIZE_T lamexp_dbg_private_bytes(void); diff --git a/src/Model_FileList.cpp b/src/Model_FileList.cpp index ba366e3c..546be17e 100644 --- a/src/Model_FileList.cpp +++ b/src/Model_FileList.cpp @@ -87,10 +87,10 @@ QVariant FileListModel::headerData(int section, Qt::Orientation orientation, int switch(section) { case 0: - return QVariant("Title"); + return QVariant(tr("Title")); break; case 1: - return QVariant("Full Path"); + return QVariant(tr("Full Path")); break; default: return QVariant(); diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index 81dbd143..21664c3b 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -29,6 +29,7 @@ #include #include #include +#include //Constants static const char *g_settingsId_versionNumber = "VersionNumber"; @@ -122,7 +123,7 @@ void SettingsModel::validate(void) if(!lamexp_query_translations().contains(this->currentLanguage(), Qt::CaseInsensitive)) { - qWarning("Current language is unknown, reverting to default language!"); + qWarning("Current language \"%s\" is unknown, reverting to default language!", this->currentLanguage().toLatin1().constData()); this->currentLanguage(defaultLanguage()); } } @@ -139,8 +140,8 @@ QString SettingsModel::defaultLanguage(void) } //Check if we can use the default translation - WORD systemLangId = PRIMARYLANGID(GetUserDefaultLangID()); - if(systemLangId == LANG_ENGLISH) + QLocale systemLanguage= QLocale::system(); + if(systemLanguage.language() == QLocale::English || systemLanguage.language() == QLocale::C) { m_defaultLanguage = new QString(LAMEXP_DEFAULT_LANGID); return LAMEXP_DEFAULT_LANGID; @@ -151,7 +152,7 @@ QString SettingsModel::defaultLanguage(void) while(!languages.isEmpty()) { QString currentLangId = languages.takeFirst(); - if(lamexp_translation_sysid(currentLangId) == systemLangId) + if(lamexp_translation_sysid(currentLangId) == systemLanguage.language()) { m_defaultLanguage = new QString(currentLangId); return currentLangId;