dolphin/Source/Core/DolphinQt2/MenuBar.h
JosJuice 1f1dae367d Unify ISOFile (wx) with GameFile (Qt) and put it in UICommon
The original reason I wanted to do this was so that we can replace
the Android-specific code with this in the future, but of course,
just deduplicating between DolphinWX and DolphinQt2 is nice too.

Fixes:

- DolphinQt2 showing the wrong size for split WBFS disc images.

- DolphinQt2 being case sensitive when checking if a file is a DOL/ELF.

- DolphinQt2 not detecting when a Wii banner has become available
after the game list cache was created.

Removes:

- DolphinWX's ability to load PNGs as custom banners. But it was
already rather broken (see https://bugs.dolphin-emu.org/issues/10365
and https://bugs.dolphin-emu.org/issues/10366). The reason I removed
this was because PNG decoding relied on wx code and we don't have any
good non-wx/Qt code for loading PNG files right now (let's not use
SOIL), but we should be able to use libpng directly to implement PNG
loading in the future.

- DolphinQt2's ability to ignore a cached game if the last modified
time differs. We currently don't have a non-wx/Qt way to get the time.
2018-03-09 13:08:38 +01:00

176 lines
3.9 KiB
C++

// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <array>
#include <memory>
#include <string>
#include <QMenu>
#include <QMenuBar>
namespace Core
{
enum class State;
}
namespace DiscIO
{
enum class Region;
};
namespace UICommon
{
class GameFile;
}
class MenuBar final : public QMenuBar
{
Q_OBJECT
public:
explicit MenuBar(QWidget* parent = nullptr);
void UpdateStateSlotMenu();
void UpdateToolsMenu(bool emulation_started);
signals:
// File
void Open();
void Exit();
// Emulation
void Play();
void Pause();
void Stop();
void Reset();
void Fullscreen();
void FrameAdvance();
void Screenshot();
void StartNetPlay();
void StateLoad();
void StateSave();
void StateLoadSlot();
void StateSaveSlot();
void StateLoadSlotAt(int slot);
void StateSaveSlotAt(int slot);
void StateLoadUndo();
void StateSaveUndo();
void StateSaveOldest();
void SetStateSlot(int slot);
void BootWiiSystemMenu();
void ImportNANDBackup();
void PerformOnlineUpdate(const std::string& region);
// Tools
void ShowMemcardManager();
void BootGameCubeIPL(DiscIO::Region region);
void ShowFIFOPlayer();
void ShowAboutDialog();
void ConnectWiiRemote(int id);
// Options
void Configure();
void ConfigureGraphics();
void ConfigureAudio();
void ConfigureControllers();
void ConfigureHotkeys();
// View
void ShowList();
void ShowGrid();
void ColumnVisibilityToggled(const QString& row, bool visible);
void GameListPlatformVisibilityToggled(const QString& row, bool visible);
void GameListRegionVisibilityToggled(const QString& row, bool visible);
// Movie
void PlayRecording();
void StartRecording();
void StopRecording();
void ExportRecording();
void ShowTASInput();
void SelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
void RecordingStatusChanged(bool recording);
void ReadOnlyModeChanged(bool read_only);
private:
void OnEmulationStateChanged(Core::State state);
void AddFileMenu();
void AddEmulationMenu();
void AddStateLoadMenu(QMenu* emu_menu);
void AddStateSaveMenu(QMenu* emu_menu);
void AddStateSlotMenu(QMenu* emu_menu);
void AddViewMenu();
void AddGameListTypeSection(QMenu* view_menu);
void AddListColumnsMenu(QMenu* view_menu);
void AddShowPlatformsMenu(QMenu* view_menu);
void AddShowRegionsMenu(QMenu* view_menu);
void AddOptionsMenu();
void AddToolsMenu();
void AddHelpMenu();
void AddMovieMenu();
void InstallWAD();
void ImportWiiSave();
void ExportWiiSaves();
void CheckNAND();
void NANDExtractCertificates();
void OnSelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
void OnRecordingStatusChanged(bool recording);
void OnReadOnlyModeChanged(bool read_only);
void OnDebugModeToggled(bool enabled);
// File
QAction* m_open_action;
QAction* m_exit_action;
// Tools
QAction* m_wad_install_action;
QMenu* m_perform_online_update_menu;
QAction* m_perform_online_update_for_current_region;
QAction* m_ntscj_ipl;
QAction* m_ntscu_ipl;
QAction* m_pal_ipl;
QAction* m_import_backup;
QAction* m_check_nand;
QAction* m_extract_certificates;
std::array<QAction*, 5> m_wii_remotes;
// Emulation
QAction* m_play_action;
QAction* m_pause_action;
QAction* m_stop_action;
QAction* m_reset_action;
QAction* m_fullscreen_action;
QAction* m_frame_advance_action;
QAction* m_screenshot_action;
QAction* m_boot_sysmenu;
QMenu* m_state_load_menu;
QMenu* m_state_save_menu;
QMenu* m_state_slot_menu;
QActionGroup* m_state_slots;
QMenu* m_state_load_slots_menu;
QMenu* m_state_save_slots_menu;
// Movie
QAction* m_recording_export;
QAction* m_recording_play;
QAction* m_recording_start;
QAction* m_recording_stop;
QAction* m_recording_read_only;
// View
QAction* m_show_registers;
QAction* m_show_watch;
QAction* m_show_breakpoints;
};