OSDN Git Service

Implement update reminder + added options to disable the update reminder and/or the...
[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 class QMenu;
37
38 class MainWindow: public QMainWindow, private Ui::MainWindow
39 {
40         Q_OBJECT
41
42 public:
43         MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
44         ~MainWindow(void);
45
46         bool isAccepted() { return m_accepted; }
47
48 private slots:
49         void windowShown(void);
50         void aboutButtonClicked(void);
51         void encodeButtonClicked(void);
52         void closeButtonClicked(void);
53         void addFilesButtonClicked(void);
54         void clearFilesButtonClicked(void);
55         void removeFileButtonClicked(void);
56         void fileDownButtonClicked(void);
57         void fileUpButtonClicked(void);
58         void showDetailsButtonClicked(void);
59         void tabPageChanged(int idx);
60         void tabActionActivated(QAction *action);
61         void styleActionActivated(QAction *action);
62         void outputFolderViewClicked(const QModelIndex &index);
63         void makeFolderButtonClicked(void);
64         void gotoHomeFolderButtonClicked(void);
65         void gotoDesktopButtonClicked(void);
66         void gotoMusicFolderButtonClicked(void);
67         void checkUpdatesActionActivated(void);
68         void visitHomepageActionActivated(void);
69         void openFolderActionActivated(void);
70         void notifyOtherInstance(void);
71         void addFileDelayed(const QString &filePath);
72         void handleDelayedFiles(void);
73         void editMetaButtonClicked(void);
74         void clearMetaButtonClicked(void);
75         void updateEncoder(int id);
76         void updateRCMode(int id);
77         void updateBitrate(int value);
78         void sourceModelChanged(void);
79         void metaTagsEnabledChanged(void);
80         void playlistEnabledChanged(void);
81         void saveToSourceFolderChanged(void);
82         void restoreCursor(void);
83         void sourceFilesContextMenu(const QPoint &pos);
84         void previewContextActionTriggered(void);
85         void findFileContextActionTriggered(void);
86         void disableUpdateReminderActionTriggered(bool checked);
87         void disableSoundsActionTriggered(bool checked);
88
89 protected:
90         void showEvent(QShowEvent *event);
91         void dragEnterEvent(QDragEnterEvent *event);
92         void dropEvent(QDropEvent *event);
93         void closeEvent(QCloseEvent *event);
94         void resizeEvent(QResizeEvent *event);
95         bool eventFilter(QObject *obj, QEvent *event);
96
97 private:
98         void addFiles(const QStringList &files);
99
100         bool m_accepted;
101         bool m_firstTimeShown;
102         FileListModel *m_fileListModel;
103         QFileSystemModelEx *m_fileSystemModel;
104         QActionGroup *m_tabActionGroup;
105         QActionGroup *m_styleActionGroup;
106         QButtonGroup *m_encoderButtonGroup;
107         QButtonGroup *m_modeButtonGroup;
108         WorkingBanner *m_banner;
109         MessageHandlerThread *m_messageHandler;
110         QStringList *m_delayedFileList;
111         QTimer *m_delayedFileTimer;
112         AudioFileModel *m_metaData;
113         MetaInfoModel *m_metaInfoModel;
114         SettingsModel *m_settings;
115         QLabel *m_dropNoteLabel;
116         QMenu *m_sourceFilesContextMenu;
117 };