diff --git a/doc/Changelog.html b/doc/Changelog.html index 6d5b3c13..7459b6ba 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -20,6 +20,7 @@ a:visited { color: #0000EE; }
  • Added an option to rename the output files (based on an user-defined pattern)
  • Added an option to enforce Stereo Downmix for Multi-Channel sources
  • Added "built-in" WMA decoder (see this thread for details) and removed all remnants of "old" decoder +
  • Added a menu for bookmarking "favorite" output folders to the "output folder" tab
  • Updated Qt runtime libraries to v4.8.0 Beta-1 (2011-07-19), compiled with MSVC 10.0
  • Updated MediaInfo to v0.7.47 (2011-07-27), compiled with MSVC 10.0
  • Updated language files (big thank-you to all contributors !!!) diff --git a/etc/NSIS/setup.nsi b/etc/NSIS/setup.nsi index b3141c4f..15b3e6f2 100644 --- a/etc/NSIS/setup.nsi +++ b/etc/NSIS/setup.nsi @@ -457,6 +457,7 @@ FunctionEnd ;-------------------------------- Section "-PreInit" + SetShellVarContext all SetOutPath "$INSTDIR" SectionEnd @@ -491,10 +492,18 @@ Section "-Create Shortcuts" !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_SHORTCUTS)" CreateDirectory "$SMPROGRAMS\$StartMenuFolder" + SetShellVarContext current + Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk" Delete "$SMPROGRAMS\$StartMenuFolder\*.pif" Delete "$SMPROGRAMS\$StartMenuFolder\*.url" + SetShellVarContext all + + Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\*.pif" + Delete "$SMPROGRAMS\$StartMenuFolder\*.url" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\LameXP.exe" "" "$INSTDIR\LameXP.exe" 0 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html" diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index e89cee56..c245cbc2 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -663,7 +663,7 @@ - + Source Files @@ -684,1417 +684,1422 @@ - + Show Details - + Output Directory - + Goto Home Folder - + Goto Music Folder - + Goto Desktop Folder - + Make New Folder - + Save output files to the same location where the input file is located - + Prepend relative source file path to output file - - + + Meta Data - + Meta Information - + Edit - + Note: Meta information you enter here will <u>supersede</u> data from the source! - + Reset - + Options - + Automatically generate playlist file (.m3u) - + Write meta information to encoded files - - + + Compression - + Encoder / Format - + Lame MP3 - + Ogg Vorbis - + Nero AAC - + Wave (PCM) - + FLAC - + Aften A/52 - + Rate Control Method - + Quality-based (VBR) - + Average Bitrate (ABR) - + Constant Bitrate (CBR) - + Quality / Bitrate - + Minimum - + Maximum - - + + Advanced Options - + Bitrate Management (LAME and OggEnc2) - + Enable Bitrate Management - + Minimum (kbps): - + Maximum (kbps): - + LAME Algorithm Quality - + Faster Processing - + Better quality - + Channel Mode / Sampling Rate - - + + Auto Select (Default) - + Joint Stereo - + Forced Joint Stereo - + Simple - + Dual Mono - + Mono - + MP3 Channel Mode: - + Sampling Rate (Hz): - + 16.000 - + 22.050 - + 24.000 - + 32.000 - + 44.100 - + 48.000 - + Enforce Stereo Downmix of Surround (Multi-Channel) Sources - + Nero AAC Options - + Enable 2-Pass Processing (ABR Mode) - + Select AAC Profile: - + Auto Select (Recommended) - + Enforce LC-AAC - + Enforce HE-AAC (AAC + SBR) - + Enforce HE-AAC v2 (AAC + SBR + PS) - + Volume Normalization - + Enable Normalization Filter - + Peak Volume (dB): - + Tone Adjustment - + Adjust Treble (dB): - + Adjust Bass (dB): - + Custom Encoder Parameters - - - - - + + + + + You can eneter custom parameters here! - + Lame MP3: - + OggEnc2: - + Nero AAC: - + FLAC: - + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! - + Aften A/52: - + Multi-Threading - + Choose the number of parallel instances based on the number of CPU cores (Recommended) - + Fewer Instances - + More Instances - + Temp Directory - + Browse... - + Store temporary files in your system's default TEMP directory (Recommended) - + Aften A/52 Options - + Film Light - + Film Standard - + Music Light - + Music Standard - + Speech - + None (Default) - + Auto Select - + 1+1 (Ch1,Ch2) - + 1/0 (C) - + 2/0 (L,R) - + 3/0 (L,R,C) - + 2/1 (L,R,S) - + 3/1 (L,R,C,S) - + 2/2 (L,R,SL,SR) - + 3/2 (L,R,C,SL,SR) - + Audio Coding Mode: - + Dynamic Range Compression: - + Fast Bit Allocation (Less Accurate) - + Exponent Search Size: - + Rename Output Files - + Entere the pattern to rename the output files here! - + Rename Output Files - + <a href="reset">Reset</a> &nbsp; <a href="#">Show List of Macros</a> - + Rename Pattern: - + Example File Name: - + Reset Advanced Options - + Encode Now! - - + + About... - + Exit Program - + File - + ? - + View - + Style - + Language - + Tools - + Configuration - + Quit - + Open File(s)... - - + + Visit Official Web-Site - - - - + + + + Check for Updates - + Open Folder... - + Clear All - + Plastique - + Cleanlooks - + Windows Vista ("Aero") - + Windows Classic - + Windows XP ("Luna") - - + + Disable Update Reminder - - + + Disable Sound Effects - + Install WMA Decoder - + Disable Nero AAC Notifications - + Show DropBox - + From File... - + Encode! - + Disable Shell Integration - + Frequently Asked Questions - + Changelog - + Translator's Guide - + Help && Support - + Open Folder Recursively... - + Check for Beta Updates - + Import Cue Sheet - + Disable Slow Startup Notifications - + Adding file(s), please wait... - - + + Access Denied - + %1 file(s) have been rejected, because read access was not granted! - + This usually means the file is locked by another process. - + CDDA Files - + %1 file(s) have been rejected, because they are dummy CDDA files! - + Sorry, LameXP cannot extract audio tracks from an Audio&minus;CD at present. - + We recommend using %1 for that purpose. - + Cue Sheet - + %1 file(s) have been rejected, because they appear to be Cue Sheet images! - + Please use LameXP's Cue Sheet wizard for importing Cue Sheet files. - + Files Rejected - + %1 file(s) have been rejected, because the file format could not be recognized! - + This usually means the file is damaged or the file format is not supported. - + Scanning folder(s) for files, please wait... - + DEMO VERSION - + You can drop in audio files here! - + Open File in External Application - + Browse File Location - + Browse Selected Folder - + + Bookmark Current Output Folder + + + + License Declined - + You have declined the license. Consequently the application will exit now! - + Goodbye! - + LameXP - Expired - + This demo (pre-release) version of LameXP has expired at %1. - + LameXP is free software and release versions won't expire. - - + + Exit Program - + It seems that a bogus anti-virus software is slowing down the startup of LameXP. - + Please refer to the %1 document for details and solutions! - + Slow Startup - - - - + + + + Discard - - + + Don't Show Again - + Urgent Update - + Your version of LameXP is more than a year old. Time for an update! - - - + + + Update Reminder - + Your last update check was more than 14 days ago. Check for updates now? - + Your did not check for LameXP updates yet. Check for updates now? - + Postpone - + LameXP detected that your version of the Nero AAC encoder is outdated! - + The current version available is %1 (or later), but you still have version %2 installed. - + n/a - + You can download the latest version of the Nero AAC encoder from the Nero website at: - + AAC Encoder Outdated - + The Nero AAC encoder could not be found. AAC encoding support will be disabled. - + Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory! - + Your LameXP directory is located here: - + You can download the Nero AAC encoder for free from the official Nero website at: - + AAC Support Disabled - - - + + + LameXP - + You must add at least one file to the list before proceeding! - + Not Found - + Your currently selected TEMP folder does not exist anymore: - + Restore Default - + Cancel - + Low Diskspace Warning - + There are less than %1 GB of free diskspace available on your system's TEMP folder. - + It is highly recommend to free up more diskspace before proceeding with the encode! - + Your TEMP folder is located at: - + Abort Encoding Process - + Clean Disk Now - + Ignore - + Low Diskspace - + You are proceeding with low diskspace. Problems might occur! - + Sorry, an unsupported encoder has been chosen! - + Cannot write to the selected output directory. - + Please choose a different directory! - + Load Translation - + Translation Files - + Do you really want to disable the update reminder? - - - - - - + + + + + + Yes - - - - - - + + + + + + No - + The update reminder has been disabled. - + Please remember to check for updates at regular intervals! - + The update reminder has been re-enabled. - + Do you really want to disable all sound effects? - - + + Sound Effects - + All sound effects have been disabled. - + The sound effects have been re-enabled. + + - - Nero AAC Notifications - + Do you really want to disable all Nero AAC Encoder notifications? - + All Nero AAC Encoder notifications have been disabled. - + The Nero AAC Encoder notifications have been re-enabled. + + - - Slow Startup Notifications - + Do you really want to disable the slow startup notifications? - + The slow startup notifications have been disabled. - + The slow startup notifications have been re-enabled. - + Open Cue Sheet - + Cue Sheet File - - - + + + Beta Updates - + Do you really want LameXP to check for Beta (pre-release) updates? - + LameXP will check for Beta (pre-release) updates from now on. - + Check Now - + LameXP will <i>not</i> check for Beta (pre-release) updates from now on. - - - + + + Shell Integration - + Do you really want to disable the LameXP shell integration? - + The LameXP shell integration has been disabled. - + The LameXP shell integration has been re-enabled. - - + + Add file(s) - - + + Add Folder - - + + New Folder - + Enter the name of the new folder: - + Failed to create folder - + The new folder could not be created: - + Drive is read-only or insufficient access rights! - - - - + + + + Quality Level %1 - - - + + + Compression %1 - - - + + + Uncompressed - + Best Quality (Very Slow) - + High Quality (Recommended) - + Average Quality (Default) - + Low Quality (Fast) - + Poor Quality (Very Fast) - + File name without extension - + Track number with leading zero - + Track title - + Artist name - + Album name - + Year with (at least) four digits - + Comment - + Characters forbidden in file names: - + Rename Macros - + %1 Instance(s) - + Cannot write to the selected directory. Please choose another directory! - + Already Running - + LameXP is already running, please use the running instance! diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 97a0b6c4..e461933b 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -1622,6 +1622,10 @@ Enforce Stereo Downmix of Surround (Multi-Channel) Sources Surround (Mehrkanal-Ton) Quellen immer auf Stereo heruntermischen + + Bookmark Current Output Folder + + MetaInfo diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index 927196fe..7869d56e 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -1621,6 +1621,10 @@ Enforce Stereo Downmix of Surround (Multi-Channel) Sources + + Bookmark Current Output Folder + + MetaInfo diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 143324bc..0c831fbe 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -1631,6 +1631,10 @@ Ouvrir le dossier récursivement... Enforce Stereo Downmix of Surround (Multi-Channel) Sources + + Bookmark Current Output Folder + + MetaInfo diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index ffd9b1f1..92960a4c 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -1622,6 +1622,10 @@ Enforce Stereo Downmix of Surround (Multi-Channel) Sources + + Bookmark Current Output Folder + + MetaInfo diff --git a/etc/Translation/LameXP_KR.ts b/etc/Translation/LameXP_KR.ts index b53fef4a..421afd1c 100644 --- a/etc/Translation/LameXP_KR.ts +++ b/etc/Translation/LameXP_KR.ts @@ -1621,6 +1621,10 @@ Enforce Stereo Downmix of Surround (Multi-Channel) Sources + + Bookmark Current Output Folder + + MetaInfo diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts index dfccf969..a9bcab03 100644 --- a/etc/Translation/LameXP_RU.ts +++ b/etc/Translation/LameXP_RU.ts @@ -1627,6 +1627,10 @@ Enforce Stereo Downmix of Surround (Multi-Channel) Sources + + Bookmark Current Output Folder + + MetaInfo diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index 68bc6906..62168d13 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -1622,6 +1622,10 @@ Enforce Stereo Downmix of Surround (Multi-Channel) Sources + + Bookmark Current Output Folder + + MetaInfo diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index bdea3023..599b3ada 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -277,57 +277,89 @@ - - - - - - - - 200 - 0 - 0 - - - - - - - - - 200 - 0 - 0 - - - - - - - - - 200 - 0 - 0 - - - - - + + + 3 - - PointingHandCursor - - - QFrame::StyledPanel - - - QFrame::Plain - - - ($OUTDIR) - - + + + + + 0 + 0 + + + + + + + + + 200 + 0 + 0 + + + + + + + + + 200 + 0 + 0 + + + + + + + + + 200 + 0 + 0 + + + + + + + + PointingHandCursor + + + QFrame::StyledPanel + + + QFrame::Plain + + + ($OUTDIR) + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + + + + :/icons/star.png + + + + @@ -1067,8 +1099,8 @@ 0 0 - 604 - 1426 + 602 + 1423 diff --git a/src/Config.h b/src/Config.h index 0e7b3907..c44cf1e1 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 3 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 9 -#define VER_LAMEXP_BUILD 630 +#define VER_LAMEXP_BUILD 634 /////////////////////////////////////////////////////////////////////////////// // Tools versions diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 956c1859..4f56120e 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -147,6 +147,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S outputFolderView->setMouseTracking(false); outputFolderView->setContextMenuPolicy(Qt::CustomContextMenu); outputFolderView->installEventFilter(this); + outputFoldersFovoritesLabel->installEventFilter(this); while(saveToSourceFolderCheckBox->isChecked() != m_settings->outputToSourceDir()) saveToSourceFolderCheckBox->click(); prependRelativePathCheckBox->setChecked(m_settings->prependRelativeSourcePath()); connect(outputFolderView, SIGNAL(clicked(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex))); @@ -161,11 +162,16 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(prependRelativePathCheckBox, SIGNAL(clicked()), this, SLOT(prependRelativePathChanged())); m_outputFolderContextMenu = new QMenu(); m_showFolderContextAction = m_outputFolderContextMenu->addAction(QIcon(":/icons/zoom.png"), "N/A"); + m_outputFolderFavoritesMenu = new QMenu(); + m_addFavoriteFolderAction = m_outputFolderFavoritesMenu->addAction(QIcon(":/icons/add.png"), "N/A"); + m_outputFolderFavoritesMenu->insertSeparator(m_addFavoriteFolderAction); connect(outputFolderView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(outputFolderContextMenu(QPoint))); connect(m_showFolderContextAction, SIGNAL(triggered(bool)), this, SLOT(showFolderContextActionTriggered())); + connect(m_addFavoriteFolderAction, SIGNAL(triggered(bool)), this, SLOT(addFavoriteFolderActionTriggered())); outputFolderLabel->installEventFilter(this); outputFolderView->setCurrentIndex(m_fileSystemModel->index(m_settings->outputDir())); outputFolderViewClicked(outputFolderView->currentIndex()); + refreshFavorites(); //Setup "Meta Data" tab m_metaInfoModel = new MetaInfoModel(m_metaData, 6); @@ -448,6 +454,7 @@ MainWindow::~MainWindow(void) LAMEXP_DELETE(m_encoderButtonGroup); LAMEXP_DELETE(m_encoderButtonGroup); LAMEXP_DELETE(m_sourceFilesContextMenu); + LAMEXP_DELETE(m_outputFolderFavoritesMenu); LAMEXP_DELETE(m_dropBox); } @@ -553,85 +560,6 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed) } } -/* - * Download and install WMA Decoder component - */ -//bool MainWindow::installWMADecoder(void) -//{ -// static const char *download_url = "http://www.nch.com.au/components/wmawav.exe"; -// static const char *download_hash = "52a3b0e6690faf3f830c336d3c0eadfb7a4e9bc6"; -// -// bool bResult = false; -// -// QString binaryWGet = lamexp_lookup_tool("wget.exe"); -// QString binaryElevator = lamexp_lookup_tool("elevator.exe"); -// -// if(binaryWGet.isEmpty() || binaryElevator.isEmpty()) -// { -// throw "Required binary is not available!"; -// } -// -// while(true) -// { -// QString setupFile = QString("%1/%2.exe").arg(lamexp_temp_folder2(), lamexp_rand_str()); -// -// QProcess process; -// process.setWorkingDirectory(QFileInfo(setupFile).absolutePath()); -// -// QEventLoop loop; -// connect(&process, SIGNAL(error(QProcess::ProcessError)), &loop, SLOT(quit())); -// connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), &loop, SLOT(quit())); -// -// process.start(binaryWGet, QStringList() << "-O" << QFileInfo(setupFile).fileName() << download_url); -// m_banner->show(tr("Downloading WMA Decoder Setup, please wait..."), &loop); -// -// if(process.exitCode() != 0 || QFileInfo(setupFile).size() < 10240) -// { -// QFile::remove(setupFile); -// if(QMessageBox::critical(this, tr("Download Failed"), tr("Failed to download the WMA Decoder setup. Check your internet connection!"), tr("Try Again"), tr("Cancel")) == 0) -// { -// continue; -// } -// break; -// } -// -// QFile setupFileContent(setupFile); -// QCryptographicHash setupFileHash(QCryptographicHash::Sha1); -// -// setupFileContent.open(QIODevice::ReadOnly); -// if(setupFileContent.isOpen() && setupFileContent.isReadable()) -// { -// setupFileHash.addData(setupFileContent.readAll()); -// setupFileContent.close(); -// } -// -// if(_stricmp(setupFileHash.result().toHex().constData(), download_hash)) -// { -// qWarning("Hash miscompare:\n Expected %s\n Detected %s\n", download_hash, setupFileHash.result().toHex().constData()); -// QFile::remove(setupFile); -// if(QMessageBox::critical(this, tr("Download Failed"), tr("The download seems to be corrupted. Please try again!"), tr("Try Again"), tr("Cancel")) == 0) -// { -// continue; -// } -// break; -// } -// -// QApplication::setOverrideCursor(Qt::WaitCursor); -// process.start(binaryElevator, QStringList() << QString("/exec=%1").arg(setupFile)); -// loop.exec(QEventLoop::ExcludeUserInputEvents); -// QFile::remove(setupFile); -// QApplication::restoreOverrideCursor(); -// -// if(QMessageBox::information(this, tr("WMA Decoder"), tr("The WMA File Decoder has been installed. Please restart LameXP now!"), tr("Quit LameXP"), tr("Postpone")) == 0) -// { -// bResult = true; -// } -// break; -// } -// -// return bResult; -//} - /* * Check for updates */ @@ -652,6 +580,36 @@ bool MainWindow::checkForUpdates(void) return bReadyToInstall; } +void MainWindow::refreshFavorites(void) +{ + QList folderList = m_outputFolderFavoritesMenu->actions(); + QStringList favorites = m_settings->favoriteOutputFolders().split("|", QString::SkipEmptyParts); + while(favorites.count() > 6) favorites.removeFirst(); + + while(!folderList.isEmpty()) + { + QAction *currentItem = folderList.takeFirst(); + if(currentItem->isSeparator()) break; + m_outputFolderFavoritesMenu->removeAction(currentItem); + LAMEXP_DELETE(currentItem); + } + + QAction *lastItem = m_outputFolderFavoritesMenu->actions().first(); + + while(!favorites.isEmpty()) + { + QString path = favorites.takeLast(); + if(QDir(path).exists()) + { + QAction *action = new QAction(QIcon(":/icons/folder_go.png"), QDir::toNativeSeparators(path), this); + action->setData(path); + m_outputFolderFavoritesMenu->insertAction(lastItem, action); + connect(action, SIGNAL(triggered(bool)), this, SLOT(gotoFavoriteFolder())); + lastItem = action; + } + } +} + //////////////////////////////////////////////////////////// // EVENTS //////////////////////////////////////////////////////////// @@ -726,6 +684,7 @@ void MainWindow::changeEvent(QEvent *e) m_previewContextAction->setText(tr("Open File in External Application")); m_findFileContextAction->setText(tr("Browse File Location")); m_showFolderContextAction->setText(tr("Browse Selected Folder")); + m_addFavoriteFolderAction->setText(tr("Bookmark Current Output Folder")); //Force GUI update m_metaInfoModel->clearData(); @@ -871,6 +830,35 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) break; } } + else if(obj == outputFoldersFovoritesLabel) + { + QMouseEvent *mouseEvent = dynamic_cast(event); + QPoint pos = (mouseEvent != NULL) ? mouseEvent->pos() : QPoint(); + QWidget *sender = dynamic_cast(obj); + + switch(event->type()) + { + case QEvent::Enter: + outputFoldersFovoritesLabel->setFrameShadow(QFrame::Raised); + break; + case QEvent::MouseButtonPress: + outputFoldersFovoritesLabel->setFrameShadow(QFrame::Sunken); + break; + case QEvent::MouseButtonRelease: + outputFoldersFovoritesLabel->setFrameShadow(QFrame::Raised); + if(sender && mouseEvent) + { + if(pos.x() <= sender->width() && pos.y() <= sender->height() && pos.x() >= 0 && pos.y() >= 0 && mouseEvent->button() != Qt::MidButton) + { + m_outputFolderFavoritesMenu->popup(sender->mapToGlobal(pos)); + } + } + break; + case QEvent::Leave: + outputFoldersFovoritesLabel->setFrameShadow(QFrame::Plain); + break; + } + } return false; } @@ -2100,6 +2088,31 @@ void MainWindow::gotoMusicFolderButtonClicked(void) } } +/* + * Goto music favorite output folder + */ +void MainWindow::gotoFavoriteFolder(void) +{ + QAction *item = dynamic_cast(QObject::sender()); + + if(item) + { + QDir path(item->data().toString()); + if(path.exists()) + { + outputFolderView->setCurrentIndex(m_fileSystemModel->index(path.canonicalPath())); + outputFolderViewClicked(outputFolderView->currentIndex()); + outputFolderView->setFocus(); + } + else + { + MessageBeep(MB_ICONERROR); + m_outputFolderFavoritesMenu->removeAction(item); + item->deleteLater(); + } + } +} + /* * Make folder button */ @@ -2146,6 +2159,8 @@ void MainWindow::makeFolderButtonClicked(void) } } + suggestedName = lamexp_clean_filename(suggestedName); + while(true) { bool bApplied = false; @@ -2153,15 +2168,7 @@ void MainWindow::makeFolderButtonClicked(void) if(bApplied) { - folderName.remove(":", Qt::CaseInsensitive); - folderName.remove("/", Qt::CaseInsensitive); - folderName.remove("\\", Qt::CaseInsensitive); - folderName.remove("?", Qt::CaseInsensitive); - folderName.remove("*", Qt::CaseInsensitive); - folderName.remove("<", Qt::CaseInsensitive); - folderName.remove(">", Qt::CaseInsensitive); - - folderName = folderName.simplified(); + folderName = lamexp_clean_filepath(folderName.simplified()); if(folderName.isEmpty()) { @@ -2177,7 +2184,7 @@ void MainWindow::makeFolderButtonClicked(void) newFolder = QString(folderName).append(QString().sprintf(" (%d)", ++i)); } - if(basePath.mkdir(newFolder)) + if(basePath.mkpath(newFolder)) { QDir createdDir = basePath; if(createdDir.cd(newFolder)) @@ -2234,6 +2241,28 @@ void MainWindow::showFolderContextActionTriggered(void) QDesktopServices::openUrl(QUrl::fromLocalFile(m_fileSystemModel->filePath(outputFolderView->currentIndex()))); } +/* + * Add current folder to favorites + */ +void MainWindow::addFavoriteFolderActionTriggered(void) +{ + QString path = m_fileSystemModel->filePath(outputFolderView->currentIndex()); + QStringList favorites = m_settings->favoriteOutputFolders().split("|", QString::SkipEmptyParts); + + if(!favorites.contains(path, Qt::CaseInsensitive)) + { + favorites.append(path); + while(favorites.count() > 6) favorites.removeFirst(); + } + else + { + MessageBeep(MB_ICONWARNING); + } + + m_settings->favoriteOutputFolders(favorites.join("|")); + refreshFavorites(); +} + /* * Initialize file system model */ diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 0375142c..7c00a664 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -51,6 +51,7 @@ private slots: void addFileDelayed(const QString &filePath, bool tryASAP = false); void addFilesButtonClicked(void); void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false); + void addFavoriteFolderActionTriggered(void); void addFolderDelayed(const QString &folderPath, bool recursive); void aftenCodingModeChanged(int value); void aftenDRCModeChanged(int value); @@ -82,6 +83,7 @@ private slots: void findFileContextActionTriggered(void); void forceStereoDownmixEnabledChanged(bool checked); void gotoDesktopButtonClicked(void); + void gotoFavoriteFolder(void); void gotoHomeFolderButtonClicked(void); void gotoMusicFolderButtonClicked(void); void handleDelayedFiles(void); @@ -145,7 +147,7 @@ private: void addFiles(const QStringList &files); void addFolder(const QString &path, bool recursive = false, bool delayed = false); bool checkForUpdates(void); - bool installWMADecoder(void); + void refreshFavorites(void); bool m_accepted; bool m_firstTimeShown; @@ -166,11 +168,13 @@ private: QMenu *m_outputFolderContextMenu; SettingsModel *m_settings; QMenu *m_sourceFilesContextMenu; + QMenu *m_outputFolderFavoritesMenu; QAction *m_findFileContextAction; QAction *m_previewContextAction; QAction *m_showDetailsContextAction; QAction *m_showFolderContextAction; + QAction *m_addFavoriteFolderAction; QActionGroup *m_languageActionGroup; QActionGroup *m_styleActionGroup; QActionGroup *m_tabActionGroup; diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index b27c574a..b5da28c1 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -75,6 +75,7 @@ LAMEXP_MAKE_ID(compressionBitrate, "Compression/Bitrate"); LAMEXP_MAKE_ID(outputDir, "OutputDirectory/SelectedPath"); LAMEXP_MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder"); LAMEXP_MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath"); +LAMEXP_MAKE_ID(favoriteOutputFolders, "OutputDirectory/Favorites"); LAMEXP_MAKE_ID(writeMetaTags, "Flags/WriteMetaTags"); LAMEXP_MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist"); LAMEXP_MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck"); @@ -267,6 +268,7 @@ LAMEXP_MAKE_OPTION_I(compressionBitrate, 7) LAMEXP_MAKE_OPTION_S(outputDir, QString()) LAMEXP_MAKE_OPTION_B(outputToSourceDir, false) LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath, false) +LAMEXP_MAKE_OPTION_S(favoriteOutputFolders, QString()); LAMEXP_MAKE_OPTION_B(writeMetaTags, true) LAMEXP_MAKE_OPTION_B(createPlaylist, true) LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck, "Never") diff --git a/src/Model_Settings.h b/src/Model_Settings.h index 8ac9733d..f3cbf966 100644 --- a/src/Model_Settings.h +++ b/src/Model_Settings.h @@ -85,6 +85,7 @@ public: LAMEXP_MAKE_OPTION_S(outputDir); LAMEXP_MAKE_OPTION_B(outputToSourceDir); LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath); + LAMEXP_MAKE_OPTION_S(favoriteOutputFolders); LAMEXP_MAKE_OPTION_B(writeMetaTags); LAMEXP_MAKE_OPTION_B(createPlaylist); LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck);