/*
 *  Copyright (C) 2007-2008 CMM Sigma Andrzej Chmielowiec <cmmsigma@cmmsigma.eu>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 3
 *  as published by the Free Software Foundation.
 *
 *  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.
 */

// AdminOptionsDialog.cpp: implementation of the AdminOptionsDialog class.
//
//////////////////////////////////////////////////////////////////////

#include "AdminOptionsDialog.h"

AdminOptionsDialog::AdminOptionsDialog(QWidget *parent, Qt::WindowFlags f): QDialog(parent, f)
{
	QGridLayout *layout = new QGridLayout();
	
	mailWidget = new MailAccountWidget(false, false, this);

//	mTab = new QTabWidget();
//	mTab->addTab(mailWidget, tr("Konto pocztowe"));

	mCancel = new QPushButton(tr("Ca&ncel"));
	connect(mCancel, SIGNAL(clicked()), this, SLOT(reject()));
	mAccept = new QPushButton(tr("&Accept"));
	connect(mAccept, SIGNAL(clicked()), this, SLOT(accept()));
	
	layout->addWidget(mailWidget, 0, 0, 1, 3);
	layout->addWidget(mAccept, 1, 1);
	layout->addWidget(mCancel, 1, 2);
	
	layout->setColumnStretch(0, 1);
	layout->setRowStretch(0, 1);
	
	setLayout(layout);
}

AdminOptionsDialog::~AdminOptionsDialog()
{

}

void
AdminOptionsDialog::setData(AdminOptions &data)
{
	mailWidget->setData(data.mailConfig);
}

void
AdminOptionsDialog::getData(AdminOptions &data)
{
	mailWidget->getData(data.mailConfig);
}

MailAccountWidget *
AdminOptionsDialog::getMailWidget()
{
	return mailWidget;
}
