diff --git a/LameXP.rc b/LameXP.rc index f72d9e6f..ae1581ee 100644 --- a/LameXP.rc +++ b/LameXP.rc @@ -12,6 +12,59 @@ ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD + PRODUCTVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x3L +#else + FILEFLAGS 0x2L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "Comments", "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY" + VALUE "CompanyName", "Free Software Foundation" + VALUE "FileDescription", "LameXP - Audio Encoder Front-End" + VALUE "FileVersion", VER_LAMEXP_STR + VALUE "InternalName", "LameXP Qt" + VALUE "LegalCopyright", "Copyright (C) 2004-2010 LoRd_MuldeR " + VALUE "LegalTrademarks", "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License " + VALUE "OriginalFilename", "LameXP.exe" + VALUE "ProductName", "LameXP - Audio Encoder Front-End" + VALUE "ProductVersion", VER_LAMEXP_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + ///////////////////////////////////////////////////////////////////////////// // German (Germany) resources @@ -54,47 +107,6 @@ END IDR_WAVE_ABOUT WAVE "res\\sounds\\uuaarrgh.wav" -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD - PRODUCTVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x3L -#else - FILEFLAGS 0x2L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "Comments", "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY" - VALUE "CompanyName", "Free Software Foundation" - VALUE "FileDescription", "LameXP - Audio Encoder Front-End" - VALUE "FileVersion", VER_LAMEXP_STR - VALUE "InternalName", "LameXP Qt" - VALUE "LegalCopyright", "Copyright (C) 2004-2010 LoRd_MuldeR " - VALUE "LegalTrademarks", "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License " - VALUE "OriginalFilename", "LameXP.exe" - VALUE "ProductName", "LameXP - Audio Encoder Front-End" - VALUE "ProductVersion", VER_LAMEXP_STR - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - - ///////////////////////////////////////////////////////////////////////////// // // Icon diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index e7fb1609..1af5f1fd 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -759,11 +759,22 @@ View + + + Style + + + + + + + + @@ -842,7 +853,7 @@ :/icons/world.png:/icons/world.png - Visit Official Homepage + Visit Official Web-Site Visit Official Web-Site @@ -875,6 +886,41 @@ Clear All + + + true + + + true + + + Plastique + + + + + true + + + Cleanlooks + + + + + true + + + Windows + + + + + true + + + Classic + + @@ -898,6 +944,8 @@ + + diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 76ce0995..b1e16200 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -38,6 +38,10 @@ #include #include #include +#include +#include +#include +#include //Win32 includes #include @@ -115,6 +119,15 @@ MainWindow::MainWindow(QWidget *parent) actionSourceFiles->setChecked(true); connect(m_tabActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(tabActionActivated(QAction*))); + //Activate style menu actions + m_styleActionGroup = new QActionGroup(this); + m_styleActionGroup->addAction(actionStylePlastique); + m_styleActionGroup->addAction(actionStyleCleanlooks); + m_styleActionGroup->addAction(actionStyleWindows); + m_styleActionGroup->addAction(actionStyleClassic); + actionStylePlastique->setChecked(true); + connect(m_styleActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(styleActionActivated(QAction*))); + //Activate help menu actions connect(actionCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdatesActionActivated())); connect(actionVisitHomepage, SIGNAL(triggered()), this, SLOT(visitHomepageActionActivated())); @@ -136,6 +149,7 @@ MainWindow::MainWindow(QWidget *parent) MainWindow::~MainWindow(void) { LAMEXP_DELETE(m_tabActionGroup); + LAMEXP_DELETE(m_styleActionGroup); LAMEXP_DELETE(m_fileListModel); LAMEXP_DELETE(m_banner); LAMEXP_DELETE(m_fileSystemModel); @@ -282,6 +296,7 @@ void MainWindow::addFilesButtonClicked(void) */ void MainWindow::openFolderActionActivated(void) { + tabWidget->setCurrentIndex(0); QString selectedFolder = QFileDialog::getExistingDirectory(this, "Add folder", QDesktopServices::storageLocation(QDesktopServices::MusicLocation)); if(!selectedFolder.isEmpty()) @@ -430,6 +445,17 @@ void MainWindow::tabActionActivated(QAction *action) } } +/* + * Style action triggered + */ +void MainWindow::styleActionActivated(QAction *action) +{ + if(action == actionStylePlastique) QApplication::setStyle(new QPlastiqueStyle()); + else if(action == actionStyleCleanlooks) QApplication::setStyle(new QCleanlooksStyle()); + else if(action == actionStyleWindows) QApplication::setStyle(new QWindowsVistaStyle()); + else if(action == actionStyleClassic) QApplication::setStyle(new QWindowsStyle()); +} + /* * Output folder changed */ diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 6739f158..38fee2dd 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -48,6 +48,7 @@ private slots: void editMetaButtonClicked(void); void tabPageChanged(int idx); void tabActionActivated(QAction *action); + void styleActionActivated(QAction *action); void outputFolderViewClicked(const QModelIndex &index); void makeFolderButtonClicked(void); void gotoHomeFolderButtonClicked(void); @@ -61,5 +62,6 @@ private: FileListModel *m_fileListModel; QFileSystemModel *m_fileSystemModel; QActionGroup *m_tabActionGroup; + QActionGroup *m_styleActionGroup; WorkingBanner *m_banner; }; diff --git a/src/Main.cpp b/src/Main.cpp index 39b8231a..b305ee59 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -46,7 +46,7 @@ int lamexp_main(int argc, char* argv[]) //print license info qDebug("This program is free software: you can redistribute it and/or modify"); - qDebug("it under the terms of the GNU General Public License ."); + qDebug("it under the terms of the GNU General Public License ."); qDebug("This program comes with ABSOLUTELY NO WARRANTY.\n"); //Print warning, if this is a "debug" build diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp index 30b768f5..d26279d6 100644 --- a/src/Thread_FileAnalyzer.cpp +++ b/src/Thread_FileAnalyzer.cpp @@ -64,7 +64,7 @@ void FileAnalyzer::run() qDebug("Analyzing: %s", currentFile.toUtf8().constData()); emit fileSelected(QFileInfo(currentFile).fileName()); AudioFileModel file = analyzeFile(currentFile); - if(file.formatContainerType().isEmpty() || file.formatAudioType().isEmpty()) + if(file.fileName().isEmpty() || file.formatContainerType().isEmpty() || file.formatAudioType().isEmpty()) { qDebug("Skipped: %s", file.filePath().toUtf8().constData()); continue; @@ -85,6 +85,17 @@ const AudioFileModel FileAnalyzer::analyzeFile(const QString &filePath) AudioFileModel audioFile(filePath); m_currentSection = sectionOther; + QFile readTest(filePath); + if(!readTest.open(QIODevice::ReadOnly)) + { + qWarning("Cannot access file for reading, skipping!"); + return audioFile; + } + else + { + readTest.close(); + } + QProcess process; process.setProcessChannelMode(QProcess::MergedChannels); process.setReadChannel(QProcess::StandardOutput); @@ -93,7 +104,17 @@ const AudioFileModel FileAnalyzer::analyzeFile(const QString &filePath) while(process.state() != QProcess::NotRunning) { - process.waitForReadyRead(1000); + if(!process.waitForReadyRead()) + { + if(process.state() == QProcess::Running) + { + qWarning("MediaInfo time out. Killing process and skipping file!"); + process.kill(); + process.waitForFinished(-1); + return audioFile; + } + } + QByteArray data = process.readLine().constData(); while(data.size() > 0) { @@ -139,7 +160,7 @@ const AudioFileModel FileAnalyzer::analyzeFile(const QString &filePath) audioFile.setFileName(baseName); } - + return audioFile; } @@ -307,4 +328,4 @@ unsigned int FileAnalyzer::parseDuration(const QString &str) // EVENTS //////////////////////////////////////////////////////////// -/*NONE*/ \ No newline at end of file +/*NONE*/