/***************************************************************************
 * optionsexportmusixtex.cpp: implementation of OptionsExportMusixtex 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 "optionsexportmusixtex.h"

#include <QCheckBox>
#include <QRadioButton>
#include <QVBoxLayout>

#include "settings.h"

OptionsExportMusixtex::OptionsExportMusixtex(KConfig* conf, QWidget* parent)
: OptionsPage(conf, parent)
{
	QVBoxLayout* mainLayout = new QVBoxLayout(this);
	QVBoxLayout* layoutGroup = new QVBoxLayout();
	
	// Create option widgets
	//
	mShowBarNumber  = new QCheckBox(tr("Show Bar Number"));
	mShowStr        = new QCheckBox(tr("Show Tuning"));
	mShowPageNumber = new QCheckBox(tr("Show Page Number"));

	mExportModeGroup = new QVBoxLayout();
	mExportMode[0] = new QRadioButton(tr("Tabulature"));
	mExportMode[1] = new QRadioButton(tr("Notes"));
	
	mExportModeGroup->addWidget(mExportMode[0]);
	mExportModeGroup->addWidget(mExportMode[1]);
	
	mTabSizeGroup = new QVBoxLayout();
	mTabSize[0] = new QRadioButton(tr("Smallest"));
	mTabSize[1] = new QRadioButton(tr("Small"));
	mTabSize[2] = new QRadioButton(tr("Normal"));
	mTabSize[3] = new QRadioButton(tr("Big"));
	
	for (int i = 0; i < 4; i++)
		mTabSizeGroup->addWidget(mTabSize[i]);
	
	mAlways = new QCheckBox(tr("Always show this dialog on export"));
	
	layoutGroup->addWidget(mShowBarNumber);
	layoutGroup->addWidget(mShowStr);
	layoutGroup->addWidget(mShowPageNumber);
	
	// Set widget layout
	//
	mainLayout->addLayout(layoutGroup);
	mainLayout->addLayout(mTabSizeGroup);
	mainLayout->addLayout(mExportModeGroup);
	mainLayout->addStretch(1);
	mainLayout->addWidget(mAlways);
	mainLayout->activate();
	
	setLayout(mainLayout);
	
	// Fill in current config
	//
//	mTabSizeGroup->setButton(Settings::texTabSize());
//	mShowBarNumber->setChecked(Settings::texShowBarNumber());
//	mShowStr->setChecked(Settings::texShowStr());
//	mShowPageNumber->setChecked(Settings::texShowPageNumber());
//	mExportModeGroup->setButton(Settings::texExportMode());
//	mAlways->setChecked(config->readBoolEntry("AlwaysShow", TRUE));
}

void OptionsExportMusixtex::defaultBtnClicked()
{
//	mTabSizeGroup->setButton(2);
//	mShowBarNumber->setChecked(TRUE);
//	mShowStr->setChecked(TRUE);
//	mShowPageNumber->setChecked(TRUE);
//	mExportModeGroup->setButton(0);
}

void OptionsExportMusixtex::applyBtnClicked()
{
/*	config->setGroup("MusiXTeX");
	config->writeEntry("TabSize", mTabSizeGroup->id(mTabSizeGroup->selected()));
	config->writeEntry("ShowBarNumber", mShowBarNumber->isChecked());
	config->writeEntry("ShowStr", mShowStr->isChecked());
	config->writeEntry("ShowPageNumber", mShowPageNumber->isChecked());
	config->writeEntry("ExportMode", mExportModeGroup->id(mExportModeGroup->selected()));
	config->writeEntry("AlwaysShow", mAlways->isChecked());*/
}

#include "optionsexportmusixtex.moc"
