mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Removed the hackery that was being done with the plugin configuration dialogs on windows. That was unnecessary and ugly. The HWND type is dead for non windows. Also cleaned up the gui a little.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5999 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -93,7 +93,7 @@ bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo)
|
||||
}
|
||||
|
||||
// Config: Open the Config window
|
||||
void CPlugin::Config(HWND _hwnd)
|
||||
void CPlugin::Config(void *_hwnd)
|
||||
{
|
||||
if (m_DllConfig != NULL)
|
||||
m_DllConfig(_hwnd);
|
||||
|
@ -25,7 +25,7 @@
|
||||
namespace Common
|
||||
{
|
||||
typedef void (__cdecl * TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl * TDllConfig)(HWND);
|
||||
typedef void (__cdecl * TDllConfig)(void *);
|
||||
typedef void* (__cdecl * TDllDebugger)(void *, bool);
|
||||
typedef void (__cdecl * TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl * TInitialize)(void *);
|
||||
@ -47,8 +47,8 @@ public:
|
||||
void SetGlobals(PLUGIN_GLOBALS* _PluginGlobals);
|
||||
void *LoadSymbol(const char *sym);
|
||||
|
||||
void Config(HWND _hwnd);
|
||||
void About(HWND _hwnd);
|
||||
void Config(void *_hwnd);
|
||||
void About(void *_hwnd);
|
||||
void *Debug(void *Parent, bool Show);
|
||||
void DoState(unsigned char **ptr, int mode);
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState);
|
||||
|
@ -101,7 +101,7 @@ void Stop();
|
||||
bool g_bStopping = false;
|
||||
bool g_bHwInit = false;
|
||||
bool g_bRealWiimote = false;
|
||||
HWND g_pWindowHandle = NULL;
|
||||
void *g_pWindowHandle = NULL;
|
||||
|
||||
Common::Thread* g_EmuThread = NULL;
|
||||
|
||||
@ -367,7 +367,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
Plugins.GetVideo()->Initialize(&VideoInitialize); // Call the dll
|
||||
|
||||
// Under linux, this is an X11 Window, not a HWND!
|
||||
g_pWindowHandle = (HWND)VideoInitialize.pWindowHandle;
|
||||
g_pWindowHandle = VideoInitialize.pWindowHandle;
|
||||
Callback_PeekMessages = VideoInitialize.pPeekMessages;
|
||||
g_pUpdateFPSDisplay = VideoInitialize.pUpdateFPSDisplay;
|
||||
|
||||
|
@ -420,15 +420,15 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TY
|
||||
{
|
||||
case PLUGIN_TYPE_VIDEO:
|
||||
if (GetVideo() != NULL)
|
||||
GetVideo()->Config((HWND)_Parent);
|
||||
GetVideo()->Config(_Parent);
|
||||
break;
|
||||
case PLUGIN_TYPE_DSP:
|
||||
if (GetDSP() != NULL)
|
||||
GetDSP()->Config((HWND)_Parent);
|
||||
GetDSP()->Config(_Parent);
|
||||
break;
|
||||
case PLUGIN_TYPE_WIIMOTE:
|
||||
if (GetWiimote() != NULL)
|
||||
GetWiimote()->Config((HWND)_Parent);
|
||||
GetWiimote()->Config(_Parent);
|
||||
break;
|
||||
default:
|
||||
PanicAlert("Type %d config not supported in plugin %s", Type, _rFilename);
|
||||
|
@ -1181,7 +1181,19 @@ void CConfigMain::CallConfig(wxChoice* _pChoice)
|
||||
{
|
||||
const CPluginInfo* pInfo = static_cast<CPluginInfo*>(_pChoice->GetClientData(Index));
|
||||
if (pInfo != NULL)
|
||||
CPluginManager::GetInstance().OpenConfig((HWND) this->GetHandle(), pInfo->GetFilename().c_str(), pInfo->GetPluginInfo().Type);
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Make sure only one dialog can be opened at a time in Windows,
|
||||
// but is unnecessary and looks bad in linux.
|
||||
Disable();
|
||||
#endif
|
||||
CPluginManager::GetInstance().OpenConfig(this,
|
||||
pInfo->GetFilename().c_str(), pInfo->GetPluginInfo().Type);
|
||||
#ifdef _WIN32
|
||||
Enable();
|
||||
Raise();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,9 +306,6 @@ EVT_SIZE(CFrame::OnResize)
|
||||
EVT_MOVE(CFrame::OnMove)
|
||||
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated)
|
||||
EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage)
|
||||
#if wxUSE_TIMER
|
||||
EVT_TIMER(wxID_ANY, CFrame::OnTimer)
|
||||
#endif
|
||||
|
||||
EVT_AUI_PANE_CLOSE(CFrame::OnPaneClose)
|
||||
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, CFrame::OnNotebookPageClose)
|
||||
@ -338,14 +335,11 @@ CFrame::CFrame(wxFrame* parent,
|
||||
, g_pCodeWindow(NULL)
|
||||
, bRenderToMain(false), bNoWiimoteMsg(false)
|
||||
, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
|
||||
, m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL)
|
||||
, m_GameListCtrl(NULL), m_Panel(NULL)
|
||||
, m_RenderFrame(NULL), m_RenderParent(NULL)
|
||||
, m_LogWindow(NULL), UseDebugger(_UseDebugger)
|
||||
, m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
|
||||
, m_bControlsCreated(false), m_bGameLoading(false), m_StopDlg(NULL)
|
||||
#if wxUSE_TIMER
|
||||
, m_timer(this)
|
||||
#endif
|
||||
, m_bGameLoading(false)
|
||||
{
|
||||
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
|
||||
bFloatWindow[i] = false;
|
||||
@ -367,15 +361,8 @@ CFrame::CFrame(wxFrame* parent,
|
||||
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, IDM_CODEWINDOW);
|
||||
LoadIniPerspectives();
|
||||
g_pCodeWindow->Load();
|
||||
g_pCodeWindow->Hide();
|
||||
}
|
||||
|
||||
// Create timer
|
||||
#if wxUSE_TIMER
|
||||
const int TimesPerSecond = 10; // We don't need more than this
|
||||
m_timer.Start(1000 / TimesPerSecond);
|
||||
#endif
|
||||
|
||||
// Create toolbar bitmaps
|
||||
InitBitmaps();
|
||||
|
||||
@ -385,9 +372,9 @@ CFrame::CFrame(wxFrame* parent,
|
||||
SetIcon(IconTemp);
|
||||
|
||||
// Give it a status bar
|
||||
m_pStatusBar = CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR);
|
||||
SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR));
|
||||
if (!SConfig::GetInstance().m_InterfaceStatusbar)
|
||||
m_pStatusBar->Hide();
|
||||
GetStatusBar()->Hide();
|
||||
|
||||
// Give it a menu bar
|
||||
CreateMenu();
|
||||
@ -413,26 +400,19 @@ CFrame::CFrame(wxFrame* parent,
|
||||
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().Name(wxT("Pane 0")).Caption(wxT("Pane 0")).Show());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().Name(wxT("Pane 0")).Caption(wxT("Pane 0")).Hide());
|
||||
m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Name(wxT("Pane 1")).Caption(wxT("Logging")).Hide());
|
||||
}
|
||||
|
||||
// Setup perspectives
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
m_Mgr->GetPane(wxT("Pane 0")).CenterPane().PaneBorder(false);
|
||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo()
|
||||
.Name(wxT("Pane 0")).Caption(wxT("Pane 0"))
|
||||
.CenterPane().PaneBorder(false).Show());
|
||||
AuiFullscreen = m_Mgr->SavePerspective();
|
||||
m_Mgr->GetPane(wxT("Pane 0")).CenterPane().PaneBorder(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mgr->GetPane(wxT("Pane 0")).Show().PaneBorder(false).CaptionVisible(false).Layer(0).Center();
|
||||
m_Mgr->GetPane(wxT("Pane 1")).Hide().PaneBorder(false).CaptionVisible(true).Layer(0)
|
||||
.FloatingSize(wxSize(600, 350)).CloseButton(false);
|
||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo()
|
||||
.Name(wxT("Pane 0")).Caption(wxT("Pane 0")).PaneBorder(false)
|
||||
.CaptionVisible(false).Layer(0).Center().Show());
|
||||
m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo()
|
||||
.Name(wxT("Pane 1")).Caption(wxT("Logging")).CaptionVisible(true)
|
||||
.Layer(0).FloatingSize(wxSize(600, 350)).CloseButton(true).Hide());
|
||||
AuiFullscreen = m_Mgr->SavePerspective();
|
||||
}
|
||||
|
||||
@ -482,7 +462,6 @@ CFrame::CFrame(wxFrame* parent,
|
||||
// ----------
|
||||
|
||||
// Update controls
|
||||
m_bControlsCreated = true;
|
||||
UpdateGUI();
|
||||
|
||||
// If we are rerecording create the status bar now instead of later when a game starts
|
||||
@ -495,14 +474,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
// Destructor
|
||||
CFrame::~CFrame()
|
||||
{
|
||||
m_bControlsCreated = false;
|
||||
|
||||
drives.clear();
|
||||
/* The statbar sample has this so I add this to, but I guess timer will be deleted after
|
||||
this anyway */
|
||||
#if wxUSE_TIMER
|
||||
if (m_timer.IsRunning()) m_timer.Stop();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
delete m_XRRConfig;
|
||||
@ -641,15 +613,6 @@ WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_TIMER
|
||||
void CFrame::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||
{
|
||||
// Process events. Primarily to update the statusbar text.
|
||||
if (wxGetApp().Pending())
|
||||
wxGetApp().ProcessPendingEvents();
|
||||
}
|
||||
#endif
|
||||
|
||||
void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
@ -659,9 +622,9 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
break;
|
||||
|
||||
case IDM_UPDATESTATUSBAR:
|
||||
if (m_pStatusBar != NULL)
|
||||
if (GetStatusBar() != NULL)
|
||||
{
|
||||
m_pStatusBar->SetStatusText(event.GetString(), event.GetInt());
|
||||
GetStatusBar()->SetStatusText(event.GetString(), event.GetInt());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -143,38 +143,9 @@ class CFrame : public CRenderFrame
|
||||
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
|
||||
bool bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
|
||||
|
||||
// Utility
|
||||
wxWindow * GetNotebookPageFromId(wxWindowID Id);
|
||||
wxAuiNotebook * GetNotebookFromId(u32 NBId);
|
||||
int GetNotebookCount();
|
||||
wxString GetMenuLabel(int Id);
|
||||
|
||||
// Perspectives
|
||||
void AddRemoveBlankPage();
|
||||
void OnNotebookPageClose(wxAuiNotebookEvent& event);
|
||||
void OnAllowNotebookDnD(wxAuiNotebookEvent& event);
|
||||
void OnNotebookPageChanged(wxAuiNotebookEvent& event);
|
||||
void OnFloatWindow(wxCommandEvent& event);
|
||||
void ToggleFloatWindow(int Id);
|
||||
void OnTab(wxAuiNotebookEvent& event);
|
||||
int GetNotebookAffiliation(wxWindowID Id);
|
||||
void ClosePages();
|
||||
void CloseAllNotebooks();
|
||||
// Perspectives (Should find a way to make all of this private)
|
||||
void DoAddPage(wxWindow *Win, int i, bool Float);
|
||||
void DoRemovePage(wxWindow *, bool bHide = true);
|
||||
void TogglePane();
|
||||
void SetPaneSize();
|
||||
void ResetToolbarStyle();
|
||||
void TogglePaneStyle(bool On, int EventId);
|
||||
void ToggleNotebookStyle(bool On, long Style);
|
||||
void ResizeConsole();
|
||||
// Float window
|
||||
void DoUnfloatPage(int Id);
|
||||
void OnFloatingPageClosed(wxCloseEvent& event);
|
||||
void OnFloatingPageSize(wxSizeEvent& event);
|
||||
void DoFloatNotebookPage(wxWindowID Id);
|
||||
wxFrame * CreateParentFrame(wxWindowID Id = wxID_ANY, const wxString& title = wxT(""), wxWindow * = NULL);
|
||||
// User perspectives. Should find a way to make these private.
|
||||
struct SPerspectives
|
||||
{
|
||||
std::string Name;
|
||||
@ -182,39 +153,20 @@ class CFrame : public CRenderFrame
|
||||
std::vector<int> Width, Height;
|
||||
};
|
||||
std::vector<SPerspectives> Perspectives;
|
||||
wxString AuiFullscreen, AuiCurrent;
|
||||
wxArrayString AuiPerspective;
|
||||
u32 ActivePerspective;
|
||||
void AddPane();
|
||||
void UpdateCurrentPerspective();
|
||||
void SaveIniPerspectives();
|
||||
void LoadIniPerspectives();
|
||||
void OnPaneClose(wxAuiManagerEvent& evt);
|
||||
void ReloadPanes();
|
||||
void DoLoadPerspective();
|
||||
void OnDropDownToolbarSelect(wxCommandEvent& event);
|
||||
void OnDropDownSettingsToolbar(wxAuiToolBarEvent& event);
|
||||
void OnDropDownToolbarItem(wxAuiToolBarEvent& event);
|
||||
void OnSelectPerspective(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
wxStatusBar* m_pStatusBar;
|
||||
wxBoxSizer* sizerFrame;
|
||||
CGameListCtrl* m_GameListCtrl;
|
||||
wxPanel* m_Panel;
|
||||
CRenderFrame* m_RenderFrame;
|
||||
wxPanel* m_RenderParent;
|
||||
wxToolBarToolBase* m_ToolPlay;
|
||||
CLogWindow* m_LogWindow;
|
||||
bool UseDebugger;
|
||||
bool m_bBatchMode;
|
||||
bool m_bEdit;
|
||||
bool m_bTabSplit;
|
||||
bool m_bNoDocking;
|
||||
bool m_bControlsCreated;
|
||||
bool m_bGameLoading;
|
||||
char newDiscpath[2048];
|
||||
wxMessageDialog *m_StopDlg;
|
||||
|
||||
std::vector<std::string> drives;
|
||||
|
||||
@ -253,8 +205,52 @@ class CFrame : public CRenderFrame
|
||||
void PopulateToolbarAui(wxAuiToolBar* toolBar);
|
||||
void RecreateToolbar();
|
||||
void CreateMenu();
|
||||
|
||||
// Utility
|
||||
wxString GetMenuLabel(int Id);
|
||||
wxWindow * GetNotebookPageFromId(wxWindowID Id);
|
||||
wxAuiNotebook * GetNotebookFromId(u32 NBId);
|
||||
int GetNotebookCount();
|
||||
wxAuiNotebook *CreateEmptyNotebook();
|
||||
|
||||
// Perspectives
|
||||
void AddRemoveBlankPage();
|
||||
void OnNotebookPageClose(wxAuiNotebookEvent& event);
|
||||
void OnAllowNotebookDnD(wxAuiNotebookEvent& event);
|
||||
void OnNotebookPageChanged(wxAuiNotebookEvent& event);
|
||||
void OnFloatWindow(wxCommandEvent& event);
|
||||
void ToggleFloatWindow(int Id);
|
||||
void OnTab(wxAuiNotebookEvent& event);
|
||||
int GetNotebookAffiliation(wxWindowID Id);
|
||||
void ClosePages();
|
||||
void CloseAllNotebooks();
|
||||
void TogglePane();
|
||||
void SetPaneSize();
|
||||
void ResetToolbarStyle();
|
||||
void TogglePaneStyle(bool On, int EventId);
|
||||
void ToggleNotebookStyle(bool On, long Style);
|
||||
void ResizeConsole();
|
||||
// Float window
|
||||
void DoUnfloatPage(int Id);
|
||||
void OnFloatingPageClosed(wxCloseEvent& event);
|
||||
void OnFloatingPageSize(wxSizeEvent& event);
|
||||
void DoFloatNotebookPage(wxWindowID Id);
|
||||
wxFrame * CreateParentFrame(wxWindowID Id = wxID_ANY,
|
||||
const wxString& title = wxT(""),
|
||||
wxWindow * = NULL);
|
||||
wxString AuiFullscreen, AuiCurrent;
|
||||
void AddPane();
|
||||
void UpdateCurrentPerspective();
|
||||
void SaveIniPerspectives();
|
||||
void LoadIniPerspectives();
|
||||
void OnPaneClose(wxAuiManagerEvent& evt);
|
||||
void ReloadPanes();
|
||||
void DoLoadPerspective();
|
||||
void OnDropDownToolbarSelect(wxCommandEvent& event);
|
||||
void OnDropDownSettingsToolbar(wxAuiToolBarEvent& event);
|
||||
void OnDropDownToolbarItem(wxAuiToolBarEvent& event);
|
||||
void OnSelectPerspective(wxCommandEvent& event);
|
||||
|
||||
#ifdef _WIN32
|
||||
// Override window proc for tricks like screensaver disabling
|
||||
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
@ -329,21 +325,6 @@ class CFrame : public CRenderFrame
|
||||
bool RendererIsFullscreen();
|
||||
void StartGame(const std::string& filename);
|
||||
|
||||
// MenuBar
|
||||
// File - Drive
|
||||
wxMenuItem* m_pSubMenuDrive;
|
||||
|
||||
// Emulation
|
||||
wxMenuItem* m_pSubMenuLoad;
|
||||
wxMenuItem* m_pSubMenuSave;
|
||||
wxMenuItem* m_pSubMenuFrameSkipping;
|
||||
|
||||
#if wxUSE_TIMER
|
||||
// Used to process command events
|
||||
void OnTimer(wxTimerEvent& WXUNUSED(event));
|
||||
wxTimer m_timer;
|
||||
#endif
|
||||
|
||||
// Event table
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
@ -107,7 +107,7 @@ void CFrame::CreateMenu()
|
||||
fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
|
||||
|
||||
wxMenu *externalDrive = new wxMenu;
|
||||
m_pSubMenuDrive = fileMenu->AppendSubMenu(externalDrive, _T("&Boot from DVD Drive..."));
|
||||
fileMenu->Append(IDM_DRIVES, _T("&Boot from DVD Drive..."), externalDrive);
|
||||
|
||||
drives = cdio_get_devices();
|
||||
// Windows Limitation of 24 character drives
|
||||
@ -139,7 +139,7 @@ void CFrame::CreateMenu()
|
||||
emulationMenu->Append(IDM_FRAMESTEP, _T("&Frame Stepping"), wxEmptyString, wxITEM_CHECK);
|
||||
|
||||
wxMenu *skippingMenu = new wxMenu;
|
||||
m_pSubMenuFrameSkipping = emulationMenu->AppendSubMenu(skippingMenu, _T("Frame S&kipping"));
|
||||
emulationMenu->AppendSubMenu(skippingMenu, _T("Frame S&kipping"));
|
||||
for(int i = 0; i < 10; i++)
|
||||
skippingMenu->Append(IDM_FRAMESKIP0 + i, wxString::Format(_T("%i"), i), wxEmptyString, wxITEM_RADIO);
|
||||
|
||||
@ -148,8 +148,8 @@ void CFrame::CreateMenu()
|
||||
emulationMenu->AppendSeparator();
|
||||
wxMenu *saveMenu = new wxMenu;
|
||||
wxMenu *loadMenu = new wxMenu;
|
||||
m_pSubMenuLoad = emulationMenu->AppendSubMenu(loadMenu, _T("&Load State"));
|
||||
m_pSubMenuSave = emulationMenu->AppendSubMenu(saveMenu, _T("Sa&ve State"));
|
||||
fileMenu->Append(IDM_LOADSTATE, _T("&Load State"), loadMenu);
|
||||
fileMenu->Append(IDM_SAVESTATE, _T("&Load State"), saveMenu);
|
||||
|
||||
saveMenu->Append(IDM_SAVESTATEFILE, _T("Save State..."));
|
||||
loadMenu->Append(IDM_UNDOSAVESTATE, _T("Last Overwritten State\tShift+F12"));
|
||||
@ -311,16 +311,11 @@ wxString CFrame::GetMenuLabel(int Id)
|
||||
Label = _T("&Stop\t");
|
||||
break;
|
||||
case HK_WIIMOTE1_CONNECT:
|
||||
Label = _T("Connect Wiimote 1\t");
|
||||
break;
|
||||
case HK_WIIMOTE2_CONNECT:
|
||||
Label = _T("Connect Wiimote 2\t");
|
||||
break;
|
||||
case HK_WIIMOTE3_CONNECT:
|
||||
Label = _T("Connect Wiimote 3\t");
|
||||
break;
|
||||
case HK_WIIMOTE4_CONNECT:
|
||||
Label = _T("Connect Wiimote 4\t");
|
||||
Label = wxString::Format(_T("Connect Wiimote %i\t"),
|
||||
Id - HK_WIIMOTE1_CONNECT + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -604,6 +599,7 @@ void CFrame::DoOpen(bool Boot)
|
||||
}
|
||||
else
|
||||
{
|
||||
char newDiscpath[2048];
|
||||
strncpy(newDiscpath, path.mb_str(), strlen(path.mb_str())+1);
|
||||
DVDInterface::ChangeDisc(newDiscpath);
|
||||
}
|
||||
@ -879,11 +875,7 @@ void CFrame::DoStop()
|
||||
// Ask for confirmation in case the user accidentally clicked Stop / Escape
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
|
||||
{
|
||||
// Suppress duplicate dialog boxes
|
||||
if (m_StopDlg)
|
||||
return;
|
||||
|
||||
m_StopDlg = new wxMessageDialog(
|
||||
wxMessageDialog *m_StopDlg = new wxMessageDialog(
|
||||
this,
|
||||
wxT("Do you want to stop the current emulation?"),
|
||||
wxT("Please confirm..."),
|
||||
@ -892,8 +884,7 @@ void CFrame::DoStop()
|
||||
|
||||
int Ret = m_StopDlg->ShowModal();
|
||||
m_StopDlg->Destroy();
|
||||
m_StopDlg = NULL;
|
||||
if (Ret == wxID_NO)
|
||||
if (Ret != wxID_YES)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -933,10 +924,10 @@ void CFrame::DoStop()
|
||||
UpdateGUI();
|
||||
|
||||
// Clean framerate indications from the status bar.
|
||||
m_pStatusBar->SetStatusText(wxT(" "), 0);
|
||||
GetStatusBar()->SetStatusText(wxT(" "), 0);
|
||||
|
||||
// Clear wiimote connection status from the status bar.
|
||||
m_pStatusBar->SetStatusText(wxT(" "), 1);
|
||||
GetStatusBar()->SetStatusText(wxT(" "), 1);
|
||||
|
||||
// If batch mode was specified on the command-line, exit now.
|
||||
if (m_bBatchMode)
|
||||
@ -965,7 +956,7 @@ void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
|
||||
void CFrame::OnPluginGFX(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
this,
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||
PLUGIN_TYPE_VIDEO
|
||||
);
|
||||
@ -974,7 +965,7 @@ void CFrame::OnPluginGFX(wxCommandEvent& WXUNUSED (event))
|
||||
void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
this,
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||
PLUGIN_TYPE_DSP
|
||||
);
|
||||
@ -1007,7 +998,7 @@ void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
|
||||
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
this,
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin.c_str(),
|
||||
PLUGIN_TYPE_WIIMOTE
|
||||
);
|
||||
@ -1231,9 +1222,6 @@ void CFrame::OnFrameSkip(wxCommandEvent& event)
|
||||
// Update the enabled/disabled status
|
||||
void CFrame::UpdateGUI()
|
||||
{
|
||||
if (!m_bControlsCreated)
|
||||
return;
|
||||
|
||||
// Save status
|
||||
bool Initialized = Core::isRunning();
|
||||
bool Running = Core::GetState() == Core::CORE_RUN;
|
||||
@ -1252,7 +1240,7 @@ void CFrame::UpdateGUI()
|
||||
|
||||
// File
|
||||
GetMenuBar()->FindItem(wxID_OPEN)->Enable(!Initialized);
|
||||
m_pSubMenuDrive->Enable(!Initialized);
|
||||
GetMenuBar()->FindItem(IDM_DRIVES)->Enable(!Initialized);
|
||||
GetMenuBar()->FindItem(wxID_REFRESH)->Enable(!Initialized);
|
||||
GetMenuBar()->FindItem(IDM_BROWSE)->Enable(!Initialized);
|
||||
|
||||
@ -1274,24 +1262,33 @@ void CFrame::UpdateGUI()
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->SetItemLabel(GetMenuLabel(HK_WIIMOTE3_CONNECT));
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->SetItemLabel(GetMenuLabel(HK_WIIMOTE4_CONNECT));
|
||||
|
||||
m_pSubMenuLoad->Enable(Initialized);
|
||||
m_pSubMenuSave->Enable(Initialized);
|
||||
GetMenuBar()->FindItem(IDM_LOADSTATE)->Enable(Initialized);
|
||||
GetMenuBar()->FindItem(IDM_SAVESTATE)->Enable(Initialized);
|
||||
|
||||
// Misc
|
||||
GetMenuBar()->FindItem(IDM_CHANGEDISC)->Enable(Initialized);
|
||||
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(std::string(File::GetUserPath(D_WIIMENU_IDX))).IsValid())
|
||||
if (DiscIO::CNANDContentManager::Access().GetNANDLoader
|
||||
(std::string(File::GetUserPath(D_WIIMENU_IDX))).IsValid())
|
||||
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(!Initialized);
|
||||
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->
|
||||
Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->
|
||||
Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->
|
||||
Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->
|
||||
Enable(Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);
|
||||
if (Initialized && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||
{
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Check(GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Check(GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Check(GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Check(GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Check(GetUsbPointer()->
|
||||
AccessWiiMote(0x0100)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Check(GetUsbPointer()->
|
||||
AccessWiiMote(0x0101)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Check(GetUsbPointer()->
|
||||
AccessWiiMote(0x0102)->IsConnected() == 3);
|
||||
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Check(GetUsbPointer()->
|
||||
AccessWiiMote(0x0103)->IsConnected() == 3);
|
||||
}
|
||||
|
||||
if (Running)
|
||||
@ -1475,9 +1472,9 @@ void CFrame::OnToggleStatusbar(wxCommandEvent& event)
|
||||
{
|
||||
SConfig::GetInstance().m_InterfaceStatusbar = event.IsChecked();
|
||||
if (SConfig::GetInstance().m_InterfaceStatusbar == true)
|
||||
m_pStatusBar->Show();
|
||||
GetStatusBar()->Show();
|
||||
else
|
||||
m_pStatusBar->Hide();
|
||||
GetStatusBar()->Hide();
|
||||
|
||||
this->SendSizeEvent();
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ enum
|
||||
IDM_FRAMESTEP,
|
||||
IDM_SCREENSHOT,
|
||||
IDM_BROWSE,
|
||||
IDM_DRIVES,
|
||||
IDM_DRIVE1,
|
||||
IDM_DRIVE24 = IDM_DRIVE1 + 23,//248,
|
||||
|
||||
|
Reference in New Issue
Block a user