From b46736836e07d44dddd6797c50047a8847354696 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Wed, 16 Sep 2020 00:53:58 +0200 Subject: [PATCH] CDVD: remove disc selector dialog --- pcsx2/CMakeLists.txt | 1 - pcsx2/gui/Dialogs/DriveSelectorDialog.cpp | 58 ----------------- pcsx2/gui/Dialogs/ModalPopups.h | 9 --- pcsx2/gui/MainFrame.cpp | 1 - pcsx2/gui/MainFrame.h | 2 - pcsx2/gui/MainMenuClicks.cpp | 63 ------------------- pcsx2/windows/VCprojects/pcsx2.vcxproj | 3 +- .../windows/VCprojects/pcsx2.vcxproj.filters | 5 +- 8 files changed, 2 insertions(+), 140 deletions(-) delete mode 100644 pcsx2/gui/Dialogs/DriveSelectorDialog.cpp diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index aa14aa1226..6311abd07d 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -272,7 +272,6 @@ set(pcsx2GuiSources gui/Dialogs/ConfirmationDialogs.cpp gui/Dialogs/ConvertMemoryCardDialog.cpp gui/Dialogs/CreateMemoryCardDialog.cpp - gui/Dialogs/DriveSelectorDialog.cpp gui/Dialogs/FirstTimeWizard.cpp gui/Dialogs/ImportSettingsDialog.cpp gui/Dialogs/LogOptionsDialog.cpp diff --git a/pcsx2/gui/Dialogs/DriveSelectorDialog.cpp b/pcsx2/gui/Dialogs/DriveSelectorDialog.cpp deleted file mode 100644 index cadd0fecc4..0000000000 --- a/pcsx2/gui/Dialogs/DriveSelectorDialog.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2020 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- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#include "PrecompiledHeader.h" -#include "Dialogs/ModalPopups.h" -#include "../CDVD/CDVDdiscReader.h" - -Dialogs::DriveSelectorDialog::DriveSelectorDialog(wxWindow* parent, wxString curDrive) - : wxDialog(parent, wxID_ANY, "") -{ - wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer* staticSizer = new wxStaticBoxSizer(wxVERTICAL, this, "Source drive..."); - wxBoxSizer* btnSizer = new wxBoxSizer(wxHORIZONTAL); - - auto drives = GetOpticalDriveList(); - wxArrayString driveList; - - for (auto i : drives) - { - driveList.Add(i); - } - - choiceDrive = new wxChoice(this, wxID_ANY, wxDefaultPosition, {240, 40}, driveList); - - int driveIndex = choiceDrive->FindString(curDrive); - if (driveIndex != wxNOT_FOUND) - { - choiceDrive->SetSelection(driveIndex); - } - - wxButton* btnOk = new wxButton(this, wxID_OK); - wxButton* btnCancel = new wxButton(this, wxID_CANCEL); - - btnSizer->Add(btnOk, wxSizerFlags(1).Expand()); - btnSizer->Add(btnCancel, wxSizerFlags(1).Expand().Border(wxLEFT, 5)); - - staticSizer->Add(choiceDrive, wxSizerFlags(1).Expand().Border(wxTOP, 10).Border(wxLEFT, 7)); - topSizer->Add(staticSizer, wxSizerFlags(2).Expand().Border(wxALL, 10)); - topSizer->Add(btnSizer, wxSizerFlags(0).Border(wxRIGHT | wxLEFT | wxBOTTOM, 5).Right()); - SetSizerAndFit(topSizer); -} - -wxString Dialogs::DriveSelectorDialog::GetSelectedDrive() -{ - return choiceDrive->GetStringSelection(); -} \ No newline at end of file diff --git a/pcsx2/gui/Dialogs/ModalPopups.h b/pcsx2/gui/Dialogs/ModalPopups.h index d71f3ffea8..27814bd491 100644 --- a/pcsx2/gui/Dialogs/ModalPopups.h +++ b/pcsx2/gui/Dialogs/ModalPopups.h @@ -101,15 +101,6 @@ namespace Dialogs AssertionDialog( const wxString& text, const wxString& stacktrace ); virtual ~AssertionDialog() = default; }; - - class DriveSelectorDialog : public wxDialog - { - public: - DriveSelectorDialog( wxWindow* parent, wxString curDrive ); - wxString GetSelectedDrive(); - private: - wxChoice* choiceDrive; - }; } wxWindowID pxIssueConfirmation( wxDialogWithHelpers& confirmDlg, const MsgButtons& buttons ); diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index b76ae29735..142ed15e5b 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -228,7 +228,6 @@ void MainEmuFrame::ConnectMenus() Bind(wxEVT_MENU, &MainEmuFrame::Menu_IsoBrowse_Click, this, MenuId_IsoBrowse); Bind(wxEVT_MENU, &MainEmuFrame::Menu_IsoClear_Click, this, MenuId_IsoClear); Bind(wxEVT_MENU, &MainEmuFrame::Menu_CdvdSource_Click, this, MenuId_Src_Iso); - Bind(wxEVT_MENU, &MainEmuFrame::Menu_DiscBrowse_Click, this, MenuId_DriveSelector); Bind(wxEVT_MENU, &MainEmuFrame::Menu_CdvdSource_Click, this, MenuId_Src_Disc); Bind(wxEVT_MENU, &MainEmuFrame::Menu_CdvdSource_Click, this, MenuId_Src_NoDisc); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Ask_On_Boot_Click, this, MenuId_Ask_On_Booting); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index 8c5d96d761..81bc9f5466 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -190,7 +190,6 @@ protected: void Menu_IsoBrowse_Click(wxCommandEvent &event); void Menu_IsoClear_Click(wxCommandEvent &event); - void Menu_DiscBrowse_Click(wxCommandEvent &event); void Menu_EnableBackupStates_Click(wxCommandEvent &event); void Menu_EnablePatches_Click(wxCommandEvent &event); void Menu_EnableCheats_Click(wxCommandEvent &event); @@ -250,7 +249,6 @@ protected: void _DoBootCdvd(); bool _DoSelectIsoBrowser( wxString& dest ); bool _DoSelectELFBrowser(); - bool _DoSelectDiscBrowser( wxString& driveLetter ); // ------------------------------------------------------------------------ // MainEmuFram Internal API for Populating Main Menu Contents diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 8868ad45ef..aa72cf0cde 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -354,20 +354,6 @@ bool MainEmuFrame::_DoSelectELFBrowser() return false; } -bool MainEmuFrame::_DoSelectDiscBrowser(wxString& driveLetter) -{ - DriveSelectorDialog driveDialog(this, g_Conf->Folders.RunDisc.GetPath()); - - if (driveDialog.ShowModal() != wxID_CANCEL) - { - driveLetter = driveDialog.GetSelectedDrive(); - SysUpdateDiscSrcDrive(driveLetter); - return true; - } - - return false; -} - void MainEmuFrame::_DoBootCdvd() { ScopedCoreThreadPause paused_core; @@ -404,41 +390,6 @@ void MainEmuFrame::_DoBootCdvd() SysUpdateIsoSrcFile( result ); } } - else if( g_Conf->CdvdSource == CDVD_SourceType::Disc ) - { - #if defined(_WIN32) - const bool driveExists = g_Conf->Folders.RunDisc.DirExists(); - #else - const bool driveExists = g_Conf->Folders.RunDisc.Exists(); - #endif - - if( !driveExists ) - { - // The previous mounted disc isn't mounted anymore - - wxDialogWithHelpers dialog( this, _("Drive not mounted!") ); - dialog += dialog.Heading( - _("An error occured while trying to read drive: ") + g_Conf->Folders.RunDisc.GetPath() + L"\n\n" + - _("Error: The configured drive does not exist. Click OK to select a new drive for CDVD.") - ); - - // Send event to refresh drive list submenu - wxCommandEvent event(wxEVT_MENU, MenuId_DriveListRefresh); - wxGetApp().ProcessEvent(event); - - pxIssueConfirmation( dialog, MsgButtons().OK() ); - - wxString driveLetter; - if (!_DoSelectDiscBrowser(driveLetter)) - { - paused_core.AllowResume(); - return; - } - - // Refresh again after selection - wxGetApp().ProcessEvent(event); - } - } if( SysHasValidState() ) { @@ -485,20 +436,6 @@ void MainEmuFrame::Menu_FastBoot_Click( wxCommandEvent &event ) UpdateStatusBar(); } -void MainEmuFrame::Menu_DiscBrowse_Click(wxCommandEvent& event) -{ - ScopedCoreThreadPopup core; - wxString driveLetter; - - if ( !_DoSelectDiscBrowser(driveLetter) ) - { - core.AllowResume(); - return; - } - - SwapOrReset_Disc(this, core, driveLetter); -} - wxString GetMsg_IsoImageChanged() { return _("You have selected the following ISO image into PCSX2:\n\n"); diff --git a/pcsx2/windows/VCprojects/pcsx2.vcxproj b/pcsx2/windows/VCprojects/pcsx2.vcxproj index c0f9f2270d..1dbd93413c 100644 --- a/pcsx2/windows/VCprojects/pcsx2.vcxproj +++ b/pcsx2/windows/VCprojects/pcsx2.vcxproj @@ -184,7 +184,6 @@ - @@ -625,4 +624,4 @@ - + \ No newline at end of file diff --git a/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters b/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters index 4f82fcde2d..7642eb7a8d 100644 --- a/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters +++ b/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters @@ -870,9 +870,6 @@ System\Ps2\Iop\CDVD - - AppHost\Dialogs - System\Ps2\Iop\CDVD @@ -1429,4 +1426,4 @@ AppHost\Resources - + \ No newline at end of file