Reorganized web-links a bit + added "Reset" button to preferences dialog.

This commit is contained in:
LoRd_MuldeR 2012-02-05 15:42:41 +01:00
parent 48991004ff
commit 71a5b84d7b
9 changed files with 127 additions and 17 deletions

View File

@ -329,13 +329,28 @@
<property name="title"> <property name="title">
<string>?</string> <string>?</string>
</property> </property>
<widget class="QMenu" name="menuDownloadX264">
<property name="title">
<string>Download x264 Binaries</string>
</property>
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/buttons/setup.png</normaloff>:/buttons/setup.png</iconset>
</property>
<addaction name="actionWebJarod"/>
<addaction name="actionWebKomisar"/>
<addaction name="actionWebJEEB"/>
</widget>
<addaction name="actionWebMulder"/> <addaction name="actionWebMulder"/>
<addaction name="actionWebX264"/> <addaction name="actionWebX264"/>
<addaction name="actionWebKomisar"/> <addaction name="separator"/>
<addaction name="actionWebJarod"/> <addaction name="menuDownloadX264"/>
<addaction name="actionWebAvisynth32"/>
<addaction name="actionWebAvisynth64"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionWebWiki"/> <addaction name="actionWebWiki"/>
<addaction name="actionWebBluRay"/> <addaction name="actionWebBluRay"/>
<addaction name="actionWebSecret"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionAbout"/> <addaction name="actionAbout"/>
</widget> </widget>
@ -508,6 +523,42 @@
<string>Explore Job</string> <string>Explore Job</string>
</property> </property>
</action> </action>
<action name="actionWebAvisynth32">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/buttons/setup.png</normaloff>:/buttons/setup.png</iconset>
</property>
<property name="text">
<string>Download Avisynth (32-Bit)</string>
</property>
</action>
<action name="actionWebAvisynth64">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/buttons/setup.png</normaloff>:/buttons/setup.png</iconset>
</property>
<property name="text">
<string>Download Avisynth (64-Bit)</string>
</property>
</action>
<action name="actionWebJEEB">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/buttons/world_link.png</normaloff>:/buttons/world_link.png</iconset>
</property>
<property name="text">
<string>JEEB's Web-Site</string>
</property>
</action>
<action name="actionWebSecret">
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/buttons/book_open.png</normaloff>:/buttons/book_open.png</iconset>
</property>
<property name="text">
<string>Secret Recipe (Shush!)</string>
</property>
</action>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>buttonAddJob</tabstop> <tabstop>buttonAddJob</tabstop>

View File

@ -248,6 +248,23 @@ Please be aware that this option does NOT have any effect on 32-Bit systems.</st
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="resetButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Reset</string>
</property>
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/buttons/bomb.png</normaloff>:/buttons/bomb.png</iconset>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="closeButton"> <widget class="QPushButton" name="closeButton">
<property name="minimumSize"> <property name="minimumSize">
@ -271,8 +288,11 @@ Please be aware that this option does NOT have any effect on 32-Bit systems.</st
</widget> </widget>
<tabstops> <tabstops>
<tabstop>closeButton</tabstop> <tabstop>closeButton</tabstop>
<tabstop>resetButton</tabstop>
<tabstop>checkRunNextJob</tabstop> <tabstop>checkRunNextJob</tabstop>
<tabstop>spinBoxJobCount</tabstop> <tabstop>spinBoxJobCount</tabstop>
<tabstop>checkUse64BitAvs2YUV</tabstop>
<tabstop>checkShutdownComputer</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../res/resources.qrc"/> <include location="../res/resources.qrc"/>

BIN
res/buttons/bomb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

BIN
res/buttons/setup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

View File

@ -4,6 +4,7 @@
<file>icons/movie.ico</file> <file>icons/movie.ico</file>
<file>buttons/accept.png</file> <file>buttons/accept.png</file>
<file>buttons/add.png</file> <file>buttons/add.png</file>
<file>buttons/bomb.png</file>
<file>buttons/book_open.png</file> <file>buttons/book_open.png</file>
<file>buttons/cancel.png</file> <file>buttons/cancel.png</file>
<file>buttons/clock_pause.png</file> <file>buttons/clock_pause.png</file>
@ -26,6 +27,7 @@
<file>buttons/play_big.png</file> <file>buttons/play_big.png</file>
<file>buttons/power_off.png</file> <file>buttons/power_off.png</file>
<file>buttons/power_on.png</file> <file>buttons/power_on.png</file>
<file>buttons/setup.png</file>
<file>buttons/suspended.png</file> <file>buttons/suspended.png</file>
<file>buttons/trash.png</file> <file>buttons/trash.png</file>
<file>buttons/world_link.png</file> <file>buttons/world_link.png</file>

