Добавлена реализация базовых профилей (Имя, путь до java)

This commit is contained in:
2025-10-26 20:00:25 +03:00
parent 0d18e48783
commit 3b3d9e7af0
7 changed files with 365 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
#include <QMainWindow>
#include <QProcess>
#include <QSettings>
#include <QJsonObject> // Важно: добавить для хранения данных профилей
// Предварительное объявление класса, сгенерированного из mainwindow.ui
QT_BEGIN_NAMESPACE
@@ -24,6 +25,9 @@ private slots:
void on_modsFolderButton_clicked();
void on_updateModsButton_clicked();
void on_settingsButton_clicked();
void on_addProfileButton_clicked(); // Слот для кнопки "Новый..."
void on_editProfileButton_clicked(); // <-- ДОБАВЬТЕ ЭТОТ СЛОТ
void on_profileComboBox_currentIndexChanged(int index); // Слот для смены профиля
// Слоты для QProcess (подключаются вручную)
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
@@ -33,6 +37,13 @@ private slots:
private:
QString getMinecraftPath();
// Новые методы для работы с профилями
void loadProfiles();
void saveProfiles();
void createNewProfile();
QString profilesPath; // Путь к launcher_profiles.json
QJsonObject profilesData; // JSON данные из файла
Ui::MainWindow *ui; // Указатель на объект интерфейса
QProcess *process;
QSettings *settings;