/////////////////////////////////////////////////////////////////////////////// // Simple x264 Launcher // Copyright (C) 2004-2012 LoRd_MuldeR // // 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" #include "global.h" #include "model_jobList.h" #include /////////////////////////////////////////////////////////////////////////////// // Constructor & Destructor /////////////////////////////////////////////////////////////////////////////// MainWindow::MainWindow(void) { //Init the dialog, from the .ui file setupUi(this); setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint); //Register meta types qRegisterMetaType("QUuid"); qRegisterMetaType("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())); } MainWindow::~MainWindow(void) { } /////////////////////////////////////////////////////////////////////////////// // Slots /////////////////////////////////////////////////////////////////////////////// void MainWindow::addButtonPressed(void) { qWarning("Yeah!"); EncodeThread *thrd = new EncodeThread(); m_jobList->insertJob(thrd); }