Implemented update reminder to main window. Also added option to disable update reminder to preferences dialog.

This commit is contained in:
LoRd_MuldeR 2013-12-14 22:30:19 +01:00
parent e194239b96
commit 8d9fb210c6
17 changed files with 619 additions and 478 deletions

Binary file not shown.

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>379</width> <width>372</width>
<height>432</height> <height>387</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -21,428 +21,428 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title"> <property name="title">
<string> Preferences </string> <string> Preferences </string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item row="13" column="1" colspan="5"> <item>
<spacer name="verticalSpacer_8"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <widget class="QCheckBox" name="checkRunNextJob">
</property> <property name="text">
<property name="sizeType"> <string notr="true"/>
<enum>QSizePolicy::Fixed</enum> </property>
</property> </widget>
<property name="sizeHint" stdset="0"> </item>
<size> <item>
<width>20</width> <widget class="QLabel" name="labelRunNextJob">
<height>8</height> <property name="text">
</size> <string>Automatically launch next job when a running job completes</string>
</property> </property>
</spacer> </widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="2" column="2" colspan="2"> <item>
<widget class="QLabel" name="labelJobCount"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="enabled"> <item>
<bool>false</bool> <widget class="QCheckBox" name="checkBoxDummy1">
</property> <property name="enabled">
<property name="toolTip"> <bool>false</bool>
<string>If the specified number of jobs (or even more) is already running, the next one will NOT be launched yet.</string> </property>
</property> <property name="text">
<property name="text"> <string/>
<string>Maximum number of running jobs:</string> </property>
</property> </widget>
</widget> </item>
<item>
<widget class="QLabel" name="labelJobCount">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>If the specified number of jobs (or even more) is already running, the next one will NOT be launched yet.</string>
</property>
<property name="text">
<string>Maximum number of running jobs:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxJobCount">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>If the specified number of jobs (or even more) is already running, the next one will NOT be launched yet.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="1" column="2" colspan="4"> <item>
<widget class="QLabel" name="labelRunNextJob"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="text"> <item>
<string>Automatically launch next job when a running job completes</string> <widget class="QCheckBox" name="checkUse10BitEncoding">
</property> <property name="text">
</widget> <string notr="true"/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelUse10BitEncoding">
<property name="text">
<string>Use 10-Bit version of x264 → implies 'High 10' H.264 Profile</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="1" column="1"> <item>
<widget class="QCheckBox" name="checkRunNextJob"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="text"> <item>
<string notr="true"/> <widget class="QCheckBox" name="checkUse64BitAvs2YUV">
</property> <property name="toolTip">
</widget> <string>If this option is un-checked (default), then 32-Bit Avisynth will be used - even when using 64-Bit x264.
</item>
<item row="2" column="5">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="4">
<widget class="QSpinBox" name="spinBoxJobCount">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>If the specified number of jobs (or even more) is already running, the next one will NOT be launched yet.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkUse64BitAvs2YUV">
<property name="toolTip">
<string>If this option is un-checked (default), then 32-Bit Avisynth will be used - even when using 64-Bit x264.
Please be aware that this option does NOT have any effect on 32-Bit systems.</string> Please be aware that this option does NOT have any effect on 32-Bit systems.</string>
</property> </property>
<property name="text"> <property name="text">
<string notr="true"/> <string notr="true"/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="5"> <item>
<spacer name="verticalSpacer"> <widget class="QLabel" name="labelUse64BitAvs2YUV">
<property name="orientation"> <property name="toolTip">
<enum>Qt::Vertical</enum> <string>If this option is un-checked (default), then 32-Bit Avisynth will be used - even when using 64-Bit x264.
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="checkShutdownComputer">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="12" column="2" colspan="4">
<widget class="QLabel" name="labelShutdownComputer">
<property name="text">
<string>Shutdown computer as soon as the last job has completed</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="5">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>12</height>
</size>
</property>
</spacer>
</item>
<item row="19" column="1" colspan="5">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>12</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="2" colspan="4">
<widget class="QLabel" name="labelUse64BitAvs2YUV">
<property name="toolTip">
<string>If this option is un-checked (default), then 32-Bit Avisynth will be used - even when using 64-Bit x264.
Please be aware that this option does NOT have any effect on 32-Bit systems.</string> Please be aware that this option does NOT have any effect on 32-Bit systems.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Use 64-Bit Avisynth/Avs2YUV, if running on a 64-Bit machine</string> <string>Use 64-Bit Avisynth/Avs2YUV, if running on a 64-Bit machine</string>
</property> </property>
</widget> </widget>
</item>
<item row="7" column="1" colspan="5">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkUse10BitEncoding">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="2" colspan="4">
<widget class="QLabel" name="labelUse10BitEncoding">
<property name="text">
<string>Use 10-Bit version of x264 → implies 'High 10' H.264 Profile</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="5">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkSaveLogFiles">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="2" colspan="4">
<widget class="QLabel" name="labelSaveLogFiles">
<property name="text">
<string>Automatically save output to log file when a job has finished</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="5">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="2" colspan="4">
<widget class="QLabel" name="labelSaveToSourceFolder">
<property name="text">
<string>Save output to the same folder where the source is located</string>
</property>
</widget>
</item>
<item row="11" column="1" colspan="5">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkSaveToSourceFolder">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="14" column="4">
<widget class="QComboBox" name="comboBoxPriority">
<property name="editable">
<bool>false</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Above Normal</string>
</property>
</item> </item>
<item> <item>
<property name="text"> <spacer name="horizontalSpacer_2">
<string>Normal</string> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QCheckBox" name="checkSaveLogFiles">
<property name="text">
<string/>
</property>
</widget>
</item> </item>
<item> <item>
<property name="text"> <widget class="QLabel" name="labelSaveLogFiles">
<string>Below Normal</string> <property name="text">
</property> <string>Automatically save output to log file when a job has finished</string>
</property>
</widget>
</item> </item>
<item> <item>
<property name="text"> <spacer name="horizontalSpacer_3">
<string>Idle</string> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</widget> </layout>
</item> </item>
<item row="14" column="5"> <item>
<spacer name="horizontalSpacer_5"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="orientation"> <item>
<enum>Qt::Horizontal</enum> <widget class="QCheckBox" name="checkSaveToSourceFolder">
</property> <property name="text">
<property name="sizeHint" stdset="0"> <string/>
<size> </property>
<width>40</width> </widget>
<height>20</height> </item>
</size> <item>
</property> <widget class="QLabel" name="labelSaveToSourceFolder">
</spacer> <property name="text">
<string>Save output to the same folder where the source is located</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="14" column="2" colspan="2"> <item>
<widget class="QLabel" name="labelProcessPriority"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="text"> <item>
<string>Priority for encoder processes:</string> <widget class="QCheckBox" name="checkShutdownComputer">
</property> <property name="text">
</widget> <string notr="true"/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelShutdownComputer">
<property name="text">
<string>Shutdown computer as soon as the last job has completed</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="16" column="1"> <item>
<widget class="QCheckBox" name="checkEnableSounds"> <layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="text"> <item>
<string/> <widget class="QCheckBox" name="checkBoxDummy2">
</property> <property name="enabled">
</widget> <bool>false</bool>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelProcessPriority">
<property name="text">
<string>Priority for encoder processes:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxPriority">
<property name="editable">
<bool>false</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Above Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Below Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Idle</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="16" column="2" colspan="4"> <item>
<widget class="QLabel" name="labelEnableSounds"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="text"> <item>
<string>Enable sound effects when a job has completed or failed</string> <widget class="QCheckBox" name="checkEnableSounds">
</property> <property name="text">
</widget> <string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelEnableSounds">
<property name="text">
<string>Enable sound effects when a job has completed or failed</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="15" column="1" colspan="5"> <item>
<spacer name="verticalSpacer_9"> <layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="orientation"> <property name="spacing">
<enum>Qt::Vertical</enum> <number>6</number>
</property> </property>
<property name="sizeType"> <item>
<enum>QSizePolicy::Fixed</enum> <widget class="QCheckBox" name="checkDisableWarnings">
</property> <property name="text">
<property name="sizeHint" stdset="0"> <string/>
<size> </property>
<width>20</width> </widget>
<height>8</height> </item>
</size> <item>
</property> <widget class="QLabel" name="labelDisableWarnings">
</spacer> <property name="text">
<string>Never show warning about missing Avisynth or VapourSynth</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="18" column="2" colspan="4"> <item>
<widget class="QLabel" name="labelDisableWarnings"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="text"> <item>
<string>Never show warning about missing Avisynth or VapourSynth</string> <widget class="QCheckBox" name="checkNoUpdateReminder">
</property> <property name="text">
</widget> <string/>
</item> </property>
<item row="18" column="1"> </widget>
<widget class="QCheckBox" name="checkDisableWarnings"> </item>
<property name="text"> <item>
<string/> <widget class="QLabel" name="labelNoUpdateReminder">
</property> <property name="text">
</widget> <string>Never show auto-update notifications on application startup</string>
</item> </property>
<item row="17" column="1" colspan="5"> </widget>
<spacer name="verticalSpacer_10"> </item>
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <spacer name="horizontalSpacer_14">
</property> <property name="orientation">
<property name="sizeType"> <enum>Qt::Horizontal</enum>
<enum>QSizePolicy::Fixed</enum> </property>
</property> <property name="sizeHint" stdset="0">
<property name="sizeHint" stdset="0"> <size>
<size> <width>40</width>
<width>20</width> <height>20</height>
<height>8</height> </size>
</size> </property>
</property> </spacer>
</spacer> </item>
</item> </layout>
<item row="1" column="6" rowspan="18">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>12</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" rowspan="18">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</item> </item>
@ -505,10 +505,6 @@ Please be aware that this option does NOT have any effect on 32-Bit systems.</st
<tabstops> <tabstops>
<tabstop>closeButton</tabstop> <tabstop>closeButton</tabstop>
<tabstop>resetButton</tabstop> <tabstop>resetButton</tabstop>
<tabstop>checkRunNextJob</tabstop>
<tabstop>spinBoxJobCount</tabstop>
<tabstop>checkUse64BitAvs2YUV</tabstop>
<tabstop>checkShutdownComputer</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../res/resources.qrc"/> <include location="../res/resources.qrc"/>

