const char *home_url = "http://mulder.brhack.net/";
-#define PRE_RELEASE (1)
+#define PRE_RELEASE (0)
#define SET_FONT_BOLD(WIDGET,BOLD) { QFont _font = WIDGET->font(); _font.setBold(BOLD); WIDGET->setFont(_font); }
#define SET_TEXT_COLOR(WIDGET,COLOR) { QPalette _palette = WIDGET->palette(); _palette.setColor(QPalette::WindowText, (COLOR)); _palette.setColor(QPalette::Text, (COLOR)); WIDGET->setPalette(_palette); }
//Update title
labelBuildDate->setText(tr("Built on %1 at %2").arg(x264_version_date().toString(Qt::ISODate), QString::fromLatin1(x264_version_time())));
+ labelBuildDate->installEventFilter(this);
setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_x64supported ? "64-Bit" : "32-Bit"));
if(PRE_RELEASE) setWindowTitle(QString("%1 | PRE-RELEASE VERSION").arg(windowTitle()));
+
//Create model
m_jobList = new JobListModel();
connect(m_jobList, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(jobChangedData(QModelIndex, QModelIndex)));
connect(buttonAddJob, SIGNAL(clicked()), this, SLOT(addButtonPressed()));
connect(buttonStartJob, SIGNAL(clicked()), this, SLOT(startButtonPressed()));
connect(buttonAbortJob, SIGNAL(clicked()), this, SLOT(abortButtonPressed()));
+ connect(buttonPauseJob, SIGNAL(toggled(bool)), this, SLOT(pauseButtonPressed(bool)));
//Enable menu
connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
m_jobList->abortJob(jobsView->currentIndex());
}
+void MainWindow::pauseButtonPressed(bool checked)
+{
+ if(checked)
+ {
+ m_jobList->pauseJob(jobsView->currentIndex());
+ }
+ else
+ {
+ m_jobList->resumeJob(jobsView->currentIndex());
+ }
+}
+
void MainWindow::jobSelected(const QModelIndex & current, const QModelIndex & previous)
{
qDebug("Job selected: %d", current.row());
text += QString().sprintf("Note that this program is distributed with ABSOLUTELY NO WARRANTY.<br><br>");
text += QString().sprintf("Please check the web-site at <a href=\"%s\">%s</a> for updates !!!<br></tt></nobr>", home_url, home_url);
- QMessageBox::information(this, tr("About..."), text.replace("-", "−"));
+ QMessageBox::information(this, tr("About..."), text.replace("-", "−"), tr("Close"));
}
void MainWindow::showWebLink(void)
int val = QMessageBox::warning(this, tr("Avisynth Missing"), tr("<nobr>It appears that Avisynth is not currently installed on your computer.<br>Thus Avisynth input will not be working at all!<br><br>Please download and install Avisynth:<br><a href=\"http://sourceforge.net/projects/avisynth2/files/AviSynth%202.5/\">http://sourceforge.net/projects/avisynth2/files/AviSynth 2.5/</a></nobr>").replace("-", "−"), tr("Quit"), tr("Ignore"));
if(val != 1) { close(); qApp->exit(-1); return; }
}
+
+ //Check for expiration
+ if(x264_version_date().addMonths(6) < QDate::currentDate())
+ {
+ QMessageBox msgBox(this);
+ msgBox.setIcon(QMessageBox::Information);
+ msgBox.setWindowTitle(tr("Update Notification"));
+ msgBox.setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
+ msgBox.setText(tr("<nobr><tt>Oups, this version of 'Simple x264 Launcher' is more than 6 months old.<br><br>Please check the official web-site at <a href=\"%1\">%1</a> for updates!<br></tt></nobr>").replace("-", "−").arg(home_url));
+ QPushButton *btn1 = msgBox.addButton(tr("Discard"), QMessageBox::NoRole);
+ QPushButton *btn2 = msgBox.addButton(tr("Discard"), QMessageBox::AcceptRole);
+ btn1->setEnabled(false);
+ btn2->setVisible(false);
+ QTimer::singleShot(5000, btn1, SLOT(hide()));
+ QTimer::singleShot(5000, btn2, SLOT(show()));
+ msgBox.exec();
+ }
}
void MainWindow::updateLabel(void)
updateLabel();
}
+bool MainWindow::eventFilter(QObject *o, QEvent *e)
+{
+ if((o == labelBuildDate) && (e->type() == QEvent::MouseButtonPress))
+ {
+ QTimer::singleShot(0, this, SLOT(showAbout()));
+ return true;
+ }
+ return false;
+}
+
///////////////////////////////////////////////////////////////////////////////
// Private functions
///////////////////////////////////////////////////////////////////////////////
qDebug("MainWindow::updateButtons(void)");
buttonStartJob->setEnabled(status == EncodeThread::JobStatus_Enqueued);
- buttonAbortJob->setEnabled(status == EncodeThread::JobStatus_Indexing || status == EncodeThread::JobStatus_Running ||
- status == EncodeThread::JobStatus_Running_Pass1 || status == EncodeThread::JobStatus_Running_Pass2 );
+ buttonAbortJob->setEnabled(status == EncodeThread::JobStatus_Indexing || status == EncodeThread::JobStatus_Running || status == EncodeThread::JobStatus_Running_Pass1 || status == EncodeThread::JobStatus_Running_Pass2 || status == EncodeThread::JobStatus_Paused);
+ buttonPauseJob->setEnabled(status == EncodeThread::JobStatus_Indexing || status == EncodeThread::JobStatus_Running || status == EncodeThread::JobStatus_Paused || status == EncodeThread::JobStatus_Running_Pass1 || status == EncodeThread::JobStatus_Running_Pass2);
+ buttonPauseJob->setChecked(status == EncodeThread::JobStatus_Paused || status == EncodeThread::JobStatus_Pausing);
actionJob_Start->setEnabled(buttonStartJob->isEnabled());
actionJob_Abort->setEnabled(buttonAbortJob->isEnabled());
+ actionJob_Pause->setEnabled(buttonPauseJob->isEnabled());
+ actionJob_Pause->setChecked(buttonPauseJob->isChecked());
+
+ editDetails->setEnabled(status != EncodeThread::JobStatus_Paused);
}