2021-11-01 13:14:00 -04:00
|
|
|
#include "settingswindow.h"
|
|
|
|
|
|
|
|
#include <QFormLayout>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QDesktopServices>
|
2021-11-01 13:35:27 -04:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QFileDialog>
|
2021-11-01 14:35:32 -04:00
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QGroupBox>
|
2021-11-02 08:27:00 -04:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QProcess>
|
2021-11-09 10:37:48 -05:00
|
|
|
#include <QGridLayout>
|
2021-11-01 13:14:00 -04:00
|
|
|
|
|
|
|
#include "xivlauncher.h"
|
|
|
|
|
|
|
|
SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window(window), QWidget(parent) {
|
|
|
|
setWindowTitle("Settings");
|
|
|
|
setWindowModality(Qt::WindowModality::ApplicationModal);
|
|
|
|
|
2021-11-09 10:37:48 -05:00
|
|
|
auto mainLayout = new QGridLayout(this);
|
|
|
|
setLayout(mainLayout);
|
|
|
|
|
2021-11-09 11:44:27 -05:00
|
|
|
profileWidget = new QListWidget();
|
2021-11-09 12:06:30 -05:00
|
|
|
profileWidget->addItem("INVALID *DEBUG*");
|
|
|
|
profileWidget->setCurrentRow(0);
|
|
|
|
|
2021-11-09 12:10:52 -05:00
|
|
|
connect(profileWidget, &QListWidget::currentRowChanged, this, &SettingsWindow::reloadControls);
|
2021-11-09 12:06:30 -05:00
|
|
|
|
2021-11-09 13:38:48 -05:00
|
|
|
mainLayout->addWidget(profileWidget, 0, 0, 0, 1);
|
2021-11-01 13:14:00 -04:00
|
|
|
|
2021-11-09 11:44:27 -05:00
|
|
|
auto addProfileButton = new QPushButton("Add Profile");
|
|
|
|
connect(addProfileButton, &QPushButton::pressed, [=] {
|
2021-11-09 13:44:37 -05:00
|
|
|
profileWidget->setCurrentRow(this->window.addProfile());
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
2021-11-09 11:44:27 -05:00
|
|
|
});
|
2021-11-09 13:44:37 -05:00
|
|
|
mainLayout->addWidget(addProfileButton, 2, 0);
|
|
|
|
|
|
|
|
deleteProfileButton = new QPushButton("Delete Profile");
|
|
|
|
connect(deleteProfileButton, &QPushButton::pressed, [=] {
|
|
|
|
profileWidget->setCurrentRow(this->window.deleteProfile(getCurrentProfile().name));
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
|
|
|
mainLayout->addWidget(deleteProfileButton, 3, 0);
|
2021-11-09 11:44:27 -05:00
|
|
|
|
2021-11-09 12:10:52 -05:00
|
|
|
nameEdit = new QLineEdit();
|
|
|
|
connect(nameEdit, &QLineEdit::editingFinished, [=] {
|
|
|
|
getCurrentProfile().name = nameEdit->text();
|
|
|
|
|
|
|
|
reloadControls();
|
2021-11-09 12:16:14 -05:00
|
|
|
this->window.saveSettings();
|
2021-11-09 12:10:52 -05:00
|
|
|
});
|
2021-11-09 13:38:48 -05:00
|
|
|
mainLayout->addWidget(nameEdit, 0, 1);
|
2021-11-09 12:10:52 -05:00
|
|
|
|
2021-11-09 10:50:45 -05:00
|
|
|
auto gameBox = new QGroupBox("Game Options");
|
|
|
|
auto gameBoxLayout = new QFormLayout();
|
|
|
|
gameBox->setLayout(gameBoxLayout);
|
|
|
|
|
2021-11-09 13:38:48 -05:00
|
|
|
mainLayout->addWidget(gameBox, 1, 1);
|
2021-11-09 10:50:45 -05:00
|
|
|
|
2021-11-09 12:06:30 -05:00
|
|
|
directXCombo = new QComboBox();
|
2021-11-02 08:49:06 -04:00
|
|
|
directXCombo->addItem("DirectX 11");
|
|
|
|
directXCombo->addItem("DirectX 9");
|
2021-11-09 10:50:45 -05:00
|
|
|
gameBoxLayout->addRow("DirectX Version", directXCombo);
|
2021-11-02 08:49:06 -04:00
|
|
|
|
2021-11-18 07:30:38 -05:00
|
|
|
connect(directXCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [=](int index) {
|
2021-11-09 12:10:52 -05:00
|
|
|
getCurrentProfile().useDX9 = directXCombo->currentIndex() == 1;
|
2021-11-09 12:16:14 -05:00
|
|
|
this->window.saveSettings();
|
2021-11-02 08:49:06 -04:00
|
|
|
});
|
|
|
|
|
2021-11-09 12:46:27 -05:00
|
|
|
currentGameDirectory = new QLabel(window.currentProfile().gamePath);
|
2021-11-09 10:50:45 -05:00
|
|
|
currentGameDirectory->setWordWrap(true);
|
|
|
|
gameBoxLayout->addRow("Game Directory", currentGameDirectory);
|
|
|
|
|
|
|
|
auto selectDirectoryButton = new QPushButton("Select Game Directory");
|
2021-11-09 12:46:27 -05:00
|
|
|
connect(selectDirectoryButton, &QPushButton::pressed, [this] {
|
|
|
|
getCurrentProfile().gamePath = QFileDialog::getExistingDirectory(this, "Open Game Directory");
|
2021-11-09 10:50:45 -05:00
|
|
|
|
2021-11-09 12:46:27 -05:00
|
|
|
this->reloadControls();
|
|
|
|
this->window.saveSettings();
|
|
|
|
|
2021-11-09 13:11:21 -05:00
|
|
|
this->window.readGameVersion();
|
2021-11-09 10:50:45 -05:00
|
|
|
});
|
|
|
|
gameBoxLayout->addWidget(selectDirectoryButton);
|
|
|
|
|
|
|
|
auto gameDirectoryButton = new QPushButton("Open Game Directory");
|
|
|
|
connect(gameDirectoryButton, &QPushButton::pressed, [this] {
|
2021-11-09 12:46:27 -05:00
|
|
|
openPath(getCurrentProfile().gamePath);
|
2021-11-09 10:50:45 -05:00
|
|
|
});
|
|
|
|
gameBoxLayout->addWidget(gameDirectoryButton);
|
|
|
|
|
2021-11-09 11:06:42 -05:00
|
|
|
auto loginBox = new QGroupBox("Login Options");
|
|
|
|
auto loginBoxLayout = new QFormLayout();
|
|
|
|
loginBox->setLayout(loginBoxLayout);
|
|
|
|
|
2021-11-09 13:38:48 -05:00
|
|
|
mainLayout->addWidget(loginBox, 2, 1);
|
2021-11-09 11:06:42 -05:00
|
|
|
|
2021-11-09 21:13:21 -05:00
|
|
|
encryptArgumentsBox = new QCheckBox();
|
|
|
|
connect(encryptArgumentsBox, &QCheckBox::stateChanged, [=](int) {
|
|
|
|
getCurrentProfile().encryptArguments = encryptArgumentsBox->isChecked();
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
|
|
|
loginBoxLayout->addRow("Encrypt Game Arguments", encryptArgumentsBox);
|
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
enableDalamudBox = new QCheckBox();
|
|
|
|
connect(enableDalamudBox, &QCheckBox::stateChanged, [=](int) {
|
|
|
|
getCurrentProfile().enableDalamud = enableDalamudBox->isChecked();
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
|
|
|
loginBoxLayout->addRow("Enable Dalamud Injection", enableDalamudBox);
|
|
|
|
|
2021-11-09 12:38:18 -05:00
|
|
|
serverType = new QComboBox();
|
2021-11-09 11:08:08 -05:00
|
|
|
serverType->insertItem(0, "Square Enix");
|
|
|
|
serverType->insertItem(1, "Sapphire");
|
2021-11-09 12:38:18 -05:00
|
|
|
|
2021-11-18 07:30:38 -05:00
|
|
|
connect(serverType, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [=](int index) {
|
2021-11-09 13:50:32 -05:00
|
|
|
getCurrentProfile().isSapphire = index == 1;
|
2021-11-09 12:42:05 -05:00
|
|
|
|
2021-11-09 13:50:32 -05:00
|
|
|
reloadControls();
|
2021-11-09 12:42:05 -05:00
|
|
|
this->window.reloadControls();
|
2021-11-09 12:38:18 -05:00
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
2021-11-09 11:08:08 -05:00
|
|
|
|
|
|
|
loginBoxLayout->addRow("Server Lobby", serverType);
|
|
|
|
|
2021-11-09 12:50:37 -05:00
|
|
|
lobbyServerURL = new QLineEdit();
|
|
|
|
connect(lobbyServerURL, &QLineEdit::editingFinished, [=] {
|
|
|
|
getCurrentProfile().lobbyURL = lobbyServerURL->text();
|
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
2021-11-09 11:08:08 -05:00
|
|
|
loginBoxLayout->addRow("Lobby URL", lobbyServerURL);
|
|
|
|
|
2021-11-09 12:32:18 -05:00
|
|
|
rememberUsernameBox = new QCheckBox();
|
|
|
|
connect(rememberUsernameBox, &QCheckBox::stateChanged, [=](int) {
|
|
|
|
getCurrentProfile().rememberUsername = rememberUsernameBox->isChecked();
|
2021-11-09 12:42:05 -05:00
|
|
|
|
|
|
|
this->window.reloadControls();
|
2021-11-09 12:32:18 -05:00
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
2021-11-09 11:06:42 -05:00
|
|
|
loginBoxLayout->addRow("Remember Username?", rememberUsernameBox);
|
|
|
|
|
2021-11-09 12:32:18 -05:00
|
|
|
rememberPasswordBox = new QCheckBox();
|
|
|
|
connect(rememberPasswordBox, &QCheckBox::stateChanged, [=](int) {
|
|
|
|
getCurrentProfile().rememberPassword = rememberPasswordBox->isChecked();
|
2021-11-09 12:42:05 -05:00
|
|
|
|
|
|
|
this->window.reloadControls();
|
2021-11-09 12:32:18 -05:00
|
|
|
this->window.saveSettings();
|
|
|
|
});
|
2021-11-09 11:06:42 -05:00
|
|
|
loginBoxLayout->addRow("Remember Password?", rememberPasswordBox);
|
|
|
|
|
2021-11-02 20:04:53 -04:00
|
|
|
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
2021-11-02 14:53:46 -04:00
|
|
|
auto wineBox = new QGroupBox("Wine Options");
|
|
|
|
auto wineBoxLayout = new QFormLayout();
|
|
|
|
wineBox->setLayout(wineBoxLayout);
|
|
|
|
|
2021-11-09 13:38:48 -05:00
|
|
|
mainLayout->addWidget(wineBox, 1, 2, 2, 2);
|
2021-11-02 20:04:53 -04:00
|
|
|
|
|
|
|
auto infoLabel = new QLabel("This is a list of possible enhancements you can make to your Wine gaming experience.\n"
|
|
|
|
"This is all stuff you can do outside of the launcher, but we can take care of it for you.");
|
|
|
|
infoLabel->setWordWrap(true);
|
2021-11-02 14:53:46 -04:00
|
|
|
wineBoxLayout->addWidget(infoLabel);
|
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
winePathLabel = new QLabel(window.currentProfile().winePath);
|
2021-11-03 06:18:31 -04:00
|
|
|
winePathLabel->setWordWrap(true);
|
|
|
|
wineBoxLayout->addRow("Wine Executable", winePathLabel);
|
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
wineVersionCombo = new QComboBox();
|
2021-11-03 06:18:31 -04:00
|
|
|
|
|
|
|
#if defined(Q_OS_MAC)
|
|
|
|
wineVersionCombo->insertItem(2, "FFXIV Built-In");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
wineVersionCombo->insertItem(0, "System Wine");
|
|
|
|
wineVersionCombo->insertItem(1, "Custom Path...");
|
2021-11-09 13:04:22 -05:00
|
|
|
|
2021-11-03 06:18:31 -04:00
|
|
|
wineBoxLayout->addWidget(wineVersionCombo);
|
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
selectWineButton = new QPushButton("Select Wine Executable");
|
2021-11-03 06:18:31 -04:00
|
|
|
wineBoxLayout->addWidget(selectWineButton);
|
|
|
|
|
2021-11-18 07:30:38 -05:00
|
|
|
connect(wineVersionCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this](int index) {
|
2021-11-09 13:04:22 -05:00
|
|
|
getCurrentProfile().wineVersion = index;
|
|
|
|
|
2021-11-10 04:30:01 -05:00
|
|
|
this->window.readWineInfo(getCurrentProfile());
|
2021-11-09 13:04:22 -05:00
|
|
|
this->window.saveSettings();
|
|
|
|
this->reloadControls();
|
2021-11-03 06:18:31 -04:00
|
|
|
});
|
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
connect(selectWineButton, &QPushButton::pressed, [this] {
|
|
|
|
getCurrentProfile().winePath = QFileDialog::getOpenFileName(this, "Open Wine Executable");
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
|
|
|
this->reloadControls();
|
2021-11-03 06:18:31 -04:00
|
|
|
});
|
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
winePrefixDirectory = new QLabel(window.currentProfile().winePrefixPath);
|
2021-11-03 06:31:02 -04:00
|
|
|
winePrefixDirectory->setWordWrap(true);
|
|
|
|
wineBoxLayout->addRow("Wine Prefix", winePrefixDirectory);
|
|
|
|
|
|
|
|
auto selectPrefixButton = new QPushButton("Select Wine Prefix");
|
2021-11-09 13:04:22 -05:00
|
|
|
connect(selectPrefixButton, &QPushButton::pressed, [this] {
|
|
|
|
getCurrentProfile().winePrefixPath = QFileDialog::getExistingDirectory(this, "Open Wine Prefix");
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
|
|
|
this->reloadControls();
|
2021-11-03 06:31:02 -04:00
|
|
|
});
|
|
|
|
wineBoxLayout->addWidget(selectPrefixButton);
|
|
|
|
|
|
|
|
auto openPrefixButton = new QPushButton("Open Wine Prefix");
|
|
|
|
connect(openPrefixButton, &QPushButton::pressed, [this] {
|
2021-11-09 13:04:22 -05:00
|
|
|
openPath(getCurrentProfile().winePrefixPath);
|
2021-11-03 06:31:02 -04:00
|
|
|
});
|
|
|
|
wineBoxLayout->addWidget(openPrefixButton);
|
|
|
|
|
2021-11-02 20:04:53 -04:00
|
|
|
auto enableDXVKhud = new QCheckBox("Enable DXVK HUD");
|
2021-11-09 11:03:44 -05:00
|
|
|
enableDXVKhud->setChecked(window.currentProfile().enableDXVKhud);
|
2021-11-02 20:04:53 -04:00
|
|
|
wineBoxLayout->addWidget(enableDXVKhud);
|
|
|
|
|
|
|
|
connect(enableDXVKhud, &QCheckBox::stateChanged, [this](int state) {
|
2021-11-09 11:03:44 -05:00
|
|
|
this->window.currentProfile().enableDXVKhud = state;
|
2021-11-02 20:04:53 -04:00
|
|
|
this->window.settings.setValue("enableDXVKhud", static_cast<bool>(state));
|
|
|
|
});
|
|
|
|
#endif
|
|
|
|
|
2021-11-01 14:35:32 -04:00
|
|
|
#if defined(Q_OS_LINUX)
|
2021-11-09 13:08:25 -05:00
|
|
|
useEsync = new QCheckBox("Use Esync");
|
2021-11-01 14:35:32 -04:00
|
|
|
wineBoxLayout->addWidget(useEsync);
|
|
|
|
|
|
|
|
auto esyncLabel = new QLabel("Improves general game performance, but requires a Wine built with the Esync patches.\n"
|
|
|
|
"If you use the latest Wine staging, it should work.");
|
2021-11-02 14:53:46 -04:00
|
|
|
esyncLabel->setWordWrap(true);
|
2021-11-01 14:35:32 -04:00
|
|
|
wineBoxLayout->addWidget(esyncLabel);
|
|
|
|
|
|
|
|
connect(useEsync, &QCheckBox::stateChanged, [this](int state) {
|
2021-11-09 13:08:25 -05:00
|
|
|
getCurrentProfile().useEsync = state;
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
2021-11-01 14:35:32 -04:00
|
|
|
});
|
|
|
|
|
2021-11-09 13:08:25 -05:00
|
|
|
useGamescope = new QCheckBox("Use Gamescope");
|
2021-11-02 20:04:53 -04:00
|
|
|
wineBoxLayout->addWidget(useGamescope);
|
2021-11-01 14:35:32 -04:00
|
|
|
|
|
|
|
auto gamescopeLabel = new QLabel("Use the SteamOS compositor that uses Wayland.\n"
|
|
|
|
"If you are experiencing input issues on XWayland, try this option if you have it installed.");
|
2021-11-02 14:53:46 -04:00
|
|
|
gamescopeLabel->setWordWrap(true);
|
2021-11-01 14:35:32 -04:00
|
|
|
wineBoxLayout->addWidget(gamescopeLabel);
|
|
|
|
|
|
|
|
connect(useGamescope, &QCheckBox::stateChanged, [this](int state) {
|
2021-11-09 13:08:25 -05:00
|
|
|
getCurrentProfile().useGamescope = state;
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
2021-11-01 14:35:32 -04:00
|
|
|
});
|
|
|
|
|
2021-11-09 13:08:25 -05:00
|
|
|
useGamemode = new QCheckBox("Use Gamemode");
|
2021-11-01 14:35:32 -04:00
|
|
|
wineBoxLayout->addWidget(useGamemode);
|
|
|
|
|
|
|
|
auto gamemodeLabel = new QLabel("Use Feral Interactive's GameMode, which applies a couple of performance enhancements.\n"
|
|
|
|
"May give a slight performance boost, but requires GameMode to be installed.\n");
|
2021-11-02 14:53:46 -04:00
|
|
|
gamemodeLabel->setWordWrap(true);
|
2021-11-01 14:35:32 -04:00
|
|
|
wineBoxLayout->addWidget(gamemodeLabel);
|
|
|
|
|
|
|
|
connect(useGamemode, &QCheckBox::stateChanged, [this](int state) {
|
2021-11-09 13:08:25 -05:00
|
|
|
getCurrentProfile().useGamemode = state;
|
|
|
|
|
|
|
|
this->window.saveSettings();
|
2021-11-01 14:35:32 -04:00
|
|
|
});
|
|
|
|
#endif
|
2021-11-09 11:44:27 -05:00
|
|
|
|
|
|
|
reloadControls();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SettingsWindow::reloadControls() {
|
2021-11-09 12:06:30 -05:00
|
|
|
if(currentlyReloadingControls)
|
|
|
|
return;
|
|
|
|
|
|
|
|
currentlyReloadingControls = true;
|
|
|
|
|
|
|
|
auto oldRow = profileWidget->currentRow();
|
|
|
|
|
2021-11-09 11:44:27 -05:00
|
|
|
profileWidget->clear();
|
|
|
|
|
|
|
|
for(auto profile : window.profileList()) {
|
|
|
|
profileWidget->addItem(profile);
|
|
|
|
}
|
2021-11-09 12:06:30 -05:00
|
|
|
profileWidget->setCurrentRow(oldRow);
|
|
|
|
|
2021-11-09 13:44:37 -05:00
|
|
|
// deleting the main profile is unsupported behavior
|
|
|
|
deleteProfileButton->setEnabled(window.profileList().size() > 1);
|
|
|
|
|
2021-11-09 12:06:30 -05:00
|
|
|
ProfileSettings& profile = window.getProfile(profileWidget->currentRow());
|
2021-11-09 12:10:52 -05:00
|
|
|
nameEdit->setText(profile.name);
|
2021-11-09 13:04:22 -05:00
|
|
|
|
|
|
|
// game
|
2021-11-09 12:06:30 -05:00
|
|
|
directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0);
|
2021-11-09 12:46:27 -05:00
|
|
|
currentGameDirectory->setText(profile.gamePath);
|
2021-11-09 12:38:18 -05:00
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
// wine
|
|
|
|
wineVersionCombo->setCurrentIndex(profile.wineVersion);
|
|
|
|
selectWineButton->setEnabled(profile.wineVersion == 1);
|
|
|
|
winePathLabel->setText(profile.winePath);
|
|
|
|
winePrefixDirectory->setText(profile.winePrefixPath);
|
|
|
|
|
2021-11-09 14:17:04 -05:00
|
|
|
#if defined(Q_OS_LINUX)
|
2021-11-09 13:08:25 -05:00
|
|
|
useEsync->setChecked(profile.useEsync);
|
|
|
|
useGamescope->setChecked(profile.useGamescope);
|
|
|
|
useGamemode->setChecked(profile.useGamemode);
|
2021-11-09 14:17:04 -05:00
|
|
|
#endif
|
2021-11-09 13:08:25 -05:00
|
|
|
|
2021-11-09 13:04:22 -05:00
|
|
|
// login
|
2021-11-09 21:13:21 -05:00
|
|
|
encryptArgumentsBox->setChecked(profile.encryptArguments);
|
2021-11-09 12:38:18 -05:00
|
|
|
serverType->setCurrentIndex(profile.isSapphire ? 1 : 0);
|
2021-11-09 13:50:32 -05:00
|
|
|
lobbyServerURL->setEnabled(profile.isSapphire);
|
2021-11-09 12:50:37 -05:00
|
|
|
lobbyServerURL->setText(profile.lobbyURL);
|
2021-11-09 12:32:18 -05:00
|
|
|
rememberUsernameBox->setChecked(profile.rememberUsername);
|
|
|
|
rememberPasswordBox->setChecked(profile.rememberPassword);
|
2021-11-09 12:06:30 -05:00
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
enableDalamudBox->setChecked(profile.enableDalamud);
|
|
|
|
|
2021-11-09 12:39:28 -05:00
|
|
|
window.reloadControls();
|
|
|
|
|
2021-11-09 12:06:30 -05:00
|
|
|
currentlyReloadingControls = false;
|
2021-11-03 06:31:02 -04:00
|
|
|
}
|
|
|
|
|
2021-11-09 12:10:52 -05:00
|
|
|
ProfileSettings& SettingsWindow::getCurrentProfile() {
|
|
|
|
return this->window.getProfile(profileWidget->currentRow());
|
|
|
|
}
|
|
|
|
|
2021-11-03 06:31:02 -04:00
|
|
|
void SettingsWindow::openPath(const QString path) {
|
2021-11-02 08:27:11 -04:00
|
|
|
#if defined(Q_OS_WIN)
|
2021-11-03 06:31:02 -04:00
|
|
|
// for some reason, windows requires special treatment (what else is new?)
|
|
|
|
const QFileInfo fileInfo(path);
|
2021-11-02 08:27:11 -04:00
|
|
|
|
|
|
|
QProcess::startDetached("explorer.exe", QStringList(QDir::toNativeSeparators(fileInfo.canonicalFilePath())));
|
|
|
|
#else
|
2021-11-03 06:31:02 -04:00
|
|
|
QDesktopServices::openUrl("file://" + path);
|
2021-11-02 08:27:11 -04:00
|
|
|
#endif
|
2021-11-01 13:14:00 -04:00
|
|
|
}
|