View File

@ -10,7 +10,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>428</width> <width>428</width>
<height>257</height> <height>247</height>
</rect> </rect>
</property> </property>
<property name="palette"> <property name="palette">
@ -94,6 +94,9 @@
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="logo"> <widget class="QLabel" name="logo">
<property name="minimumSize"> <property name="minimumSize">
@ -152,6 +155,9 @@
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
@ -218,7 +224,7 @@
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>8</height> <height>12</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -289,7 +295,7 @@
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>8</height> <height>12</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -360,7 +366,7 @@
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>6</height> <height>8</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -373,7 +379,7 @@
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -403,6 +409,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>3</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="labelLoadingCenter"> <widget class="QLabel" name="labelLoadingCenter">
<property name="text"> <property name="text">
@ -413,6 +435,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>3</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="labelLoadingRight"> <widget class="QLabel" name="labelLoadingRight">
<property name="text"> <property name="text">
@ -438,6 +476,35 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="labelBuildNo">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">(Build number: installed vs. latest)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="labelInfo"> <widget class="QLabel" name="labelInfo">
<property name="text"> <property name="text">
@ -493,7 +560,7 @@
<cursorShape>PointingHandCursor</cursorShape> <cursorShape>PointingHandCursor</cursorShape>
</property> </property>
<property name="text"> <property name="text">
<string>http://www.example.com/update_info.html</string> <string notr="true">http://www.example.com/update_info.html</string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse</set> <set>Qt::LinksAccessibleByMouse</set>
@ -501,17 +568,14 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>

