OSDN Git Service

Added menu entry for the User's Manual + improved code for opening document links.
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
index c962ac3..1f95df2 100644 (file)
@@ -1,11 +1,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
+// (at your option) any later version, but always including the *additional*
+// restrictions defined in the "License.txt" file.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 #pragma once
 
-#include "../tmp/UIC_MainWindow.h"
+#include <QMainWindow>
 
 //Class declarations
-class QFileSystemModelEx;
-class WorkingBanner;
-class MessageHandlerThread;
+class AbstractEncoder;
 class AudioFileModel;
+class AudioFileModel_MetaInfo;
+class CustomEventFilter;
+class DropBox;
+class FileListModel;
+class MessageHandlerThread;
 class MetaInfoModel;
-class SettingsModel;
+class QActionGroup;
 class QButtonGroup;
-class FileListModel;
-class AbstractEncoder;
+class QFileSystemModelEx;
+class QLabel;
 class QMenu;
-class DropBox;
-class CustomEventFilter;
+class QUrl;
+class QModelIndex;
+class SettingsModel;
+class WorkingBanner;
+class lamexp_icon_t;
 
-class MainWindow: public QMainWindow, private Ui::MainWindow
+//UIC forward declartion
+namespace Ui
+{
+       class MainWindow;
+}
+
+//IPC forward declartion
+namespace MUtils
+{
+       class IPCChannel;
+}
+
+//MainWindow class
+class MainWindow: public QMainWindow
 {
        Q_OBJECT
 
 public:
-       MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, SettingsModel *settingsModel, QWidget *parent = 0);
+       MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *const fileListModel, AudioFileModel_MetaInfo *const metaInfo, SettingsModel *const settingsModel, QWidget *const parent = 0);
        ~MainWindow(void);
 
        bool isAccepted() { return m_accepted; }
@@ -72,6 +92,7 @@ private slots:
        void clearMetaButtonClicked(void);
        void closeButtonClicked(void);
        void compressionTabEventOccurred(QWidget*, QEvent*);
+       void cornerWidgetEventOccurred(QWidget *sender, QEvent *event);
        void customParamsChanged(void);
        void customParamsHelpRequested(QWidget *obj, QEvent *event);
        void customTempFolderChanged(const QString &text);
@@ -92,7 +113,9 @@ private slots:
        void gotoFavoriteFolder(void);
        void gotoHomeFolderButtonClicked(void);
        void gotoMusicFolderButtonClicked(void);
+       void goUpFolderContextActionTriggered(void);
        void handleDelayedFiles(void);
+       void handleDroppedFiles(void);
        void hibernateComputerActionTriggered(bool checked);
        void importCueSheetActionTriggered(bool checked);
        void importCsvContextActionTriggered(void);
@@ -127,7 +150,7 @@ private slots:
        void removeFileButtonClicked(void);
        void renameOutputEnabledChanged(bool checked);
        void renameOutputPatternChanged(void);
-       void renameOutputPatternChanged(const QString &text);
+       void renameOutputPatternChanged(const QString &text, bool silent = false);
        void resetAdvancedOptionsButtonClicked(void);
        void restoreCursor(void);
        void samplingRateChanged(int value);
@@ -143,12 +166,12 @@ private slots:
        void sourceModelChanged(void);
        void styleActionActivated(QAction *action);
        void tabActionActivated(QAction *action);
-       void tabPageChanged(int idx);
+       void tabPageChanged(int idx, const bool silent = false);
        void toneAdjustBassChanged(double value);
        void toneAdjustTrebleChanged(double value);
        void toneAdjustTrebleReset(void);
        void updateBitrate(int value);
-       void updateEncoder(int id);
+       void updateEncoder(int id = 0);
        void updateLameAlgoQuality(int value);
        void updateMaximumInstances(int value);
        void updateRCMode(int id);
@@ -169,22 +192,22 @@ protected:
        virtual bool winEvent(MSG *message, long *result);
 
 private:
+       Ui::MainWindow *ui; //for Qt UIC
+
        void addFiles(const QStringList &files);
        void addFolder(const QString &path, bool recursive = false, bool delayed = false);
        bool checkForUpdates(void);
        void initializeTranslation(void);
        void refreshFavorites(void);
+       void openDocumentLink(QAction *const action);
        
        bool m_accepted;
        bool m_firstTimeShown;
        uint m_outputFolderViewInitCounter;
        bool m_outputFolderViewCentering;
 
-       const bool m_neroEncoderAvailable;
-       const bool m_fhgEncoderAvailable;
-       const bool m_qaacEncoderAvailable;
-
        WorkingBanner *m_banner;
+       QList<QUrl> *m_droppedFileList;
        QStringList *m_delayedFileList;
        QTimer *m_delayedFileTimer;
        DropBox *m_dropBox;
@@ -192,7 +215,7 @@ private:
        FileListModel *m_fileListModel;
        QFileSystemModelEx *m_fileSystemModel;
        MessageHandlerThread *m_messageHandler;
-       AudioFileModel *m_metaData;
+       AudioFileModel_MetaInfo *const m_metaData;
        MetaInfoModel *m_metaInfoModel;
        QMenu *m_outputFolderContextMenu;
        SettingsModel *m_settings;
@@ -205,6 +228,7 @@ private:
        QAction *m_showDetailsContextAction;
        QAction *m_showFolderContextAction;
        QAction *m_refreshFolderContextAction;
+       QAction *m_goUpFolderContextAction;
        QAction *m_addFavoriteFolderAction;
        QAction *m_exportCsvContextAction;
        QAction *m_importCsvContextAction;
@@ -215,6 +239,7 @@ private:
        QButtonGroup *m_modeButtonGroup;
        QButtonGroup *m_overwriteButtonGroup;
 
+       CustomEventFilter *m_evenFilterCornerWidget;
        CustomEventFilter *m_evenFilterCustumParamsHelp;
        CustomEventFilter *m_evenFilterOutputFolderMouse;
        CustomEventFilter *m_evenFilterOutputFolderView;