more work

This commit is contained in:
2026-06-04 17:30:41 +02:00
parent 506e4ff6f9
commit 4b9b26f8af
13 changed files with 104 additions and 75 deletions
+17 -11
View File
@@ -7,21 +7,27 @@
GeneralSettings::GeneralSettings() {
QSettings settings;
description.setText("Saves path:");
selectedFolderLabel.setDisabled(true);
selectedFolderLabel.setText(Options::GetSavesPath().c_str());
folderSelectButton.setText("Choose...");
connect(&folderSelectButton, &QPushButton::clicked, this, [&] {
description = new QLabel("Path:");
description->setToolTip("Path where game saves are stored.");
selectedFolderLabel = new QLabel(Options::GetSavesPath().c_str());
selectedFolderLabel->setDisabled(true);
folderSelectButton = new QPushButton("Choose...");
connect(folderSelectButton, &QPushButton::clicked, this, [&] {
auto dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QCoreApplication::applicationDirPath(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
selectedFolderLabel.setText(dir);
selectedFolderLabel->setText(dir);
Options::SetSavesPath(dir.toStdString());
settings.setValue("general/saves_path", dir);
});
h.addWidget(&description);
h.addWidget(&selectedFolderLabel);
h.addWidget(&folderSelectButton);
v.addLayout(&h);
setLayout(&v);
h = new QHBoxLayout(this);
h->addWidget(description);
h->addWidget(selectedFolderLabel);
h->addWidget(folderSelectButton);
v = new QVBoxLayout(this);
v->addLayout(h);
setLayout(v);
}