-
Notifications
You must be signed in to change notification settings - Fork 6
/
mainwindow.h
228 lines (198 loc) · 6.57 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QApplication>
#include <QPainter>
#include <QStandardItemModel>
#include <QTableWidgetItem>
#include <QScrollBar>
#include <QDesktopServices>
#include <QJsonDocument>
#include <QMetaMethod>
#include <QSystemTrayIcon>
#include <QWinTaskbarButton>
#include <QWinTaskbarProgress>
#include <QWinThumbnailToolBar>
#include <QWinThumbnailToolButton>
#include <QWinJumpList>
#include <QWinJumpListItem>
#include <QWinJumpListCategory>
#include "job/job_creator.h"
#include "job/job_cmdlist.h"
#include "job/job_chef.h"
#include "job/job_item.h"
#include "job/job_view_cmd.h"
#include "com/common.h"
#include "com/logging.h"
#include "com/timer.h"
#include "com/mail_box.h"
#include "com/config.h"
#undef QT_PLASH
#ifndef QT_DEBUG
#define QT_PLASH
#endif
class AudioEnc;
class Muxer;
class Demuxer;
class ScriptPlayer;
class MediaInfoDialog;
class InstallerDialog;
class PreviewDialog;
class ScriptCreator;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
friend class Timer;
friend class AudioEnc;
friend class Muxer;
friend class Demuxer;
friend class MediaInfo;
friend class AudioConfig;
friend class ScriptPlayer;
friend class InstallerDialog;
friend class PreviewDialog;
friend class ScriptCreator;
friend class StdWatcher;
enum ETAB
{
eTAB_MAIN,
eTAB_AUDIO,
eTAB_MUXER,
eTAB_EXTRA,
eTAB_MEDIAINFO,
eTAB_MAX,
};
void modeLaunch(void);
void setLanguage(Config::ELANGUAGE a_language);
Config::ELANGUAGE language(void);
void execJobCreator(JobCreator::EJOB_RELOAD a_job_reload, QString a_filename = QT_EMPTY);
void acceptedJobCreator(JobCreator::EJOB_RELOAD a_job_reload);
void saveJob(JobItem a_job_item, JobCreator::EJOB_RELOAD a_job_reload);
void viewLog(JobChef::EJOB_LOG_TYPE a_log_type, const QString &a_log);
void setDetailLog(const QString &a_log);
bool isStarted(void);
bool isPaused(void);
bool isAborted(void);
void setStartJobImmediately(bool a_set);
void logging(const QString &a_log);
QList<JobItem> m_jobs;
int m_jobs_index;
JobChef *m_job_chef;
Logging *m_logging;
QMenu *m_pJobViewMenu;
QMenu *m_pLogViewMenu;
QSystemTrayIcon *m_pSystemTray;
QWinTaskbarButton *m_pTaskbarButton;
QWinThumbnailToolBar *m_pThumbnailToolBar;
QWinJumpList m_jumpList;
QScopedPointer<QLabel> m_label[eINDEX_1];
JobChef::EJOB_STATUS m_job_status_prev;
signals:
void ntfStartJob(void);
void ntfFailJob(void);
void ntfStatusChanged(JobChef::EJOB_STATUS a_job_status);
public slots:
void slotChildWindowClosed(QUuid a_uid);
void slotTimeout(int a_timerType, int a_timerSlot);
bool slotMail(EMODULE a_module, STMAILBOX* a_mail_box);
private slots:
bool isEmptyJobs(void);
bool isSkipJob(void);
void reqJobStart(void);
void initJob(void);
void startJob(void);
void failJob(void);
void pauseJob(void);
void resumeJob(void);
void abortJob(void);
void exploreJob(void);
void editJob(void);
void viewJobCmd(void);
void resetJob(void);
void delJob(void);
void moveUpJob(void);
void moveDownJob(void);
void slotPreview(void);
void allCompleted(void);
void commandRecived(const QString &a_cmd);
void updateLabelPos(void);
void updateViewHeaderWidth(void);
void showPreferences(void);
void showInstaller(void);
void statusChanged(JobChef::EJOB_STATUS a_job_status);
bool slotChildWindowClosedRemove(QUuid a_uid);
void logCopy(void);
void logClear(void);
void logSave(void);
void logSetWrapped(bool a_enable);
void languageChanged(void);
void openCommandLine(void);
void openPython(void);
void openPreviewDialog(void);
void openScriptCreator(void);
void openScriptBlockly(void);
void openScriptPlayer(void);
void openTools(void);
void selectOpenfile(void);
void slotMinimize(void);
void slotTrayActivated(QSystemTrayIcon::ActivationReason a_reason);
void slotViewJobsLog(void);
void slotAudioBatchEncStarted(void);
void cleanUpAll(void);
void cleanUpFinished(void);
void cleanLoggingFile(void);
int getFirstJobStatusIndex(JobChef::EJOB_STATUS a_status);
void cleanUpStatusAll(JobChef::EJOB_STATUS a_status);
void slotOpenUrl(void);
void slotAbout(void);
void slotAboutQt(void);
void on_buttonAddJob_clicked(void);
void on_buttonStartJob_clicked(void);
void on_jobsView_itemDoubleClicked(QTableWidgetItem *a_item);
void on_buttonPauseJob_clicked(bool a_checked);
void on_buttonAbortJob_clicked(void);
void on_jobsView_customContextMenuRequested(const QPoint &a_pos);
void on_logView_customContextMenuRequested(const QPoint &a_pos);
private:
Ui::MainWindow *ui;
bool m_isAborted;
QActionGroup *m_pActionGruopOnCompletion;
QActionGroup *m_pActionGruopLanguage;
void showShutdownMessage(Common::ESHUTDOWN a_shutdown);
QString getShutdownTitle(Common::ESHUTDOWN a_shutdown);
void setShutCountMessage(void);
QMessageBox *m_pMsgBoxShutdown;
unsigned int m_count4shutdown;
bool m_isStartJobImmediately;
void setupUi(void);
void setAcctions(void);
void setJumpListItems(void);
void bindWinTaskbar();
QString getJobStatusText(JobChef::EJOB_STATUS a_job_status);
QIcon getJobStatusIcon(JobChef::EJOB_STATUS a_job_status);
void appendItems(QStringList a_contents);
void addItem(int a_row, int a_col, QString a_content);
void addItem(int a_row, int a_col, QString a_content, QIcon a_icon);
void releaseChildWindowsAll(void);
void setInsertTextColor(QColor a_color, int a_length);
protected:
virtual bool eventFilter(QObject *o, QEvent *e);
virtual void keyPressEvent(QKeyEvent * e);
virtual void dragEnterEvent(QDragEnterEvent *e);
virtual void dropEvent(QDropEvent *e);
virtual void dragMoveEvent(QDragMoveEvent *e);
virtual void resizeEvent(QResizeEvent* e);
virtual void showEvent(QShowEvent *e);
virtual void closeEvent(QCloseEvent *e);
virtual void focusInEvent(QFocusEvent *e);
virtual void focusOutEvent(QFocusEvent *e);
virtual void enterEvent(QEvent *e);
virtual void leaveEvent(QEvent *e);
};
#endif // MAINWINDOW_H