mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-25 11:34:55 +00:00
Created a separate .exe for updating. Added a checkbox in the settings to enable the option to update on Windows startup. When the option is enabled, a PowerShell script adds the new updater exe to the Windows Task Scheduler and sets it to run at startup. If there are updates available at startup, the update windows pops up. Disabling the option runs another script to remove the updater from the Task Scheduler. Co-authored-by: Joao Ribeiro <joao.viegas.ribeiro@tecnico.ulisboa.pt>
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <span>
|
|
#include <QDialog>
|
|
#include <QGroupBox>
|
|
#include <QPushButton>
|
|
|
|
#include "common/config.h"
|
|
#include "common/path_util.h"
|
|
#include "qt_gui/compatibility_info.h"
|
|
|
|
namespace Ui {
|
|
class SettingsDialog;
|
|
}
|
|
|
|
class SettingsDialog : public QDialog {
|
|
Q_OBJECT
|
|
public:
|
|
explicit SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_info,
|
|
QWidget* parent = nullptr);
|
|
~SettingsDialog();
|
|
|
|
bool eventFilter(QObject* obj, QEvent* event) override;
|
|
void updateNoteTextEdit(const QString& groupName);
|
|
|
|
int exec() override;
|
|
|
|
signals:
|
|
void LanguageChanged(const std::string& locale);
|
|
void CompatibilityChanged();
|
|
void BackgroundOpacityChanged(int opacity);
|
|
|
|
private:
|
|
void LoadValuesFromConfig();
|
|
void UpdateSettings();
|
|
void ResetInstallFolders();
|
|
void InitializeEmulatorLanguages();
|
|
void OnLanguageChanged(int index);
|
|
void OnCursorStateChanged(s16 index);
|
|
void closeEvent(QCloseEvent* event) override;
|
|
void AddUpdaterToStartup();
|
|
void RemoveUpdaterFromStartup();
|
|
|
|
std::unique_ptr<Ui::SettingsDialog> ui;
|
|
|
|
std::map<std::string, int> languages;
|
|
|
|
QString defaultTextEdit;
|
|
|
|
int initialHeight;
|
|
|
|
bool is_saving = false;
|
|
};
|