Compare commits
4 Commits
b5b964713e
...
beta
| Author | SHA1 | Date | |
|---|---|---|---|
| 49cbded003 | |||
| 3b3d9e7af0 | |||
| 0d18e48783 | |||
| a22dca1093 |
@@ -16,7 +16,7 @@ qt_add_executable(minecraft-launcher
|
|||||||
settingsdialog.h settingsdialog.cpp
|
settingsdialog.h settingsdialog.cpp
|
||||||
settingsdialog.ui
|
settingsdialog.ui
|
||||||
mainwindow.ui
|
mainwindow.ui
|
||||||
|
profiledialog.h profiledialog.cpp profiledialog.ui
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
177
Ui-TEMP/MinecraftUI.qml
Normal file
177
Ui-TEMP/MinecraftUI.qml
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
|
||||||
|
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
|
||||||
|
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
|
||||||
|
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
|
||||||
|
*/
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import UntitledProject1
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: rectangle
|
||||||
|
width: Constants.width
|
||||||
|
height: Constants.height
|
||||||
|
color: "#2e2e2e"
|
||||||
|
radius: 0
|
||||||
|
border.color: "#1a1a1a"
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: kishkaProfileIdle
|
||||||
|
x: 40
|
||||||
|
y: 239
|
||||||
|
source: "Profile Box/Kishka Profile Idle.svg"
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: kishkaVerIdle
|
||||||
|
x: 165
|
||||||
|
y: 239
|
||||||
|
source: "Version box/Kishka Ver idle.svg"
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: folderbutt
|
||||||
|
x: 130
|
||||||
|
y: 304
|
||||||
|
width: 70
|
||||||
|
height: 40
|
||||||
|
visible: true
|
||||||
|
text: qsTr("Button")
|
||||||
|
topPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
icon.width: 335
|
||||||
|
icon.source: "Folder/Folder Idle.svg"
|
||||||
|
icon.height: 170
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
flat: true
|
||||||
|
display: AbstractButton.IconOnly
|
||||||
|
bottomPadding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: playbutt
|
||||||
|
x: 40
|
||||||
|
y: 57
|
||||||
|
width: 335
|
||||||
|
height: 170
|
||||||
|
visible: true
|
||||||
|
text: qsTr("Button")
|
||||||
|
icon.cache: false
|
||||||
|
rightPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
topPadding: 0
|
||||||
|
flat: true
|
||||||
|
icon.height: 170
|
||||||
|
icon.width: 335
|
||||||
|
display: AbstractButton.IconOnly
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
icon.source: "Play Button/Play Idle.svg"
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: optionsbut
|
||||||
|
x: 215
|
||||||
|
y: 304
|
||||||
|
width: 70
|
||||||
|
height: 40
|
||||||
|
visible: true
|
||||||
|
text: qsTr("Button")
|
||||||
|
topPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
icon.width: 335
|
||||||
|
icon.source: "Options/Options Idle.svg"
|
||||||
|
icon.height: 170
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
icon.cache: false
|
||||||
|
flat: true
|
||||||
|
display: AbstractButton.IconOnly
|
||||||
|
bottomPadding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "clicked"
|
||||||
|
when: playbutt.pressed
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: playbutt
|
||||||
|
x: 40
|
||||||
|
y: 55
|
||||||
|
rightPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
topPadding: 0
|
||||||
|
icon.source: "Play Button/Play pressed.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
State {
|
||||||
|
name: "Hover"
|
||||||
|
when: playbutt.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: playbutt
|
||||||
|
flat: true
|
||||||
|
icon.source: "Play Button/Play Active.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "Folder Pressed"
|
||||||
|
when: folderbutt.pressed
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: folderbutt
|
||||||
|
icon.source: "Folder/Folder Pressed.svg"
|
||||||
|
icon.height: 170
|
||||||
|
icon.width: 335
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
State {
|
||||||
|
name: "Folder Hover"
|
||||||
|
when: folderbutt.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: rectangle
|
||||||
|
color: "#2e2e2e"
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: folderbutt
|
||||||
|
x: 130
|
||||||
|
y: 304
|
||||||
|
icon.height: 170
|
||||||
|
icon.width: 335
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
icon.source: "Folder/Folder Active.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "Option Pressed"
|
||||||
|
when: optionsbut.pressed
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: optionsbut
|
||||||
|
icon.source: "Options/Options active.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "OptionHover"
|
||||||
|
when: optionsbut.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: optionsbut
|
||||||
|
icon.source: "Options/Options Pressed.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
177
Ui-TEMP/MinecraftUI.ui.qml
Normal file
177
Ui-TEMP/MinecraftUI.ui.qml
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
|
||||||
|
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
|
||||||
|
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
|
||||||
|
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
|
||||||
|
*/
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import UntitledProject1
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: rectangle
|
||||||
|
width: Constants.width
|
||||||
|
height: Constants.height
|
||||||
|
color: "#2e2e2e"
|
||||||
|
radius: 0
|
||||||
|
border.color: "#1a1a1a"
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: kishkaProfileIdle
|
||||||
|
x: 40
|
||||||
|
y: 239
|
||||||
|
source: "Profile Box/Kishka Profile Idle.svg"
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: kishkaVerIdle
|
||||||
|
x: 165
|
||||||
|
y: 239
|
||||||
|
source: "Version box/Kishka Ver idle.svg"
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: folderbutt
|
||||||
|
x: 130
|
||||||
|
y: 304
|
||||||
|
width: 70
|
||||||
|
height: 40
|
||||||
|
visible: true
|
||||||
|
text: qsTr("Button")
|
||||||
|
topPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
icon.width: 335
|
||||||
|
icon.source: "Folder/Folder Idle.svg"
|
||||||
|
icon.height: 170
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
flat: true
|
||||||
|
display: AbstractButton.IconOnly
|
||||||
|
bottomPadding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: playbutt
|
||||||
|
x: 40
|
||||||
|
y: 57
|
||||||
|
width: 335
|
||||||
|
height: 170
|
||||||
|
visible: true
|
||||||
|
text: qsTr("Button")
|
||||||
|
icon.cache: false
|
||||||
|
rightPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
topPadding: 0
|
||||||
|
flat: true
|
||||||
|
icon.height: 170
|
||||||
|
icon.width: 335
|
||||||
|
display: AbstractButton.IconOnly
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
icon.source: "Play Button/Play Idle.svg"
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: optionsbut
|
||||||
|
x: 215
|
||||||
|
y: 304
|
||||||
|
width: 70
|
||||||
|
height: 40
|
||||||
|
visible: true
|
||||||
|
text: qsTr("Button")
|
||||||
|
topPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
icon.width: 335
|
||||||
|
icon.source: "Options/Options Idle.svg"
|
||||||
|
icon.height: 170
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
icon.cache: false
|
||||||
|
flat: true
|
||||||
|
display: AbstractButton.IconOnly
|
||||||
|
bottomPadding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "clicked"
|
||||||
|
when: playbutt.pressed
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: playbutt
|
||||||
|
x: 40
|
||||||
|
y: 55
|
||||||
|
rightPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
topPadding: 0
|
||||||
|
icon.source: "Play Button/Play pressed.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
State {
|
||||||
|
name: "Hover"
|
||||||
|
when: playbutt.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: playbutt
|
||||||
|
flat: true
|
||||||
|
icon.source: "Play Button/Play Active.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "Folder Pressed"
|
||||||
|
when: folderbutt.pressed
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: folderbutt
|
||||||
|
icon.source: "Folder/Folder Pressed.svg"
|
||||||
|
icon.height: 170
|
||||||
|
icon.width: 335
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
State {
|
||||||
|
name: "Folder Hover"
|
||||||
|
when: folderbutt.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: rectangle
|
||||||
|
color: "#2e2e2e"
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: folderbutt
|
||||||
|
x: 130
|
||||||
|
y: 304
|
||||||
|
icon.height: 170
|
||||||
|
icon.width: 335
|
||||||
|
icon.color: "#0026282a"
|
||||||
|
icon.source: "Folder/Folder Active.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "Option Pressed"
|
||||||
|
when: optionsbut.pressed
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: optionsbut
|
||||||
|
icon.source: "Options/Options active.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "OptionHover"
|
||||||
|
when: optionsbut.hovered
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: optionsbut
|
||||||
|
icon.source: "Options/Options Pressed.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
347
mainwindow.cpp
347
mainwindow.cpp
@@ -1,6 +1,7 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h" // Подключаем сгенерированный заголовочный файл
|
#include "ui_mainwindow.h" // Подключаем сгенерированный заголовочный файл
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
|
#include "profiledialog.h" // Подключаем новый диалог
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
@@ -8,6 +9,12 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QInputDialog> // Для диалога выбора
|
#include <QInputDialog> // Для диалога выбора
|
||||||
#include <QFileInfo> // Для проверки файла
|
#include <QFileInfo> // Для проверки файла
|
||||||
|
#include <QJsonDocument> // Для работы с JSON
|
||||||
|
#include <QJsonObject> // Для работы с JSON
|
||||||
|
#include <QJsonArray> // Для работы с JSON
|
||||||
|
#include <QJsonValue> // Для работы с JSON
|
||||||
|
#include <QUuid> // Для генерации ID профиля
|
||||||
|
#include <QStandardPaths> // Для поиска папки с данными
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
@@ -28,6 +35,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
connect(process, &QProcess::readyReadStandardError, this, &MainWindow::readProcessOutput);
|
connect(process, &QProcess::readyReadStandardError, this, &MainWindow::readProcessOutput);
|
||||||
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onProcessFinished(int, QProcess::ExitStatus)));
|
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onProcessFinished(int, QProcess::ExitStatus)));
|
||||||
connect(process, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(onProcessError(QProcess::ProcessError)));
|
connect(process, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(onProcessError(QProcess::ProcessError)));
|
||||||
|
// Загружаем профили при старте
|
||||||
|
profilesPath = "/launcher_profiles.json";
|
||||||
|
loadProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@@ -35,59 +45,346 @@ MainWindow::~MainWindow()
|
|||||||
delete ui; // Освобождаем память от объекта UI
|
delete ui; // Освобождаем память от объекта UI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Вспомогательная функция для проверки правил OS
|
||||||
|
bool checkRules(const QJsonObject &item) {
|
||||||
|
if (!item.contains("rules")) {
|
||||||
|
return true; // Нет правил - разрешено для всех.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Если правила есть, по умолчанию запрещаем, пока не найдем разрешающее правило.
|
||||||
|
bool isAllowed = false;
|
||||||
|
|
||||||
|
QString currentOs;
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
currentOs = "windows";
|
||||||
|
#elif defined(Q_OS_MAC)
|
||||||
|
currentOs = "osx";
|
||||||
|
#elif defined(Q_OS_LINUX)
|
||||||
|
currentOs = "linux";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QJsonArray rules = item["rules"].toArray();
|
||||||
|
|
||||||
|
for (const QJsonValue &value : rules) {
|
||||||
|
QJsonObject rule = value.toObject();
|
||||||
|
QString action = rule["action"].toString();
|
||||||
|
|
||||||
|
bool conditionMet = false;
|
||||||
|
if (rule.contains("os")) {
|
||||||
|
QJsonObject osRule = rule["os"].toObject();
|
||||||
|
if (osRule.contains("name") && osRule["name"].toString() == currentOs) {
|
||||||
|
conditionMet = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Правило без указания ОС применяется ко всем системам.
|
||||||
|
conditionMet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conditionMet) {
|
||||||
|
if (action == "allow") {
|
||||||
|
isAllowed = true;
|
||||||
|
} else if (action == "disallow") {
|
||||||
|
isAllowed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::loadProfiles()
|
||||||
|
{
|
||||||
|
QFile profilesFile(profilesPath);
|
||||||
|
if (profilesFile.exists() && profilesFile.open(QIODevice::ReadOnly)) {
|
||||||
|
QJsonDocument doc = QJsonDocument::fromJson(profilesFile.readAll());
|
||||||
|
profilesData = doc.object();
|
||||||
|
profilesFile.close();
|
||||||
|
} else {
|
||||||
|
// Создаем базовую структуру, если файла нет
|
||||||
|
profilesData = QJsonObject({{"profiles", QJsonObject()}});
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject profiles = profilesData["profiles"].toObject();
|
||||||
|
ui->profileComboBox->clear();
|
||||||
|
|
||||||
|
if (profiles.isEmpty()) {
|
||||||
|
// Если профилей нет, принудительно открываем диалог создания
|
||||||
|
QMessageBox::information(this, "Настройка", "Не найдено ни одного профиля. Давайте создадим новый.");
|
||||||
|
createNewProfile();
|
||||||
|
return; // createNewProfile вызовет loadProfiles() повторно
|
||||||
|
}
|
||||||
|
|
||||||
|
// Заполняем ComboBox
|
||||||
|
for (const QString &key : profiles.keys()) {
|
||||||
|
QJsonObject profile = profiles[key].toObject();
|
||||||
|
ui->profileComboBox->addItem(profile["name"].toString(), key); // Имя и UUID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::saveProfiles()
|
||||||
|
{
|
||||||
|
QFile profilesFile(profilesPath);
|
||||||
|
if (profilesFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||||
|
QJsonDocument doc(profilesData);
|
||||||
|
profilesFile.write(doc.toJson(QJsonDocument::Indented));
|
||||||
|
profilesFile.close();
|
||||||
|
} else {
|
||||||
|
QMessageBox::critical(this, "Ошибка", "Не удалось сохранить файл профилей: " + profilesFile.errorString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_editProfileButton_clicked()
|
||||||
|
{
|
||||||
|
// 1. Проверяем, выбран ли профиль
|
||||||
|
QString currentProfileId = ui->profileComboBox->currentData().toString();
|
||||||
|
if (currentProfileId.isEmpty()) {
|
||||||
|
QMessageBox::warning(this, "Нет профиля", "Пожалуйста, выберите профиль для редактирования.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Получаем данные текущего профиля
|
||||||
|
QJsonObject profiles = profilesData["profiles"].toObject();
|
||||||
|
QJsonObject currentProfile = profiles[currentProfileId].toObject();
|
||||||
|
|
||||||
|
// 3. Создаем диалог и заполняем его данными
|
||||||
|
ProfileDialog dialog(this);
|
||||||
|
dialog.setWindowTitle("Редактирование профиля");
|
||||||
|
dialog.setProfileName(currentProfile["name"].toString());
|
||||||
|
dialog.setJavaPath(currentProfile["javaDir"].toString());
|
||||||
|
|
||||||
|
// 4. Показываем диалог и обрабатываем результат
|
||||||
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
|
if (dialog.profileName().isEmpty() || dialog.javaPath().isEmpty()) {
|
||||||
|
QMessageBox::warning(this, "Ошибка", "Имя профиля и путь к Java не могут быть пустыми.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. Обновляем данные в нашем JSON объекте
|
||||||
|
currentProfile["name"] = dialog.profileName();
|
||||||
|
currentProfile["javaDir"] = dialog.javaPath();
|
||||||
|
|
||||||
|
// 6. Записываем обновленный профиль обратно
|
||||||
|
profiles[currentProfileId] = currentProfile;
|
||||||
|
profilesData["profiles"] = profiles;
|
||||||
|
|
||||||
|
// 7. Сохраняем и перезагружаем список
|
||||||
|
saveProfiles();
|
||||||
|
|
||||||
|
// Сохраняем ID, чтобы восстановить выбор после перезагрузки
|
||||||
|
QString previouslySelectedId = currentProfileId;
|
||||||
|
loadProfiles();
|
||||||
|
int indexToSelect = ui->profileComboBox->findData(previouslySelectedId);
|
||||||
|
if (indexToSelect != -1) {
|
||||||
|
ui->profileComboBox->setCurrentIndex(indexToSelect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::createNewProfile()
|
||||||
|
{
|
||||||
|
ProfileDialog dialog(this);
|
||||||
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
|
if (dialog.profileName().isEmpty() || dialog.javaPath().isEmpty()) {
|
||||||
|
QMessageBox::warning(this, "Ошибка", "Имя профиля и путь к Java не могут быть пустыми.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString uuid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||||
|
QJsonObject newProfile;
|
||||||
|
newProfile["name"] = dialog.profileName();
|
||||||
|
newProfile["javaDir"] = dialog.javaPath();
|
||||||
|
newProfile["lastVersionId"] = "";
|
||||||
|
newProfile["created"] = QDateTime::currentDateTime().toString(Qt::ISODate);
|
||||||
|
newProfile["lastUsed"] = QDateTime::currentDateTime().toString(Qt::ISODate);
|
||||||
|
newProfile["icon"] = "Bedrock";
|
||||||
|
newProfile["type"] = "custom";
|
||||||
|
|
||||||
|
QJsonObject profiles = profilesData["profiles"].toObject();
|
||||||
|
profiles[uuid] = newProfile;
|
||||||
|
profilesData["profiles"] = profiles;
|
||||||
|
|
||||||
|
saveProfiles();
|
||||||
|
loadProfiles(); // Перезагружаем список профилей
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_addProfileButton_clicked()
|
||||||
|
{
|
||||||
|
createNewProfile();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_profileComboBox_currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
// Пока ничего не делаем, но слот полезен для будущего
|
||||||
|
Q_UNUSED(index);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_launchButton_clicked()
|
void MainWindow::on_launchButton_clicked()
|
||||||
{
|
{
|
||||||
|
QString currentProfileId = ui->profileComboBox->currentData().toString();
|
||||||
|
if (currentProfileId.isEmpty()) {
|
||||||
|
QMessageBox::critical(this, "Ошибка", "Не выбран профиль для запуска!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QJsonObject profile = profilesData["profiles"].toObject()[currentProfileId].toObject();
|
||||||
|
QString javaPath = profile["javaDir"].toString();
|
||||||
|
if (!QFileInfo::exists(javaPath)) {
|
||||||
|
QMessageBox::critical(this, "Ошибка", "Не найден исполняемый файл Java, указанный в профиле:\n" + javaPath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// --- 1. Выбор версии (остается без изменений) ---
|
||||||
QString minecraftPath = getMinecraftPath();
|
QString minecraftPath = getMinecraftPath();
|
||||||
if (minecraftPath.isEmpty()) {
|
if (minecraftPath.isEmpty()) {
|
||||||
QMessageBox::warning(this, "Ошибка", "Не удалось найти директорию .minecraft.");
|
QMessageBox::warning(this, "Ошибка", "Не удалось найти директорию .minecraft.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
QString versionsPath = QDir::toNativeSeparators(minecraftPath + "/versions");
|
||||||
// 1. Находим папку с версиями
|
|
||||||
QString versionsPath = minecraftPath + "/versions";
|
|
||||||
QDir versionsDir(versionsPath);
|
QDir versionsDir(versionsPath);
|
||||||
if (!versionsDir.exists()) {
|
if (!versionsDir.exists()) {
|
||||||
QMessageBox::warning(this, "Ошибка", "Папка 'versions' не найдена!");
|
QMessageBox::warning(this, "Ошибка", "Папка 'versions' не найдена!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Получаем список всех папок внутри 'versions' (это и есть наши версии)
|
|
||||||
QStringList versionList = versionsDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
QStringList versionList = versionsDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
if (versionList.isEmpty()) {
|
if (versionList.isEmpty()) {
|
||||||
QMessageBox::warning(this, "Ошибка", "Не найдено ни одной установленной версии Minecraft.");
|
QMessageBox::warning(this, "Ошибка", "Не найдено ни одной установленной версии Minecraft.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Предлагаем пользователю выбрать версию
|
|
||||||
bool ok;
|
bool ok;
|
||||||
QString selectedVersion = QInputDialog::getItem(this, "Выбор версии",
|
QString selectedVersion = QInputDialog::getItem(this, "Выбор версии",
|
||||||
"Выберите версию Minecraft для запуска:",
|
"Выберите версию Minecraft для запуска:",
|
||||||
versionList, 0, false, &ok);
|
versionList, 0, false, &ok);
|
||||||
|
if (!ok || selectedVersion.isEmpty()) {
|
||||||
|
return; // Пользователь отменил выбор
|
||||||
|
}
|
||||||
|
|
||||||
// 4. Если пользователь сделал выбор (нажал "OK" и версия не пустая)
|
// --- 2. Чтение и парсинг JSON файла версии ---
|
||||||
if (ok && !selectedVersion.isEmpty()) {
|
QString jsonPath = QDir::toNativeSeparators(versionsPath + "/" + selectedVersion + "/" + selectedVersion + ".json");
|
||||||
// Формируем путь к .jar файлу. Например: /.minecraft/versions/1.19.2/1.19.2.jar
|
QFile jsonFile(jsonPath);
|
||||||
QString jarPath = versionsPath + "/" + selectedVersion + "/" + selectedVersion + ".jar";
|
if (!jsonFile.open(QIODevice::ReadOnly)) {
|
||||||
|
QMessageBox::critical(this, "Ошибка", "Не удалось открыть .json файл для версии " + selectedVersion);
|
||||||
// Проверяем, что .jar файл действительно существует
|
|
||||||
QFileInfo jarFile(jarPath);
|
|
||||||
if (!jarFile.exists() || !jarFile.isFile()) {
|
|
||||||
QMessageBox::critical(this, "Ошибка запуска",
|
|
||||||
"Не удалось найти запускаемый .jar файл для версии " + selectedVersion + ".\n"
|
|
||||||
"Проверьте целостность файлов игры.\n"
|
|
||||||
"Ожидаемый путь: " + jarPath);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
QByteArray jsonData = jsonFile.readAll();
|
||||||
|
jsonFile.close();
|
||||||
|
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData);
|
||||||
|
if (jsonDoc.isNull()) {
|
||||||
|
QMessageBox::critical(this, "Ошибка", "Некорректный .json файл для версии " + selectedVersion);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QJsonObject rootObj = jsonDoc.object();
|
||||||
|
|
||||||
// 5. Запускаем игру
|
// --- 3. Формирование Classpath ---
|
||||||
QString javaPath = "java"; // Java должна быть в системной переменной PATH
|
QStringList classpathEntries;
|
||||||
QStringList arguments;
|
QString librariesPath = QDir::toNativeSeparators(minecraftPath + "/libraries");
|
||||||
arguments << "-jar" << jarPath << "net.fabricmc.loader.impl.launch.knot.KnotClient";
|
QJsonArray libraries = rootObj["libraries"].toArray();
|
||||||
|
|
||||||
|
for (const QJsonValue &value : libraries) {
|
||||||
|
QJsonObject library = value.toObject();
|
||||||
|
|
||||||
|
if (!checkRules(library)) {
|
||||||
|
continue; // Пропускаем библиотеку, если она не для этой ОС
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject downloads = library["downloads"].toObject();
|
||||||
|
if(downloads.isEmpty()){ // Для Fabric Loader и некоторых других
|
||||||
|
QString name = library["name"].toString();
|
||||||
|
QStringList parts = name.split(':');
|
||||||
|
QString path = parts[0].replace('.', '/') + "/" + parts[1] + "/" + parts[2] + "/" + parts[1] + "-" + parts[2] + ".jar";
|
||||||
|
classpathEntries << QDir::toNativeSeparators(librariesPath + "/" + path);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
QJsonObject artifact = downloads["artifact"].toObject();
|
||||||
|
QString path = artifact["path"].toString();
|
||||||
|
classpathEntries << QDir::toNativeSeparators(librariesPath + "/" + path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Добавляем сам .jar файл игры в classpath
|
||||||
|
classpathEntries << QDir::toNativeSeparators(versionsPath + "/" + selectedVersion + "/" + selectedVersion + ".jar");
|
||||||
|
|
||||||
|
// Определяем разделитель для classpath в зависимости от ОС
|
||||||
|
QString pathSeparator;
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
pathSeparator = ";";
|
||||||
|
#else
|
||||||
|
pathSeparator = ":";
|
||||||
|
#endif
|
||||||
|
QString classpath = classpathEntries.join(pathSeparator);
|
||||||
|
|
||||||
|
// --- 4. Сборка аргументов ---
|
||||||
|
QStringList jvmArgs;
|
||||||
|
QStringList gameArgs;
|
||||||
|
|
||||||
|
// Аргументы для JVM
|
||||||
|
QJsonObject argumentsObj = rootObj["arguments"].toObject();
|
||||||
|
QJsonArray jvmArgsArray = argumentsObj["jvm"].toArray();
|
||||||
|
for (const QJsonValue &value : jvmArgsArray) {
|
||||||
|
if (value.isString()) {
|
||||||
|
jvmArgs << value.toString();
|
||||||
|
} else if (value.isObject()) {
|
||||||
|
if (checkRules(value.toObject())) {
|
||||||
|
QJsonArray values = value.toObject()["values"].toArray();
|
||||||
|
for(const QJsonValue &v : values){
|
||||||
|
jvmArgs << v.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Аргументы для игры
|
||||||
|
QJsonArray gameArgsArray = argumentsObj["game"].toArray();
|
||||||
|
for (const QJsonValue &value : gameArgsArray) {
|
||||||
|
if (value.isString()) {
|
||||||
|
gameArgs << value.toString();
|
||||||
|
} else if (value.isObject()) {
|
||||||
|
if (checkRules(value.toObject())) {
|
||||||
|
QJsonArray values = value.toObject()["values"].toArray();
|
||||||
|
for(const QJsonValue &v : values){
|
||||||
|
gameArgs << v.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 5. Подстановка значений в плейсхолдеры ---
|
||||||
|
QString nativesPath = QDir::toNativeSeparators(versionsPath + "/" + selectedVersion + "/natives");
|
||||||
|
QDir(nativesPath).mkpath("."); // Создаем папку для нативных библиотек, если ее нет
|
||||||
|
|
||||||
|
// Заменители для JVM аргументов
|
||||||
|
for (QString &arg : jvmArgs) {
|
||||||
|
arg.replace("${natives_directory}", nativesPath);
|
||||||
|
arg.replace("${launcher_name}", "CustomLauncher");
|
||||||
|
arg.replace("${launcher_version}", "1.0");
|
||||||
|
arg.replace("${classpath}", classpath);
|
||||||
|
}
|
||||||
|
// Заменители для игровых аргументов (используем базовые значения)
|
||||||
|
for (QString &arg : gameArgs) {
|
||||||
|
arg.replace("${auth_player_name}", "Player");
|
||||||
|
arg.replace("${version_name}", selectedVersion);
|
||||||
|
arg.replace("${game_directory}", minecraftPath);
|
||||||
|
arg.replace("${assets_root}", QDir::toNativeSeparators(minecraftPath + "/assets"));
|
||||||
|
arg.replace("${assets_index_name}", rootObj["assetIndex"].toObject()["id"].toString());
|
||||||
|
arg.replace("${auth_uuid}", "00000000-0000-0000-0000-000000000000");
|
||||||
|
arg.replace("${auth_access_token}", "0");
|
||||||
|
arg.replace("${clientid}", "N/A");
|
||||||
|
arg.replace("${auth_xuid}", "N/A");
|
||||||
|
arg.replace("${user_type}", "msa");
|
||||||
|
arg.replace("${version_type}", rootObj["type"].toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 6. Финальная сборка и запуск ---
|
||||||
|
QString mainClass = rootObj["mainClass"].toString();
|
||||||
|
//QString javaPath = "java";
|
||||||
|
|
||||||
|
QStringList finalArguments;
|
||||||
|
finalArguments << jvmArgs << mainClass << gameArgs;
|
||||||
|
|
||||||
ui->logOutput->appendPlainText("Запуск Minecraft версии: " + selectedVersion);
|
ui->logOutput->appendPlainText("Запуск Minecraft версии: " + selectedVersion);
|
||||||
process->start(javaPath, arguments);
|
ui->logOutput->appendPlainText("Главный класс: " + mainClass);
|
||||||
|
// Для отладки можно вывести всю команду
|
||||||
|
ui->logOutput->appendPlainText("Команда: " + javaPath + " " + finalArguments.join(" "));
|
||||||
|
|
||||||
|
process->start(javaPath, finalArguments);
|
||||||
ui->progressBar->setVisible(true);
|
ui->progressBar->setVisible(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_modsFolderButton_clicked()
|
void MainWindow::on_modsFolderButton_clicked()
|
||||||
|
|||||||
11
mainwindow.h
11
mainwindow.h
@@ -4,6 +4,7 @@
|
|||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QJsonObject> // Важно: добавить для хранения данных профилей
|
||||||
|
|
||||||
// Предварительное объявление класса, сгенерированного из mainwindow.ui
|
// Предварительное объявление класса, сгенерированного из mainwindow.ui
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@@ -24,6 +25,9 @@ private slots:
|
|||||||
void on_modsFolderButton_clicked();
|
void on_modsFolderButton_clicked();
|
||||||
void on_updateModsButton_clicked();
|
void on_updateModsButton_clicked();
|
||||||
void on_settingsButton_clicked();
|
void on_settingsButton_clicked();
|
||||||
|
void on_addProfileButton_clicked(); // Слот для кнопки "Новый..."
|
||||||
|
void on_editProfileButton_clicked(); // <-- ДОБАВЬТЕ ЭТОТ СЛОТ
|
||||||
|
void on_profileComboBox_currentIndexChanged(int index); // Слот для смены профиля
|
||||||
|
|
||||||
// Слоты для QProcess (подключаются вручную)
|
// Слоты для QProcess (подключаются вручную)
|
||||||
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
@@ -33,6 +37,13 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
QString getMinecraftPath();
|
QString getMinecraftPath();
|
||||||
|
|
||||||
|
// Новые методы для работы с профилями
|
||||||
|
void loadProfiles();
|
||||||
|
void saveProfiles();
|
||||||
|
void createNewProfile();
|
||||||
|
QString profilesPath; // Путь к launcher_profiles.json
|
||||||
|
QJsonObject profilesData; // JSON данные из файла
|
||||||
|
|
||||||
Ui::MainWindow *ui; // Указатель на объект интерфейса
|
Ui::MainWindow *ui; // Указатель на объект интерфейса
|
||||||
QProcess *process;
|
QProcess *process;
|
||||||
QSettings *settings;
|
QSettings *settings;
|
||||||
|
|||||||
@@ -15,6 +15,34 @@
|
|||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Профиль:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="profileComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addProfileButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Новый...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="editProfileButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Редактировать...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="launchButton">
|
<widget class="QPushButton" name="launchButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
32
profiledialog.h
Normal file
32
profiledialog.h
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#ifndef PROFILEDIALOG_H
|
||||||
|
#define PROFILEDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ProfileDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ProfileDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ProfileDialog(QWidget *parent = nullptr);
|
||||||
|
~ProfileDialog();
|
||||||
|
|
||||||
|
QString profileName() const;
|
||||||
|
QString javaPath() const;
|
||||||
|
// === НОВЫЕ ФУНКЦИИ ===
|
||||||
|
void setProfileName(const QString &name);
|
||||||
|
void setJavaPath(const QString &path);
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_browseButton_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ProfileDialog *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PROFILEDIALOG_H
|
||||||
99
profiledialog.ui
Normal file
99
profiledialog.ui
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ProfileDialog</class>
|
||||||
|
<widget class="QDialog" name="ProfileDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>450</width>
|
||||||
|
<height>150</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Настройка профиля</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Имя профиля:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="profileNameEdit"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Путь к Java:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="javaPathEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="browseButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>ProfileDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>ProfileDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user