Better workaround for "ResizeToContents not updating" bug.
[LameXP.git] / src / Dialog_MainWindow.h
blobd593dc0dd72b716d01165aabd11165edd9cca722
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2011 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.
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 ///////////////////////////////////////////////////////////////////////////////
22 #pragma once
24 #include "../tmp/UIC_MainWindow.h"
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 class DropBox;
39 class MainWindow: public QMainWindow, private Ui::MainWindow
41 Q_OBJECT
43 public:
44 MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
45 ~MainWindow(void);
47 bool isAccepted() { return m_accepted; }
49 private slots:
50 void aboutButtonClicked(void);
51 void addFileDelayed(const QString &filePath, bool tryASAP = false);
52 void addFilesButtonClicked(void);
53 void addFilesDelayed(const QStringList &filePaths, bool tryASAP = false);
54 void addFavoriteFolderActionTriggered(void);
55 void addFolderDelayed(const QString &folderPath, bool recursive);
56 void aftenCodingModeChanged(int value);
57 void aftenDRCModeChanged(int value);
58 void aftenFastAllocationChanged(bool checked);
59 void aftenSearchSizeChanged(int value);
60 void autoDetectInstancesChanged(bool checked);
61 void bitrateManagementEnabledChanged(bool checked);
62 void bitrateManagementMaxChanged(int value);
63 void bitrateManagementMinChanged(int value);
64 void browseCustomTempFolderButtonClicked(void);
65 void channelModeChanged(int value);
66 void checkForBetaUpdatesActionTriggered(bool checked);
67 void checkUpdatesActionActivated(void);
68 void clearFilesButtonClicked(void);
69 void clearMetaButtonClicked(void);
70 void closeButtonClicked(void);
71 void customParamsChanged(void);
72 void customTempFolderChanged(const QString &text);
73 void disableNeroAacNotificationsActionTriggered(bool checked);
74 void disableShellIntegrationActionTriggered(bool);
75 void disableSlowStartupNotificationsActionTriggered(bool checked);
76 void disableSoundsActionTriggered(bool checked);
77 void disableUpdateReminderActionTriggered(bool checked);
78 void documentActionActivated(void);
79 void editMetaButtonClicked(void);
80 void encodeButtonClicked(void);
81 void fileDownButtonClicked(void);
82 void fileUpButtonClicked(void);
83 void findFileContextActionTriggered(void);
84 void forceStereoDownmixEnabledChanged(bool checked);
85 void gotoDesktopButtonClicked(void);
86 void gotoFavoriteFolder(void);
87 void gotoHomeFolderButtonClicked(void);
88 void gotoMusicFolderButtonClicked(void);
89 void handleDelayedFiles(void);
90 void importCueSheetActionTriggered(bool checked);
91 void initOutputFolderModel(void);
92 void languageActionActivated(QAction *action);
93 void languageFromFileActionActivated(bool checked);
94 void makeFolderButtonClicked(void);
95 void metaTagsEnabledChanged(void);
96 void neroAAC2PassChanged(bool checked);
97 void neroAACProfileChanged(int value);
98 void normalizationEnabledChanged(bool checked);
99 void normalizationMaxVolumeChanged(double volume);
100 void notifyOtherInstance(void);
101 void openFolderActionActivated(void);
102 void outputFolderContextMenu(const QPoint &pos);
103 void outputFolderViewClicked(const QModelIndex &index);
104 void outputFolderViewMoved(const QModelIndex &index);
105 void playlistEnabledChanged(void);
106 void prependRelativePathChanged(void);
107 void previewContextActionTriggered(void);
108 void removeFileButtonClicked(void);
109 void renameOutputEnabledChanged(bool checked);
110 void renameOutputPatternChanged(void);
111 void renameOutputPatternChanged(const QString &text);
112 void resetAdvancedOptionsButtonClicked(void);
113 void restoreCursor(void);
114 void samplingRateChanged(int value);
115 void saveToSourceFolderChanged(void);
116 void showDetailsButtonClicked(void);
117 void showDropBoxWidgetActionTriggered(bool checked);
118 void showFolderContextActionTriggered(void);
119 void showRenameMacros(const QString &text);
120 void sourceFilesContextMenu(const QPoint &pos);
121 void sourceFilesScrollbarMoved(int);
122 void sourceModelChanged(void);
123 void styleActionActivated(QAction *action);
124 void tabActionActivated(QAction *action);
125 void tabPageChanged(int idx);
126 void toneAdjustBassChanged(double value);
127 void toneAdjustTrebleChanged(double value);
128 void toneAdjustTrebleReset(void);
129 void updateBitrate(int value);
130 void updateEncoder(int id);
131 void updateLameAlgoQuality(int value);
132 void updateMaximumInstances(int value);
133 void updateRCMode(int id);
134 void useCustomTempFolderChanged(bool checked);
135 void visitHomepageActionActivated(void);
136 void windowShown(void);
138 protected:
139 void changeEvent(QEvent *e);
140 void closeEvent(QCloseEvent *event);
141 void dragEnterEvent(QDragEnterEvent *event);
142 void dropEvent(QDropEvent *event);
143 bool eventFilter(QObject *obj, QEvent *event);
144 void resizeEvent(QResizeEvent *event);
145 void showEvent(QShowEvent *event);
147 private:
148 void addFiles(const QStringList &files);
149 void addFolder(const QString &path, bool recursive = false, bool delayed = false);
150 bool checkForUpdates(void);
151 void refreshFavorites(void);
153 bool m_accepted;
154 bool m_firstTimeShown;
155 bool m_OutputFolderViewInitialized;
157 const bool m_neroEncoderAvailable;
158 const bool m_fhgEncoderAvailable;
160 WorkingBanner *m_banner;
161 QStringList *m_delayedFileList;
162 QTimer *m_delayedFileTimer;
163 DropBox *m_dropBox;
164 QLabel *m_dropNoteLabel;
165 FileListModel *m_fileListModel;
166 QFileSystemModelEx *m_fileSystemModel;
167 MessageHandlerThread *m_messageHandler;
168 AudioFileModel *m_metaData;
169 MetaInfoModel *m_metaInfoModel;
170 QMenu *m_outputFolderContextMenu;
171 SettingsModel *m_settings;
172 QMenu *m_sourceFilesContextMenu;
173 QMenu *m_outputFolderFavoritesMenu;
175 QAction *m_findFileContextAction;
176 QAction *m_previewContextAction;
177 QAction *m_showDetailsContextAction;
178 QAction *m_showFolderContextAction;
179 QAction *m_addFavoriteFolderAction;
180 QActionGroup *m_languageActionGroup;
181 QActionGroup *m_styleActionGroup;
182 QActionGroup *m_tabActionGroup;
183 QButtonGroup *m_encoderButtonGroup;
184 QButtonGroup *m_modeButtonGroup;