mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-10 10:41:26 +01:00
Reset would crash the app, because a cleared item received a signal on currentItemChanged. Also, Reset did not reset the list as one might think, but clean it and then result in wrong behaviour. Furthermore the settings were saved, regardless of accepting the dialog or not.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
#include "Emu/System.h"
|
|
|
|
#include "gui_settings.h"
|
|
#include "emu_settings.h"
|
|
|
|
#include <QHBoxLayout>
|
|
#include <QListWidget>
|
|
#include <QLabel>
|
|
|
|
struct vfs_settings_info
|
|
{
|
|
QString name; // name of tab
|
|
emu_settings::SettingsType settingLoc; // Where the setting is saved in emu_settings
|
|
gui_save listLocation; // Where the list of dir options are saved
|
|
cfg::string* cfg_node; // Needed since emu_settings overrides settings file and doesn't touch g_cfg currently.
|
|
};
|
|
|
|
class vfs_dialog_tab : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit vfs_dialog_tab(const vfs_settings_info& info, std::shared_ptr<gui_settings> guiSettings, std::shared_ptr<emu_settings> emuSettings, QWidget* parent = nullptr);
|
|
|
|
void SetSettings();
|
|
void AddNewDirectory();
|
|
|
|
// Reset this tab without saving the settings yet
|
|
void Reset();
|
|
|
|
private:
|
|
const QString EmptyPath = tr("Empty Path");
|
|
|
|
vfs_settings_info m_info;
|
|
std::shared_ptr<gui_settings> m_gui_settings;
|
|
std::shared_ptr<emu_settings> m_emu_settings;
|
|
|
|
// UI variables needed in higher scope
|
|
QListWidget* m_dirList;
|
|
QLabel* m_selectedConfigLabel;
|
|
};
|