RedPanda-CPP/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp

42 lines
1.0 KiB
C++
Raw Normal View History

#include "projectdllhostwidget.h"
#include "ui_projectdllhostwidget.h"
#include "../project.h"
#include "../mainwindow.h"
#include <QFileDialog>
ProjectDLLHostWidget::ProjectDLLHostWidget(const QString &name, const QString &group, QWidget *parent) :
SettingsWidget(name,group,parent),
ui(new Ui::ProjectDLLHostWidget)
{
ui->setupUi(this);
}
ProjectDLLHostWidget::~ProjectDLLHostWidget()
{
delete ui;
}
void ProjectDLLHostWidget::doLoad()
{
ui->txtHost->setText(pMainWindow->project()->options().hostApplication);
}
void ProjectDLLHostWidget::doSave()
{
pMainWindow->project()->options().hostApplication = ui->txtHost->text();
}
2021-10-20 18:05:43 +08:00
void ProjectDLLHostWidget::on_btnBrowse_clicked()
{
QString filename = QFileDialog::getOpenFileName(
this,
tr("Choose host application"),
pMainWindow->project()->directory(),
tr("All files (*.*)"));
if (!filename.isEmpty() && fileExists(filename)) {
ui->txtHost->setText(filename);
}
}