MediaInfoXP/src/MainWindow.h

99 lines
2.6 KiB
C
Raw Normal View History

2013-05-19 22:32:58 +02:00
///////////////////////////////////////////////////////////////////////////////
// MediaInfoXP
2014-01-11 21:41:24 +01:00
// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
2013-05-19 22:32:58 +02:00
//
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QMainWindow>
#include <QDate>
//UIC forward declartion
namespace Ui {
class MainWindow;
}
class QProcess;
class QLabel;
class QFile;
class mixp_icon_t;
class IPC;
2013-05-19 22:32:58 +02:00
//MainWindow class
class CMainWindow: public QMainWindow
{
Q_OBJECT
public:
CMainWindow(const QString &tempFolder, IPC *const ipc, QWidget *parent = 0);
2013-05-19 22:32:58 +02:00
~CMainWindow(void);
private slots:
2013-06-01 00:09:17 +02:00
void analyzeFiles(void);
void analyzeNextFile(void);
2013-05-19 22:32:58 +02:00
void analyzeButtonClicked(void);
void saveButtonClicked(void);
void copyToClipboardButtonClicked(void);
2013-05-19 22:32:58 +02:00
void clearButtonClicked(void);
void outputAvailable(void);
void processFinished(void);
void linkTriggered(void);
void showAboutScreen(void);
2013-06-01 00:09:17 +02:00
void updateSize(void);
void initShellExtension(void);
void updateShellExtension(bool checked);
void fileReceived(const QString &path);
2013-05-19 22:32:58 +02:00
protected:
virtual void showEvent(QShowEvent *event);
virtual void closeEvent(QCloseEvent *event);
virtual void resizeEvent(QResizeEvent *event);
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
virtual bool eventFilter(QObject *o, QEvent *e);
2013-06-01 00:09:17 +02:00
virtual void keyPressEvent(QKeyEvent *e);
2013-05-19 22:32:58 +02:00
private:
enum
{
APP_STATUS_STARTING = 0,
APP_STATUS_IDLE = 1,
APP_STATUS_AWAITING = 2,
APP_STATUS_WORKING = 3
}
status_t;
2013-05-19 22:32:58 +02:00
Ui::MainWindow *ui; //for Qt UIC
int m_status;
2013-05-19 22:32:58 +02:00
const QString &m_tempFolder;
QFile *m_mediaInfoHandle;
2013-05-19 22:32:58 +02:00
QProcess *m_process;
QLabel *m_floatingLabel;
2013-06-01 00:09:17 +02:00
QStringList m_pendingFiles;
QStringList m_outputLines;
mixp_icon_t *m_icon;
IPC *const m_ipc;
const QList<QPair<const QString, const QString>> m_htmlEscape;
2013-05-19 22:32:58 +02:00
QString getMediaInfoPath(void);
void escapeHtmlChars(QStringList &strings);
2013-05-19 22:32:58 +02:00
};