1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2015 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 ///////////////////////////////////////////////////////////////////////////////
28 #include <QMainWindow>
35 class PreferencesModel;
37 class InputEventFilter;
40 class QSystemTrayIcon;
54 typedef struct _cpu_info_t cpu_info_t;
61 class MainWindow: public QMainWindow
66 MainWindow(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, MUtils::IPCChannel *const ipcChannel);
69 typedef QList<QFile*> QFileList;
72 virtual void closeEvent(QCloseEvent *e);
73 virtual void showEvent(QShowEvent *e);
74 virtual void resizeEvent(QResizeEvent *e);
75 virtual void dragEnterEvent(QDragEnterEvent *event);
76 virtual void dropEvent(QDropEvent *event);
79 Ui::MainWindow *const ui;
80 MUtils::IPCChannel *const m_ipcChannel;
83 QScopedPointer<QLabel> m_label;
84 QScopedPointer<QTimer> m_fileTimer;
86 QScopedPointer<IPCThread_Recv> m_ipcThread;
87 QScopedPointer<MUtils::Taskbar7> m_taskbar;
88 QScopedPointer<QSystemTrayIcon> m_sysTray;
90 QScopedPointer<InputEventFilter> m_inputFilter_jobList;
91 QScopedPointer<InputEventFilter> m_inputFilter_version;
92 QScopedPointer<InputEventFilter> m_inputFilter_checkUp;
94 QScopedPointer<JobListModel> m_jobList;
95 QScopedPointer<OptionsModel> m_options;
96 QScopedPointer<QStringList> m_pendingFiles;
97 QScopedPointer<QFileList> m_toolsList;
99 QScopedPointer<SysinfoModel> m_sysinfo;
100 QScopedPointer<PreferencesModel> m_preferences;
101 QScopedPointer<RecentlyUsed> m_recentlyUsed;
103 bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
104 bool createJobMultiple(const QStringList &filePathIn);
106 bool appendJob(const QString &sourceFileName, const QString &outputFileName, OptionsModel *options, const bool runImmediately);
107 void updateButtons(JobStatus status);
108 void updateTaskbar(JobStatus status, const QIcon &icon);
109 unsigned int countPendingJobs(void);
110 unsigned int countRunningJobs(void);
112 bool parseCommandLineArgs(void);
115 void addButtonPressed();
116 void openActionTriggered();
117 void abortButtonPressed(void);
118 void browseButtonPressed(void);
119 void deleteButtonPressed(void);
120 void copyLogToClipboard(bool checked);
121 void checkUpdates(void);
122 void handlePendingFiles(void);
124 void handleCommand(const int &command, const QStringList &args, const quint32 &flags = 0);
125 void jobSelected(const QModelIndex ¤t, const QModelIndex &previous);
126 void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
127 void jobLogExtended(const QModelIndex & parent, int start, int end);
128 void jobListKeyPressed(const int &tag);
129 void launchNextJob();
130 void moveButtonPressed(void);
131 void pauseButtonPressed(bool checked);
132 void restartButtonPressed(void);
133 void saveLogFile(const QModelIndex &index);
134 void showAbout(void);
135 void showPreferences(void);
136 void showWebLink(void);
137 void shutdownComputer(void);
138 void startButtonPressed(void);
139 void sysTrayActived(void);
140 void updateLabelPos(void);
141 void versionLabelMouseClicked(const int &tag);