1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
35 class AddJobDialog : public QDialog
40 AddJobDialog(QWidget *parent, OptionsModel *options, RecentlyUsed *recentlyUsed, bool x64supported, bool use10BitEncoding, bool saveToSourceFolder);
43 QString sourceFile(void);
44 QString outputFile(void);
47 QString profile(void);
49 bool runImmediately(void);
50 bool applyToAll(void);
51 void setRunImmediately(bool run);
52 void setSourceFile(const QString &path);
53 void setOutputFile(const QString &path);
54 void setSourceEditable(const bool editable);
55 void setApplyToAllVisible(const bool visible);
57 static QString generateOutputFileName(const QString &sourceFilePath, const QString &destinationDirectory, const int filterIndex, const bool saveToSourceDir);
58 static int getFilterIdx(const QString &fileExt);
59 static QString getFilterExt(const int filterIndex);
60 static QString AddJobDialog::getFilterStr(const int filterIndex);
61 static QString getFilterLst(void);
62 static QString getInputFilterLst(void);
65 OptionsModel *m_options;
66 OptionsModel *m_defaults;
67 RecentlyUsed *m_recentlyUsed;
69 const bool m_x64supported;
70 const bool m_use10BitEncoding;
71 const bool m_saveToSourceFolder;
73 virtual void showEvent(QShowEvent *event);
74 virtual bool eventFilter(QObject *o, QEvent *e);
75 virtual void dragEnterEvent(QDragEnterEvent *event);
76 virtual void dropEvent(QDropEvent *event);
79 void modeIndexChanged(int index);
80 void browseButtonClicked(void);
81 void configurationChanged(void);
82 void templateSelected(void);
83 void saveTemplateButtonClicked(void);
84 void deleteTemplateButtonClicked(void);
85 void editorActionTriggered(void);
86 void copyActionTriggered(void);
87 void pasteActionTriggered(void);
89 virtual void accept(void);
92 Ui::AddJobDialog *const ui;
94 void loadTemplateList(void);
95 void restoreOptions(OptionsModel *options);
96 void saveOptions(OptionsModel *options);
97 void updateComboBox(QComboBox *cbox, const QString &text);
99 QString currentSourcePath(const bool bWithName = false);
100 QString currentOutputPath(const bool bWithName = false);
101 int currentOutputIndx(void);