2012-01-28 16:40:14 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Simple x264 Launcher
|
|
|
|
// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
|
|
|
|
//
|
|
|
|
// 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_main.h"
|
2012-01-28 18:55:40 +01:00
|
|
|
|
2012-01-28 16:40:14 +01:00
|
|
|
#include "global.h"
|
2012-01-28 18:55:40 +01:00
|
|
|
#include "model_jobList.h"
|
|
|
|
|
|
|
|
#include <QDate>
|
2012-01-28 16:40:14 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Constructor & Destructor
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
MainWindow::MainWindow(void)
|
|
|
|
{
|
|
|
|
//Init the dialog, from the .ui file
|
|
|
|
setupUi(this);
|
|
|
|
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
|
2012-01-28 18:55:40 +01:00
|
|
|
|
|
|
|
//Register meta types
|
|
|
|
qRegisterMetaType<QUuid>("QUuid");
|
|
|
|
qRegisterMetaType<EncodeThread::JobStatus>("EncodeThread::JobStatus");
|
|
|
|
|
|
|
|
//Freeze minimum size
|
|
|
|
setMinimumSize(size());
|
|
|
|
|
|
|
|
//Show version
|
|
|
|
setWindowTitle(QString("%1 [%2]").arg(windowTitle(), x264_version_date().toString(Qt::ISODate)));
|
|
|
|
|
|
|
|
//Create model
|
|
|
|
m_jobList = new JobListModel();
|
|
|
|
jobsView->setModel(m_jobList);
|
|
|
|
|
|
|
|
//Setup view
|
|
|
|
jobsView->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
|
|
|
|
jobsView->horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
|
|
|
|
jobsView->horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
|
|
|
|
jobsView->horizontalHeader()->resizeSection(1, 150);
|
|
|
|
jobsView->horizontalHeader()->resizeSection(2, 90);
|
|
|
|
jobsView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
|
|
|
|
|
|
|
//Enable buttons
|
|
|
|
connect(buttonAddJob, SIGNAL(clicked()), this, SLOT(addButtonPressed()));
|
2012-01-28 16:40:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow(void)
|
|
|
|
{
|
|
|
|
}
|
2012-01-28 18:55:40 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Slots
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void MainWindow::addButtonPressed(void)
|
|
|
|
{
|
|
|
|
qWarning("Yeah!");
|
|
|
|
|
|
|
|
EncodeThread *thrd = new EncodeThread();
|
|
|
|
m_jobList->insertJob(thrd);
|
|
|
|
}
|