BIN
res/buttons/shield_blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -36,6 +36,7 @@
<file>buttons/restart.png</file> <file>buttons/restart.png</file>
<file>buttons/setup.png</file> <file>buttons/setup.png</file>
<file>buttons/shield_admin.png</file> <file>buttons/shield_admin.png</file>
<file>buttons/shield_blue.png</file>
<file>buttons/shield_error.png</file> <file>buttons/shield_error.png</file>
<file>buttons/shield_exclamation.png</file> <file>buttons/shield_exclamation.png</file>
<file>buttons/shield_green.png</file> <file>buttons/shield_green.png</file>

View File

@ -49,6 +49,7 @@ void PreferencesModel::initPreferences(PreferencesModel *preferences)
preferences->m_processPriority = -1; preferences->m_processPriority = -1;
preferences->m_enableSounds = false; preferences->m_enableSounds = false;
preferences->m_disableWarnings = false; preferences->m_disableWarnings = false;
preferences->m_noUpdateReminder = false;
} }
void PreferencesModel::loadPreferences(PreferencesModel *preferences) void PreferencesModel::loadPreferences(PreferencesModel *preferences)
@ -69,6 +70,7 @@ void PreferencesModel::loadPreferences(PreferencesModel *preferences)
preferences->m_processPriority = settings.value("process_priority", QVariant(defaults.m_processPriority)).toInt(); preferences->m_processPriority = settings.value("process_priority", QVariant(defaults.m_processPriority)).toInt();
preferences->m_enableSounds = settings.value("enable_sounds", QVariant(defaults.m_enableSounds)).toBool(); preferences->m_enableSounds = settings.value("enable_sounds", QVariant(defaults.m_enableSounds)).toBool();
preferences->m_disableWarnings = settings.value("disable_warnings", QVariant(defaults.m_disableWarnings)).toBool(); preferences->m_disableWarnings = settings.value("disable_warnings", QVariant(defaults.m_disableWarnings)).toBool();
preferences->m_noUpdateReminder = settings.value("disable_update_reminder", QVariant(defaults.m_disableWarnings)).toBool();
} }
void PreferencesModel::savePreferences(PreferencesModel *preferences) void PreferencesModel::savePreferences(PreferencesModel *preferences)
@ -87,5 +89,6 @@ void PreferencesModel::savePreferences(PreferencesModel *preferences)
settings.setValue("process_priority", preferences->m_processPriority); settings.setValue("process_priority", preferences->m_processPriority);
settings.setValue("enable_sounds", preferences->m_enableSounds); settings.setValue("enable_sounds", preferences->m_enableSounds);
settings.setValue("disable_warnings", preferences->m_disableWarnings); settings.setValue("disable_warnings", preferences->m_disableWarnings);
settings.setValue("disable_update_reminder", preferences->m_noUpdateReminder);
settings.sync(); settings.sync();
} }

View File

@ -37,6 +37,7 @@ public:
int processPriority(void) { return m_processPriority; } int processPriority(void) { return m_processPriority; }
bool enableSounds(void) { return m_enableSounds; } bool enableSounds(void) { return m_enableSounds; }
bool disableWarnings(void) { return m_disableWarnings; } bool disableWarnings(void) { return m_disableWarnings; }
bool noUpdateReminder(void) { return m_noUpdateReminder; }
//Setter //Setter
void setAutoRunNextJob(const bool autoRunNextJob) { m_autoRunNextJob = autoRunNextJob; } void setAutoRunNextJob(const bool autoRunNextJob) { m_autoRunNextJob = autoRunNextJob; }
@ -49,6 +50,7 @@ public:
void setProcessPriority(const int processPriority) { m_processPriority = processPriority; } void setProcessPriority(const int processPriority) { m_processPriority = processPriority; }
void setEnableSounds(const bool enableSounds) { m_enableSounds = enableSounds; } void setEnableSounds(const bool enableSounds) { m_enableSounds = enableSounds; }
void setDisableWarnings(const bool disableWarnings) { m_disableWarnings = disableWarnings; } void setDisableWarnings(const bool disableWarnings) { m_disableWarnings = disableWarnings; }
void setNoUpdateReminder(const bool noUpdateReminder) { m_noUpdateReminder = noUpdateReminder; }
//Static //Static
static void initPreferences(PreferencesModel *preferences); static void initPreferences(PreferencesModel *preferences);
@ -66,4 +68,5 @@ protected:
int m_processPriority; int m_processPriority;
bool m_enableSounds; bool m_enableSounds;
bool m_disableWarnings; bool m_disableWarnings;
bool m_noUpdateReminder;
}; };

View File