View File

@ -65,7 +65,7 @@ MainWindow::MainWindow(bool x64supported)
qRegisterMetaType<EncodeThread::JobStatus>("EncodeThread::JobStatus"); qRegisterMetaType<EncodeThread::JobStatus>("EncodeThread::JobStatus");
//Load preferences //Load preferences
memset(&m_preferences, 0, sizeof(PreferencesDialog::Preferences)); PreferencesDialog::initPreferences(&m_preferences);
PreferencesDialog::loadPreferences(&m_preferences); PreferencesDialog::loadPreferences(&m_preferences);
//Freeze minimum size //Freeze minimum size
@ -122,8 +122,12 @@ MainWindow::MainWindow(bool x64supported)
connect(actionWebX264, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebX264, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebKomisar, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebKomisar, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebJarod, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebJarod, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebJEEB, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebAvisynth32, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebAvisynth64, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebWiki, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebWiki, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebBluRay, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebBluRay, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionWebSecret, SIGNAL(triggered()), this, SLOT(showWebLink()));
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences())); connect(actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences()));
//Create floating label //Create floating label
@ -362,12 +366,16 @@ void MainWindow::showAbout(void)
void MainWindow::showWebLink(void) void MainWindow::showWebLink(void)
{ {
if(QObject::sender() == actionWebMulder) QDesktopServices::openUrl(QUrl(home_url)); if(QObject::sender() == actionWebMulder) QDesktopServices::openUrl(QUrl(home_url));
if(QObject::sender() == actionWebX264) QDesktopServices::openUrl(QUrl("http://www.x264.com/")); if(QObject::sender() == actionWebX264) QDesktopServices::openUrl(QUrl("http://www.x264.com/"));
if(QObject::sender() == actionWebKomisar) QDesktopServices::openUrl(QUrl("http://komisar.gin.by/")); if(QObject::sender() == actionWebKomisar) QDesktopServices::openUrl(QUrl("http://komisar.gin.by/"));
if(QObject::sender() == actionWebJarod) QDesktopServices::openUrl(QUrl("http://www.x264.nl/")); if(QObject::sender() == actionWebJarod) QDesktopServices::openUrl(QUrl("http://www.x264.nl/"));
if(QObject::sender() == actionWebWiki) QDesktopServices::openUrl(QUrl("http://mewiki.project357.com/wiki/X264_Settings")); if(QObject::sender() == actionWebJEEB) QDesktopServices::openUrl(QUrl("http://x264.fushizen.eu/"));
if(QObject::sender() == actionWebBluRay) QDesktopServices::openUrl(QUrl("http://www.x264bluray.com/")); if(QObject::sender() == actionWebAvisynth32) QDesktopServices::openUrl(QUrl("http://sourceforge.net/projects/avisynth2/files/AviSynth%202.5/"));
if(QObject::sender() == actionWebAvisynth64) QDesktopServices::openUrl(QUrl("http://code.google.com/p/avisynth64/downloads/list"));
if(QObject::sender() == actionWebWiki) QDesktopServices::openUrl(QUrl("http://mewiki.project357.com/wiki/X264_Settings"));
if(QObject::sender() == actionWebBluRay) QDesktopServices::openUrl(QUrl("http://www.x264bluray.com/"));
if(QObject::sender() == actionWebSecret) QDesktopServices::openUrl(QUrl("http://www.youtube.com/watch_popup?v=AXIeHY-OYNI"));
} }
void MainWindow::showPreferences(void) void MainWindow::showPreferences(void)

View File

