/***************************************************************************
 * optionsexportascii.cpp: implementation of OptionsExportAscii class
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-2006 the KTabEdit development team <mrgwen@gmail.com>
 * copyright (C) 2002-2003 the KGuitar development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * 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.
 *
 * See the file COPYING for more information.
 ***************************************************************************/

#include "optionsexportascii.h"

#include <QCheckBox>
#include <QLabel>
#include <QRadioButton>
#include <QSpinBox>
#include <QVBoxLayout>

OptionsExportAscii::OptionsExportAscii(KConfig* conf, QWidget* parent)
: OptionsPage(conf, parent)
{
	QVBoxLayout* mainLayout = new QVBoxLayout(this);
	QHBoxLayout* pageWidthBox = new QHBoxLayout();
	QLabel* pageWidth_l;
	
	mDurationGroup = new QVBoxLayout();
	mDuration[0] = new QRadioButton(tr("Fixed one blank"));
	mDuration[1] = new QRadioButton(tr("One blank") + " = 1/4");
	mDuration[2] = new QRadioButton(tr("One blank") + " = 1/8");
	mDuration[3] = new QRadioButton(tr("One blank") + " = 1/16");
	mDuration[4] = new QRadioButton(tr("One blank") + " = 1/32");
	
	for (int i = 0; i < 5; i++)
		mDurationGroup->addWidget(mDuration[i]);
	
	mainLayout->addLayout(mDurationGroup);
	
	mPageWidth = new QSpinBox();
	mPageWidth->setRange(1, 1024 * 1024);
	
	pageWidth_l = new QLabel(tr("Page &width:"), mPageWidth);
	
	pageWidthBox->addWidget(pageWidth_l);
	pageWidthBox->addWidget(mPageWidth);
	pageWidthBox->addStretch(1);
	
	mainLayout->addLayout(pageWidthBox);

	mAlways = new QCheckBox(tr("Always show this dialog on export"));
	
	mainLayout->addStretch(1);
	mainLayout->addWidget(mAlways);
	
	setLayout(mainLayout);
	// Fill in current config
	//
//	config->setGroup("ASCII");
//	mDurationGroup->setButton(config->readNumEntry("DurationDisplay", 3));
//	mPageWidth->setValue(config->readNumEntry("PageWidth", 72));
//	mAlways->setChecked(config->readBoolEntry("AlwaysShow", TRUE));
}

void OptionsExportAscii::defaultBtnClicked()
{
//	mDurationGroup->setButton(3);
//	mPageWidth->setValue(72);
//	mAlways->setChecked(TRUE);
}

void OptionsExportAscii::applyBtnClicked()
{
//	config->setGroup("ASCII");
//	config->writeEntry("DurationDisplay", mDurationGroup->id(mDurationGroup->selected()));
//	config->writeEntry("PageWidth", mPageWidth->value());
//	config->writeEntry("AlwaysShow", mAlways->isChecked());
}

#include "optionsexportascii.moc"
