#include "qcd_modedialog.h"
#include "ui_qcd_modedialog.h"


QCDModeDialog::QCDModeDialog(QWidget * parent): QDialog(parent) {
	ui = new Ui::QCDModeDialog();
	ui->setupUi(this);
}


QCDModeDialog::~QCDModeDialog() {
	delete ui;
}


CDUtils::UpdateModeFlags QCDModeDialog::mode() const {
	CDUtils::UpdateModeFlags ret = 0;
	if (ui->checkSaveIndex->isChecked()) ret |= CDUtils::SaveByIndex;
	if (ui->checkSaveName->isChecked()) ret |= CDUtils::SaveByName;
	if (ui->checkMerge->isChecked()) ret |= CDUtils::Merge;
	return ret;
}


void QCDModeDialog::changeEvent(QEvent *e) {
	QDialog::changeEvent(e);
	switch (e->type()) {
	case QEvent::LanguageChange:
		ui->retranslateUi(this);
		break;
	default:
		break;
	}
}


void QCDModeDialog::on_checkSaveIndex_clicked(bool checked) {
	if (!checked) return;
	ui->checkSaveName->setChecked(false);
}


void QCDModeDialog::on_checkSaveName_clicked(bool checked) {
	if (!checked) return;
	ui->checkSaveIndex->setChecked(false);
}
