diff --git a/LameXP.vcproj b/LameXP.vcproj index 2c57f400..73bd0112 100644 --- a/LameXP.vcproj +++ b/LameXP.vcproj @@ -314,6 +314,10 @@ RelativePath=".\src\Dialog_SplashScreen.cpp" > + + @@ -604,6 +608,40 @@ /> + + + + + + + + + + + @@ -715,7 +753,7 @@ @@ -725,7 +763,7 @@ @@ -735,7 +773,7 @@ @@ -1074,6 +1112,10 @@ RelativePath=".\tmp\MOC_Dialog_SplashScreen.cpp" > + + @@ -1426,6 +1468,40 @@ /> + + + + + + + + + + + diff --git a/gui/UpdateDialog.ui b/gui/UpdateDialog.ui new file mode 100644 index 00000000..35b4af31 --- /dev/null +++ b/gui/UpdateDialog.ui @@ -0,0 +1,353 @@ + + + UpdateDialog + + + + 0 + 0 + 622 + 364 + + + + LameXP Update Manager + + + + 0 + + + 0 + + + + + 0 + + + 0 + + + + + + + + 164 + 314 + + + + + 164 + 314 + + + + + + + :/images/Wizard.png + + + + + + + + 0 + 314 + + + + + 16777215 + 314 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + true + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + 18 + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + + 75 + true + + + + Please wait... + + + + + + + 24 + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + 0 + 2 + + + + + 16777215 + 2 + + + + QFrame::HLine + + + QFrame::Sunken + + + + + + + 6 + + + 10 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 140 + 0 + + + + Download && Install + + + + :/icons/accept.png:/icons/accept.png + + + + + + + + 90 + 0 + + + + Close + + + + :/icons/cross.png:/icons/cross.png + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + closeButton + clicked() + UpdateDialog + reject() + + + 565 + 340 + + + 310 + 181 + + + + + diff --git a/res/Images.qrc b/res/Images.qrc index 6249dadd..47d7d308 100644 --- a/res/Images.qrc +++ b/res/Images.qrc @@ -13,5 +13,6 @@ images/Cogwheels.png images/Qt.svg images/Working.gif + images/Wizard.png diff --git a/res/images/Wizard.png b/res/images/Wizard.png new file mode 100644 index 00000000..9cdec3c6 Binary files /dev/null and b/res/images/Wizard.png differ diff --git a/src/Config.h b/src/Config.h index 54194c35..bb9bcd20 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 85 +#define VER_LAMEXP_BUILD 89 #define VER_LAMEXP_SUFFIX TechPreview /* diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index fc65da39..b37d5921 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -27,6 +27,7 @@ #include "Dialog_WorkingBanner.h" #include "Dialog_MetaInfo.h" #include "Dialog_About.h" +#include "Dialog_Update.h" #include "Thread_FileAnalyzer.h" #include "Thread_MessageHandler.h" #include "Model_MetaInfo.h" @@ -854,17 +855,36 @@ void MainWindow::checkUpdatesActionActivated(void) { ABORT_IF_BUSY; - m_banner->show("Checking for updates, please be patient..."); - - for(int i = 0; i < 300; i++) - { - QApplication::processEvents(); - Sleep(5); - } - - m_banner->close(); - - QMessageBox::information(this, "Update Check", "Your version of LameXP is still up-to-date. There are no updates available.\nPlease remember to check for updates at regular intervals!"); + UpdateDialog *updateDialog = new UpdateDialog(this); + updateDialog->exec(); + LAMEXP_DELETE(updateDialog); + + //m_banner->show("Checking for updates, please be patient..."); + // + //for(int i = 0; i < 300; i++) + //{ + // QApplication::processEvents(); + // Sleep(5); + //} + // + //QNetworkAccessManager networkMgr; + //QNetworkReply *reply = networkMgr.get(QNetworkRequest(QUrl( "http://mulder.dummwiedeutsch.de/update.ver"))); + + //QEventLoop loop; + //connect(reply, SIGNAL(readyRead()), &loop, SLOT(quit())); + //connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), &loop, SLOT(quit())); + //connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); + + //while(!reply->isFinished()) + //{ + // loop.exec(QEventLoop::ExcludeUserInputEvents); + // QByteArray buffer = reply->readAll(); + // qDebug("%s", buffer.constData()); + //} + + //m_banner->close(); + // + //QMessageBox::information(this, "Update Check", "Your version of LameXP is still up-to-date. There are no updates available.\nPlease remember to check for updates at regular intervals!"); } /* diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp new file mode 100644 index 00000000..0d86a2fd --- /dev/null +++ b/src/Dialog_Update.cpp @@ -0,0 +1,69 @@ +/////////////////////////////////////////////////////////////////////////////// +// LameXP - Audio Encoder Front-End +// Copyright (C) 2004-2010 LoRd_MuldeR +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// http://www.gnu.org/licenses/gpl-2.0.txt +/////////////////////////////////////////////////////////////////////////////// + +#include "Dialog_Update.h" + +#include +#include +#include + +#include + +UpdateDialog::UpdateDialog(QWidget *parent) +: + QDialog(parent) +{ + //Init the dialog, from the .ui file + setupUi(this); + setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint); + setMinimumSize(size()); + setMaximumHeight(height()); + + //Disable "X" button + HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE); + EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); + + //Init flags + m_clipboardUsed = false; +} + +UpdateDialog::~UpdateDialog(void) +{ + if(m_clipboardUsed) + { + QApplication::clipboard()->clear(); + } +} + +void UpdateDialog::showEvent(QShowEvent *event) +{ + statusLabel->setText("Checking for new updates online, please wait..."); + QTimer::singleShot(8000, this, SLOT(updateCompleted())); + installButton->setEnabled(false); + closeButton->setEnabled(false); +} + +void UpdateDialog::updateCompleted(void) +{ + statusLabel->setText("No new updates avialbale. Your version of LameXP is up-to-date."); + closeButton->setEnabled(true); +} + diff --git a/src/Dialog_Update.h b/src/Dialog_Update.h new file mode 100644 index 00000000..5958594a --- /dev/null +++ b/src/Dialog_Update.h @@ -0,0 +1,45 @@ +/////////////////////////////////////////////////////////////////////////////// +// LameXP - Audio Encoder Front-End +// Copyright (C) 2004-2010 LoRd_MuldeR +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// http://www.gnu.org/licenses/gpl-2.0.txt +/////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "..\tmp\UIC_UpdateDialog.h" + +#include + +class UpdateDialog : public QDialog, private Ui::UpdateDialog +{ + Q_OBJECT + +public: + UpdateDialog(QWidget *parent = 0); + ~UpdateDialog(void); + +private slots: + void updateCompleted(void); + +protected: + void showEvent(QShowEvent *event); + + +private: + bool m_clipboardUsed; +}; diff --git a/src/Encoder_Vorbis.cpp b/src/Encoder_Vorbis.cpp index ee8c846b..525d7db0 100644 --- a/src/Encoder_Vorbis.cpp +++ b/src/Encoder_Vorbis.cpp @@ -156,6 +156,13 @@ bool VorbisEncoder::isFormatSupported(const QString &containerType, const QStrin return true; } } + else if(containerType.compare("FLAC", Qt::CaseInsensitive) == 0) + { + if(formatType.compare("FLAC", Qt::CaseInsensitive) == 0) + { + return true; + } + } return false; }