InfoWindow fixes for linux build, dvd drive list

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3076 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2009-04-25 18:55:05 +00:00
parent ad77806927
commit 375e1227d9
2 changed files with 240 additions and 243 deletions

View File

@ -1,158 +1,155 @@
// Copyright (C) 2003-2009 Dolphin Project. // Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Globals.h" #include "Globals.h"
#include "InfoWindow.h" #include "InfoWindow.h"
#include "CPUDetect.h" #include "CPUDetect.h"
#include "Core.h" #include "Core.h"
#include "ConfigManager.h" #include "ConfigManager.h"
#include "CDUtils.h" #include "CDUtils.h"
BEGIN_EVENT_TABLE(wxInfoWindow, wxWindow) BEGIN_EVENT_TABLE(wxInfoWindow, wxWindow)
EVT_SIZE( wxInfoWindow::OnEvent_Window_Resize) EVT_SIZE( wxInfoWindow::OnEvent_Window_Resize)
EVT_CLOSE( wxInfoWindow::OnEvent_Window_Close) EVT_CLOSE( wxInfoWindow::OnEvent_Window_Close)
EVT_BUTTON(ID_BUTTON_CLOSE, wxInfoWindow::OnEvent_ButtonClose_Press) EVT_BUTTON(ID_BUTTON_CLOSE, wxInfoWindow::OnEvent_ButtonClose_Press)
END_EVENT_TABLE() END_EVENT_TABLE()
wxInfoWindow::wxInfoWindow(wxFrame* parent, const wxPoint& pos, const wxSize& size) : wxInfoWindow::wxInfoWindow(wxFrame* parent, const wxPoint& pos, const wxSize& size) :
wxFrame(parent, wxID_ANY, _T("System Information"), pos, size, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) wxFrame(parent, wxID_ANY, _T("System Information"), pos, size, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{ {
// Create the GUI controls // Create the GUI controls
Init_ChildControls(); Init_ChildControls();
// Setup Window // Setup Window
SetBackgroundColour(wxColour(COLOR_GRAY)); SetBackgroundColour(wxColour(COLOR_GRAY));
SetSize(size); SetSize(size);
SetPosition(pos); SetPosition(pos);
Layout(); Layout();
Show(); Show();
} }
wxInfoWindow::~wxInfoWindow() wxInfoWindow::~wxInfoWindow()
{ {
// On Disposal // On Disposal
} }
std::string Summarize_Plug() std::string Summarize_Plug()
{ {
std::string sum; return StringFromFormat("Default GFX Plugin: %s\nDefault DSP Plugin: %s\nDefault PAD Plugin: %s\nDefault WiiMote Plugin: ",
sum = StringFromFormat("",""); SConfig::GetInstance().m_DefaultGFXPlugin.c_str(), SConfig::GetInstance().m_DefaultDSPPlugin.c_str(),
sum += "Default GFX Plugin: " + SConfig::GetInstance().m_DefaultGFXPlugin +"\n"; SConfig::GetInstance().m_DefaultPADPlugin.c_str(), SConfig::GetInstance().m_DefaultWiiMotePlugin.c_str());
sum += "Default DSP Plugin: " + SConfig::GetInstance().m_DefaultDSPPlugin +"\n"; }
sum += "Default PAD Plugin: " + SConfig::GetInstance().m_DefaultPADPlugin +"\n";
sum += "Default WiiMote Plugin: " + SConfig::GetInstance().m_DefaultWiiMotePlugin +"\n"; std::string Summarize_Settings()
return sum; {
} return StringFromFormat(
"Dolphin Settings\n\nAlways HLE Bios: %s\nUse Dynarec: %s\n"
std::string Summarize_Settings() "Use Dual Core: %s\nDSP Thread: %s\nSkip Idle: %s\nLock Threads: %s\n"
{ "Use Dual Core: %s\nDefault GCM: %s\nDVD Root: %s\n"
std::string sum; "Optimize Quantizers: %s\nEnable Cheats: %s\n"
sum = StringFromFormat("",""); "Selected Language: %d\nMemcard A: %s\n"
sum += "\nDolphin Settings\n\n"; "Memcard B: %s\nSlot A: %d\nSlot B: %d\n"
sum += wxString::Format("Always HLE Bios: %08x\n",Core::GetStartupParameter().bHLEBios); "Serial Port 1: %d\nWidescreen: %s\n"
sum += wxString::Format("Use Dynarec: %08x\n",Core::GetStartupParameter().bUseJIT); "Progressive Scan: %s\n",
sum += wxString::Format("Use Dual Core: %08x\n",Core::GetStartupParameter().bUseDualCore); Core::GetStartupParameter().bHLEBios?"true":"false",
sum += wxString::Format("DSP Thread: %08x\n",Core::GetStartupParameter().bDSPThread); Core::GetStartupParameter().bUseJIT?"true":"false",
sum += wxString::Format("Skip Idle: %08x\n",Core::GetStartupParameter().bSkipIdle); Core::GetStartupParameter().bUseDualCore?"true":"false",
sum += wxString::Format("Lock Threads: %08x\n",Core::GetStartupParameter().bLockThreads); Core::GetStartupParameter().bDSPThread?"true":"false",
sum += wxString::Format("Use Dual Core: %08x\n",Core::GetStartupParameter().bUseDualCore); Core::GetStartupParameter().bSkipIdle?"true":"false",
sum += wxString::Format("Default GCM: %08x\n",Core::GetStartupParameter().m_strDefaultGCM); Core::GetStartupParameter().bLockThreads?"true":"false",
sum += wxString::Format("DVD Root: %08x\n",Core::GetStartupParameter().m_strDVDRoot); Core::GetStartupParameter().bUseDualCore?"true":"false",
sum += wxString::Format("Optimize Quantizers: %08x\n",Core::GetStartupParameter().bOptimizeQuantizers); Core::GetStartupParameter().m_strDefaultGCM.c_str(),
sum += wxString::Format("Enable Cheats: %08x\n",Core::GetStartupParameter().bEnableCheats); Core::GetStartupParameter().m_strDVDRoot.c_str(),
sum += wxString::Format("Selected Language: %08x\n",Core::GetStartupParameter().SelectedLanguage); Core::GetStartupParameter().bOptimizeQuantizers?"true":"false",
sum += wxString::Format("Memcard A: %08x\n",SConfig::GetInstance().m_strMemoryCardA); Core::GetStartupParameter().bEnableCheats?"true":"false",
sum += wxString::Format("Memcard B: %08x\n",SConfig::GetInstance().m_strMemoryCardB); Core::GetStartupParameter().SelectedLanguage, //FIXME show language based on index
sum += wxString::Format("Slot A: %08x\n",SConfig::GetInstance().m_EXIDevice[0]); SConfig::GetInstance().m_strMemoryCardA.c_str(),
sum += wxString::Format("Slot B: %08x\n",SConfig::GetInstance().m_EXIDevice[1]); SConfig::GetInstance().m_strMemoryCardB.c_str(),
sum += wxString::Format("Serial Port 1: %08x\n",SConfig::GetInstance().m_EXIDevice[2]); SConfig::GetInstance().m_EXIDevice[0], //FIXME
sum += wxString::Format("Widescreen: %08x\n",Core::GetStartupParameter().bWidescreen); SConfig::GetInstance().m_EXIDevice[1], //FIXME
sum += wxString::Format("Progressive Scan: %08x\n",Core::GetStartupParameter().bProgressiveScan); SConfig::GetInstance().m_EXIDevice[2], //FIXME
Core::GetStartupParameter().bWidescreen?"true":"false",
return sum; Core::GetStartupParameter().bProgressiveScan?"true":"false");
} }
void wxInfoWindow::Init_ChildControls() void wxInfoWindow::Init_ChildControls()
{ {
wxString Info;
// Main Notebook Info.Printf(wxT("Dolphin Revision: " SVN_REV_STR));
m_Notebook_Main = new wxNotebook(this, ID_NOTEBOOK_MAIN, wxDefaultPosition, wxDefaultSize);
// --- Tabs --- char ** drives = cdio_get_devices();
for (int i = 0; drives[i] != NULL && i < 24; i++)
// $ Log Tab {
m_Tab_Log = new wxPanel(m_Notebook_Main, ID_TAB_LOG, wxDefaultPosition, wxDefaultSize); Info.Append(wxString::Format(wxT("\nCD/DVD Drive%d: %s"), i+1, drives[i]));
m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log, }
ID_TEXTCTRL_LOG, Info.Append(wxString::Format(wxT("Plugin Information\n\n%s\n%s\nProcessor Information:%s\n"),
wxString::FromAscii(std::string( Summarize_Plug().c_str(), Summarize_Settings().c_str(), cpu_info.Summarize().c_str()));
//Dolphin revision number
std::string("Dolphin Revision: ") + SVN_REV_STR +"\n"+
std::string("CD/DVD Drive: ") + **cdio_get_devices() +"\n"+
// Main Notebook
//Plugin Information m_Notebook_Main = new wxNotebook(this, ID_NOTEBOOK_MAIN, wxDefaultPosition, wxDefaultSize);
"Plugin Information\n\n"+ // --- Tabs ---
Summarize_Plug() +"\n"+
Summarize_Settings() +"\n"+ // $ Log Tab
//CPU Info m_Tab_Log = new wxPanel(m_Notebook_Main, ID_TAB_LOG, wxDefaultPosition, wxDefaultSize);
std::string("Processor Information:\n")+cpu_info.Summarize()+"\n\n" m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log, ID_TEXTCTRL_LOG, Info, wxDefaultPosition, wxSize(100, 600),
wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);
).c_str()),
wxDefaultPosition, wxSize(100, 600), wxBoxSizer *HStrip1 = new wxBoxSizer(wxHORIZONTAL);
wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP); wxBoxSizer *sTabLog = new wxBoxSizer(wxVERTICAL);
sTabLog->Add(HStrip1, 0, wxALL, 5);
wxBoxSizer *HStrip1 = new wxBoxSizer(wxHORIZONTAL); sTabLog->Add(m_TextCtrl_Log, 1, wxALL|wxEXPAND, 5);
wxBoxSizer *sTabLog = new wxBoxSizer(wxVERTICAL);
sTabLog->Add(HStrip1, 0, wxALL, 5); m_Tab_Log->SetSizer(sTabLog);
sTabLog->Add(m_TextCtrl_Log, 1, wxALL|wxEXPAND, 5); m_Tab_Log->Layout();
m_Tab_Log->SetSizer(sTabLog); // Add Tabs to Notebook
m_Tab_Log->Layout(); m_Notebook_Main->AddPage(m_Tab_Log, _T("System Information"));
// Add Tabs to Notebook // Button Strip
m_Notebook_Main->AddPage(m_Tab_Log, _T("System Information")); m_Button_Close = new wxButton(this, ID_BUTTON_CLOSE, _T("Close"), wxDefaultPosition, wxDefaultSize);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
// Button Strip sButtons->Add(m_Button_Close, 0, wxALL, 5);
m_Button_Close = new wxButton(this, ID_BUTTON_CLOSE, _T("Close"), wxDefaultPosition, wxDefaultSize);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
sButtons->Add(m_Button_Close, 0, wxALL, 5); sMain->Add(m_Notebook_Main, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxALL, 5);
wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL); SetSizer(sMain);
sMain->Add(m_Notebook_Main, 1, wxEXPAND|wxALL, 5); Layout();
sMain->Add(sButtons, 0, wxALL, 5);
SetSizer(sMain); Fit();
Layout(); }
Fit();
}
void wxInfoWindow::OnEvent_Window_Resize(wxSizeEvent& WXUNUSED (event))
{
Layout();
void wxInfoWindow::OnEvent_Window_Resize(wxSizeEvent& WXUNUSED (event)) }
{ void wxInfoWindow::OnEvent_ButtonClose_Press(wxCommandEvent& WXUNUSED (event))
Layout(); {
} Destroy();
void wxInfoWindow::OnEvent_ButtonClose_Press(wxCommandEvent& WXUNUSED (event)) }
{ void wxInfoWindow::OnEvent_Window_Close(wxCloseEvent& WXUNUSED (event))
Destroy(); {
} Destroy();
void wxInfoWindow::OnEvent_Window_Close(wxCloseEvent& WXUNUSED (event)) }
{
Destroy();
}

