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 ///////////////////////////////////////////////////////////////////////////////
25 #include <QMainWindow>
33 class PreferencesModel;
35 class InputEventFilter;
45 class MainWindow: public QMainWindow
50 MainWindow(const x264_cpu_t *const cpuFeatures, IPC *ipc);
54 virtual void closeEvent(QCloseEvent *e);
55 virtual void showEvent(QShowEvent *e);
56 virtual void resizeEvent(QResizeEvent *e);
57 virtual void dragEnterEvent(QDragEnterEvent *event);
58 virtual void dropEvent(QDropEvent *event);
59 virtual bool winEvent(MSG *message, long *result);
72 Ui::MainWindow *const ui;
74 x264_status_t m_status;
79 InputEventFilter *m_inputFilter_jobList;
80 InputEventFilter *m_inputFilter_version;
81 InputEventFilter *m_inputFilter_checkUp;
83 JobListModel *m_jobList;
84 OptionsModel *m_options;
85 QStringList *m_pendingFiles;
86 QList<QFile*> m_toolsList;
88 SysinfoModel *m_sysinfo;
89 PreferencesModel *m_preferences;
90 RecentlyUsed *m_recentlyUsed;
92 bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
93 bool createJobMultiple(const QStringList &filePathIn);
95 bool appendJob(const QString &sourceFileName, const QString &outputFileName, OptionsModel *options, const bool runImmediately);
96 void updateButtons(JobStatus status);
97 void updateTaskbar(JobStatus status, const QIcon &icon);
98 unsigned int countPendingJobs(void);
99 unsigned int countRunningJobs(void);
101 bool parseCommandLineArgs(void);
104 void addButtonPressed();
105 void openActionTriggered();
106 void abortButtonPressed(void);
107 void browseButtonPressed(void);
108 void deleteButtonPressed(void);
109 void copyLogToClipboard(bool checked);
110 void checkUpdates(void);
111 void handlePendingFiles(void);
113 void handleCommand(const int &command, const QStringList &args, const quint32 &flags = 0);
114 void jobSelected(const QModelIndex ¤t, const QModelIndex &previous);
115 void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
116 void jobLogExtended(const QModelIndex & parent, int start, int end);
117 void jobListKeyPressed(const int &tag);
118 void launchNextJob();
119 void moveButtonPressed(void);
120 void pauseButtonPressed(bool checked);
121 void restartButtonPressed(void);
122 void saveLogFile(const QModelIndex &index);
123 void showAbout(void);
124 void showPreferences(void);
125 void showWebLink(void);
126 void shutdownComputer(void);
127 void startButtonPressed(void);
128 void updateLabelPos(void);
129 void versionLabelMouseClicked(const int &tag);