OSDN Git Service

Implement a custom FileSystemModel class derived from QFileSystemModel in order to...
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2010 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 "../tmp/UIC_MainWindow.h"
25
26 //Class declarations
27 class QFileSystemModelEx;
28 class WorkingBanner;
29 class MessageHandlerThread;
30 class AudioFileModel;
31 class MetaInfoModel;
32 class SettingsModel;
33 class QButtonGroup;
34 class FileListModel;
35 class AbstractEncoder;
36
37 class MainWindow: public QMainWindow, private Ui::MainWindow
38 {
39         Q_OBJECT
40
41 public:
42         MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
43         ~MainWindow(void);
44
45         bool isAccepted() { return m_accepted; }
46
47 private slots:
48         void windowShown(void);
49         void aboutButtonClicked(void);
50         void encodeButtonClicked(void);
51         void closeButtonClicked(void);
52         void addFilesButtonClicked(void);
53         void clearFilesButtonClicked(void);
54         void removeFileButtonClicked(void);
55         void fileDownButtonClicked(void);
56         void fileUpButtonClicked(void);
57         void showDetailsButtonClicked(void);
58         void tabPageChanged(int idx);
59         void tabActionActivated(QAction *action);
60         void styleActionActivated(QAction *action);
61         void outputFolderViewClicked(const QModelIndex &index);
62         void makeFolderButtonClicked(void);
63         void gotoHomeFolderButtonClicked(void);
64         void gotoDesktopButtonClicked(void);
65         void gotoMusicFolderButtonClicked(void);
66         void checkUpdatesActionActivated(void);
67         void visitHomepageActionActivated(void);
68         void openFolderActionActivated(void);
69         void notifyOtherInstance(void);
70         void addFileDelayed(const QString &filePath);
71         void handleDelayedFiles(void);
72         void editMetaButtonClicked(void);
73         void clearMetaButtonClicked(void);
74         void updateEncoder(int id);
75         void updateRCMode(int id);
76         void updateBitrate(int value);
77         void sourceModelChanged(void);
78         void metaTagsEnabledChanged(void);
79         void playlistEnabledChanged(void);
80         void saveToSourceFolderChanged(void);
81         void restoreCursor(void);
82
83 protected:
84         void showEvent(QShowEvent *event);
85         void dragEnterEvent(QDragEnterEvent *event);
86         void dropEvent(QDropEvent *event);
87         void closeEvent(QCloseEvent *event);
88         void resizeEvent(QResizeEvent *event);
89         bool eventFilter(QObject *obj, QEvent *event);
90
91 private:
92         void addFiles(const QStringList &files);
93
94         bool m_accepted;
95         bool m_firstTimeShown;
96         FileListModel *m_fileListModel;
97         QFileSystemModelEx *m_fileSystemModel;
98         QActionGroup *m_tabActionGroup;
99         QActionGroup *m_styleActionGroup;
100         QButtonGroup *m_encoderButtonGroup;
101         QButtonGroup *m_modeButtonGroup;
102         WorkingBanner *m_banner;
103         MessageHandlerThread *m_messageHandler;
104         QStringList *m_delayedFileList;
105         QTimer *m_delayedFileTimer;
106         AudioFileModel *m_metaData;
107         MetaInfoModel *m_metaInfoModel;
108         SettingsModel *m_settings;
109         QLabel *m_dropNoteLabel;
110 };