/***************************************************************************
                          dchubfilter.cpp  -  description
                             -------------------
    begin                : Mit Okt 30 2002
    copyright            : (C) 2002 by Mathias Küster
    email                : mathen@users.berlios.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "dchubfilter.h"

#include <QLineEdit>
#include <QSpinBox>
#include <QCheckBox>
#include <QPushButton>

#include "dcconfig.h"

DCHubFilter::DCHubFilter( QWidget * parent ) : QDialog( parent )
{
	setupUi(this);
}

DCHubFilter::~DCHubFilter()
{
}

/** */
void DCHubFilter::Edit( DC_HubFilterObject * HubFilterObject )
{
	LineEdit_FILTERNAME->setText(HubFilterObject->m_sFilterName);
	SpinBox_MINUSER->setValue(HubFilterObject->m_nUser);
	LineEdit_CONTAINS->setText(HubFilterObject->m_sContains);
	CheckBox_NAME->setChecked(HubFilterObject->m_bName);
	CheckBox_SERVER->setChecked(HubFilterObject->m_bServer);
	CheckBox_DESCRIPTION->setChecked(HubFilterObject->m_bDescription);
}

/** */
void DCHubFilter::Get( DC_HubFilterObject * HubFilterObject )
{
	HubFilterObject->m_sFilterName  = LineEdit_FILTERNAME->text();
	HubFilterObject->m_nUser        = SpinBox_MINUSER->value();
	HubFilterObject->m_sContains    = LineEdit_CONTAINS->text();
	HubFilterObject->m_bName        = CheckBox_NAME->isChecked();
	HubFilterObject->m_bServer      = CheckBox_SERVER->isChecked();
	HubFilterObject->m_bDescription = CheckBox_DESCRIPTION->isChecked();
}