@ -40,6 +40,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Preferences *preferences,
labelUse64BitAvs2YUV->installEventFilter(this); labelUse64BitAvs2YUV->installEventFilter(this);
labelShutdownComputer->installEventFilter(this); labelShutdownComputer->installEventFilter(this);
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
m_preferences = preferences; m_preferences = preferences;
} }
@ -49,7 +51,7 @@ PreferencesDialog::~PreferencesDialog(void)
void PreferencesDialog::showEvent(QShowEvent *event) void PreferencesDialog::showEvent(QShowEvent *event)
{ {
QDialog::showEvent(event); if(event) QDialog::showEvent(event);
while(checkRunNextJob->isChecked() != m_preferences->autoRunNextJob) while(checkRunNextJob->isChecked() != m_preferences->autoRunNextJob)
{ {
@ -98,7 +100,7 @@ void PreferencesDialog::emulateMouseEvent(QObject *object, QEvent *event, QWidge
} }
} }
void PreferencesDialog::accept(void) void PreferencesDialog::done(int n)
{ {
m_preferences->autoRunNextJob = checkRunNextJob->isChecked(); m_preferences->autoRunNextJob = checkRunNextJob->isChecked();
m_preferences->shutdownComputer = checkShutdownComputer->isChecked(); m_preferences->shutdownComputer = checkShutdownComputer->isChecked();
@ -106,7 +108,27 @@ void PreferencesDialog::accept(void)
m_preferences->maxRunningJobCount = spinBoxJobCount->value(); m_preferences->maxRunningJobCount = spinBoxJobCount->value();
savePreferences(m_preferences); savePreferences(m_preferences);
QDialog::accept(); QDialog::done(n);
}
void PreferencesDialog::resetButtonPressed(void)
{
initPreferences(m_preferences);
showEvent(NULL);
}
///////////////////////////////////////////////////////////////////////////////
// Static Functions
///////////////////////////////////////////////////////////////////////////////
void PreferencesDialog::initPreferences(Preferences *preferences)
{
memset(preferences, 0, sizeof(Preferences));
preferences->autoRunNextJob = true;
preferences->maxRunningJobCount = 1;
preferences->shutdownComputer = false;
preferences->useAvisyth64Bit = false;
} }
void PreferencesDialog::loadPreferences(Preferences *preferences) void PreferencesDialog::loadPreferences(Preferences *preferences)
@ -114,11 +136,14 @@ void PreferencesDialog::loadPreferences(Preferences *preferences)
const QString appDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); const QString appDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
QSettings settings(QString("%1/preferences.ini").arg(appDir), QSettings::IniFormat); QSettings settings(QString("%1/preferences.ini").arg(appDir), QSettings::IniFormat);
Preferences defaults;
initPreferences(&defaults);
settings.beginGroup("preferences"); settings.beginGroup("preferences");
preferences->autoRunNextJob = settings.value("auto_run_next_job", QVariant(true)).toBool(); preferences->autoRunNextJob = settings.value("auto_run_next_job", QVariant(defaults.autoRunNextJob)).toBool();
preferences->maxRunningJobCount = qBound(1U, settings.value("max_running_job_count", QVariant(1U)).toUInt(), 16U); preferences->maxRunningJobCount = qBound(1U, settings.value("max_running_job_count", QVariant(defaults.maxRunningJobCount)).toUInt(), 16U);
preferences->shutdownComputer = settings.value("shutdown_computer_on_completion", QVariant(false)).toBool(); preferences->shutdownComputer = settings.value("shutdown_computer_on_completion", QVariant(defaults.shutdownComputer)).toBool();
preferences->useAvisyth64Bit = settings.value("use_64bit_avisynth", QVariant(false)).toBool(); preferences->useAvisyth64Bit = settings.value("use_64bit_avisynth", QVariant(defaults.useAvisyth64Bit)).toBool();
} }
void PreferencesDialog::savePreferences(Preferences *preferences) void PreferencesDialog::savePreferences(Preferences *preferences)

View File

@ -42,11 +42,12 @@ public:
const bool m_x64; const bool m_x64;
static void initPreferences(Preferences *preferences);
static void loadPreferences(Preferences *preferences); static void loadPreferences(Preferences *preferences);
static void savePreferences(Preferences *preferences); static void savePreferences(Preferences *preferences);
protected: protected:
virtual void accept(void); virtual void done(int n);
virtual void showEvent(QShowEvent *event); virtual void showEvent(QShowEvent *event);
virtual bool eventFilter(QObject *o, QEvent *e); virtual bool eventFilter(QObject *o, QEvent *e);
@ -54,4 +55,7 @@ protected:
private: private:
Preferences *m_preferences; Preferences *m_preferences;
private slots:
void resetButtonPressed(void);
}; };