/**********************************************************************

	--- Qt Architect generated file ---

	File: Options.cpp
	Last generated: Fri Feb 19 21:03:35 1999

	DO NOT EDIT!!!  This file will be automatically
	regenerated by qtarch.  All changes will be lost.

 *********************************************************************/

#include <kapp.h>
#include "Options.h"

#define Inherited QTabDialog


Options::Options
(
	QWidget* parent,
	const char* name
)
	:
	Inherited( parent, name, TRUE, 0 )
{
	setCaption(i18n("Options"));
	resize( 400,320 );
	setMinimumSize( 0, 0 );
	setMaximumSize( 32767, 32767 );

	General = new OptionsGeneral(this);
	addTab(General,i18n("General"));

	Extensions = new OptionsExtensions(this);
	addTab(Extensions,i18n("Extensions"));
	connect(Extensions,SIGNAL(needApplyOptions()),SIGNAL(applyButtonPressed()));

	Detail = new OptionsDetail(this);
	addTab(Detail,i18n("Details"));

	View = new OptionsView(this);
	addTab(View,i18n("View"));
}


Options::~Options()
{
}

void Options::setConfig(KConfig *ConfigFile)
{
	ConfigFile->setGroup("Configuration");
	General->LocalIconPath->setText(ConfigFile->readEntry("IconPath").data());
	if (ConfigFile->readBoolEntry("UseKDEIcons")) General->KDEIcons->setChecked(TRUE);
	else General->LocalIcons->setChecked(TRUE);
	General->LocalMimeFile->setText(ConfigFile->readEntry("ExtensionFile").data());
	if (ConfigFile->readBoolEntry("UseKDEMimeTypes")) General->KDEMime->setChecked(TRUE);
	else General->LocalMime->setChecked(TRUE);
	General->MagicFile->setText(ConfigFile->readEntry("MagicFile").data());
	if (ConfigFile->readBoolEntry("UseMagicNumbers")) General->UseMagic->setChecked(TRUE);
	else General->UseMagic->setChecked(FALSE);
	General->MagicFile->setEnabled(General->UseMagic->isChecked());
	General->BrowseMagic->setEnabled(General->UseMagic->isChecked());
	Extensions->CanModify = !(ConfigFile->readBoolEntry("UseKDEMimeTypes"));
	Detail->DateFormat->setCurrentItem(ConfigFile->readNumEntry("DateFormat"));
	View->SavingPolicy->setCurrentItem(ConfigFile->readNumEntry("MiniImageSaving"));
	General->Shell->setText(ConfigFile->readEntry("Shell").data());
	General->Startup->setCurrentItem(ConfigFile->readNumEntry("StartupDir"));
	int	size = ConfigFile->readNumEntry("ImageSize");
	View->ImageSaveIfSize->setChecked((size != -1));
	QString	sizeStr;
	sizeStr.sprintf("%d",size/1024);
	View->ImageSize->setText((size != -1 ? sizeStr.data() : ""));
	size = ConfigFile->readNumEntry("MiniImageSaving");
	View->ImageSaveIfSize->setEnabled((size != 0));
	View->ImageSize->setEnabled((size != 0));
}
