PCSX2-GUI: Rehaul BIOS / Folder Selector (#4620)

Since emulation settings has been renamed general settings, we can put BIOS and Folder in the same location where people have an overview and can just use tab key on icons or mouse. Less confusion and also fixes the speedhacks section *for the zillionth time*.
This commit is contained in:
RedDevilus 2021-07-25 04:53:54 +02:00 committed by lightningterror
parent f45c618fc2
commit 3e1b76c0a9
13 changed files with 33 additions and 60 deletions

View File

@ -1040,10 +1040,10 @@ wxSize wxSizer::GetMinSize()
return ret;
}
void wxSizer::DoSetMinSize( int width, int height )
void wxSizer::DoSetMinSize(int width, int height)
{
m_minSize.x = width;
m_minSize.y = height;
m_minSize.x = width;
m_minSize.y = height * 1.6; // Hackfix: There is no real fixed height, workaround for general settings where BIOS / Folders / GS Window / Speedhacks and others reside in.
}
bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height )

View File

@ -257,7 +257,6 @@ void operator+=(wxWindow &target, WinType &src)
return;
*target.GetSizer() += src;
}
template <typename WinType>
void operator+=(wxWindow &target, const pxWindowAndFlags<WinType> &src)
{

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -143,7 +143,6 @@ enum MenuIdentifiers
MenuId_Config_SysSettings,
MenuId_Config_McdSettings,
MenuId_Config_AppSettings,
MenuId_Config_BIOS,
MenuId_Config_Language,
MenuId_Config_GS,

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -100,7 +100,7 @@ protected:
static bool HandleBIOSError(BaseException& ex)
{
if (!pxDialogExists(L"Dialog:" + Dialogs::ComponentsConfigDialog::GetNameStatic()))
if (!pxDialogExists(L"Dialog:" + Dialogs::SysConfigDialog::GetNameStatic()))
{
if (!Msgbox::OkCancel(ex.FormatDisplayMessage() + L"\n\n" + BIOS_GetMsg_Required()
+ L"\n\n" + _("Press Ok to go to the BIOS Configuration Panel."), _("PS2 BIOS Error")))
@ -113,7 +113,7 @@ static bool HandleBIOSError(BaseException& ex)
g_Conf->ComponentsTabName = L"BIOS";
return AppOpenModalDialog<Dialogs::ComponentsConfigDialog>(L"BIOS") != wxID_CANCEL;
return AppOpenModalDialog<Dialogs::SysConfigDialog>(L"BIOS") != wxID_CANCEL;
}
void BIOSLoadErrorEvent::InvokeEvent()

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -221,7 +221,7 @@ public:
BaseApplicableConfigPanel_SpecificConfig( wxWindow* parent, wxOrientation orient, const wxString& staticLabel );
//possible flags are: AppConfig: APPLY_FLAG_MANUALLY_PROPAGATE and APPLY_FLAG_IS_FROM_PRESET
virtual void ApplyConfigToGui(AppConfig& configToApply, int flags=0)=0;
virtual void ApplyConfigToGui(AppConfig& configToApply, int flags=0) = 0;
};
class ApplicableWizardPage : public wxWizardPageSimple, public IApplyState

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2018 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -150,23 +150,6 @@ namespace Dialogs
//void OnMultitapClicked( wxCommandEvent& evt );
};
// --------------------------------------------------------------------------------------
// ComponentsConfigDialog
// --------------------------------------------------------------------------------------
class ComponentsConfigDialog : public BaseConfigurationDialog
{
protected:
public:
virtual ~ComponentsConfigDialog() = default;
ComponentsConfigDialog(wxWindow* parent=NULL);
static wxString GetNameStatic() { return L"AppSettings"; }
wxString GetDialogName() const { return GetNameStatic(); }
protected:
virtual wxString& GetConfSettingsTabName() const { return g_Conf->ComponentsTabName; }
};
// --------------------------------------------------------------------------------------
// CreateMemoryCardDialog
// --------------------------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -227,6 +227,6 @@ void FirstTimeWizard::OnPageChanging( wxWizardEvent& evt )
void FirstTimeWizard::OnPageChanged( wxWizardEvent& evt )
{
if( ((sptr)evt.GetPage() == (sptr)&m_page_bios) )
m_panel_BiosSel.OnShown();
// if( ((sptr)evt.GetPage() == (sptr)&m_page_bios) ) // FirstTimeWizard panel which prevents the user for clicking on finish to the main PCSX2 menu , it has the warning message:
// m_panel_BiosSel.OnShown(); // .SetUserMsg(pxE(L"Please select a valid BIOS. If you are unable to make a valid selection then press Cancel to close the Configuration panel."));
}

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -192,7 +192,7 @@ void Dialogs::SysConfigDialog::Cancel()
}
Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent)
: BaseConfigurationDialog( parent, AddAppName(_("Emulation Settings - %s")), 580 )
: BaseConfigurationDialog( parent, AddAppName(_("General Settings - %s")), 600 )
{
ScopedBusyCursor busy( Cursor_ReallyBusy );
@ -202,6 +202,8 @@ Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent)
//NOTE: all pages which are added to SysConfigDialog must be of class BaseApplicableConfigPanel or derived.
// see comment inside UpdateGuiForPreset implementation for more info.
AddPage<BiosSelectorPanel> ( pxL("BIOS"), cfgid.Cpu );
AddPage<StandardPathsPanel> ( pxL("Folders"), cfgid.Paths );
AddPage<CpuPanelEE> ( pxL("EE/IOP"), cfgid.Cpu );
AddPage<CpuPanelVU> ( pxL("VUs"), cfgid.Cpu );
AddPage<VideoPanel> ( pxL("GS"), cfgid.Cpu );
@ -219,24 +221,6 @@ Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent)
wxGetApp().PostMethod( CheckHacksOverrides );
}
Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent)
: BaseConfigurationDialog( parent, AddAppName(_("Components Selectors - %s")), 750 )
{
ScopedBusyCursor busy( Cursor_ReallyBusy );
CreateListbook( wxGetApp().GetImgList_Config() );
const AppImageIds::ConfigIds& cfgid( wxGetApp().GetImgId().Config );
SetIcons(wxGetApp().GetIconBundle());
AddPage<BiosSelectorPanel> ( pxL("BIOS"), cfgid.Cpu );
AddPage<StandardPathsPanel> ( pxL("Folders"), cfgid.Paths );
AddListbook();
AddOkCancel();
SetSizerAndFit(GetSizer());
}
Dialogs::InterfaceLanguageDialog::InterfaceLanguageDialog(wxWindow* parent)
: BaseConfigurationDialog(parent, _("Language Selector"), 400)
{

View File

@ -278,7 +278,6 @@ void MainEmuFrame::ConnectMenus()
// Config
Bind(wxEVT_MENU, &MainEmuFrame::Menu_SysSettings_Click, this, MenuId_Config_SysSettings);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_McdSettings_Click, this, MenuId_Config_McdSettings);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_SelectBios_Click, this, MenuId_Config_BIOS);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_AudioSettings_Click, this, MenuId_Config_SPU2);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_NetworkSettings_Click, this, MenuId_Config_DEV9);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_USBSettings_Click, this, MenuId_Config_USB);
@ -449,7 +448,6 @@ void MainEmuFrame::CreateConfigMenu()
{
m_menuConfig.Append(MenuId_Config_SysSettings, _("General &Settings"));
m_menuConfig.Append(MenuId_Config_McdSettings, _("&Memory Cards"));
m_menuConfig.Append(MenuId_Config_BIOS, _("&BIOS / Folder Selector"));
m_menuConfig.AppendSeparator();
m_menuConfig.Append(MenuId_Config_GS, _("&Graphics Settings"));
m_menuConfig.Append(MenuId_Config_SPU2, _("&Audio Settings"));

View File

@ -126,7 +126,7 @@ void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent& event)
void MainEmuFrame::Menu_SelectBios_Click(wxCommandEvent& event)
{
AppOpenDialog<ComponentsConfigDialog>(this);
AppOpenDialog<SysConfigDialog>(this);
}
void MainEmuFrame::Menu_ChangeLang(wxCommandEvent& event) // Always in English

