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>
36 class PreferencesModel
;
38 class InputEventFilter
;
41 class QSystemTrayIcon
;
54 typedef struct _cpu_info_t cpu_info_t
;
58 class MainWindow
: public QMainWindow
63 MainWindow(const MUtils::CPUFetaures::cpu_info_t
&cpuFeatures
);
67 virtual void closeEvent(QCloseEvent
*e
);
68 virtual void showEvent(QShowEvent
*e
);
69 virtual void resizeEvent(QResizeEvent
*e
);
70 virtual void dragEnterEvent(QDragEnterEvent
*event
);
71 virtual void dropEvent(QDropEvent
*event
);
72 virtual bool winEvent(MSG
*message
, long *result
);
75 Ui::MainWindow
*const ui
;
82 QSystemTrayIcon
*const m_sysTray
;
84 InputEventFilter
*m_inputFilter_jobList
;
85 InputEventFilter
*m_inputFilter_version
;
86 InputEventFilter
*m_inputFilter_checkUp
;
88 JobListModel
*m_jobList
;
89 OptionsModel
*m_options
;
90 QStringList
*m_pendingFiles
;
91 QList
<QFile
*> m_toolsList
;
93 SysinfoModel
*m_sysinfo
;
94 PreferencesModel
*m_preferences
;
95 RecentlyUsed
*m_recentlyUsed
;
97 bool createJob(QString
&sourceFileName
, QString
&outputFileName
, OptionsModel
*options
, bool &runImmediately
, const bool restart
= false, int fileNo
= -1, int fileTotal
= 0, bool *applyToAll
= NULL
);
98 bool createJobMultiple(const QStringList
&filePathIn
);
100 bool appendJob(const QString
&sourceFileName
, const QString
&outputFileName
, OptionsModel
*options
, const bool runImmediately
);
101 void updateButtons(JobStatus status
);
102 void updateTaskbar(JobStatus status
, const QIcon
&icon
);
103 unsigned int countPendingJobs(void);
104 unsigned int countRunningJobs(void);
106 bool parseCommandLineArgs(void);
109 void addButtonPressed();
110 void openActionTriggered();
111 void abortButtonPressed(void);
112 void browseButtonPressed(void);
113 void deleteButtonPressed(void);
114 void copyLogToClipboard(bool checked
);
115 void checkUpdates(void);
116 void handlePendingFiles(void);
118 void handleCommand(const int &command
, const QStringList
&args
, const quint32
&flags
= 0);
119 void jobSelected(const QModelIndex
¤t
, const QModelIndex
&previous
);
120 void jobChangedData(const QModelIndex
&top
, const QModelIndex
&bottom
);
121 void jobLogExtended(const QModelIndex
& parent
, int start
, int end
);
122 void jobListKeyPressed(const int &tag
);
123 void launchNextJob();
124 void moveButtonPressed(void);
125 void pauseButtonPressed(bool checked
);
126 void restartButtonPressed(void);
127 void saveLogFile(const QModelIndex
&index
);
128 void showAbout(void);
129 void showPreferences(void);
130 void showWebLink(void);
131 void shutdownComputer(void);
132 void startButtonPressed(void);
133 void sysTrayActived(void);
134 void updateLabelPos(void);
135 void versionLabelMouseClicked(const int &tag
);