@ -26,6 +26,7 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QDir> #include <QDir>
#include <QSettings> #include <QSettings>
#include <QDate>
#define ARRAY_SIZE(ARRAY) (sizeof((ARRAY))/sizeof((ARRAY[0]))) #define ARRAY_SIZE(ARRAY) (sizeof((ARRAY))/sizeof((ARRAY[0])))
#define VALID_DIR(PATH) ((!(PATH).isEmpty()) && QFileInfo(PATH).exists() && QFileInfo(PATH).isDir()) #define VALID_DIR(PATH) ((!(PATH).isEmpty()) && QFileInfo(PATH).exists() && QFileInfo(PATH).isDir())
@ -33,27 +34,43 @@
static const char *KEY_FILTER_IDX = "path/filterIndex"; static const char *KEY_FILTER_IDX = "path/filterIndex";
static const char *KEY_SOURCE_DIR = "path/directory_openFrom"; static const char *KEY_SOURCE_DIR = "path/directory_openFrom";
static const char *KEY_OUTPUT_DIR = "path/directory_saveTo"; static const char *KEY_OUTPUT_DIR = "path/directory_saveTo";
static const char *KEY_UPDATE_CHK = "auto_update/last_successfull_check";
static void READ_INT(QSettings &settings, const QString &key, int default, int *value)
{
bool ok = false;
const int temp = settings.value(key, default).toInt(&ok);
*value = (ok) ? temp : default;
}
RecentlyUsed::RecentlyUsed(void) RecentlyUsed::RecentlyUsed(void)
{ {
initRecentlyUsed(this); initRecentlyUsed(this);
} }
RecentlyUsed::~RecentlyUsed(void)
{
/*nothing to do*/
}
void RecentlyUsed::initRecentlyUsed(RecentlyUsed *recentlyUsed) void RecentlyUsed::initRecentlyUsed(RecentlyUsed *recentlyUsed)
{ {
recentlyUsed->m_sourceDirectory = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation)); recentlyUsed->m_sourceDirectory = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation));
recentlyUsed->m_outputDirectory = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation)); recentlyUsed->m_outputDirectory = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation));
recentlyUsed->m_filterIndex = 0; recentlyUsed->m_filterIndex = 0;
recentlyUsed->m_lastUpdateCheck = QDate(1969, 8, 15).toJulianDay();
} }
void RecentlyUsed::loadRecentlyUsed(RecentlyUsed *recentlyUsed) void RecentlyUsed::loadRecentlyUsed(RecentlyUsed *recentlyUsed)
{ {
RecentlyUsed defaults; RecentlyUsed defaults;
QSettings settings(QString("%1/last.ini").arg(x264_data_path()), QSettings::IniFormat); QSettings settings(QString("%1/last.ini").arg(x264_data_path()), QSettings::IniFormat);
int temp = 0;
recentlyUsed->m_sourceDirectory = settings.value(KEY_SOURCE_DIR, defaults.m_sourceDirectory).toString(); recentlyUsed->m_sourceDirectory = settings.value(KEY_SOURCE_DIR, defaults.m_sourceDirectory).toString();
recentlyUsed->m_outputDirectory = settings.value(KEY_OUTPUT_DIR, defaults.m_outputDirectory).toString(); recentlyUsed->m_outputDirectory = settings.value(KEY_OUTPUT_DIR, defaults.m_outputDirectory).toString();
recentlyUsed->m_filterIndex = settings.value(KEY_FILTER_IDX, defaults.m_filterIndex).toInt(); READ_INT(settings, KEY_FILTER_IDX, defaults.m_filterIndex, &recentlyUsed->m_filterIndex);
READ_INT(settings, KEY_UPDATE_CHK, defaults.m_lastUpdateCheck, &recentlyUsed->m_lastUpdateCheck);
if(!VALID_DIR(recentlyUsed->m_sourceDirectory)) recentlyUsed->m_sourceDirectory = defaults.m_sourceDirectory; if(!VALID_DIR(recentlyUsed->m_sourceDirectory)) recentlyUsed->m_sourceDirectory = defaults.m_sourceDirectory;
if(!VALID_DIR(recentlyUsed->m_outputDirectory)) recentlyUsed->m_outputDirectory = defaults.m_outputDirectory; if(!VALID_DIR(recentlyUsed->m_outputDirectory)) recentlyUsed->m_outputDirectory = defaults.m_outputDirectory;
@ -68,6 +85,11 @@ void RecentlyUsed::saveRecentlyUsed(RecentlyUsed *recentlyUsed)
settings.setValue(KEY_SOURCE_DIR, recentlyUsed->m_sourceDirectory); settings.setValue(KEY_SOURCE_DIR, recentlyUsed->m_sourceDirectory);
settings.setValue(KEY_OUTPUT_DIR, recentlyUsed->m_outputDirectory); settings.setValue(KEY_OUTPUT_DIR, recentlyUsed->m_outputDirectory);
settings.setValue(KEY_FILTER_IDX, recentlyUsed->m_filterIndex); settings.setValue(KEY_FILTER_IDX, recentlyUsed->m_filterIndex);
settings.setValue(KEY_UPDATE_CHK, recentlyUsed->m_lastUpdateCheck);
settings.sync(); settings.sync();
} }
else
{
qWarning("Settings are not writable!");
}
} }

View File

@ -39,6 +39,7 @@ class RecentlyUsed
{ {
public: public:
RecentlyUsed(void); RecentlyUsed(void);
~RecentlyUsed(void);
static void initRecentlyUsed(RecentlyUsed *recentlyUsed); static void initRecentlyUsed(RecentlyUsed *recentlyUsed);
static void loadRecentlyUsed(RecentlyUsed *recentlyUsed); static void loadRecentlyUsed(RecentlyUsed *recentlyUsed);
@ -47,15 +48,18 @@ public:
//Getter //Getter
QString sourceDirectory(void) { return m_sourceDirectory; } QString sourceDirectory(void) { return m_sourceDirectory; }
QString outputDirectory(void) { return m_outputDirectory; } QString outputDirectory(void) { return m_outputDirectory; }
int filterIndex(void) { return m_filterIndex; } int filterIndex(void) { return m_filterIndex; }
int lastUpdateCheck(void) { return m_lastUpdateCheck; }
//Setter //Setter
void setSourceDirectory(const QString &sourceDirectory) { m_sourceDirectory = sourceDirectory; } void setSourceDirectory(const QString &sourceDirectory) { m_sourceDirectory = sourceDirectory; }
void setOutputDirectory(const QString &outputDirectory) { m_outputDirectory = outputDirectory; } void setOutputDirectory(const QString &outputDirectory) { m_outputDirectory = outputDirectory; }
void setFilterIndex(const int filterIndex) { m_filterIndex = filterIndex; } void setFilterIndex(const int filterIndex) { m_filterIndex = filterIndex; }
void setLastUpdateCheck(const int updateCheck) { m_lastUpdateCheck = updateCheck; }
protected: protected:
QString m_sourceDirectory; QString m_sourceDirectory;
QString m_outputDirectory; QString m_outputDirectory;
int m_filterIndex; int m_filterIndex;
int m_lastUpdateCheck;
}; };

