From 78c73d6d6e9348a97058bf8f76de8077d6978a7e Mon Sep 17 00:00:00 2001 From: lordmulder Date: Thu, 29 Mar 2012 03:22:24 +0200 Subject: [PATCH] Some improvement of the previous commit. --- etc/Translation/Blank.ts | 70 ++++++++++++++++++++++---------------------- etc/Translation/LameXP_PL.ts | 70 ++++++++++++++++++++++---------------------- src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 27 +++++++++++++++-- src/Dialog_MainWindow.h | 2 ++ 5 files changed, 97 insertions(+), 74 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 565710e5..a1bc2bac 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -1577,7 +1577,7 @@ - + Access Denied @@ -1742,7 +1742,7 @@ - + Discard @@ -2258,139 +2258,139 @@ - + QAAC (Apple) - + FHG AAC (Winamp) - + Nero AAC - + Not available! - + Current AAC Encoder: %1 - - - - + + + + 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_PL.ts b/etc/Translation/LameXP_PL.ts index a7aaafe3..6af62169 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -1577,7 +1577,7 @@ - + Access Denied Dostęp zablokowany @@ -1727,7 +1727,7 @@ - + Discard Zamknij @@ -2258,139 +2258,139 @@ Dysk tylko do odczytu lub brak praw dostępu! - + QAAC (Apple) - + FHG AAC (Winamp) - + Nero AAC - + Not available! - + Current AAC Encoder: %1 - - - - + + + + Quality Level %1 Poziom jakości %1 - - - + + + Compression %1 Kompresja %1 - - - + + + Uncompressed Nieskompresowany - + Best Quality (Very Slow) Najlepsza jakość (Bardzo wolno) - + High Quality (Recommended) Wysoka jakość (Zalecane) - + Average Quality (Default) Średnia jakość (Domyślnie) - + Low Quality (Fast) Niska jakość (Szybko) - + Poor Quality (Very Fast) Najniższa jakość (Bardzo szybko) - + File name without extension Nazwa pliku bez rozszerzenia - + Track number with leading zero Numer ścieżki z zerem na początku - + Track title Nazwa ścieżki - + Artist name Nazwa Artysty - + Album name Nazwa Albumu - + Year with (at least) four digits Rok z (przynajmniej) czterema cyframi - + Comment Komentarz - + Characters forbidden in file names: Zabronione znaki w nazwach plików: - + Rename Macros Zmień nazwy makr - + %1 Instance(s) %1 wątek/ki - + Cannot write to the selected directory. Please choose another directory! Nie można zapisać do wybranej lokalizacji. Prosze wybierz inną lokalizację! - + Already Running Już działa - + LameXP is already running, please use the running instance! LameXP już działa, przejdź do działającego programu! diff --git a/src/Config.h b/src/Config.h index 7ee3c0fa..ae68dd8d 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 9 -#define VER_LAMEXP_BUILD 929 +#define VER_LAMEXP_BUILD 930 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 49e5a286..610b187d 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -147,7 +147,6 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(m_findFileContextAction, SIGNAL(triggered(bool)), this, SLOT(findFileContextActionTriggered())); connect(m_exportCsvContextAction, SIGNAL(triggered(bool)), this, SLOT(exportCsvContextActionTriggered())); connect(m_importCsvContextAction, SIGNAL(triggered(bool)), this, SLOT(importCsvContextActionTriggered())); - //Setup "Output" tab m_fileSystemModel = new QFileSystemModelEx(); @@ -179,6 +178,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(prependRelativePathCheckBox, SIGNAL(clicked()), this, SLOT(prependRelativePathChanged())); connect(outputFolderEdit, SIGNAL(editingFinished()), this, SLOT(outputFolderEditFinished())); connect(m_fileSystemModel, SIGNAL(directoryLoaded(QString)), this, SLOT(outputFolderDirectoryLoaded(QString))); + connect(m_fileSystemModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(outputFolderRowsInserted(QModelIndex,int,int))); m_outputFolderContextMenu = new QMenu(); m_showFolderContextAction = m_outputFolderContextMenu->addAction(QIcon(":/icons/zoom.png"), "N/A"); m_outputFolderFavoritesMenu = new QMenu(); @@ -2673,9 +2673,20 @@ void MainWindow::centerOutputFolderModel(void) { if(outputFolderView->isVisible()) { + centerOutputFolderModelAsync(); + QTimer::singleShot(125, this, SLOT(centerOutputFolderModelAsync())); + } +} + +/* + * Center current folder in view (do NOT call this one directly!) + */ +void MainWindow::centerOutputFolderModelAsync(void) +{ + if(outputFolderView->isVisible()) + { m_outputFolderViewCentering = true; const QModelIndex index = outputFolderView->currentIndex(); - QApplication::processEvents(); outputFolderView->scrollTo(index, QAbstractItemView::PositionAtCenter); outputFolderView->setFocus(); } @@ -2686,7 +2697,17 @@ void MainWindow::centerOutputFolderModel(void) */ void MainWindow::outputFolderDirectoryLoaded(const QString &path) { - //We need to center again, because the focus on the current item gets lost when a dir is loaded asynchronously! + if(m_outputFolderViewCentering) + { + QTimer::singleShot(125, this, SLOT(centerOutputFolderModel())); + } +} + +/* + * File system model inserted new items + */ +void MainWindow::outputFolderRowsInserted(const QModelIndex &parent, int start, int end) +{ if(m_outputFolderViewCentering) { QTimer::singleShot(125, this, SLOT(centerOutputFolderModel())); diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index e615ae57..9e1e61ae 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -63,6 +63,7 @@ private slots: void bitrateManagementMinChanged(int value); void browseCustomTempFolderButtonClicked(void); void centerOutputFolderModel(void); + void centerOutputFolderModelAsync(void); void channelModeChanged(int value); void checkForBetaUpdatesActionTriggered(bool checked); void checkUpdatesActionActivated(void); @@ -108,6 +109,7 @@ private slots: void outputFolderDirectoryLoaded(const QString &path); void outputFolderEditFinished(void); void outputFolderItemExpanded(const QModelIndex &item); + void outputFolderRowsInserted(const QModelIndex &parent, int start, int end); void outputFolderViewClicked(const QModelIndex &index); void outputFolderViewMoved(const QModelIndex &index); void playlistEnabledChanged(void); -- 2.11.0