diff --git a/res/resources.qrc b/res/resources.qrc index e5be481..6c45468 100644 --- a/res/resources.qrc +++ b/res/resources.qrc @@ -20,6 +20,7 @@ buttons/door_in.png buttons/error.png buttons/exclamation.png + buttons/exclamation_small.png buttons/find.png buttons/folder_add.png buttons/folder_magnify.png diff --git a/src/version.h b/src/version.h index 9d87caa..3ebe43f 100644 --- a/src/version.h +++ b/src/version.h @@ -26,7 +26,7 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 3 #define VER_X264_PATCH 8 -#define VER_X264_BUILD 857 +#define VER_X264_BUILD 859 #define VER_X264_PORTABLE_EDITION (0) diff --git a/src/win_main.cpp b/src/win_main.cpp index 47c0d87..108e391 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -226,6 +226,18 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures, IPC *ipc) m_label->addActions(ui->jobsView->actions()); connect(ui->splitter, SIGNAL(splitterMoved(int, int)), this, SLOT(updateLabelPos())); updateLabelPos(); + + //Create corner widget + QLabel *checkUp = new QLabel(ui->menubar); + checkUp->setText(QString(" %1   ").arg(tr("Check for Updates"))); + checkUp->setFixedHeight(ui->menubar->height()); + checkUp->setCursor(QCursor(Qt::PointingHandCursor)); + m_inputFilter_checkUp = new InputEventFilter(checkUp); + m_inputFilter_checkUp->addMouseFilter(Qt::LeftButton, 0); + m_inputFilter_checkUp->addMouseFilter(Qt::RightButton, 0); + connect(m_inputFilter_checkUp, SIGNAL(mouseClicked(int)), this, SLOT(checkUpdates())); + checkUp->hide(); + ui->menubar->setCornerWidget(checkUp); } /* @@ -242,6 +254,7 @@ MainWindow::~MainWindow(void) X264_DELETE(m_label); X264_DELETE(m_inputFilter_jobList); X264_DELETE(m_inputFilter_version); + X264_DELETE(m_inputFilter_checkUp); while(!m_toolsList.isEmpty()) { @@ -957,12 +970,26 @@ void MainWindow::init(void) qDebug(" "); } + //--------------------------------------- + // Finish initialization + //--------------------------------------- + + //Set Window title + setWindowTitle(QString("%1 (%2)").arg(windowTitle(), m_sysinfo->hasX64Support() ? "64-Bit" : "32-Bit")); + + //Enable drag&drop support for this window, required for Qt v4.8.4+ + setAcceptDrops(true); + + //Update app staus + m_status = STATUS_IDLE; + //--------------------------------------- // Check for Expiration //--------------------------------------- if(x264_version_date().addMonths(6) < x264_current_date_safe()) { + if(QWidget *cornerWidget = ui->menubar->cornerWidget()) cornerWidget->show(); QString text; text += QString("%1

").arg(tr("Your version of Simple x264 Launcher is more than 6 months old!").replace('-', "−")); text += QString("%1
%3

").arg(tr("You can download the most recent version from the official web-site now:").replace('-', "−"), QString::fromLatin1(update_url), QString::fromLatin1(update_url).replace("-", "−")); @@ -981,27 +1008,11 @@ void MainWindow::init(void) QTimer::singleShot(7500, btn3, SLOT(show())); if(msgBox.exec() == 0) { - m_status = STATUS_IDLE; QTimer::singleShot(0, this, SLOT(checkUpdates())); return; } } - - //--------------------------------------- - // Finish initialization - //--------------------------------------- - - //Set Window title - setWindowTitle(QString("%1 (%2)").arg(windowTitle(), m_sysinfo->hasX64Support() ? "64-Bit" : "32-Bit")); - - //Enable drag&drop support for this window, required for Qt v4.8.4+ - setAcceptDrops(true); - - //Update app staus - m_status = STATUS_IDLE; - - //Try adding files from command-line - if(!parseCommandLineArgs()) + else if(!parseCommandLineArgs()) { //Update reminder if(CLIParser::checkFlag(CLI_PARAM_FIRST_RUN, arguments)) @@ -1010,12 +1021,16 @@ void MainWindow::init(void) m_recentlyUsed->setLastUpdateCheck(0); RecentlyUsed::saveRecentlyUsed(m_recentlyUsed); } - else if((!m_preferences->getNoUpdateReminder()) && (m_recentlyUsed->lastUpdateCheck() + 14 < x264_current_date_safe().toJulianDay())) + else if(m_recentlyUsed->lastUpdateCheck() + 14 < x264_current_date_safe().toJulianDay()) { - if(QMessageBox::warning(this, tr("Update Notification"), QString("
%1").arg(tr("Your last update check was more than 14 days ago. Check for updates now?")), tr("Check for Updates"), tr("Discard")) == 0) + if(QWidget *cornerWidget = ui->menubar->cornerWidget()) cornerWidget->show(); + if(!m_preferences->getNoUpdateReminder()) { - QTimer::singleShot(0, this, SLOT(checkUpdates())); - return; + if(QMessageBox::warning(this, tr("Update Notification"), QString("%1").arg(tr("Your last update check was more than 14 days ago. Check for updates now?")), tr("Check for Updates"), tr("Discard")) == 0) + { + QTimer::singleShot(0, this, SLOT(checkUpdates())); + return; + } } } } @@ -1169,6 +1184,7 @@ void MainWindow::checkUpdates(void) { m_recentlyUsed->setLastUpdateCheck(x264_current_date_safe().toJulianDay()); RecentlyUsed::saveRecentlyUsed(m_recentlyUsed); + if(QWidget *cornerWidget = ui->menubar->cornerWidget()) cornerWidget->hide(); } if(ret == UpdaterDialog::READY_TO_INSTALL_UPDATE) diff --git a/src/win_main.h b/src/win_main.h index 2ea8fff..51dd242 100644 --- a/src/win_main.h +++ b/src/win_main.h @@ -72,12 +72,13 @@ private: Ui::MainWindow *const ui; x264_status_t m_status; - QLabel *m_label; + IPC *const m_ipc; InputEventFilter *m_inputFilter_jobList; InputEventFilter *m_inputFilter_version; + InputEventFilter *m_inputFilter_checkUp; JobListModel *m_jobList; OptionsModel *m_options;