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;
|
2013-12-07 19:42:07 +01:00
|
|
|
class QFile;
|
|
|
|
class mixp_icon_t;
|
2014-01-16 02:09:48 +01:00
|
|
|
class IPC;
|
2013-05-19 22:32:58 +02:00
|
|
|
|
|
|
|
//MainWindow class
|
|
|
|
class CMainWindow: public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-01-16 02:09:48 +01:00
|
|
|
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);
|
2013-05-21 00:33:35 +02:00
|
|
|
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);
|
2014-01-14 23:27:43 +01:00
|
|
|
void initShellExtension(void);
|
|
|
|
void updateShellExtension(bool checked);
|
2014-01-16 02:09:48 +01:00
|
|
|
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:
|
2014-01-16 02:09:48 +01:00
|
|
|
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
|
|
|
|
|
2014-01-16 02:09:48 +01:00
|
|
|
int m_status;
|
2013-05-19 22:32:58 +02:00
|
|
|
const QString &m_tempFolder;
|
2014-01-16 02:09:48 +01:00
|
|
|
|
2013-12-07 19:42:07 +01:00
|
|
|
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;
|
2013-05-21 00:33:35 +02:00
|
|
|
QStringList m_outputLines;
|
2013-12-07 19:42:07 +01:00
|
|
|
mixp_icon_t *m_icon;
|
2014-01-16 02:09:48 +01:00
|
|
|
IPC *const m_ipc;
|
2013-05-30 12:53:26 +02:00
|
|
|
|
|
|
|
const QList<QPair<const QString, const QString>> m_htmlEscape;
|
2013-05-19 22:32:58 +02:00
|
|
|
|
|
|
|
QString getMediaInfoPath(void);
|
2013-05-30 12:53:26 +02:00
|
|
|
void escapeHtmlChars(QStringList &strings);
|
2013-05-19 22:32:58 +02:00
|
|
|
};
|