//Activate tools menu actions
actionDisableUpdateReminder->setChecked(!m_settings->autoUpdateEnabled());
actionDisableSounds->setChecked(!m_settings->soundsEnabled());
+ actionDisableNeroAacNotifications->setChecked(!m_settings->neroAacNotificationsEnabled());
+ actionDisableWmaDecoderNotifications->setChecked(!m_settings->wmaDecoderNotificationsEnabled());
connect(actionDisableUpdateReminder, SIGNAL(triggered(bool)), this, SLOT(disableUpdateReminderActionTriggered(bool)));
connect(actionDisableSounds, SIGNAL(triggered(bool)), this, SLOT(disableSoundsActionTriggered(bool)));
connect(actionInstallWMADecoder, SIGNAL(triggered(bool)), this, SLOT(installWMADecoderActionTriggered(bool)));
+ connect(actionDisableNeroAacNotifications, SIGNAL(triggered(bool)), this, SLOT(disableNeroAacNotificationsActionTriggered(bool)));
+ connect(actionDisableWmaDecoderNotifications, SIGNAL(triggered(bool)), this, SLOT(disableWmaDecoderNotificationsActionTriggered(bool)));
//Activate help menu actions
connect(actionCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdatesActionActivated()));
}
//Check for AAC support
- if(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe"))
+ if(m_settings->neroAacNotificationsEnabled())
{
- if(lamexp_tool_version("neroAacEnc.exe") < lamexp_toolver_neroaac())
+ if(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe"))
{
+ if(lamexp_tool_version("neroAacEnc.exe") < lamexp_toolver_neroaac())
+ {
+ QString messageText;
+ messageText += "<nobr>LameXP detected that your version of the Nero AAC encoder is outdated!<br>";
+ messageText += "The current version available is " + lamexp_version2string("?.?.?.?", lamexp_toolver_neroaac()) + " (or later), but you still have version " + lamexp_version2string("?.?.?.?", lamexp_tool_version("neroAacEnc.exe")) + " installed.<br><br>";
+ messageText += "You can download the latest version of the Nero AAC encoder from the Nero website at:<br>";
+ messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
+ QMessageBox::information(this, "AAC Encoder Outdated", messageText);
+ }
+ }
+ else
+ {
+ radioButtonEncoderAAC->setEnabled(false);
QString messageText;
- messageText += "<nobr>LameXP detected that your version of the Nero AAC encoder is outdated!<br>";
- messageText += "The current version available is " + lamexp_version2string("?.?.?.?", lamexp_toolver_neroaac()) + " (or later), but you still have version " + lamexp_version2string("?.?.?.?", lamexp_tool_version("neroAacEnc.exe")) + " installed.<br><br>";
- messageText += "You can download the latest version of the Nero AAC encoder from the Nero website at:<br>";
+ messageText += "<nobr>The Nero AAC encoder could not be found. AAC encoding support will be disabled.<br>";
+ messageText += "Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!<br><br>";
+ messageText += "Your LameXP directory is as follows:<br>";
+ messageText += "<i><nobr>" + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "</nobr></i><br><br>";
+ messageText += "You can download the Nero AAC encoder for free from the official Nero website at:<br>";
messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
- QMessageBox::information(this, "AAC Encoder Outdated", messageText);
+ QMessageBox::information(this, "AAC Support Disabled", messageText);
}
}
- else
- {
- radioButtonEncoderAAC->setEnabled(false);
- QString messageText;
- messageText += "<nobr>The Nero AAC encoder could not be found. AAC encoding support will be disabled.<br>";
- messageText += "Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!<br><br>";
- messageText += "Your LameXP directory is as follows:<br>";
- messageText += "<i><nobr>" + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "</nobr></i><br><br>";
- messageText += "You can download the Nero AAC encoder for free from the official Nero website at:<br>";
- messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
- QMessageBox::information(this, "AAC Support Disabled", messageText);
- }
//Check for WMA support
- if(!lamexp_check_tool("wmawav.exe"))
+ if(m_settings->wmaDecoderNotificationsEnabled())
{
- QString messageText;
- messageText += "<nobr>LameXP has detected that the WMA File Decoder component is not currently installed on your system.<br>";
- messageText += "You won't be able to process WMA files as input unless the WMA File Decoder component is installed!</nobr>";
- QMessageBox::information(this, "WMA Decoder Missing", messageText);
- installWMADecoderActionTriggered(rand() % 2);
+ if(!lamexp_check_tool("wmawav.exe"))
+ {
+ QString messageText;
+ messageText += "<nobr>LameXP has detected that the WMA File Decoder component is not currently installed on your system.<br>";
+ messageText += "You won't be able to process WMA files as input unless the WMA File Decoder component is installed!</nobr>";
+ QMessageBox::information(this, "WMA Decoder Missing", messageText);
+ installWMADecoderActionTriggered(rand() % 2);
+ }
}
//Add files from the command-line
void MainWindow::encodeButtonClicked(void)
{
static const __int64 oneGigabyte = 1073741824;
- static const __int64 minimumFreeDiskspaceMultiplier = 222;
+ static const __int64 minimumFreeDiskspaceMultiplier = 2;
ABORT_IF_BUSY;
return;
}
- if(lamexp_free_diskspace(lamexp_temp_folder()) < (oneGigabyte * minimumFreeDiskspaceMultiplier))
+ __int64 currentFreeDiskspace = lamexp_free_diskspace(lamexp_temp_folder());
+
+ if(currentFreeDiskspace < (oneGigabyte * minimumFreeDiskspaceMultiplier))
{
- QDir tempFolder(lamexp_temp_folder());
- tempFolder.cdUp();
- if(QMessageBox::warning(this, "Low Diskspace Warning", QString("<nobr>Warning: There are less than %1 GB of free diskspace available on your system's TEMP folder!</nobr><br><br>Your TEMP folder is located at:<br><i>%2</i>").arg(QString::number(minimumFreeDiskspaceMultiplier), tempFolder.path()), "Abort Process (Recommended)", "Ignore") != 1)
+ QStringList tempFolderParts = lamexp_temp_folder().split("/", QString::SkipEmptyParts, Qt::CaseInsensitive);
+ tempFolderParts.takeLast();
+ switch(QMessageBox::warning(this, "Low Diskspace Warning", QString("<nobr>There are less than %1 GB of free diskspace available on your system's TEMP folder.</nobr><br><nobr>It is highly recommend to free up more diskspace before proceeding with the encode!.</nobr><br><br>Your TEMP folder is located at:<br><nobr><i><a href=\"file:///%3\">%3</a></i></nobr><br>").arg(QString::number(minimumFreeDiskspaceMultiplier), tempFolderParts.join("\\")), "Abort Encoding Process", "Clean Disk Now", "Ignore"))
{
+ case 1:
+ QProcess::startDetached(QString("%1/cleanmgr.exe").arg(lamexp_known_folder(lamexp_folder_systemfolder)), QStringList() << "/D" << tempFolderParts.first());
+ case 0:
return;
+ break;
+ default:
+ QMessageBox::warning(this, "Low Diskspace", "You are proceeding with low diskspace. Problems might occur!");
+ break;
}
}
actionDisableSounds->setChecked(!m_settings->soundsEnabled());
}
+/*
+ * Disable Nero AAC encoder action
+ */
+void MainWindow::disableNeroAacNotificationsActionTriggered(bool checked)
+{
+ if(checked)
+ {
+ if(QMessageBox::Yes == QMessageBox::question(this, "Nero AAC Notifications", "Do you really want to disable all Nero AAC Encoder notifications?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No))
+ {
+ QMessageBox::information(this, "Nero AAC Notifications", "All Nero AAC Encoder notifications have been disabled.");
+ m_settings->neroAacNotificationsEnabled(false);
+ }
+ else
+ {
+ m_settings->neroAacNotificationsEnabled(true);
+ }
+ }
+ else
+ {
+ QMessageBox::information(this, "Nero AAC Notifications", "The Nero AAC Encoder notifications have been re-enabled.");
+ m_settings->neroAacNotificationsEnabled(true);
+ }
+
+ actionDisableNeroAacNotifications->setChecked(!m_settings->neroAacNotificationsEnabled());
+}
+
+/*
+ * Disable WMA Decoder component action
+ */
+void MainWindow::disableWmaDecoderNotificationsActionTriggered(bool checked)
+{
+ if(checked)
+ {
+ if(QMessageBox::Yes == QMessageBox::question(this, "WMA Decoder Notifications", "Do you really want to disable all WMA Decoder notifications?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No))
+ {
+ QMessageBox::information(this, "WMA Decoder Notifications", "All WMA Decoder notifications have been disabled.");
+ m_settings->wmaDecoderNotificationsEnabled(false);
+ }
+ else
+ {
+ m_settings->wmaDecoderNotificationsEnabled(true);
+ }
+ }
+ else
+ {
+ QMessageBox::information(this, "WMA Decoder Notifications", "The WMA Decoder notifications have been re-enabled.");
+ m_settings->wmaDecoderNotificationsEnabled(true);
+ }
+
+ actionDisableWmaDecoderNotifications->setChecked(!m_settings->wmaDecoderNotificationsEnabled());
+}
+
+/*
+ * Download and install WMA Decoder component
+ */
void MainWindow::installWMADecoderActionTriggered(bool checked)
{
static const char *download_url = "http://www.nch.com.au/components/wmawav.exe";
static const int CSIDL_LOCAL_APPDATA = 0x001c;
static const int CSIDL_PROGRAM_FILES = 0x0026;
+ static const int CSIDL_SYSTEM_FOLDER = 0x0025;
static const GUID GUID_LOCAL_APPDATA = {0xF1B32785,0x6FBA,0x4FCF,{0x9D,0x55,0x7B,0x8E,0x7F,0x15,0x70,0x91}};
static const GUID GUID_LOCAL_APPDATA_LOW = {0xA520A1A4,0x1780,0x4FF6,{0xBD,0x18,0x16,0x73,0x43,0xC5,0xAF,0x16}};
static const GUID GUID_PROGRAM_FILES = {0x905e63b6,0xc1bf,0x494e,{0xb2,0x9c,0x65,0xb7,0x32,0xd3,0xd2,0x1a}};
+ static const GUID GUID_SYSTEM_FOLDER = {0x1AC14E77,0x02E7,0x4E5D,{0xB7,0x44,0x2E,0xB1,0xAE,0x51,0x98,0xB7}};
static QLibrary *Kernel32Lib = NULL;
static SHGetKnownFolderPathFun SHGetKnownFolderPathPtr = NULL;
folderCSIDL = CSIDL_PROGRAM_FILES;
folderGUID = GUID_PROGRAM_FILES;
break;
+ case lamexp_folder_systemfolder:
+ folderCSIDL = CSIDL_SYSTEM_FOLDER;
+ folderGUID = GUID_SYSTEM_FOLDER;
+ break;
default:
return QString();
break;