From 3226d455e3d5bcc9a84034706e8c3713243025f1 Mon Sep 17 00:00:00 2001 From: "sl1nk3.s" Date: Mon, 28 Dec 2009 19:34:19 +0000 Subject: [PATCH] Some changes/fixes for the GUI : no need for 2 play button in the debugger, fix some issues with the console not closing as it should when floating. Wii games now show their description in the gamelist instead of the company (= always "N/A"), fix SJIS handling using wxString code instead of Win32 code, fixes some broken characters in the gamelist and ISOProperties. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4740 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DebuggerWX/Src/CodeWindow.cpp | 169 +++++++------------- Source/Core/DiscIO/Src/VolumeWad.cpp | 4 +- Source/Core/DolphinWX/Src/Frame.h | 17 +- Source/Core/DolphinWX/Src/FrameAui.cpp | 141 +++++++--------- Source/Core/DolphinWX/Src/FrameTools.cpp | 44 +++-- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 126 ++++++++------- Source/Core/DolphinWX/Src/GameListCtrl.h | 1 - Source/Core/DolphinWX/Src/Globals.h | 1 - Source/Core/DolphinWX/Src/ISOProperties.cpp | 64 +++++--- Source/Core/DolphinWX/Src/ISOProperties.h | 2 +- Source/Core/DolphinWX/Src/LogWindow.cpp | 2 +- 11 files changed, 269 insertions(+), 302 deletions(-) diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 25b521a937..740dd21f94 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -79,72 +79,71 @@ class CPluginManager; BEGIN_EVENT_TABLE(CCodeWindow, wxPanel) -// Menu bar -EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode) // Options -EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont) + // Menu bar + EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode) // Options + EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont) -EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // Jit -EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode) - EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnCPUMode) - EVT_MENU(IDM_JITLSLWZOFF, CCodeWindow::OnCPUMode) - EVT_MENU(IDM_JITLSLBZXOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITIOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode) -EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu) -EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu) -EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu) + EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // Jit + EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITLSLWZOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITLSLBZXOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITIOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu) + EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu) + EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu) -EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) // View -EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleWindow) -EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleWindow) -EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleWindow) -EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleWindow) -EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleWindow) + EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) // View + EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleWindow) + EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleWindow) + EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleWindow) + EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleWindow) + EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleWindow) -EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_SAVEMAPFILE, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_SAVEMAPFILEWITHCODES, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_SAVEMAPFILE, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_SAVEMAPFILEWITHCODES, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu) -EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu) -EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu) + EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu) + EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu) -// Menu tooltips -//EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar) -// Do this to to avoid that the ToolTips get stuck when only the wxMenu is changed -// and not any wxMenuItem that is required by EVT_MENU_HIGHLIGHT_ALL -//EVT_UPDATE_UI(wxID_ANY, CCodeWindow::OnStatusBar_) + // Menu tooltips + //EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar) + // Do this to to avoid that the ToolTips get stuck when only the wxMenu is changed + // and not any wxMenuItem that is required by EVT_MENU_HIGHLIGHT_ALL + //EVT_UPDATE_UI(wxID_ANY, CCodeWindow::OnStatusBar_) -// Toolbar -EVT_MENU(IDM_DEBUG_GO, CCodeWindow::OnCodeStep) -EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep) -EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep) -EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep) -EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep) -EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep) -EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange) + // Toolbar + EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep) + EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep) + EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep) + EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep) + EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep) + EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange) -// Other -EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) -EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) -EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) -EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) + // Other + EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) + EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) + EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) + EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) -EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) + EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) -//EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange) + //EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange) END_EVENT_TABLE() @@ -202,11 +201,11 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event) case IDM_NOTIFYMAPLOADED: NotifyMapLoaded(); break; - /* - case IDM_UPDATELOGDISPLAY: - if (m_LogWindow) m_LogWindow->NotifyUpdate(); - break; - */ + // Is this still necessary ? + //case IDM_UPDATELOGDISPLAY: + // if (m_LogWindow) m_LogWindow->NotifyUpdate(); + // break; + case IDM_UPDATEDISASMDIALOG: Update(); if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate(); @@ -235,24 +234,6 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event) { switch (event.GetId()) { - case IDM_DEBUG_GO: - { - // [F|RES] prolly we should disable the other buttons in go mode too ... - if (CCPU::IsStepping()) - { - CCPU::EnableStepping(false); - } - else - { - CCPU::EnableStepping(true); // Break - Host_UpdateLogDisplay(); - } - wxThread::Sleep(20); - JumpToAddress(PC); - Update(); - } - break; - case IDM_STEP: SingleCPUStep(); break; @@ -647,7 +628,6 @@ void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar) h = m_Bitmaps[Toolbar_DebugGo].GetHeight(); toolBar->SetToolBitmapSize(wxSize(w, h)); - toolBar->AddTool(IDM_DEBUG_GO, _T("Play"), m_Bitmaps[Toolbar_DebugGo]); toolBar->AddTool(IDM_STEP, _T("Step"), m_Bitmaps[Toolbar_Step]); toolBar->AddTool(IDM_STEPOVER, _T("Step Over"), m_Bitmaps[Toolbar_StepOver]); toolBar->AddTool(IDM_SKIP, _T("Skip"), m_Bitmaps[Toolbar_Skip]); @@ -690,7 +670,6 @@ void CCodeWindow::UpdateButtonStates() if (!Initialized) { - ToolBar->EnableTool(IDM_DEBUG_GO, false); ToolBar->EnableTool(IDM_STEPOVER, false); ToolBar->EnableTool(IDM_SKIP, false); } @@ -698,19 +677,11 @@ void CCodeWindow::UpdateButtonStates() { if (!Stepping) { - ToolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Pause")); - ToolBar->SetToolLabel(IDM_DEBUG_GO, _("Pause")); - ToolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_DebugPause]); - ToolBar->EnableTool(IDM_DEBUG_GO, true); ToolBar->EnableTool(IDM_STEPOVER, false); ToolBar->EnableTool(IDM_SKIP, false); } else { - ToolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Play")); - ToolBar->SetToolLabel(IDM_DEBUG_GO, _("Play")); - ToolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_DebugGo]); - ToolBar->EnableTool(IDM_DEBUG_GO, true); ToolBar->EnableTool(IDM_STEPOVER, true); ToolBar->EnableTool(IDM_SKIP, true); } @@ -757,24 +728,6 @@ void CCodeWindow::UpdateButtonStates() calls->SetFont(DebuggerFont); } -void CCodeWindow::RecreateToolbar(wxAuiToolBar * toolBar) -{ - /* - // delete and recreate the toolbar - wxToolBarBase* toolBar = GetToolBar(); - delete toolBar; - SetToolBar(NULL); - - - long style = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT; - style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP); - wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR_DEBUG); - - PopulateToolbar(theToolBar); - SetToolBar(theToolBar); - */ -} - // Show Tool Tip for menu items void CCodeWindow::DoTip(wxString text) diff --git a/Source/Core/DiscIO/Src/VolumeWad.cpp b/Source/Core/DiscIO/Src/VolumeWad.cpp index bc4c658b35..cae2fbfb6d 100644 --- a/Source/Core/DiscIO/Src/VolumeWad.cpp +++ b/Source/Core/DiscIO/Src/VolumeWad.cpp @@ -110,12 +110,12 @@ std::string CVolumeWAD::GetName() const u32 footer_size; if (!Read(0x1C, 4, (u8*)&footer_size)) - return "Unknown"; + return false; // Offset to the english title char temp[84]; if (!Read(0xF1 + OpeningBnrOffset, 84, (u8*)&temp) || Common::swap32(footer_size) < 0xF1) - return "Unknown"; + return false; // Remove the null bytes due to 16bit char length std::string out_temp; diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index b487b8b92c..8e840a46c7 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -52,11 +52,11 @@ class CFrame : public wxFrame CFrame(wxFrame* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Dolphin"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - bool _UseDebugger = false, - bool ShowLogWindow = false, - long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + bool _UseDebugger = false, + bool ShowLogWindow = false, + long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); void* GetRenderHandle() { @@ -146,12 +146,12 @@ class CFrame : public wxFrame void DoRemovePage(wxWindow *, bool Hide = true); void DoRemovePageId(wxWindowID Id, bool Hide = true, bool Destroy = false); void DoRemovePageString(wxString, bool Hide = true, bool Destroy = false); - void HidePane(); + void TogglePane(); void SetSimplePaneSize(); void SetPaneSize(); void ResetToolbarStyle(); - void TogglePaneStyle(bool,int); - void ToggleNotebookStyle(long); + void TogglePaneStyle(bool On, int EventId); + void ToggleNotebookStyle(bool On, long Style); void ResizeConsole(); // Float window void DoUnfloatPage(int Id); @@ -344,3 +344,4 @@ class CFrame : public wxFrame #endif // __FRAME_H_ + diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index 789b9d1bc9..45f0389177 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -70,22 +70,26 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event) wxAuiNotebook * nb = (wxAuiNotebook*)event.pane->window; if (!nb) return; - if (! (nb->GetPageCount() == 0 || (nb->GetPageCount() == 1 && nb->GetPageText(0).IsSameAs(wxT("<>"))))) + + if ((nb->GetPageText(0).IsSameAs(wxT("Log")) || nb->GetPageText(0).IsSameAs(wxT("Console")))) + { + // Closing a pane containing the logwindow or a console closes both + GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(false); + GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(false); + SConfig::GetInstance().m_InterfaceConsole = false; + SConfig::GetInstance().m_InterfaceLogWindow = false; + ToggleConsole(false); + ToggleLogWindow(false); + } + else if (nb->GetPageCount() != 0 && !nb->GetPageText(0).IsSameAs(wxT("<>"))) { wxMessageBox(wxT("You can't close panes that have pages in them."), wxT("Notice"), wxOK, this); } else { - /* - ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LNOTICE, StringFromFormat("GetNotebookCount before: %i\n", GetNotebookCount()).c_str()); - */ - // Detach and delete the empty notebook event.pane->DestroyOnClose(true); m_Mgr->ClosePane(*event.pane); - - //Console->Log(LogTypes::LNOTICE, StringFromFormat("GetNotebookCount after: %i\n", GetNotebookCount()).c_str()); } m_Mgr->Update(); @@ -110,8 +114,9 @@ void CFrame::ToggleLogWindow(bool bShow, int i) DoRemovePage(m_LogWindow); } - // Hide pane - if (!g_pCodeWindow) HidePane(); + // Hide or Show the pane + if (!g_pCodeWindow) + TogglePane(); } // Enable and disable the console @@ -123,48 +128,47 @@ void CFrame::OnToggleConsole(wxCommandEvent& event) void CFrame::ToggleConsole(bool bShow, int i) { +// Can anyone check this code under Linux ? commenting the windows console Hide/show +// should be enough to make it work. #ifdef _WIN32 - ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener(); + ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener(); if (bShow) { - //Console->Log(LogTypes::LNOTICE, StringFromFormat(" >>> Show\n").c_str()); - - if (GetNotebookCount() == 0) return; if (i < 0 || i > GetNotebookCount()-1) i = 0; - wxWindow *Win = GetWxWindowHwnd(GetConsoleWindow()); - if (Win && GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return; - { - if(!GetConsoleWindow()) Console->Open(); else ShowWindow(GetConsoleWindow(),SW_SHOW); - } - Win = GetWxWindowHwnd(GetConsoleWindow()); - if (!Win) return; - // Create parent window - wxPanel * ConsoleParent = CreateEmptyPanel(IDM_CONSOLEWINDOW); - Win->Reparent(ConsoleParent); - if (!bFloatConsoleWindow) - GetNotebookFromId(i)->AddPage(ConsoleParent, wxT("Console"), true, aNormalFile); + // If the window and its page already exist, there's a bug :p + if (GetNotebookFromId(i)->GetPageIndex(GetWxWindowHwnd(GetConsoleWindow())) != wxNOT_FOUND) + return; + + // If the console doesn't exist, we create it + if (!GetConsoleWindow()) + Console->Open(); else - CreateParentFrame(WindowParentIdFromChildId(ConsoleParent->GetId()), WindowNameFromId(ConsoleParent->GetId()), ConsoleParent); + ShowWindow(GetConsoleWindow(), SW_SHOW); // WIN32 + + // We retrieve our wxWindow to access our console + its parent (which is the page) + wxWindow *ConsoleWin = GetWxWindowHwnd(GetConsoleWindow()); + wxPanel *ConsoleParent = (wxPanel*)FindWindowById(IDM_CONSOLEWINDOW); + + // Create the parent window if it doesn't exist, and put the console in it + if (!ConsoleParent) ConsoleParent = CreateEmptyPanel(IDM_CONSOLEWINDOW); + ConsoleWin->Reparent(ConsoleParent); + + DoAddPage(ConsoleParent, i, wxT("Console"), bFloatConsoleWindow); } - else // hide + else // Hide { - //Console->Log(LogTypes::LNOTICE, StringFromFormat(" >>> Show\n").c_str()); + if(GetConsoleWindow()) + ShowWindow(GetConsoleWindow(), SW_HIDE); // WIN32 - // Hide - if(GetConsoleWindow()) ShowWindow(GetConsoleWindow(),SW_HIDE); - // Release the console to Windows - ::SetParent(GetConsoleWindow(), NULL); - // Destroy the empty parent of the console - if (FindWindowById(WindowParentIdFromChildId(IDM_CONSOLEWINDOW))) - FindWindowById(WindowParentIdFromChildId(IDM_CONSOLEWINDOW))->Destroy(); - else - DoRemovePageId(IDM_CONSOLEWINDOW, true, true); + // Then close the page + DoRemovePageId(IDM_CONSOLEWINDOW, true, true); } - // Hide pane - if (!g_pCodeWindow) HidePane(); + // Hide or Show the pane + if (!g_pCodeWindow) + TogglePane(); #endif } @@ -326,7 +330,7 @@ void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event) event.Allow(); ResizeConsole(); } -void CFrame::HidePane() +void CFrame::TogglePane() { // Get the first notebook wxAuiNotebook * NB = NULL; @@ -377,7 +381,6 @@ void CFrame::DoRemovePageString(wxString Str, bool /*_Hide*/, bool _Destroy) { NB->DeletePage(j); } - //if (_Hide) Win->Hide(); break; } } @@ -450,19 +453,10 @@ void CFrame::DoAddPage(wxWindow * Win, int i, wxString Name, bool Float) GetNotebookFromId(i)->AddPage(Win, Name, true, aNormalFile ); else CreateParentFrame(WindowParentIdFromChildId(Win->GetId()), WindowNameFromId(Win->GetId()), Win); - - //NOTICE_LOG(CONSOLE, "DoAddPage: %i", Win->GetId()); - - /* - ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LNOTICE, StringFromFormat("Add: %s\n", Name.c_str()).c_str()); - */ } void CFrame::DoUnfloatPage(int Id) { - //NOTICE_LOG(CONSOLE, "DoUnfloatPage: %i", Id); - wxFrame * Win = (wxFrame*)this->FindWindowById(Id); if (!Win) return; @@ -473,20 +467,16 @@ void CFrame::DoUnfloatPage(int Id) } void CFrame::OnFloatingPageClosed(wxCloseEvent& event) { - //NOTICE_LOG(CONSOLE, "OnFloatingPageClosed: %i", event.GetId()); DoUnfloatPage(event.GetId()); } void CFrame::OnFloatingPageSize(wxSizeEvent& event) { event.Skip(); - //NOTICE_LOG(CONSOLE, "OnFloatingPageClosed: %i", event.GetId()); ResizeConsole(); } - void CFrame::DoFloatNotebookPage(wxWindowID Id) { - //NOTICE_LOG(CONSOLE, "DoFloatNotebookPage: %i %s", Win->GetId(), WindowNameFromId(Win->GetId()).mb_str()); wxFrame * Win = (wxFrame*)this->FindWindowById(Id); if (!Win) return; @@ -631,7 +621,6 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event) else DlgOk = true; } - //wxID_CANCEL SPerspectives Tmp; Tmp.Name = dlg.GetValue().mb_str(); @@ -639,8 +628,8 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event) } break; case IDM_TAB_SPLIT: - m_bTabSplit = event.IsChecked(); - ToggleNotebookStyle(wxAUI_NB_TAB_SPLIT); + m_bTabSplit = event.IsChecked(); + ToggleNotebookStyle(m_bTabSplit, wxAUI_NB_TAB_SPLIT); break; case IDM_NO_DOCKING: m_bNoDocking = event.IsChecked(); @@ -693,11 +682,6 @@ void CFrame::TogglePaneStyle(bool On, int EventId) Pane.Floatable(On); Pane.Dockable(On); break; - /* - case IDM_NO_DOCKING: - Pane.Dockable(!On); - break; - */ } Pane.Dockable(!m_bNoDocking); } @@ -705,7 +689,7 @@ void CFrame::TogglePaneStyle(bool On, int EventId) m_Mgr->Update(); } -void CFrame::ToggleNotebookStyle(long Style) +void CFrame::ToggleNotebookStyle(bool On, long Style) { wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes(); for (int i = 0, Count = (int)AllPanes.GetCount(); i < Count; ++i) @@ -714,7 +698,12 @@ void CFrame::ToggleNotebookStyle(long Style) if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook))) { wxAuiNotebook* NB = (wxAuiNotebook*)Pane.window; - NB->SetWindowStyleFlag(NB->GetWindowStyleFlag() ^ Style); + + if (On) + NB->SetWindowStyleFlag(NB->GetWindowStyleFlag() | Style); + else + NB->SetWindowStyleFlag(NB->GetWindowStyleFlag() &~ Style); + NB->Refresh(); } } @@ -838,10 +827,6 @@ void CFrame::ReloadPanes() // Keep settings bool bConsole = SConfig::GetInstance().m_InterfaceConsole; - //ListChildren(); - //ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - //Console->Log(LogTypes::LNOTICE, StringFromFormat("ReloadPanes begin: Sound %i\n", FindWindowByName(wxT("Sound"))).c_str()); - if (ActivePerspective >= Perspectives.size()) ActivePerspective = 0; // Check that there is a perspective @@ -903,13 +888,6 @@ void CFrame::DoLoadPerspective() SetPaneSize(); // Show ShowAllNotebooks(true); - - /* - ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LNOTICE, StringFromFormat( - "Loaded: %s (%i panes, %i NBs)\n", - Perspectives.at(ActivePerspective).Name.c_str(), m_Mgr->GetAllPanes().GetCount(), GetNotebookCount()).c_str()); - */ } // Update the local perspectives array @@ -1009,12 +987,6 @@ void CFrame::Save() // Update the local vector SaveLocal(); - /* - ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LNOTICE, StringFromFormat( - "Saved: %s (%s, %i panes, %i NBs)\n", - Perspectives.at(ActivePerspective).Name.c_str(), STmp.c_str(), m_Mgr->GetAllPanes().GetCount(), GetNotebookCount()).c_str()); - */ TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES); } @@ -1207,14 +1179,9 @@ void CFrame::CloseAllNotebooks() //m_Mgr->DetachPane(m_Mgr->GetAllPanes().Item(i).window); i = 0; - //Console->Log(LogTypes::LNOTICE, StringFromFormat(" %i Pane\n", i).c_str()); } else - { i++; - //Console->Log(LogTypes::LNOTICE, StringFromFormat(" %i No pane\n", i).c_str()); - } - } } int CFrame::GetNotebookCount() diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 30c00319c9..ceeead1752 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -60,6 +60,8 @@ Core::GetWindowHandle(). #include "ConfigManager.h" // Core #include "Core.h" #include "OnFrame.h" +#include "HW/CPU.h" +#include "PowerPC/PowerPC.h" #include "HW/DVDInterface.h" #include "HW/ProcessorInterface.h" #include "IPC_HLE/WII_IPC_HLE_Device_usb.h" @@ -293,6 +295,7 @@ void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar) // the changes ToolBar->Realize(); } + void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar) { int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(), @@ -319,6 +322,7 @@ void CFrame::RecreateToolbar() } m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE); + PopulateToolbar(m_ToolBar); m_Mgr->AddPane(m_ToolBar, wxAuiPaneInfo(). @@ -353,7 +357,7 @@ void CFrame::InitBitmaps() int Theme = SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme; // Save memory by only having one set of bitmaps loaded at any time. I mean, they are still - // in the exe, which is in memory, but at least we wont make another copy of all of them. */ + // in the exe, which is in memory, but at least we wont make another copy of all of them. switch (Theme) { case BOOMY: @@ -458,19 +462,9 @@ void CFrame::InitBitmaps() // Start the game or change the disc void CFrame::BootGame() { - // Rerecording -#ifdef RERECORDING - Core::RerecordingStart(); -#endif - if (Core::GetState() != Core::CORE_UNINITIALIZED) - { - if (Core::GetState() == Core::CORE_RUN) - Core::SetState(Core::CORE_PAUSE); - else - Core::SetState(Core::CORE_RUN); - UpdateGUI(); - } + return; + // Start the selected ISO, or try one of the saved paths. // If all that fails, ask to add a dir and don't boot else if (m_GameListCtrl->GetSelectedISO() != NULL) @@ -606,6 +600,30 @@ void CFrame::OnPlayRecording(wxCommandEvent& WXUNUSED (event)) void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event)) { + if (Core::GetState() != Core::CORE_UNINITIALIZED) + { + if (UseDebugger) + { + if (CCPU::IsStepping()) + CCPU::EnableStepping(false); + else + CCPU::EnableStepping(true); // Break + + wxThread::Sleep(20); + g_pCodeWindow->JumpToAddress(PC); + g_pCodeWindow->Update(); + } + else + { + if (Core::GetState() == Core::CORE_RUN) + Core::SetState(Core::CORE_PAUSE); + else + Core::SetState(Core::CORE_RUN); + } + + UpdateGUI(); + } + BootGame(); } diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 16ca736246..d4d9327802 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -77,8 +77,13 @@ bool operator < (const GameListItem &one, const GameListItem &other) switch(currentColumn) { case CGameListCtrl::COLUMN_TITLE: return strcasecmp(one.GetName(indexOne).c_str(), other.GetName(indexOther).c_str()) < 0; - case CGameListCtrl::COLUMN_COMPANY: return strcasecmp(one.GetCompany().c_str(), other.GetCompany().c_str()) < 0; - case CGameListCtrl::COLUMN_NOTES: return strcasecmp(one.GetDescription(indexOne).c_str(), other.GetDescription(indexOther).c_str()) < 0; + case CGameListCtrl::COLUMN_NOTES: + { + // On Gamecube we show the company string, while it's empty on other platforms, so we show the description instead + std::string cmp1 = (one.GetPlatform() == GameListItem::GAMECUBE_DISC) ? one.GetCompany() : one.GetDescription(indexOne); + std::string cmp2 = (other.GetPlatform() == GameListItem::GAMECUBE_DISC) ? other.GetCompany() : other.GetDescription(indexOther); + return strcasecmp(cmp1.c_str(), cmp2.c_str()) < 0; + } case CGameListCtrl::COLUMN_COUNTRY: return (one.GetCountry() < other.GetCountry()); case CGameListCtrl::COLUMN_SIZE: return (one.GetFileSize() < other.GetFileSize()); case CGameListCtrl::COLUMN_PLATFORM: return (one.GetPlatform() < other.GetPlatform()); @@ -227,8 +232,10 @@ void CGameListCtrl::Update() InsertColumn(COLUMN_PLATFORM, _("")); InsertColumn(COLUMN_BANNER, _("Banner")); InsertColumn(COLUMN_TITLE, _("Title")); - InsertColumn(COLUMN_COMPANY, _("Company")); - InsertColumn(COLUMN_NOTES, _("Notes")); + + // Instead of showing the notes + the company, which is unknown with wii titles + // We show in the same column : company for GC games and description for wii/wad games + InsertColumn(COLUMN_NOTES, _(" ")); InsertColumn(COLUMN_COUNTRY, _("")); InsertColumn(COLUMN_SIZE, _("Size")); InsertColumn(COLUMN_EMULATION_STATE, _("State")); @@ -238,8 +245,7 @@ void CGameListCtrl::Update() SetColumnWidth(COLUMN_PLATFORM, 35); SetColumnWidth(COLUMN_BANNER, 96); SetColumnWidth(COLUMN_TITLE, 150); - SetColumnWidth(COLUMN_COMPANY, 130); - SetColumnWidth(COLUMN_NOTES, 150); + SetColumnWidth(COLUMN_NOTES, 130); SetColumnWidth(COLUMN_COUNTRY, 32); SetColumnWidth(COLUMN_EMULATION_STATE, 50); @@ -325,66 +331,72 @@ void CGameListCtrl::InsertItemInReportView(long _Index) // title: 0xFF0000 // company: 0x007030 - wxString name, description; - GameListItem& rISOFile = m_ISOFiles[_Index]; - m_gamePath.append(std::string(rISOFile.GetFileName()) + '\n'); - int ImageIndex = -1; - if (rISOFile.GetImage().IsOk()) - ImageIndex = m_imageListSmall->Add(rISOFile.GetImage()); - + wxCSConv SJISConv(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS)); + GameListItem& rISOFile = m_ISOFiles[_Index]; + // Insert a row with the platform image, that will be used as the Index long ItemIndex = InsertItem(_Index, wxEmptyString, m_PlatformImageIndex[rISOFile.GetPlatform()]); + if (rISOFile.GetImage().IsOk()) + ImageIndex = m_imageListSmall->Add(rISOFile.GetImage()); + // Set the game's banner in the second column SetItemColumnImage(_Index, COLUMN_BANNER, ImageIndex); - switch (rISOFile.GetCountry()) + if (rISOFile.GetPlatform() != GameListItem::WII_WAD) { - case DiscIO::IVolume::COUNTRY_TAIWAN: - case DiscIO::IVolume::COUNTRY_JAPAN: - // keep these codes, when we move to wx unicode... - //wxCSConv convFrom(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS)); - //wxCSConv convTo(wxFontMapper::GetEncodingName(wxFONTENCODING_DEFAULT)); - //SetItem(_Index, COLUMN_TITLE, wxString(wxString(rISOFile.GetName()).wc_str(convFrom) , convTo), -1); - //SetItem(_Index, COLUMN_NOTES, wxString(wxString(rISOFile.GetDescription()).wc_str(convFrom) , convTo), -1); + std::string company; + m_gamePath.append(rISOFile.GetFileName() + '\n'); - if (WxUtils::CopySJISToString(name, rISOFile.GetName(0).c_str())) - SetItem(_Index, COLUMN_TITLE, name, -1); - if (WxUtils::CopySJISToString(description, rISOFile.GetDescription(0).c_str())) - SetItem(_Index, COLUMN_NOTES, description, -1); - m_gameList.append(StringFromFormat("%s (J)\n", (const char*)name.mb_str(wxConvUTF8))); - break; - case DiscIO::IVolume::COUNTRY_USA: - if (WxUtils::CopySJISToString(name, rISOFile.GetName(0).c_str())) - SetItem(_Index, COLUMN_TITLE, name, -1); - if (WxUtils::CopySJISToString(description, rISOFile.GetDescription(0).c_str())) - SetItem(_Index, COLUMN_NOTES, description, -1); - m_gameList.append(StringFromFormat("%s (U)\n", (const char*)name.mb_str(wxConvUTF8))); - break; - default: - m_gameList.append(StringFromFormat("%s (E)\n", rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str())); - SetItem(_Index, COLUMN_TITLE, - wxString::From8BitData(rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()), -1); - SetItem(_Index, COLUMN_NOTES, - wxString::From8BitData(rISOFile.GetDescription((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()), -1); - break; + // We show the company string on Gamecube only + // On Wii we show the description instead as the company string is empty + if (rISOFile.GetPlatform() == GameListItem::GAMECUBE_DISC) + company = rISOFile.GetCompany().c_str(); + + switch (rISOFile.GetCountry()) + { + case DiscIO::IVolume::COUNTRY_TAIWAN: + case DiscIO::IVolume::COUNTRY_JAPAN: + { + wxString name = wxString(rISOFile.GetName(0).c_str(), SJISConv); + m_gameList.append(StringFromFormat("%s (J)\n", (const char*)name.mb_str())); + SetItem(_Index, COLUMN_TITLE, name, -1); + SetItem(_Index, COLUMN_NOTES, wxString(company.size() ? company.c_str() : rISOFile.GetDescription(0).c_str(), SJISConv), -1); + } + break; + case DiscIO::IVolume::COUNTRY_USA: + m_gameList.append(StringFromFormat("%s (U)\n", rISOFile.GetName(0).c_str())); + SetItem(_Index, COLUMN_TITLE, + wxString::From8BitData(rISOFile.GetName(0).c_str()), -1); + SetItem(_Index, COLUMN_NOTES, + wxString::From8BitData(company.size() ? company.c_str() : rISOFile.GetDescription(0).c_str()), -1); + break; + default: + m_gameList.append(StringFromFormat("%s (E)\n", rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str())); + SetItem(_Index, COLUMN_TITLE, + wxString::From8BitData(rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()), -1); + SetItem(_Index, COLUMN_NOTES, wxString::From8BitData( + company.size() ? company.c_str() : rISOFile.GetDescription((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()), -1); + break; + } + } + else // It's a Wad file + { + SetItem(_Index, COLUMN_TITLE, wxString(rISOFile.GetName(0).c_str(), SJISConv), -1); + SetItem(_Index, COLUMN_NOTES, wxString(rISOFile.GetDescription(0).c_str(), SJISConv), -1); } - - SetItem(_Index, COLUMN_COMPANY, wxString::From8BitData(rISOFile.GetCompany().c_str()), -1); - SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1); // Load the INI file for columns that read from it IniFile ini; - std::string GameIni = FULL_GAMECONFIG_DIR + (rISOFile.GetUniqueID()) + ".ini"; - ini.Load(GameIni.c_str()); + ini.Load(std::string(FULL_GAMECONFIG_DIR + (rISOFile.GetUniqueID()) + ".ini").c_str()); // Emulation status int nState; - ini.Get("EmuState", "EmulationStateId", &nState); - // Emulation state + // File size + Emulation state + SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1); SetItemColumnImage(_Index, COLUMN_EMULATION_STATE, m_EmuStateImageIndex[nState]); // Country @@ -557,8 +569,7 @@ void CGameListCtrl::ScanForISOs() void CGameListCtrl::OnColBeginDrag(wxListEvent& event) { - if (event.GetColumn() != COLUMN_TITLE && event.GetColumn() != COLUMN_COMPANY - && event.GetColumn() != COLUMN_NOTES) + if (event.GetColumn() != COLUMN_TITLE && event.GetColumn() != COLUMN_NOTES) event.Veto(); } @@ -605,10 +616,12 @@ int wxCALLBACK wxListCompare(long item1, long item2, long sortData) { case CGameListCtrl::COLUMN_TITLE: return strcasecmp(iso1->GetName(indexOne).c_str(),iso2->GetName(indexOther).c_str()) *t; - case CGameListCtrl::COLUMN_COMPANY: - return strcasecmp(iso1->GetCompany().c_str(),iso2->GetCompany().c_str()) *t; case CGameListCtrl::COLUMN_NOTES: - return strcasecmp(iso1->GetDescription(indexOne).c_str(),iso2->GetDescription(indexOther).c_str()) *t; + { + std::string cmp1 = (iso1->GetPlatform() == GameListItem::GAMECUBE_DISC) ? iso1->GetCompany() : iso1->GetDescription(indexOne); + std::string cmp2 = (iso2->GetPlatform() == GameListItem::GAMECUBE_DISC) ? iso2->GetCompany() : iso2->GetDescription(indexOther); + return strcasecmp(cmp1.c_str(), cmp2.c_str()) *t; + } case CGameListCtrl::COLUMN_COUNTRY: if(iso1->GetCountry() > iso2->GetCountry()) return 1 *t; if(iso1->GetCountry() < iso2->GetCountry()) return -1 *t; @@ -1144,16 +1157,13 @@ void CGameListCtrl::AutomaticColumnWidth() if (0.66*resizable > 200) { SetColumnWidth(COLUMN_TITLE, 0.66*resizable); - SetColumnWidth(COLUMN_COMPANY, 0.34*resizable); + SetColumnWidth(COLUMN_NOTES, 0.34*resizable); } else { SetColumnWidth(COLUMN_TITLE, resizable); - SetColumnWidth(COLUMN_COMPANY, 0); + SetColumnWidth(COLUMN_NOTES, 0); } - - // We currently always hide the notes column - SetColumnWidth(COLUMN_NOTES, 0); } } diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.h b/Source/Core/DolphinWX/Src/GameListCtrl.h index 7a7989a5ab..4f69ede198 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.h +++ b/Source/Core/DolphinWX/Src/GameListCtrl.h @@ -59,7 +59,6 @@ public: COLUMN_PLATFORM = 0, COLUMN_BANNER, COLUMN_TITLE, - COLUMN_COMPANY, COLUMN_NOTES, COLUMN_COUNTRY, COLUMN_SIZE, diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 36177f41e8..43341230b0 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -174,7 +174,6 @@ enum // Debugger Toolbar // -------------------- ID_TOOLBAR_DEBUG, - IDM_DEBUG_GO, IDM_STEP, IDM_STEPOVER, IDM_SKIP, diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 9e0d2ce656..7d2bb46a99 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -74,7 +74,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW OpenISO = DiscIO::CreateVolumeFromFilename(fileName); if (DiscIO::IsVolumeWiiDisc(OpenISO)) { - for (u32 i = 0; i < 0xFFFFFFFF; i++) // yes, technically there can be that many partitions... + for (u32 i = 0; i < 0xFFFFFFFF; i++) // yes, technically there can be OVER NINE THOUSAND partitions... { WiiPartition temp; if ((temp.Partition = DiscIO::CreateVolumeFromFilename(fileName, 0, i)) != NULL) @@ -140,15 +140,21 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW break; case DiscIO::IVolume::COUNTRY_USA: m_Country->SetValue(wxT("USA")); + m_Lang->SetSelection(0); + m_Lang->Disable(); // For NTSC Games, there's no multi lang break; case DiscIO::IVolume::COUNTRY_JAPAN: m_Country->SetValue(wxT("JAPAN")); + m_Lang->SetSelection(-1); + m_Lang->Disable(); // For NTSC Games, there's no multi lang break; case DiscIO::IVolume::COUNTRY_KOREA: m_Country->SetValue(wxT("KOREA")); break; case DiscIO::IVolume::COUNTRY_TAIWAN: m_Country->SetValue(wxT("TAIWAN")); + m_Lang->SetSelection(-1); + m_Lang->Disable(); // For NTSC Games, there's no multi lang break; case DiscIO::IVolume::COUNTRY_SDK: m_Country->SetValue(wxT("No Country (SDK)")); @@ -157,13 +163,12 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW m_Country->SetValue(wxT("UNKNOWN")); break; } - wxString temp; - temp = _T("0x") + wxString::FromAscii(OpenISO->GetMakerID().c_str()); + wxString temp = _T("0x") + wxString::FromAscii(OpenISO->GetMakerID().c_str()); m_MakerID->SetValue(temp); m_Date->SetValue(wxString::FromAscii(OpenISO->GetApploaderDate().c_str())); m_FST->SetValue(wxString::Format(_T("%u"), OpenISO->GetFSTSize())); - // Banner + // Here we set all the info to be shown (be it SJIS or Ascii) + we set the window title ChangeBannerDetails((int)SConfig::GetInstance().m_InterfaceLanguage); m_Banner->SetBitmap(OpenGameListItem->GetImage()); m_Banner->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, @@ -190,17 +195,6 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW } } m_Treectrl->Expand(RootId); - - std::string filename, extension; - SplitPath(fileName, 0, &filename, &extension); - - // hyperiris: temp fix, need real work - wxString name; - WxUtils::CopySJISToString(name, OpenGameListItem->GetName(0).c_str()); - - SetTitle(wxString::Format(wxT("%s%s"), - wxString::FromAscii(StringFromFormat("%s%s: %s - ", filename.c_str(), extension.c_str(), OpenGameListItem->GetUniqueID().c_str()).c_str()).c_str(), - name.c_str()).c_str()); } CISOProperties::~CISOProperties() @@ -1139,13 +1133,39 @@ void CISOProperties::OnChangeBannerLang(wxCommandEvent& event) void CISOProperties::ChangeBannerDetails(int lang) { - wxString name, - description; + if (OpenGameListItem->GetCountry() == DiscIO::IVolume::COUNTRY_JAPAN + || OpenGameListItem->GetCountry() == DiscIO::IVolume::COUNTRY_TAIWAN + || OpenGameListItem->GetPlatform() == GameListItem::WII_WAD) + { + wxCSConv SJISConv(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS)); + wxString name = wxString(OpenGameListItem->GetName(0).c_str(), SJISConv); - WxUtils::CopySJISToString(name, OpenGameListItem->GetName(lang).c_str()); - WxUtils::CopySJISToString(description, OpenGameListItem->GetDescription(lang).c_str()); + // Updates the informations shown in the window + m_ShortName->SetValue(name); + m_Comment->SetValue(wxString(OpenGameListItem->GetDescription(0).c_str(), SJISConv)); + m_Maker->SetValue(wxString::FromAscii(OpenGameListItem->GetCompany().c_str()));//dev too - m_ShortName->SetValue(name); - m_Maker->SetValue(wxString::FromAscii(OpenGameListItem->GetCompany().c_str()));//dev too - m_Comment->SetValue(description); + std::string filename, extension; + SplitPath(OpenGameListItem->GetFileName(), 0, &filename, &extension); + + // Also sets the window's title + SetTitle(wxString::Format(wxT("%s%s"), + wxString::FromAscii(StringFromFormat("%s%s: %s - ", filename.c_str(), extension.c_str(), OpenGameListItem->GetUniqueID().c_str()).c_str()).c_str(), + name.c_str())); + } + else // Do the same for PAL/US Games using Ascii + { + wxString name = wxString::FromAscii(OpenGameListItem->GetName(lang).c_str()); + + m_ShortName->SetValue(name); + m_Comment->SetValue(wxString::FromAscii(OpenGameListItem->GetDescription(lang).c_str())); + m_Maker->SetValue(wxString::FromAscii(OpenGameListItem->GetCompany().c_str()));//dev too + + std::string filename, extension; + SplitPath(OpenGameListItem->GetFileName(), 0, &filename, &extension); + + SetTitle(wxString::Format(wxT("%s%s"), + wxString::FromAscii(StringFromFormat("%s%s: %s - ", filename.c_str(), extension.c_str(), OpenGameListItem->GetUniqueID().c_str()).c_str()).c_str(), + name.c_str())); + } } diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h index e61cb784f6..129b8b82ac 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.h +++ b/Source/Core/DolphinWX/Src/ISOProperties.h @@ -23,11 +23,11 @@ #include #include #include +#include #include #include #include #include -#include "WxUtils.h" #include #include "ISOFile.h" diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp index af7f873dbb..ad6f036cd2 100644 --- a/Source/Core/DolphinWX/Src/LogWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogWindow.cpp @@ -44,7 +44,7 @@ BEGIN_EVENT_TABLE(CLogWindow, wxPanel) EVT_TIMER(IDTM_UPDATELOG, CLogWindow::OnLogTimer) END_EVENT_TABLE() -CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style) +CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxString &, const wxPoint &position, const wxSize& size, long style) : wxPanel(parent, id, position, size, style) , Parent(parent), m_LogSection(1), m_Log(NULL), m_cmdline(NULL), m_FontChoice(NULL) , m_LogAccess(true)