/***************************************************************************
 *   Copyright (C) 2005 by Armando Navarro-Vazquez                         *
 *   armando@linux                                                         *
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   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.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include <QPushButton>
#include <qlayout.h>
#include <qlabel.h>
#include "qrenumberoptionsdialog.h"
//Added by qt3to4:
#include <Q3GridLayout>

QRenumberOptionsDialog::QRenumberOptionsDialog ( QWidget* parent )
		: QDialog ( parent )
{
	QPushButton* allAtomsButton = new QPushButton ( this );	
        Q3GridLayout* box = new Q3GridLayout ( this,2,3 );
        QLabel* label= new QLabel(this);
        label->setText("Click atoms to renumber. Press Escape key to reset");
	allAtomsButton->setText ( "All atoms" );
	QPushButton* heavyAtomsButton = new QPushButton ( this );
	heavyAtomsButton->setText ( "Only heavy atoms" );
	QPushButton* cancelButton = new QPushButton ( this );
	cancelButton->setText ( "Cancel" );

        box->addMultiCellWidget(label,0,0,0,2);
	box->addWidget ( allAtomsButton,1,0 );
	box->addWidget ( heavyAtomsButton,1,1 );
	box->addWidget ( cancelButton, 1,2 );
	connect ( allAtomsButton,SIGNAL ( clicked() ),this,SLOT ( OnAllAtoms() ) );
	connect ( heavyAtomsButton,SIGNAL ( clicked() ),this,SLOT ( OnHeavyAtoms() ) );
	connect ( cancelButton,SIGNAL ( clicked() ),this,SLOT ( reject() ) );

}


QRenumberOptionsDialog::~QRenumberOptionsDialog()
{}

void QRenumberOptionsDialog::OnAllAtoms()
{
	m_rmode=AllAtoms;
	accept();
}

void QRenumberOptionsDialog::OnHeavyAtoms()
{
	m_rmode= HeavyAtoms;
	accept();
}

