OSDN Git Service

Added option to delete jobs from the list + also added option to browse the output...
[x264-launcher/x264-launcher.git] / src / win_main.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
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.
9 //
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.
14 //
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.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #pragma once
23
24 #include "uic_win_main.h"
25 #include "thread_encode.h"
26
27 class JobListModel;
28 class OptionsModel;
29 class QFile;
30
31 class MainWindow: public QMainWindow, private Ui::MainWindow
32 {
33         Q_OBJECT
34
35 public:
36         MainWindow(bool x64supported);
37         ~MainWindow(void);
38
39 protected:
40         virtual void closeEvent(QCloseEvent *e);
41         virtual void showEvent(QShowEvent *e);
42         virtual void resizeEvent(QResizeEvent *e);
43         virtual bool eventFilter(QObject *o, QEvent *e);
44         virtual void dragEnterEvent(QDragEnterEvent *event);
45         virtual void dropEvent(QDropEvent *event);
46
47 private:
48         bool m_firstShow;
49         QLabel *m_label;
50
51         JobListModel *m_jobList;
52         OptionsModel *m_options;
53         QList<QFile*> m_toolsList;
54
55         const bool m_x64supported;
56         const QString m_appDir;
57         
58         void updateButtons(EncodeThread::JobStatus status);
59         bool havePendingJobs(void);
60         bool haveRunningJobs(void);
61
62 private slots:
63         void addButtonPressed(const QString &filePath = QString(), bool *ok = NULL);
64         void abortButtonPressed(void);
65         void browseButtonPressed(void);
66         void deleteButtonPressed(void);
67         void copyLogToClipboard(bool checked);
68         void init(void);
69         void jobSelected(const QModelIndex & current, const QModelIndex & previous);
70         void jobChangedData(const  QModelIndex &top, const  QModelIndex &bottom);
71         void jobLogExtended(const QModelIndex & parent, int start, int end);
72         void launchNextJob(void);
73         void pauseButtonPressed(bool checked);
74         void showAbout(void);
75         void showWebLink(void);
76         void startButtonPressed(void);
77         void updateLabel(void);
78 };