2022-12-04 11:03:45 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
2020-05-20 13:26:24 +00:00
|
|
|
#pragma once
|
|
|
|
#include "core/types.h"
|
2023-09-20 13:49:14 +00:00
|
|
|
|
2020-05-20 13:26:24 +00:00
|
|
|
#include <QtWidgets/QComboBox>
|
|
|
|
#include <QtWidgets/QGroupBox>
|
|
|
|
#include <QtWidgets/QLineEdit>
|
|
|
|
#include <QtWidgets/QVBoxLayout>
|
|
|
|
#include <QtWidgets/QWidget>
|
|
|
|
#include <array>
|
|
|
|
#include <vector>
|
|
|
|
|
2020-08-15 10:38:54 +00:00
|
|
|
class SettingsDialog;
|
2020-05-20 13:26:24 +00:00
|
|
|
|
|
|
|
class MemoryCardSettingsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-07-11 13:03:29 +00:00
|
|
|
MemoryCardSettingsWidget(SettingsDialog* dialog, QWidget* parent);
|
2020-05-20 13:26:24 +00:00
|
|
|
~MemoryCardSettingsWidget();
|
|
|
|
|
|
|
|
private:
|
2022-07-11 13:03:29 +00:00
|
|
|
SettingsDialog* m_dialog;
|
2020-05-20 13:26:24 +00:00
|
|
|
|
|
|
|
struct PortSettingsUI
|
|
|
|
{
|
|
|
|
QGroupBox* container;
|
|
|
|
QVBoxLayout* layout;
|
|
|
|
QComboBox* memory_card_type;
|
|
|
|
QLineEdit* memory_card_path;
|
|
|
|
};
|
|
|
|
|
2020-08-15 10:38:54 +00:00
|
|
|
void createUi(SettingsDialog* dialog);
|
|
|
|
void createPortSettingsUi(SettingsDialog* dialog, int index, PortSettingsUI* ui);
|
2020-05-20 13:26:24 +00:00
|
|
|
void onBrowseMemoryCardPathClicked(int index);
|
2021-03-27 05:18:23 +00:00
|
|
|
void onResetMemoryCardPathClicked(int index);
|
2022-07-11 13:03:29 +00:00
|
|
|
void onMemoryCardPathChanged(int index);
|
|
|
|
void updateMemoryCardPath(int index);
|
2020-05-20 13:26:24 +00:00
|
|
|
|
|
|
|
std::array<PortSettingsUI, 2> m_port_ui = {};
|
2021-03-27 05:18:23 +00:00
|
|
|
QLineEdit* m_memory_card_directory = nullptr;
|
2020-05-20 13:26:24 +00:00
|
|
|
};
|