/*****************************************************************************
 *
 *  softwareupdatedialog.h -- GUI for SoftwareUpdate class.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is NOT open source.
 *
 *****************************************************************************/

#ifndef SOFTWAREUPDATEDIALOG_H
#define SOFTWAREUPDATEDIALOG_H

#include "../main/softwareupdate.h"
#include <QDialog>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>

class SoftwareUpdateDialog : public QDialog
{
	Q_OBJECT

public:
	SoftwareUpdateDialog(QWidget *parent=0);
	~SoftwareUpdateDialog();

	virtual void checkUpdate();

protected slots:
	void checkUpdateDone();
	void checkUpdateFailed(QString);
	void downloadHome();
	void downloadOpen();
	void downloadSmart();

protected:
	QString			m_downloadOpenFileUrl;
	QString			m_downloadSmartFileUrl;
	SoftwareUpdate	*m_softwareUpdate;
	QString			m_serverResponse;
	QString			m_whatYouGet;

	// Widgets
	QGroupBox	*m_checkUpdateBox;
	QVBoxLayout	*m_checkUpdateLayout;
	QLabel		*m_checkUpdateText;

	QGroupBox	*m_downloadBox;
	QHBoxLayout	*m_downloadLayout;
	QPushButton	*m_downloadHomeButton;
	QPushButton	*m_downloadOpenButton;
	QPushButton	*m_downloadSmartButton;

	QGroupBox	*m_whatyougetBox;
	QVBoxLayout	*m_whatyougetLayout;
	QLabel		*m_whatyougetText;

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

#endif
