/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Pieringer Johannes <jpieringer@desktopbsd.net>
 *         (C) 2006
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef MODGRUBCONF_H
#define MODGRUBCONF_H

#include <qptrdict.h>
#include <qlistview.h>
#include <kprocess.h>

#include "dbsdmodule.h"
#include "uimodgrubconf.h"
#include "grubconfiguration.h"
#include "frmbootproperties.h"

class ModGrubconf : public UiModGrubconf
{
	Q_OBJECT
public:
	ModGrubconf(QWidget* parent = 0, const char* name = 0);
	~ModGrubconf();
	friend class FrmBootproperties;

public slots:
	virtual void	apply();
	virtual void	reset();
	virtual void	polish();

protected:
	GrubConfiguration grubConf;
	FrmBootproperties* fbpProperties;	//The Properties-dialog of the bootentries
	QCheckListItem *cliBootentries;
	QPtrDict<GrubBootentry> dict;
	KProcess *generateConfig;

	void FillBootentryList();
	int getQCheckListItemPos(const QListViewItem * item);
	void changeListPlace(bool up);
	void changeDefaultBootentry();
	void loadData();

	virtual void initModule();

protected slots:
	virtual void generateBootmenu();
	virtual void changeTimeout();

	virtual void bootentryUp();
	virtual void bootentryDown();
	virtual void bootentryAdd();
	virtual void bootentryDelete();
	virtual void bootentryProperties();
	virtual void bootentryDefault();
	virtual void defaultBootentry();

	virtual void splashimageFileDialog();
	virtual void splashimageStateChanged();
	virtual void colorStateChanged();

	virtual void installGrub();
};
#endif
