From a7b42c0e1ea2b79044ca34340b92d95796b2573c Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 27 May 2011 11:29:40 +0200 Subject: [PATCH] Do not add the files directly in the Drag&Drop event routine. Instead only remember files and add them asynchronously. This way Windows Explorer won't freeze while we are adding the files. --- etc/Translation/Blank.ts | 152 ++++++++++++++++++------------------- etc/Translation/update.lst | 2 + src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 8 +- 4 files changed, 86 insertions(+), 78 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 40431744..eab0e326 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -1381,14 +1381,6 @@ Please choose a different directory! - - Add file(s) - - - - Add Folder - - Load Translation @@ -1397,74 +1389,6 @@ Translation Files - - 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! - - - - Already Running - - - - LameXP is already running, please use the running instance! - - - - Quality Level %1 - - - - Compression %1 - - - - Uncompressed - - - - Best Quality (Very Slow) - - - - High Quality (Recommended) - - - - Average Quality (Default) - - - - Low Quality (Fast) - - - - Poor Quality (Very Fast) - - - - %1 Instance(s) - - - - Cannot write to the selected directory. Please choose another directory! - - Do you really want to disable the update reminder? @@ -1581,6 +1505,82 @@ 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) + + + + %1 Instance(s) + + + + Cannot write to the selected directory. Please choose another directory! + + + + Already Running + + + + LameXP is already running, please use the running instance! + + MetaInfo diff --git a/etc/Translation/update.lst b/etc/Translation/update.lst index 75523405..314672a2 100644 --- a/etc/Translation/update.lst +++ b/etc/Translation/update.lst @@ -12,6 +12,7 @@ ..\..\src\Decoder_AC3.cpp ..\..\src\Decoder_ADPCM.cpp ..\..\src\Decoder_ALAC.cpp +..\..\src\Decoder_Avisynth.cpp ..\..\src\Decoder_FLAC.cpp ..\..\src\Decoder_MAC.cpp ..\..\src\Decoder_MP3.cpp @@ -75,6 +76,7 @@ ..\..\src\Decoder_AC3.h ..\..\src\Decoder_ADPCM.h ..\..\src\Decoder_ALAC.h +..\..\src\Decoder_Avisynth.h ..\..\src\Decoder_FLAC.h ..\..\src\Decoder_MAC.h ..\..\src\Decoder_MP3.h diff --git a/src/Config.h b/src/Config.h index 2f07dd1b..8eee8b6f 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 4 -#define VER_LAMEXP_BUILD 550 +#define VER_LAMEXP_BUILD 552 /////////////////////////////////////////////////////////////////////////////// // Tools versions diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 4b8a3425..9979cbe1 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -377,6 +377,8 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S m_messageHandler = new MessageHandlerThread(); m_delayedFileList = new QStringList(); m_delayedFileTimer = new QTimer(); + m_delayedFileTimer->setSingleShot(true); + m_delayedFileTimer->setInterval(5000); connect(m_messageHandler, SIGNAL(otherInstanceDetected()), this, SLOT(notifyOtherInstance()), Qt::QueuedConnection); connect(m_messageHandler, SIGNAL(fileReceived(QString)), this, SLOT(addFileDelayed(QString)), Qt::QueuedConnection); connect(m_messageHandler, SIGNAL(killSignalReceived()), this, SLOT(close()), Qt::QueuedConnection); @@ -768,7 +770,11 @@ void MainWindow::dropEvent(QDropEvent *event) } } - addFiles(droppedFiles); + if(!droppedFiles.isEmpty()) + { + m_delayedFileList->append(droppedFiles); + QTimer::singleShot(0, this, SLOT(handleDelayedFiles())); + } } /*