/*****************************************************************************
 *
 *  splitmoviedialog.h -- Configure a split movie operation.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the Gui4 module of the DVDx 4 application.
 *
 *  GNU Lesser General Public License Usage
 *  This file may be used under the terms of the GNU Lesser General
 *  Public License version 2.1 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.LGPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU Lesser General Public License version 2.1 requirements
 *  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 *
 *  GNU General Public License Usage
 *  Alternatively, this file may be used under the terms of the GNU
 *  General Public License version 3.0 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.GPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU General Public License version 3.0 requirements will be
 *  met: http://www.gnu.org/copyleft/gpl.html.
 *
 *****************************************************************************/

#ifndef SPLITMOVIEDIALOG_H
#define SPLITMOVIEDIALOG_H

#include <QButtonGroup>
#include <QComboBox>
#include <QDialog>
#include <QGroupBox>
#include <QLabel>
#include <QLayout>
#include <QLineEdit>
#include <QList>
#include <QPushButton>
#include <QRadioButton>
#include <QSpinBox>
#include <QString>

class SplitMovieDialog : public QDialog
{
	Q_OBJECT

public:
	SplitMovieDialog(qint64 inputFileSize,
		const QString &inputFolder, QString *outputFolder, 
		int *volumeNumber, qint64 *volumeSize, QWidget *parent);

protected slots:
	void divideSetValue(int);
	void divideUpdateSelection();
	void folderSetChoice();
	void methodSetDivide();
	void methodSetVolume();
	void volumeSelectUser();
	void volumeUpdateSelection();
	void volumeUserChangeUnit();
	void volumeUserFinishEditing();

protected:
	void volumeUserCorrectInput();

protected:
	qint64 m_inputFileSize;
	int	m_minimumOutputFileSize;
	int	m_maximumDivideValue;;
	
	QString *m_outputFolder;
	QString m_outputFolderDefault;
	QString m_outputFolderInPlace;

	int	*m_volumeNumber;
	qint64	*m_volumeSize;

	qint64 m_volumeSizeCD700;
	qint64 m_volumeSizeCD800;
	qint64 m_volumeSizeCD900;
	qint64 m_volumeSizeDVD5;
	qint64 m_volumeSizeDVD9;

	// Widgets
	QGroupBox		*m_divideGroup;
	QLabel			*m_divideLabel;
	QHBoxLayout		*m_divideLayout;
	QSpinBox		*m_divideSpinBox;

	QRadioButton	*m_folderChoiceDefaultButton;
	QRadioButton	*m_folderChoiceInPlaceButton;
	QGroupBox		*m_folderGroup;
	QVBoxLayout		*m_folderLayout;

	QRadioButton	*m_methodDivideButton;
	QButtonGroup	*m_methodGroup;
	QVBoxLayout		*m_methodLayout;
	QRadioButton	*m_methodVolumeButton;

	QRadioButton	*m_volumeCD700Button;	// 737.280MB 	703.125MiB
	QRadioButton	*m_volumeCD800Button;	// 829.440MB 	791.016MiB
	QRadioButton	*m_volumeCD900Button;	// 912.384MB 	870.117MiB
	QRadioButton	*m_volumeDVD5Button;	// 4.70GB	4.37GiB
	QRadioButton	*m_volumeDVD9Button;	// 8.54GB 	7.95GiB
	QGroupBox		*m_volumeGroup;
	QVBoxLayout		*m_volumeLayout;
	QRadioButton	*m_volumeUserButton;
	QComboBox		*m_volumeUserComboBox;
	QLineEdit		*m_volumeUserInput;
	QHBoxLayout		*m_volumeUserLayout;

	QPushButton		*m_windowButtonAccept;
	QHBoxLayout		*m_windowButtonLayout;
	QPushButton		*m_windowButtonReject;
	QVBoxLayout		*m_windowLayout;
};

#endif