View File

@ -25,8 +25,8 @@
#define VER_X264_MAJOR 2 #define VER_X264_MAJOR 2
#define VER_X264_MINOR 2 #define VER_X264_MINOR 2
#define VER_X264_PATCH 7 #define VER_X264_PATCH 8
#define VER_X264_BUILD 704 #define VER_X264_BUILD 720
#define VER_X264_MINIMUM_REV 2363 #define VER_X264_MINIMUM_REV 2363
#define VER_X264_CURRENT_API 140 #define VER_X264_CURRENT_API 140

View File

@ -56,7 +56,7 @@
#include <ctime> #include <ctime>
const char *home_url = "http://muldersoft.com/"; const char *home_url = "http://muldersoft.com/";
const char *update_url = "http://code.google.com/p/mulder/downloads/list"; const char *update_url = "https://github.com/lordmulder/Simple-x264-Launcher/releases/latest";
const char *tpl_last = "<LAST_USED>"; const char *tpl_last = "<LAST_USED>";
#define SET_FONT_BOLD(WIDGET,BOLD) do { QFont _font = WIDGET->font(); _font.setBold(BOLD); WIDGET->setFont(_font); } while(0) #define SET_FONT_BOLD(WIDGET,BOLD) do { QFont _font = WIDGET->font(); _font.setBold(BOLD); WIDGET->setFont(_font); } while(0)
@ -868,21 +868,44 @@ void MainWindow::init(void)
qDebug(" "); qDebug(" ");
} }
//Update initialized flag (must do this before update check!)
m_initialized = true;
//Enable drag&drop support for this window, required for Qt v4.8.4+
setAcceptDrops(true);
//Check for expiration //Check for expiration
if(x264_version_date().addMonths(6) < QDate::currentDate()) if(x264_version_date().addMonths(6) < x264_current_date_safe())
{ {
QString text;
text += QString("<nobr><tt>%1</tt></nobr><br><br>").arg(tr("Your version of Simple x264 Launcher is more than 6 months old!").replace("-", "&minus;"));
text += QString("<nobr><tt>%1<br><a href=\"%2\">%2</a><br><br>").arg(tr("You can download the most recent version from the official web-site now:").replace("-", "&minus;"), QString::fromLatin1(update_url));
text += QString("<nobr><tt>%1</tt></nobr><br>").arg(tr("Alternatively, click 'Check for Updates' to run the auto-update utility.").replace("-", "&minus;"));
QMessageBox msgBox(this); QMessageBox msgBox(this);
msgBox.setIconPixmap(QIcon(":/images/update.png").pixmap(56,56)); msgBox.setIconPixmap(QIcon(":/images/update.png").pixmap(56,56));
msgBox.setWindowTitle(tr("Update Notification")); msgBox.setWindowTitle(tr("Update Notification"));
msgBox.setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); msgBox.setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
msgBox.setText(tr("<nobr><tt>Your version of 'Simple x264 Launcher' is more than 6 months old!<br><br>Please download the most recent version from the official web-site at:<br><a href=\"%1\">%1</a><br></tt></nobr>").replace("-", "&minus;").arg(update_url)); msgBox.setText(text);
QPushButton *btn1 = msgBox.addButton(tr("Discard"), QMessageBox::NoRole); QPushButton *btn1 = msgBox.addButton(tr("Check for Updates"), QMessageBox::AcceptRole);
QPushButton *btn2 = msgBox.addButton(tr("Discard"), QMessageBox::AcceptRole); QPushButton *btn2 = msgBox.addButton(tr("Discard"), QMessageBox::NoRole);
btn1->setEnabled(false); QPushButton *btn3 = msgBox.addButton(btn2->text(), QMessageBox::RejectRole);
btn2->setVisible(false); btn2->setEnabled(false);
QTimer::singleShot(5000, btn1, SLOT(hide())); btn3->setVisible(false);
QTimer::singleShot(5000, btn2, SLOT(show())); QTimer::singleShot(7500, btn2, SLOT(hide()));
msgBox.exec(); QTimer::singleShot(7500, btn3, SLOT(show()));
if(msgBox.exec() == 0)
{
QTimer::singleShot(0, this, SLOT(checkUpdates()));
return;
}
}
else if((!m_preferences->noUpdateReminder()) && (m_recentlyUsed->lastUpdateCheck() + 14 < x264_current_date_safe().toJulianDay()))
{
if(QMessageBox::warning(this, tr("Update Notification"), QString("<nobr>%1</nobr>").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;
}
} }
//Add files from command-line //Add files from command-line
@ -905,15 +928,6 @@ void MainWindow::init(void)
{ {
createJobMultiple(files); createJobMultiple(files);
} }
//Enable drag&drop support for this window, required for Qt v4.8.4+
setAcceptDrops(true);
//Update initialized flag
m_initialized = true;
//FIXME
QTimer::singleShot(333, this, SLOT(checkUpdates()));
} }
/* /*
@ -980,10 +994,15 @@ void MainWindow::checkUpdates(void)
UpdaterDialog *updater = new UpdaterDialog(this, QString("%1/toolset").arg(m_appDir)); UpdaterDialog *updater = new UpdaterDialog(this, QString("%1/toolset").arg(m_appDir));
const int ret = updater->exec(); const int ret = updater->exec();
if(ret == 42) if(updater->getSuccess())
{ {
X264_DELETE(updater); m_recentlyUsed->setLastUpdateCheck(x264_current_date_safe().toJulianDay());
qWarning("Exitting to install update..."); RecentlyUsed::saveRecentlyUsed(m_recentlyUsed);
}
if(ret == UpdaterDialog::READY_TO_INSTALL_UPDATE)
{
qWarning("Exitting program to install update...");
close(); close();
QApplication::quit(); QApplication::quit();
} }

View File

@ -30,7 +30,7 @@
#include <QMouseEvent> #include <QMouseEvent>
#include <QMessageBox> #include <QMessageBox>
static inline void UPDATE_CHECKBOX(QCheckBox *const chkbox, const bool value, const bool block) static inline void UPDATE_CHECKBOX(QCheckBox *const chkbox, const bool value, const bool block = false)
{ {
if(block) { chkbox->blockSignals(true); } if(block) { chkbox->blockSignals(true); }
if(chkbox->isChecked() != value) chkbox->click(); if(chkbox->isChecked() != value) chkbox->click();
@ -76,6 +76,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferen
ui->labelSaveToSourceFolder->installEventFilter(this); ui->labelSaveToSourceFolder->installEventFilter(this);
ui->labelEnableSounds->installEventFilter(this); ui->labelEnableSounds->installEventFilter(this);
ui->labelDisableWarnings->installEventFilter(this); ui->labelDisableWarnings->installEventFilter(this);
ui->labelNoUpdateReminder->installEventFilter(this);
ui->checkBoxDummy1->installEventFilter(this);
ui->checkBoxDummy2->installEventFilter(this);
connect(ui->resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed())); connect(ui->resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
connect(ui->checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool))); connect(ui->checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool)));
@ -93,12 +97,13 @@ void PreferencesDialog::showEvent(QShowEvent *event)
{ {
if(event) QDialog::showEvent(event); if(event) QDialog::showEvent(event);
UPDATE_CHECKBOX(ui->checkRunNextJob, m_preferences->autoRunNextJob(), false); UPDATE_CHECKBOX(ui->checkRunNextJob, m_preferences->autoRunNextJob());
UPDATE_CHECKBOX(ui->checkShutdownComputer, m_preferences->shutdownComputer(), false); UPDATE_CHECKBOX(ui->checkShutdownComputer, m_preferences->shutdownComputer());
UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit(), false); UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit());
UPDATE_CHECKBOX(ui->checkSaveLogFiles, m_preferences->saveLogFiles(), false); UPDATE_CHECKBOX(ui->checkSaveLogFiles, m_preferences->saveLogFiles());
UPDATE_CHECKBOX(ui->checkSaveToSourceFolder, m_preferences->saveToSourcePath(), false); UPDATE_CHECKBOX(ui->checkSaveToSourceFolder, m_preferences->saveToSourcePath());
UPDATE_CHECKBOX(ui->checkEnableSounds, m_preferences->enableSounds(), false); UPDATE_CHECKBOX(ui->checkEnableSounds, m_preferences->enableSounds());
UPDATE_CHECKBOX(ui->checkNoUpdateReminder, m_preferences->noUpdateReminder());
UPDATE_CHECKBOX(ui->checkDisableWarnings, m_preferences->disableWarnings(), true); UPDATE_CHECKBOX(ui->checkDisableWarnings, m_preferences->disableWarnings(), true);
UPDATE_CHECKBOX(ui->checkUse10BitEncoding, m_preferences->use10BitEncoding(), true); UPDATE_CHECKBOX(ui->checkUse10BitEncoding, m_preferences->use10BitEncoding(), true);
@ -112,14 +117,23 @@ void PreferencesDialog::showEvent(QShowEvent *event)
bool PreferencesDialog::eventFilter(QObject *o, QEvent *e) bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
{ {
emulateMouseEvent(o, e, ui->labelRunNextJob, ui->checkRunNextJob); if(e->type() == QEvent::Paint)
emulateMouseEvent(o, e, ui->labelShutdownComputer, ui->checkShutdownComputer); {
emulateMouseEvent(o, e, ui->labelUse10BitEncoding, ui->checkUse10BitEncoding); if(o == ui->checkBoxDummy1) return true;
emulateMouseEvent(o, e, ui->labelUse64BitAvs2YUV, ui->checkUse64BitAvs2YUV); if(o == ui->checkBoxDummy2) return true;
emulateMouseEvent(o, e, ui->labelSaveLogFiles, ui->checkSaveLogFiles); }
emulateMouseEvent(o, e, ui->labelSaveToSourceFolder, ui->checkSaveToSourceFolder); else if((e->type() == QEvent::MouseButtonPress) || (e->type() == QEvent::MouseButtonRelease))
emulateMouseEvent(o, e, ui->labelEnableSounds, ui->checkEnableSounds); {
emulateMouseEvent(o, e, ui->labelDisableWarnings, ui->checkDisableWarnings); emulateMouseEvent(o, e, ui->labelRunNextJob, ui->checkRunNextJob);
emulateMouseEvent(o, e, ui->labelShutdownComputer, ui->checkShutdownComputer);
emulateMouseEvent(o, e, ui->labelUse10BitEncoding, ui->checkUse10BitEncoding);
emulateMouseEvent(o, e, ui->labelUse64BitAvs2YUV, ui->checkUse64BitAvs2YUV);
emulateMouseEvent(o, e, ui->labelSaveLogFiles, ui->checkSaveLogFiles);
emulateMouseEvent(o, e, ui->labelSaveToSourceFolder, ui->checkSaveToSourceFolder);
emulateMouseEvent(o, e, ui->labelEnableSounds, ui->checkEnableSounds);
emulateMouseEvent(o, e, ui->labelDisableWarnings, ui->checkDisableWarnings);
emulateMouseEvent(o, e, ui->labelNoUpdateReminder, ui->checkNoUpdateReminder);
}
return false; return false;
} }
@ -127,18 +141,15 @@ void PreferencesDialog::emulateMouseEvent(QObject *object, QEvent *event, QWidge
{ {
if(object == source) if(object == source)
{ {
if((event->type() == QEvent::MouseButtonPress) || (event->type() == QEvent::MouseButtonRelease)) if(QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event))
{ {
if(QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event)) qApp->postEvent(target, new QMouseEvent
{ (
qApp->postEvent(target, new QMouseEvent event->type(),
( (qApp->widgetAt(mouseEvent->globalPos()) == source) ? QPoint(1, 1) : QPoint(INT_MAX, INT_MAX),
event->type(), Qt::LeftButton,
qApp->widgetAt(mouseEvent->globalPos()) == source ? QPoint(1, 1) : QPoint(INT_MAX, INT_MAX), 0, 0
Qt::LeftButton, ));
0, 0
));
}
} }
} }
} }
@ -155,6 +166,7 @@ void PreferencesDialog::done(int n)
m_preferences->setProcessPriority(ui->comboBoxPriority->itemData(ui->comboBoxPriority->currentIndex()).toInt()); m_preferences->setProcessPriority(ui->comboBoxPriority->itemData(ui->comboBoxPriority->currentIndex()).toInt());
m_preferences->setEnableSounds(ui->checkEnableSounds->isChecked()); m_preferences->setEnableSounds(ui->checkEnableSounds->isChecked());
m_preferences->setDisableWarnings(ui->checkDisableWarnings->isChecked()); m_preferences->setDisableWarnings(ui->checkDisableWarnings->isChecked());
m_preferences->setNoUpdateReminder(ui->checkNoUpdateReminder->isChecked());
PreferencesModel::savePreferences(m_preferences); PreferencesModel::savePreferences(m_preferences);
QDialog::done(n); QDialog::done(n);

View File

@ -45,7 +45,7 @@ protected:
virtual void showEvent(QShowEvent *event); virtual void showEvent(QShowEvent *event);
virtual bool eventFilter(QObject *o, QEvent *e); virtual bool eventFilter(QObject *o, QEvent *e);
void emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target); inline static void emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target);
private: private:
Ui::PreferencesDialog *const ui; Ui::PreferencesDialog *const ui;

View File

@ -47,6 +47,7 @@
ui->labelLoadingLeft->setVisible((FLAG)); \ ui->labelLoadingLeft->setVisible((FLAG)); \
ui->labelLoadingCenter->setVisible((FLAG)); \ ui->labelLoadingCenter->setVisible((FLAG)); \
ui->labelLoadingRight->setVisible((FLAG)); \ ui->labelLoadingRight->setVisible((FLAG)); \
ui->labelBuildNo->setVisible(!(FLAG)); \
ui->labelInfo->setVisible(!(FLAG)); \ ui->labelInfo->setVisible(!(FLAG)); \
ui->labelUrl->setVisible(!(FLAG)); \ ui->labelUrl->setVisible(!(FLAG)); \
if((FLAG)) m_animator->start(); else m_animator->stop(); \ if((FLAG)) m_animator->start(); else m_animator->stop(); \
@ -66,6 +67,7 @@ UpdaterDialog::UpdaterDialog(QWidget *parent, const QString &binDir)
m_status(UpdateCheckThread::UpdateStatus_NotStartedYet), m_status(UpdateCheckThread::UpdateStatus_NotStartedYet),
m_thread(NULL), m_thread(NULL),
m_updaterProcess(NULL), m_updaterProcess(NULL),
m_success(false),
m_firstShow(true) m_firstShow(true)
{ {
//Init the dialog, from the .ui file //Init the dialog, from the .ui file
@ -96,6 +98,7 @@ UpdaterDialog::UpdaterDialog(QWidget *parent, const QString &binDir)
//Hide labels //Hide labels
ui->labelInfo->hide(); ui->labelInfo->hide();
ui->labelUrl->hide(); ui->labelUrl->hide();
ui->labelBuildNo->hide();
} }
UpdaterDialog::~UpdaterDialog(void) UpdaterDialog::~UpdaterDialog(void)
@ -146,7 +149,7 @@ void UpdaterDialog::showEvent(QShowEvent *event)
if(m_firstShow) if(m_firstShow)
{ {
m_firstShow = false; m_firstShow = false;
QTimer::singleShot(0, this, SLOT(initUpdate())); QTimer::singleShot(16, this, SLOT(initUpdate()));
} }
} }
@ -204,7 +207,7 @@ void UpdaterDialog::initUpdate(void)
} }
//Begin updater run //Begin updater run
QTimer::singleShot(125, this, SLOT(checkForUpdates())); QTimer::singleShot(16, this, SLOT(checkForUpdates()));
} }
void UpdaterDialog::checkForUpdates(void) void UpdaterDialog::checkForUpdates(void)
@ -216,6 +219,7 @@ void UpdaterDialog::checkForUpdates(void)
//Clear texts //Clear texts
ui->retranslateUi(this); ui->retranslateUi(this);
ui->labelBuildNo->setText(tr("Installed build is #%1 | Latest build is #%2").arg(QString::number(x264_version_build()), tr("N/A")));
//Init buttons //Init buttons
ui->buttonCancel->setEnabled(false); ui->buttonCancel->setEnabled(false);
@ -240,7 +244,7 @@ void UpdaterDialog::checkForUpdates(void)
m_logFile.clear(); m_logFile.clear();
//Start the updater thread //Start the updater thread
QTimer::singleShot(125, m_thread, SLOT(start())); QTimer::singleShot(250, m_thread, SLOT(start()));
} }
void UpdaterDialog::threadStatusChanged(int status) void UpdaterDialog::threadStatusChanged(int status)
@ -290,6 +294,12 @@ void UpdaterDialog::threadStatusChanged(int status)
} }
void UpdaterDialog::threadFinished(void) void UpdaterDialog::threadFinished(void)
{
m_success = m_thread->getSuccess();
QTimer::singleShot((m_success ? 1000 : 0), this, SLOT(updateFinished()));
}
void UpdaterDialog::updateFinished(void)
{ {
//Restore cursor //Restore cursor
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
@ -309,7 +319,7 @@ void UpdaterDialog::threadFinished(void)
UPDATE_TEXT(3, tr("Your version is up-to-date.")); UPDATE_TEXT(3, tr("Your version is up-to-date."));
break; break;
case UpdateCheckThread::UpdateStatus_CompletedNewVersionOlder: case UpdateCheckThread::UpdateStatus_CompletedNewVersionOlder:
UPDATE_ICON(3, "shield_error"); UPDATE_ICON(3, "shield_blue");
UPDATE_TEXT(3, tr("You are using a pre-release version!")); UPDATE_TEXT(3, tr("You are using a pre-release version!"));
break; break;
default: default:
@ -324,6 +334,7 @@ void UpdaterDialog::threadFinished(void)
case UpdateCheckThread::UpdateStatus_CompletedNoUpdates: case UpdateCheckThread::UpdateStatus_CompletedNoUpdates:
case UpdateCheckThread::UpdateStatus_CompletedNewVersionOlder: case UpdateCheckThread::UpdateStatus_CompletedNewVersionOlder:
SHOW_ANIMATION(false); SHOW_ANIMATION(false);
ui->labelBuildNo->setText(tr("Installed build is #%1 | Latest build is #%2").arg(QString::number(x264_version_build()), QString::number(m_thread->getUpdateInfo()->m_buildNo)));
ui->labelUrl->setText(QString("<a href=\"%1\">%1</a>").arg(m_thread->getUpdateInfo()->m_downloadSite)); ui->labelUrl->setText(QString("<a href=\"%1\">%1</a>").arg(m_thread->getUpdateInfo()->m_downloadSite));
break; break;
case UpdateCheckThread::UpdateStatus_ErrorNoConnection: case UpdateCheckThread::UpdateStatus_ErrorNoConnection:
@ -411,7 +422,7 @@ void UpdaterDialog::installUpdate(void)
if(process.exitCode() == 0) if(process.exitCode() == 0)
{ {
done(42); done(READY_TO_INSTALL_UPDATE);
} }
} }

View File

@ -39,6 +39,10 @@ public:
UpdaterDialog(QWidget *parent, const QString &binDir); UpdaterDialog(QWidget *parent, const QString &binDir);
~UpdaterDialog(void); ~UpdaterDialog(void);
static const int READY_TO_INSTALL_UPDATE = 42;
inline bool getSuccess(void) { return m_success; }
protected: protected:
virtual bool event(QEvent *e); virtual bool event(QEvent *e);
virtual void showEvent(QShowEvent *event); virtual void showEvent(QShowEvent *event);
@ -51,6 +55,7 @@ private slots:
void threadStatusChanged(int status); void threadStatusChanged(int status);
void threadMessageLogged(const QString &message); void threadMessageLogged(const QString &message);
void threadFinished(void); void threadFinished(void);
void updateFinished(void);
void openUrl(const QString &url); void openUrl(const QString &url);
void installUpdate(void); void installUpdate(void);
@ -61,6 +66,7 @@ private:
bool checkFileHash(const QString &filePath, const char *expectedHash); bool checkFileHash(const QString &filePath, const char *expectedHash);
bool m_firstShow; bool m_firstShow;
bool m_success;
const QString m_binDir; const QString m_binDir;
QMovie *m_animator; QMovie *m_animator;
UpdateCheckThread *m_thread; UpdateCheckThread *m_thread;

View File

@ -97,7 +97,7 @@ copy /Y "$(SolutionDir)etc\vld\bin\Win32\*.manifest" "$(TargetDir)"
<Message>Copy Toolset</Message> <Message>Copy Toolset</Message>
</PostBuildEvent> </PostBuildEvent>
<PreBuildEvent> <PreBuildEvent>
<Command>"$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 5</Command> <Command>"$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30</Command>
<Message>Update Build Number</Message> <Message>Update Build Number</Message>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
@ -135,7 +135,7 @@ copy /Y "$(SolutionDir)etc\vld\bin\Win32\*.manifest" "$(TargetDir)"
<EntryPointSymbol>x264_entry_point</EntryPointSymbol> <EntryPointSymbol>x264_entry_point</EntryPointSymbol>
</Link> </Link>
<PreBuildEvent> <PreBuildEvent>
<Command>"$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 5</Command> <Command>"$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30</Command>
</PreBuildEvent> </PreBuildEvent>
<PreBuildEvent> <PreBuildEvent>
<Message>Update Build Number</Message> <Message>Update Build Number</Message>