49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
|
|
#include "profiledialog.h"
|
|||
|
|
#include "ui_profiledialog.h"
|
|||
|
|
#include <QFileDialog>
|
|||
|
|
|
|||
|
|
ProfileDialog::ProfileDialog(QWidget *parent) :
|
|||
|
|
QDialog(parent),
|
|||
|
|
ui(new Ui::ProfileDialog)
|
|||
|
|
{
|
|||
|
|
ui->setupUi(this);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ProfileDialog::~ProfileDialog()
|
|||
|
|
{
|
|||
|
|
delete ui;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
QString ProfileDialog::profileName() const
|
|||
|
|
{
|
|||
|
|
return ui->profileNameEdit->text();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
QString ProfileDialog::javaPath() const
|
|||
|
|
{
|
|||
|
|
return ui->javaPathEdit->text();
|
|||
|
|
}
|
|||
|
|
// === РЕАЛИЗАЦИЯ НОВЫХ ФУНКЦИЙ ===
|
|||
|
|
void ProfileDialog::setProfileName(const QString &name)
|
|||
|
|
{
|
|||
|
|
ui->profileNameEdit->setText(name);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ProfileDialog::setJavaPath(const QString &path)
|
|||
|
|
{
|
|||
|
|
ui->javaPathEdit->setText(path);
|
|||
|
|
}
|
|||
|
|
// ===============================
|
|||
|
|
|
|||
|
|
void ProfileDialog::on_browseButton_clicked()
|
|||
|
|
{
|
|||
|
|
QString filter = "Исполняемый файл (java.exe)";
|
|||
|
|
#if !defined(Q_OS_WIN)
|
|||
|
|
filter = "Все файлы (*)";
|
|||
|
|
#endif
|
|||
|
|
QString path = QFileDialog::getOpenFileName(this, "Выберите java.exe", QDir::homePath(), filter);
|
|||
|
|
if (!path.isEmpty()) {
|
|||
|
|
ui->javaPathEdit->setText(QDir::toNativeSeparators(path));
|
|||
|
|
}
|
|||
|
|
}
|