Simple-x264-Launcher/src/win_addJob.h

107 lines
3.4 KiB
C
Raw Normal View History

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
#include <QDialog>
2012-02-02 13:52:52 +01:00
2012-01-29 19:14:46 +01:00
class OptionsModel;
class RecentlyUsed;
class SysinfoModel;
class PreferencesModel;
class AbstractEncoderInfo;
class QComboBox;
namespace Ui
{
class AddJobDialog;
}
2012-01-29 19:14:46 +01:00
class AddJobDialog : public QDialog
2012-01-29 04:06:07 +01:00
{
Q_OBJECT
public:
AddJobDialog(QWidget *parent, OptionsModel *const options, RecentlyUsed *const recentlyUsed, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences);
~AddJobDialog(void);
QString sourceFile(void);
QString outputFile(void);
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);
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);
static QString AddJobDialog::getFilterStr(const int filterIndex);
static QString getFilterLst(void);
static QString getInputFilterLst(void);
2012-01-29 04:06:07 +01:00
protected:
OptionsModel *const m_options;
RecentlyUsed *const m_recentlyUsed;
const SysinfoModel *const m_sysinfo;
const PreferencesModel *const m_preferences;
const OptionsModel *m_defaults;
virtual void showEvent(QShowEvent *event);
virtual bool eventFilter(QObject *o, QEvent *e);
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
2012-01-29 04:06:07 +01:00
private slots:
void encoderIndexChanged(int index);
void variantIndexChanged(int index);
2012-01-29 04:06:07 +01:00
void modeIndexChanged(int index);
void browseButtonClicked(void);
void configurationChanged(void);
void templateSelected(void);
void saveTemplateButtonClicked(void);
void deleteTemplateButtonClicked(void);
void editorActionTriggered(void);
void copyActionTriggered(void);
void pasteActionTriggered(void);
virtual void accept(void);
2012-01-29 19:14:46 +01:00
private:
Ui::AddJobDialog *const ui;
bool m_monitorConfigChanges;
QString m_lastTemplateName;
void loadTemplateList(void);
void restoreOptions(const OptionsModel *options);
2012-01-29 19:14:46 +01:00
void saveOptions(OptionsModel *options);
void updateComboBox(QComboBox *const cbox, const QString &text);
void updateComboBox(QComboBox *const cbox, const int &data);
QString currentSourcePath(const bool bWithName = false);
QString currentOutputPath(const bool bWithName = false);
int currentOutputIndx(void);
2012-01-29 04:06:07 +01:00
};