View File

@ -1,85 +1,85 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#ifndef __INFOWINDOW_H__ #ifndef __INFOWINDOW_H__
#define __INFOWINDOW_H__ #define __INFOWINDOW_H__
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/filepicker.h> #include <wx/filepicker.h>
#include <wx/statbmp.h> #include <wx/statbmp.h>
#include <wx/imaglist.h> #include <wx/imaglist.h>
#include <wx/treectrl.h> #include <wx/treectrl.h>
#include <wx/gbsizer.h> #include <wx/gbsizer.h>
#include <wx/notebook.h> #include <wx/notebook.h>
#include <wx/mimetype.h> #include <wx/mimetype.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <string> #include <string>
#include "Filesystem.h" #include "Filesystem.h"
#include "IniFile.h" #include "IniFile.h"
class wxInfoWindow : public wxFrame class wxInfoWindow : public wxFrame
{ {
public: public:
wxInfoWindow(wxFrame* parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); wxInfoWindow(wxFrame* parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
virtual ~wxInfoWindow(); virtual ~wxInfoWindow();
protected: protected:
// Event Table // Event Table
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
// --- GUI Controls --- // --- GUI Controls ---
wxNotebook *m_Notebook_Main; wxNotebook *m_Notebook_Main;
wxPanel *m_Tab_Log; wxPanel *m_Tab_Log;
wxButton *m_Button_Close; wxButton *m_Button_Close;
wxTextCtrl *m_TextCtrl_Log; wxTextCtrl *m_TextCtrl_Log;
// GUI IDs // GUI IDs
enum enum
{ {
ID_NOTEBOOK_MAIN, ID_NOTEBOOK_MAIN,
ID_TAB_LOG, ID_TAB_LOG,
ID_BUTTON_CLOSE, ID_BUTTON_CLOSE,
ID_TEXTCTRL_LOG ID_TEXTCTRL_LOG
}; };
void Init_ChildControls(); void Init_ChildControls();
// --- Wx Events Handlers --- // --- Wx Events Handlers ---
// $ Window // $ Window
void OnEvent_Window_Resize(wxSizeEvent& event); void OnEvent_Window_Resize(wxSizeEvent& event);
void OnEvent_Window_Close(wxCloseEvent& event); void OnEvent_Window_Close(wxCloseEvent& event);
// $ Close Button // $ Close Button
void OnEvent_ButtonClose_Press(wxCommandEvent& event); void OnEvent_ButtonClose_Press(wxCommandEvent& event);
}; };
#endif #endif