Добавлена реализация базовых профилей (Имя, путь до java)
This commit is contained in:
48
profiledialog.cpp
Normal file
48
profiledialog.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user