summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Settings/GameCubePane.h
blob: 947ee7342c2df2d055674e215780c11d898e11fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <array>
#include <string>
#include <string_view>

#include <QWidget>

#include "Common/EnumMap.h"
#include "Core/HW/EXI/EXI.h"
#include "DolphinQt/MainWindow.h"

class ConfigBool;
class ConfigChoice;
class ConfigText;
class ConfigUserPath;
class QComboBox;
class QHBoxLayout;
class QLabel;
class QLineEdit;
class QPushButton;
class QString;
class QVBoxLayout;

class GameCubePane : public QWidget
{
  Q_OBJECT
public:
  explicit GameCubePane(MainWindow* main_window);

  static std::string GetOpenGBARom(std::string_view title);

signals:
  void ShowTriforceWindow();

private:
  void CreateWidgets();
  void ConnectWidgets();

  void LoadSettings();
  void SaveSettings();

  void OnEmulationStateChanged();

  void UpdateButton(ExpansionInterface::Slot slot);
  void OnConfigPressed(ExpansionInterface::Slot slot);

  void BrowseMemcard(ExpansionInterface::Slot slot);
  bool SetMemcard(ExpansionInterface::Slot slot, const QString& filename);
  void BrowseGCIFolder(ExpansionInterface::Slot slot);
  bool SetGCIFolder(ExpansionInterface::Slot slot, const QString& path);
  void BrowseAGPRom(ExpansionInterface::Slot slot);
  void SetAGPRom(ExpansionInterface::Slot slot, const QString& filename);

#ifdef HAS_LIBMGBA
  void BrowseGBABios();
  void BrowseGBARom(size_t index);
  void SaveRomPathChanged();
  void BrowseGBASaves();
#endif  // HAS_LIBMGBA

  ConfigBool* m_skip_main_menu;
  ConfigChoice* m_language_combo;

  Common::EnumMap<QPushButton*, ExpansionInterface::Slot::SP1> m_slot_buttons;
  Common::EnumMap<QComboBox*, ExpansionInterface::Slot::SP1> m_slot_combos;

  Common::EnumMap<QHBoxLayout*, ExpansionInterface::MAX_MEMCARD_SLOT> m_memcard_path_layouts;
  Common::EnumMap<QLabel*, ExpansionInterface::MAX_MEMCARD_SLOT> m_memcard_path_labels;
  Common::EnumMap<QLineEdit*, ExpansionInterface::MAX_MEMCARD_SLOT> m_memcard_paths;

  Common::EnumMap<QHBoxLayout*, ExpansionInterface::MAX_MEMCARD_SLOT> m_agp_path_layouts;
  Common::EnumMap<QLabel*, ExpansionInterface::MAX_MEMCARD_SLOT> m_agp_path_labels;
  Common::EnumMap<QLineEdit*, ExpansionInterface::MAX_MEMCARD_SLOT> m_agp_paths;

  Common::EnumMap<QVBoxLayout*, ExpansionInterface::MAX_MEMCARD_SLOT> m_gci_path_layouts;
  Common::EnumMap<QLabel*, ExpansionInterface::MAX_MEMCARD_SLOT> m_gci_path_labels;
  Common::EnumMap<QLabel*, ExpansionInterface::MAX_MEMCARD_SLOT> m_gci_override_labels;
  Common::EnumMap<QLineEdit*, ExpansionInterface::MAX_MEMCARD_SLOT> m_gci_paths;

  ConfigBool* m_gba_save_rom_path;
  QPushButton* m_gba_browse_bios;
  ConfigUserPath* m_gba_bios_edit;
  std::array<QPushButton*, 5> m_gba_browse_roms;
  std::array<ConfigText*, 5> m_gba_rom_edits;
  QPushButton* m_gba_browse_saves;
  ConfigUserPath* m_gba_saves_edit;
};