#include "cmwcover.h"
#include "ui_cmwcover.h"
#include <QMessageBox>
#include <QPushButton>
CMWCover::CMWCover(QWidget* parent) :
	CMWidget(parent),
	ui(new Ui::CMWCover)
{
	ui->setupUi(this);
}

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



void CMWCover::ShowDlg(bool bShow)
{
	if (bShow)
	{
		QWidget* pWidget = (QWidget*)parent();
		if (pWidget)
		{
			QRect rectParent = pWidget->rect();
			this->setGeometry(rectParent);
		}
		QString info;
		{
			QFile file(CMakePath::make_config_path("contact.txt"));
			if (file.open(QIODevice::ReadOnly | QIODevice::Text))
			{
				info = file.readAll();
			}
		}
		ui->plainTextEdit->setPlainText(info);
		
		show();
	}
	else
	{
		hide();
	}
}

void CMWCover::on_btnModify_clicked(bool bChecked)
{
	ui->plainTextEdit->setEnabled(bChecked);
}