View File

@ -393,7 +393,7 @@ namespace Panels
// --------------------------------------------------------------------------------------
// BasePathsPanel / StandardPathsPanel
// --------------------------------------------------------------------------------------
class BasePathsPanel : public wxPanelWithHelpers
class BasePathsPanel : public BaseApplicableConfigPanel
{
public:
BasePathsPanel(wxWindow* parent);
@ -405,6 +405,16 @@ namespace Panels
{
public:
StandardPathsPanel(wxWindow* parent);
void Apply() override
{
}
void AppStatusEvent_OnSettingsApplied() override
{
}
};
// --------------------------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -23,7 +23,7 @@ using namespace pxSizerFlags;
static const int BetweenFolderSpace = 5;
Panels::BasePathsPanel::BasePathsPanel( wxWindow* parent )
: wxPanelWithHelpers( parent, wxVERTICAL )
: BaseApplicableConfigPanel( parent, wxVERTICAL )
{
}

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -355,7 +355,7 @@ void Panels::VideoPanel::Defaults_Click(wxCommandEvent& evt)
void Panels::VideoPanel::OnOpenWindowSettings( wxCommandEvent& evt )
{
AppOpenDialog<Dialogs::ComponentsConfigDialog>( this );
AppOpenDialog<Dialogs::SysConfigDialog>( this );
// don't evt.skip, this prevents the Apply button from being activated. :)
}