From 13025766547fbbf056d097277aa71cec0ccaf1db Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 22 Nov 2013 17:01:13 +0100 Subject: [PATCH] First mock-up of the upcoming updater dialog. --- gui/win_main.ui | 11 + gui/win_updater.ui | 596 +++++++++++++++++++++++++ res/resources.qrc | 3 + src/version.h | 2 +- src/win_main.cpp | 20 + src/win_main.h | 1 + src/win_updater.cpp | 64 +++ src/win_updater.h | 41 ++ x264_launcher_MSVC2013.vcxproj | 19 + x264_launcher_MSVC2013.vcxproj.filters | 12 + 10 files changed, 768 insertions(+), 1 deletion(-) create mode 100644 gui/win_updater.ui create mode 100644 src/win_updater.cpp create mode 100644 src/win_updater.h diff --git a/gui/win_main.ui b/gui/win_main.ui index 4b4968f..b894a09 100644 --- a/gui/win_main.ui +++ b/gui/win_main.ui @@ -354,6 +354,8 @@ + + @@ -644,6 +646,15 @@ VapourSynth Manual + + + + :/buttons/update.png:/buttons/update.png + + + Check for Updates + + buttonAddJob diff --git a/gui/win_updater.ui b/gui/win_updater.ui new file mode 100644 index 0000000..3df22ac --- /dev/null +++ b/gui/win_updater.ui @@ -0,0 +1,596 @@ + + + UpdaterDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 458 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + Autoupdate + + + + :/buttons/update.png:/buttons/update.png + + + + + + + + + + + 80 + 80 + + + + + 80 + 80 + + + + + + + :/images/update.png + + + true + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 18 + 20 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 6 + + + + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + + + + :/buttons/hourglass.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + Check Internet connection + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 6 + + + + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + + + + :/buttons/hourglass.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + Download update-information from web-server + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 6 + + + + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + + + + :/buttons/hourglass.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + Examine the installed version + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/buttons/update.png + + + + + + + + + + :/images/loading.gif + + + + + + + + + + :/buttons/setup.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Info: + + + + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 120 + 120 + 120 + + + + + + + + + true + + + + http://www.example.com/info.hmtl + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + QFrame::HLine + + + QFrame::Raised + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 128 + 0 + + + + Download & Install + + + + :/buttons/shield_admin.png:/buttons/shield_admin.png + + + + + + + + 88 + 0 + + + + Retry + + + + :/buttons/restart.png:/buttons/restart.png + + + + + + + + 88 + 0 + + + + Cancel + + + + :/buttons/cross.png:/buttons/cross.png + + + + + + + + + + + + + + + + diff --git a/res/resources.qrc b/res/resources.qrc index d950bf1..20c517f 100644 --- a/res/resources.qrc +++ b/res/resources.qrc @@ -33,12 +33,15 @@ buttons/power_on.png buttons/restart.png buttons/setup.png + buttons/shield_admin.png buttons/suspended.png buttons/trash.png + buttons/update.png buttons/world_link.png buttons/wrench.png buttons/x264.png images/avisynth.png + images/loading.gif images/movie.png images/python.png images/update.png diff --git a/src/version.h b/src/version.h index a114f90..9b8951b 100644 --- a/src/version.h +++ b/src/version.h @@ -26,7 +26,7 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 2 #define VER_X264_PATCH 7 -#define VER_X264_BUILD 638 +#define VER_X264_BUILD 642 #define VER_X264_MINIMUM_REV 2363 #define VER_X264_CURRENT_API 140 diff --git a/src/win_main.cpp b/src/win_main.cpp index c9efa0b..3fc53ef 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -35,6 +35,7 @@ #include "taskbar7.h" #include "win_addJob.h" #include "win_preferences.h" +#include "win_updater.h" #include "resource.h" #include @@ -179,6 +180,7 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures) connect(ui->actionWebSecret, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(ui->actionWebSupport, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(ui->actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences())); + connect(ui->actionCheckForUpdates, SIGNAL(triggered()), this, SLOT(checkUpdates())); //Create floating label m_label = new QLabel(ui->jobsView->viewport()); @@ -959,6 +961,24 @@ void MainWindow::instanceCreated(unsigned int pid) x264_blink_window(this, 5, 125); } +void MainWindow::checkUpdates(void) +{ + if(!m_initialized) + { + return; + } + + if(countRunningJobs() > 0) + { + QMessageBox::warning(this, tr("Jobs Are Running"), tr("Sorry, can not update while there still are running jobs!")); + return; + } + + UpdaterDialog *updater = new UpdaterDialog(this); + updater->exec(); + X264_DELETE(updater); +} + /////////////////////////////////////////////////////////////////////////////// // Event functions /////////////////////////////////////////////////////////////////////////////// diff --git a/src/win_main.h b/src/win_main.h index e26f9dd..ef5ce43 100644 --- a/src/win_main.h +++ b/src/win_main.h @@ -97,6 +97,7 @@ private slots: void browseButtonPressed(void); void deleteButtonPressed(void); void copyLogToClipboard(bool checked); + void checkUpdates(void); void handleDroppedFiles(void); void init(void); void instanceCreated(unsigned int pid); diff --git a/src/win_updater.cpp b/src/win_updater.cpp new file mode 100644 index 0000000..cfa0cb8 --- /dev/null +++ b/src/win_updater.cpp @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////////// +// Simple x264 Launcher +// Copyright (C) 2004-2013 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 "win_updater.h" +#include "uic_win_updater.h" + +#include "global.h" + +/////////////////////////////////////////////////////////////////////////////// +// Constructor & Destructor +/////////////////////////////////////////////////////////////////////////////// + +UpdaterDialog::UpdaterDialog(QWidget *parent) +: + QDialog(parent), + ui(new Ui::UpdaterDialog()) +{ + //Init the dialog, from the .ui file + ui->setupUi(this); + setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); + + //Fix size + setMinimumSize(size()); +} + +UpdaterDialog::~UpdaterDialog(void) +{ + delete ui; +} + +/////////////////////////////////////////////////////////////////////////////// +// Public Functions +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Events +/////////////////////////////////////////////////////////////////////////////// + +/*None*/ + +/////////////////////////////////////////////////////////////////////////////// +// Slots +/////////////////////////////////////////////////////////////////////////////// + +/*None*/ + diff --git a/src/win_updater.h b/src/win_updater.h new file mode 100644 index 0000000..4d4c54d --- /dev/null +++ b/src/win_updater.h @@ -0,0 +1,41 @@ +/////////////////////////////////////////////////////////////////////////////// +// Simple x264 Launcher +// Copyright (C) 2004-2013 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 + +namespace Ui +{ + class UpdaterDialog; +} + +class UpdaterDialog : public QDialog +{ + Q_OBJECT + +public: + UpdaterDialog(QWidget *parent); + ~UpdaterDialog(void); + +private: + Ui::UpdaterDialog *const ui; +}; diff --git a/x264_launcher_MSVC2013.vcxproj b/x264_launcher_MSVC2013.vcxproj index ca3c4c8..3d60c3e 100644 --- a/x264_launcher_MSVC2013.vcxproj +++ b/x264_launcher_MSVC2013.vcxproj @@ -212,6 +212,15 @@ copy /Y "$(QTDIR)\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats" $(SolutionDir)tmp\uic\uic_%(Filename).h;%(Outputs) $(SolutionDir)tmp\uic\uic_%(Filename).h;%(Outputs) + + Document + "$(QTDIR)\bin\uic.exe" -o "$(SolutionDir)tmp\uic\uic_%(Filename).h" "%(FullPath)" + "$(QTDIR)\bin\uic.exe" -o "$(SolutionDir)tmp\uic\uic_%(Filename).h" "%(FullPath)" + UIC "$(SolutionDir)tmp\uic\uic_%(Filename).h" + UIC "$(SolutionDir)tmp\uic\uic_%(Filename).h" + $(SolutionDir)tmp\uic\uic_%(Filename).h;%(Outputs) + $(SolutionDir)tmp\uic\uic_%(Filename).h;%(Outputs) + Document @@ -226,6 +235,14 @@ copy /Y "$(QTDIR)\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats" + + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" "%(FullPath)" + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" "%(FullPath)" + MOC "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" + MOC "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" + $(SolutionDir)tmp\moc\moc_%(Filename).cpp;%(Outputs) + $(SolutionDir)tmp\moc\moc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" "%(FullPath)" "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" "%(FullPath)" @@ -348,6 +365,7 @@ copy /Y "$(QTDIR)\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats" + @@ -359,6 +377,7 @@ copy /Y "$(QTDIR)\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats" + diff --git a/x264_launcher_MSVC2013.vcxproj.filters b/x264_launcher_MSVC2013.vcxproj.filters index 6b1008a..3360c52 100644 --- a/x264_launcher_MSVC2013.vcxproj.filters +++ b/x264_launcher_MSVC2013.vcxproj.filters @@ -60,6 +60,9 @@ Header Files + + Header Files + @@ -155,6 +158,12 @@ Source Files + + Source Files + + + Generated Files + @@ -208,6 +217,9 @@ Header Files + + Dialogs +