2021-09-15 16:57:28 +08:00
|
|
|
#include "projectprecompilewidget.h"
|
|
|
|
#include "ui_projectprecompilewidget.h"
|
|
|
|
#include "../mainwindow.h"
|
|
|
|
#include "../project.h"
|
|
|
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
|
|
|
ProjectPreCompileWidget::ProjectPreCompileWidget(const QString &name, const QString &group, QWidget *parent) :
|
|
|
|
SettingsWidget(name,group,parent),
|
|
|
|
ui(new Ui::ProjectPreCompileWidget)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
ProjectPreCompileWidget::~ProjectPreCompileWidget()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProjectPreCompileWidget::doLoad()
|
|
|
|
{
|
|
|
|
ui->grpPrecompileHeader->setChecked(pMainWindow->project()->options().usePrecompiledHeader);
|
|
|
|
ui->txtPrecompileHeader->setText(pMainWindow->project()->options().precompiledHeader);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProjectPreCompileWidget::doSave()
|
|
|
|
{
|
|
|
|
pMainWindow->project()->options().usePrecompiledHeader = ui->grpPrecompileHeader->isChecked();
|
|
|
|
pMainWindow->project()->options().precompiledHeader = ui->txtPrecompileHeader->text();
|
|
|
|
pMainWindow->project()->saveOptions();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProjectPreCompileWidget::on_btnBrowse_triggered(QAction *arg1)
|
|
|
|
{
|
|
|
|
QString fileName = QFileDialog::getOpenFileName(
|
|
|
|
this,
|
2021-09-15 22:19:59 +08:00
|
|
|
tr("Precompiled header"),
|
2021-09-15 16:57:28 +08:00
|
|
|
pMainWindow->project()->directory(),
|
2021-09-17 21:33:19 +08:00
|
|
|
tr("header files (*.h)"));
|
2021-09-15 16:57:28 +08:00
|
|
|
if (!fileName.isEmpty() && QFileInfo(fileName).exists()) {
|
|
|
|
ui->txtPrecompileHeader->setText(fileName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|