2012-01-29 04:06:07 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Simple x264 Launcher
|
2016-01-01 23:59:55 +01:00
|
|
|
// Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
|
2012-01-29 04:06:07 +01:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-11-14 02:29:18 +01:00
|
|
|
#include <QDialog>
|
2012-02-02 13:52:52 +01:00
|
|
|
|
2012-01-29 19:14:46 +01:00
|
|
|
class OptionsModel;
|
2013-07-03 21:34:21 +02:00
|
|
|
class RecentlyUsed;
|
2014-02-12 21:36:10 +01:00
|
|
|
class SysinfoModel;
|
|
|
|
class PreferencesModel;
|
2014-04-11 15:33:02 +02:00
|
|
|
class AbstractEncoderInfo;
|
2013-11-14 02:29:18 +01:00
|
|
|
class QComboBox;
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class AddJobDialog;
|
|
|
|
}
|
2012-01-29 19:14:46 +01:00
|
|
|
|
2013-11-14 02:29:18 +01:00
|
|
|
class AddJobDialog : public QDialog
|
2012-01-29 04:06:07 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-02-12 21:36:10 +01:00
|
|
|
AddJobDialog(QWidget *parent, OptionsModel *const options, RecentlyUsed *const recentlyUsed, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences);
|
2013-05-08 22:46:25 +02:00
|
|
|
~AddJobDialog(void);
|
|
|
|
|
2012-01-29 21:31:09 +01:00
|
|
|
QString sourceFile(void);
|
|
|
|
QString outputFile(void);
|
2014-02-10 21:33:04 +01:00
|
|
|
|
2013-11-14 02:29:18 +01:00
|
|
|
bool runImmediately(void);
|
|
|
|
bool applyToAll(void);
|
|
|
|
void setRunImmediately(bool run);
|
|
|
|
void setSourceFile(const QString &path);
|
|
|
|
void setOutputFile(const QString &path);
|
|
|
|
void setSourceEditable(const bool editable);
|
|
|
|
void setApplyToAllVisible(const bool visible);
|
2013-05-08 00:04:40 +02:00
|
|
|
|
|
|
|
static QString generateOutputFileName(const QString &sourceFilePath, const QString &destinationDirectory, const int filterIndex, const bool saveToSourceDir);
|
|
|
|
static int getFilterIdx(const QString &fileExt);
|
|
|
|
static QString getFilterExt(const int filterIndex);
|
2013-05-08 22:46:25 +02:00
|
|
|
static QString AddJobDialog::getFilterStr(const int filterIndex);
|
|
|
|
static QString getFilterLst(void);
|
|
|
|
static QString getInputFilterLst(void);
|
2012-01-29 15:57:23 +01:00
|
|
|
|
2012-01-29 04:06:07 +01:00
|
|
|
protected:
|
2014-02-12 21:36:10 +01:00
|
|
|
OptionsModel *const m_options;
|
|
|
|
RecentlyUsed *const m_recentlyUsed;
|
2013-05-08 00:04:40 +02:00
|
|
|
|
2014-02-12 21:36:10 +01:00
|
|
|
const SysinfoModel *const m_sysinfo;
|
|
|
|
const PreferencesModel *const m_preferences;
|
|
|
|
const OptionsModel *m_defaults;
|
2012-02-03 12:31:51 +01:00
|
|
|
|
2012-01-31 00:13:32 +01:00
|
|
|
virtual void showEvent(QShowEvent *event);
|
|
|
|
virtual bool eventFilter(QObject *o, QEvent *e);
|
2012-02-10 18:42:16 +01:00
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
2012-01-29 04:06:07 +01:00
|
|
|
|
|
|
|
private slots:
|
2014-02-10 21:33:04 +01:00
|
|
|
void encoderIndexChanged(int index);
|
2014-02-12 21:36:10 +01:00
|
|
|
void variantIndexChanged(int index);
|
2012-01-29 04:06:07 +01:00
|
|
|
void modeIndexChanged(int index);
|
2012-01-29 15:57:23 +01:00
|
|
|
void browseButtonClicked(void);
|
2012-01-31 03:03:17 +01:00
|
|
|
void configurationChanged(void);
|
|
|
|
void templateSelected(void);
|
2012-01-31 22:30:21 +01:00
|
|
|
void saveTemplateButtonClicked(void);
|
|
|
|
void deleteTemplateButtonClicked(void);
|
2012-02-16 02:08:46 +01:00
|
|
|
void editorActionTriggered(void);
|
2012-02-16 14:33:26 +01:00
|
|
|
void copyActionTriggered(void);
|
|
|
|
void pasteActionTriggered(void);
|
2012-01-29 15:57:23 +01:00
|
|
|
|
|
|
|
virtual void accept(void);
|
2012-01-29 19:14:46 +01:00
|
|
|
|
|
|
|
private:
|
2013-11-14 02:29:18 +01:00
|
|
|
Ui::AddJobDialog *const ui;
|
2014-04-16 20:20:31 +02:00
|
|
|
bool m_monitorConfigChanges;
|
2014-10-11 17:20:05 +02:00
|
|
|
QString m_lastTemplateName;
|
2013-11-14 02:29:18 +01:00
|
|
|
|
2012-01-31 22:30:21 +01:00
|
|
|
void loadTemplateList(void);
|
2014-02-12 21:36:10 +01:00
|
|
|
void restoreOptions(const OptionsModel *options);
|
2012-01-29 19:14:46 +01:00
|
|
|
void saveOptions(OptionsModel *options);
|
2015-08-02 21:16:36 +02:00
|
|
|
void updateComboBox(QComboBox *const cbox, const QString &text);
|
|
|
|
void updateComboBox(QComboBox *const cbox, const int &data);
|
2016-05-08 16:30:31 +02:00
|
|
|
void updateComboBox(QComboBox *const cbox, const quint32 &data);
|
2013-05-11 01:50:05 +02:00
|
|
|
|
|
|
|
QString currentSourcePath(const bool bWithName = false);
|
|
|
|
QString currentOutputPath(const bool bWithName = false);
|
|
|
|
int currentOutputIndx(void);
|
2012-01-29 04:06:07 +01:00
|
|
|
};
|