From 1c21516604fecb026b8254b522ef741926979bc9 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Thu, 2 May 2013 23:02:02 +0200 Subject: [PATCH] Got rid of a superfluous Beep() that was triggered on application startup. --- etc/Translation/Blank.ts | 94 ++++++++++++++++++------------------ etc/Translation/LameXP_EN.ts | 2 +- etc/Translation/LameXP_PL.ts | 94 ++++++++++++++++++------------------ etc/Translation/LameXP_SV.ts | 94 ++++++++++++++++++------------------ src/Dialog_MainWindow.cpp | 18 ++++--- src/Dialog_MainWindow.h | 2 +- 6 files changed, 153 insertions(+), 151 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 8d815bc6..86db3efd 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -1754,7 +1754,7 @@ - + Access Denied @@ -1942,7 +1942,7 @@ - + Discard @@ -2527,89 +2527,89 @@ - + 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 - + %n Instance(s) - + Cannot write to the selected directory. Please choose another directory! - + Overwrite Mode - + Warning: This mode may overwrite existing files with no way to revert! - + Continue - + Revert - + Already Running - + LameXP is already running, please use the running instance! @@ -3315,23 +3315,23 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. - + Executable '%1' requires Qt v%2, but found Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. - - + + Executable '%1' requires Windows 2000 or later. @@ -3400,105 +3400,105 @@ - - + + Build - + Unknown - + Testing your internet connection, please wait... - - + + It appears that the computer currently is offline! - - + + Please make sure your computer is connected to the internet and try again. - + Network connectivity test has failed! - + Please make sure your internet connection is working properly and try again. - + Checking for new updates online, please wait... - + Failed to fetch update information from server! - + Sorry, the update server might be busy at this time. Plase try again later. - + More information available at: - + A new version of LameXP is available! - + We highly recommend all users to install this update as soon as possible. - + No new updates available at this time. - + Your version of LameXP is still up-to-date. Please check for updates regularly! - + Your version appears to be newer than the latest release. - + This usually indicates your are currently using a pre-release version of LameXP. - + Update is being downloaded, please be patient... - + Update ready to install. Applicaion will quit... - + Update failed. Please try again or download manually! diff --git a/etc/Translation/LameXP_EN.ts b/etc/Translation/LameXP_EN.ts index a1e0a0e5..2cb0d40c 100644 --- a/etc/Translation/LameXP_EN.ts +++ b/etc/Translation/LameXP_EN.ts @@ -63,7 +63,7 @@ - + %n Instance(s) %n Instance diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index 2be5ec0d..7cd66b6a 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -1761,7 +1761,7 @@ - + Access Denied Dostęp zablokowany @@ -1891,7 +1891,7 @@ - + Discard Zamknij @@ -2542,52 +2542,52 @@ 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 - + %n Instance(s) %n wątek @@ -2596,37 +2596,37 @@ - + Cannot write to the selected directory. Please choose another directory! Nie można zapisać do wybranej lokalizacji. Prosze wybierz inną lokalizację! - + Overwrite Mode Tryb nadpisywania - + Warning: This mode may overwrite existing files with no way to revert! Ostrzeżenie: W tym trybie istniejące pliki będą nadpisywane bez możliwości ich odzyskania! - + Continue Kontynuuj - + Revert Cofnij - + Already Running Już działa - + LameXP is already running, please use the running instance! LameXP już działa, przejdź do działającego procesu! @@ -3352,23 +3352,23 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. Plik wykonywalny '%1' nie działa w trybie kompatybilności z Windows. - + Executable '%1' requires Qt v%2, but found Qt v%3. Plik wykonywalny '%1' wymaga Qt v%2, znaleziono jednak Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. Plik wykonywalny "%1" został skompilowany dla Qt "%2", znaleziono "%3". - - + + Executable '%1' requires Windows 2000 or later. Plik wykonywalny '%1' wymaga do uruchomienia Windows 2000 lub nowszego. @@ -3437,105 +3437,105 @@ Zamknij - - + + Build Build - + Unknown Nieznana - + Testing your internet connection, please wait... Testowanie połączenia internetowego, prosze czekać... - - + + It appears that the computer currently is offline! LameXP wykrył brak dostępu do internetu! - - + + Please make sure your computer is connected to the internet and try again. Upewnij się że komputer jest podłączony do internetu i spróbuj ponownie. - + Network connectivity test has failed! Test połączenia internetowego zakończony niepowodzeniem! - + Please make sure your internet connection is working properly and try again. Upewnij się że połączenie internetowe działa prawidłowo i spróbuj ponownie. - + Checking for new updates online, please wait... Sprawdzanie aktualizacji online, prosze czekać... - + Failed to fetch update information from server! Pobieranie informacji z serwera zakończone niepowodzeniem! - + Sorry, the update server might be busy at this time. Plase try again later. Serwer aktualizacji wydaje się nie odpowiadać w tej chwili. Prosze spróbować później. - + More information available at: Więcej informacji tutaj: - + A new version of LameXP is available! Dostępna nowa wersja LameXP! - + We highly recommend all users to install this update as soon as possible. Jest wysoce zalecane aby zainstalować tę aktualizację jak najszybciej. - + No new updates available at this time. Nie ma nowych aktualizacji w tej chwili. - + Your version of LameXP is still up-to-date. Please check for updates regularly! Posiadasz najnowszą wersję LameXP. Sprawdzaj aktualizacje regularnie! - + Your version appears to be newer than the latest release. Posiadasz nowszą wersję LameXP niż ostatnie wydanie. - + This usually indicates your are currently using a pre-release version of LameXP. To wskazuje na to, że posiadasz wersję alfa LameXP. - + Update is being downloaded, please be patient... Pobieranie aktualizacji w toku, prosze czekać... - + Update ready to install. Applicaion will quit... Aktualizacja gotowa do instalacji. Teraz program zostanie zamknięty... - + Update failed. Please try again or download manually! Aktualizacja zakończona niepowodzeniem. Prosze spróbować ponownie lub zainstalować ręcznie! diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index 80276b81..4cb10dee 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -1758,7 +1758,7 @@ - + Access Denied Åtkomst nekad @@ -1950,7 +1950,7 @@ - + Discard Stäng @@ -2535,52 +2535,52 @@ Dålig kvallitet (mycket snabb) - + File name without extension Filnamn utan filtillägg - + Track number with leading zero Spårnummer med inledande nolla - + Track title Spårtitel - + Artist name Artistnamn - + Album name Albumnamn - + Year with (at least) four digits Årtal med (minst) fyra siffror - + Comment Kommentar - + Characters forbidden in file names: Förbjudna tecken i filnamn: - + Rename Macros Namnändra macron - + %n Instance(s) %n instans @@ -2588,37 +2588,37 @@ - + Cannot write to the selected directory. Please choose another directory! Kan inte skriva till den specificerade mappen. Välj en annan destination! - + Overwrite Mode Överskrivningsläge - + Warning: This mode may overwrite existing files with no way to revert! Varning! Det här läget kan skriva över befintliga filer, utan möjlighet att återskapa! - + Continue Fortsätt - + Revert Återställ - + Already Running Körs redan - + LameXP is already running, please use the running instance! LameXP körs redan, använd den redan startade instansen! @@ -3335,23 +3335,23 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. EXE-filen '%1' stöder inte Windows kompatibilitetsläge. - + Executable '%1' requires Qt v%2, but found Qt v%3. EXE-filen '%1' kräver Qt v%2, du har Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. EXE-filen '%1' är byggd för Qt '%2', du har Qt '%3'. - - + + Executable '%1' requires Windows 2000 or later. EXE-filen '%1' kräver Windows 2000 eller senare. @@ -3420,105 +3420,105 @@ Stäng - - + + Build Build - + Unknown Okänd - + Testing your internet connection, please wait... Kontrollerar iInternetanslutningen, vänta... - - + + It appears that the computer currently is offline! Datorn verkar inte vara ansluten till Internet! - - + + Please make sure your computer is connected to the internet and try again. Tillse att datorn är ansluten till Internet och försök igen. - + Network connectivity test has failed! Anslutningskontrollen misslyckades! - + Please make sure your internet connection is working properly and try again. Tillse att Internetuppkopplingen fungerar korrekt och försök igen. - + Checking for new updates online, please wait... Söker nya uppdateringar, vänta... - + Failed to fetch update information from server! Kunde inte hämta uppdateringsinformation från servern! - + Sorry, the update server might be busy at this time. Plase try again later. Uppdateringsservern kan vara upptagen. Försök senare. - + More information available at: Mer information hittas på: - + A new version of LameXP is available! En ny version av LameXP finns tillgänglig! - + We highly recommend all users to install this update as soon as possible. Vi rekommenderar alla användare att installera denna uppdatering så snart som möjligt. - + No new updates available at this time. Det finns inga nya uppdateringar. - + Your version of LameXP is still up-to-date. Please check for updates regularly! Din version av LameXP är uppdaterad. Kontrollera regelbundet! - + Your version appears to be newer than the latest release. Din version verkar vara nyare än senaste 'Release'. - + This usually indicates your are currently using a pre-release version of LameXP. Det innebär normalt att du använder en beta-version av LameXP. - + Update is being downloaded, please be patient... Uppdatering laddas ner, vänta... - + Update ready to install. Applicaion will quit... Uppdatering klar att installeras. Programmet kommer att avslutas... - + Update failed. Please try again or download manually! Uppdateringen misslyckades. Försök igen, eller ladda ner manuellt! diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 6ee1395f..bf9fe45a 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -1001,7 +1001,7 @@ void MainWindow::changeEvent(QEvent *e) updateEncoder(m_settings->compressionEncoder()); updateLameAlgoQuality(ui->sliderLameAlgoQuality->value()); updateMaximumInstances(ui->sliderMaxInstances->value()); - renameOutputPatternChanged(ui->lineEditRenamePattern->text()); + renameOutputPatternChanged(ui->lineEditRenamePattern->text(), true); //Re-install shell integration if(m_settings->shellIntegrationEnabled()) @@ -3812,7 +3812,7 @@ void MainWindow::renameOutputPatternChanged(void) /* * Rename output files patterm changed */ -void MainWindow::renameOutputPatternChanged(const QString &text) +void MainWindow::renameOutputPatternChanged(const QString &text, bool silent) { QString pattern(text.simplified()); @@ -3824,24 +3824,26 @@ void MainWindow::renameOutputPatternChanged(const QString &text) pattern.replace("", "2001", Qt::CaseInsensitive); pattern.replace("", "Encoded by LameXP", Qt::CaseInsensitive); - if(pattern.compare(lamexp_clean_filename(pattern))) + const QString patternClean = lamexp_clean_filename(pattern); + + if(pattern.compare(patternClean)) { if(ui->lineEditRenamePattern->palette().color(QPalette::Text) != Qt::red) { - MessageBeep(MB_ICONERROR); + if(!silent) MessageBeep(MB_ICONERROR); SET_TEXT_COLOR(ui->lineEditRenamePattern, Qt::red); } } else { - if(ui->lineEditRenamePattern->palette().color(QPalette::Text) != Qt::black) + if(ui->lineEditRenamePattern->palette() != QPalette()) { - MessageBeep(MB_ICONINFORMATION); - SET_TEXT_COLOR(ui->lineEditRenamePattern, Qt::black); + if(!silent) MessageBeep(MB_ICONINFORMATION); + ui->lineEditRenamePattern->setPalette(QPalette()); } } - ui->labelRanameExample->setText(lamexp_clean_filename(pattern)); + ui->labelRanameExample->setText(patternClean); } /* diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 9e572640..fa1a386a 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -137,7 +137,7 @@ private slots: void removeFileButtonClicked(void); void renameOutputEnabledChanged(bool checked); void renameOutputPatternChanged(void); - void renameOutputPatternChanged(const QString &text); + void renameOutputPatternChanged(const QString &text, bool silent = false); void resetAdvancedOptionsButtonClicked(void); void restoreCursor(void); void samplingRateChanged(int value);