1) Added a "General" tab to config window 2) Moved Interface settings to General tab 3) some code organization

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1652 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
omegadox 2008-12-25 07:28:41 +00:00
parent 34b92fe7c5
commit bce493cf3d
2 changed files with 238 additions and 219 deletions

View File

@ -100,47 +100,52 @@ CConfigMain::~CConfigMain()
void CConfigMain::CreateGUIControls()
{
Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
GeneralPage = new wxPanel(Notebook, ID_GENERALPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(GeneralPage, wxT("Core"));
CorePage = new wxPanel(Notebook, ID_COREPAGE, wxDefaultPosition, wxDefaultSize);
GamecubePage = new wxPanel(Notebook, ID_GAMECUBEPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(GamecubePage, wxT("Gamecube"));
WiiPage = new wxPanel(Notebook, ID_WIIPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(WiiPage, wxT("Wii"));
PathsPage = new wxPanel(Notebook, ID_PATHSPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(PathsPage, wxT("Paths"));
PluginPage = new wxPanel(Notebook, ID_PLUGINPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(GeneralPage, wxT("General"));
Notebook->AddPage(CorePage, wxT("Core"));
Notebook->AddPage(GamecubePage, wxT("Gamecube"));
Notebook->AddPage(WiiPage, wxT("Wii"));
Notebook->AddPage(PathsPage, wxT("Paths"));
Notebook->AddPage(PluginPage, wxT("Plugins"));
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxBoxSizer* sButtons;
sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
this->SetSizer(sMain);
this->Layout();
//////////////////////////////////
// Core page (sGeneral)
// -----------
// General page
// --------
sGeneral = new wxBoxSizer(wxVERTICAL);
// Interface Settings
ConfirmStop = new wxCheckBox(GeneralPage, ID_INTERFACE_CONFIRMSTOP, wxT("Confirm On Stop"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ConfirmStop->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop);
sbInterface = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Interface Settings"));
sbInterface->Add(ConfirmStop, 0, wxALL, 5);
sGeneralPage = new wxBoxSizer(wxVERTICAL);
sGeneralPage->Add(sbInterface, 0, wxALL|wxEXPAND, 5);
GeneralPage->SetSizer(sGeneralPage);
sGeneralPage->Layout();
//////////////////////////////////
// Core page
// --------
sCore = new wxBoxSizer(wxVERTICAL);
// Basic Settings
sbBasic = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Basic Settings"));
UseDualCore = new wxCheckBox(GeneralPage, ID_USEDUALCORE, wxT("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
sbBasic = new wxStaticBoxSizer(wxVERTICAL, CorePage, wxT("Basic Settings"));
UseDualCore = new wxCheckBox(CorePage, ID_USEDUALCORE, wxT("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDualCore->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
SkipIdle = new wxCheckBox(GeneralPage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle = new wxCheckBox(CorePage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle);
EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats = new wxCheckBox(CorePage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
sbBasic->Add(UseDualCore, 0, wxALL, 5);
@ -148,14 +153,14 @@ void CConfigMain::CreateGUIControls()
sbBasic->Add(EnableCheats, 0, wxALL, 5);
// Advanced Settings
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Advanced Settings"));
AllwaysHLEBIOS = new wxCheckBox(GeneralPage, ID_ALLWAYS_HLEBIOS, wxT("HLE the BIOS all the time"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, CorePage, wxT("Advanced Settings"));
AllwaysHLEBIOS = new wxCheckBox(CorePage, ID_ALLWAYS_HLEBIOS, wxT("HLE the BIOS all the time"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
AllwaysHLEBIOS->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios);
UseDynaRec = new wxCheckBox(GeneralPage, ID_USEDYNAREC, wxT("Enable Dynamic Recompilation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDynaRec = new wxCheckBox(CorePage, ID_USEDYNAREC, wxT("Enable Dynamic Recompilation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDynaRec->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseJIT);
LockThreads = new wxCheckBox(GeneralPage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
LockThreads = new wxCheckBox(CorePage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
OptimizeQuantizers = new wxCheckBox(GeneralPage, ID_OPTIMIZEQUANTIZERS, wxT("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
OptimizeQuantizers = new wxCheckBox(CorePage, ID_OPTIMIZEQUANTIZERS, wxT("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
OptimizeQuantizers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bOptimizeQuantizers);
sbAdvanced->Add(AllwaysHLEBIOS, 0, wxALL, 5);
@ -163,20 +168,12 @@ void CConfigMain::CreateGUIControls()
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
sbAdvanced->Add(OptimizeQuantizers, 0, wxALL, 5);
// Interface Settings
sbInterface = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Interface Settings"));
ConfirmStop = new wxCheckBox(GeneralPage, ID_INTERFACE_CONFIRMSTOP, wxT("Show confirmation box before Stopping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ConfirmStop->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop);
sbInterface->Add(ConfirmStop, 0, wxALL, 5);
// Populate sGeneral
sGeneral->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
//sGeneral->AddStretchSpacer();
sGeneral->Add(sbAdvanced, 0, wxEXPAND|wxALL, 5);
sGeneral->Add(sbInterface, 0, wxEXPAND|wxALL, 5);
GeneralPage->SetSizer(sGeneral);
sGeneral->Layout();
// Populate sCore
sCore->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
//sCore->AddStretchSpacer();
sCore->Add(sbAdvanced, 0, wxEXPAND|wxALL, 5);
CorePage->SetSizer(sCore);
sCore->Layout();
//////////////////////////////////
@ -257,7 +254,9 @@ void CConfigMain::CreateGUIControls()
sWii->Layout();
//////////////////////////////////
// Paths page
// --------
sbISOPaths = new wxStaticBoxSizer(wxVERTICAL, PathsPage, wxT("ISO Directories"));
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
@ -295,7 +294,9 @@ void CConfigMain::CreateGUIControls()
PathsPage->SetSizer(sPaths);
sPaths->Layout();
// Plugin page
//////////////////////////////////
// Plugins page
// --------
sbGraphicsPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Graphics"));
GraphicSelection = new wxChoice(PluginPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
GraphicConfig = new wxButton(PluginPage, ID_GRAPHIC_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
@ -335,6 +336,20 @@ void CConfigMain::CreateGUIControls()
sPlugins->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
PluginPage->SetSizer(sPlugins);
sPlugins->Layout();
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
this->SetSizer(sMain);
this->Layout();
Fit();
Center();
}

View File

@ -46,7 +46,10 @@ class CConfigMain
DECLARE_EVENT_TABLE();
wxBoxSizer* sGeneral; // Core settings
wxBoxSizer* sGeneralPage; // General Settings
wxCheckBox* ConfirmStop;
wxBoxSizer* sCore; // Core settings
wxStaticBoxSizer* sbBasic, *sbAdvanced, *sbInterface;
wxCheckBox* AllwaysHLEBIOS;
wxCheckBox* UseDynaRec;
@ -55,7 +58,6 @@ class CConfigMain
wxCheckBox* OptimizeQuantizers;
wxCheckBox* SkipIdle;
wxCheckBox* EnableCheats;
wxCheckBox* ConfirmStop;
wxBoxSizer* sGamecube; // GC settings
wxStaticBoxSizer* sbGamecubeIPLSettings;
@ -81,6 +83,7 @@ class CConfigMain
wxNotebook *Notebook;
wxPanel *GeneralPage;
wxPanel *CorePage;
wxPanel *GamecubePage;
wxPanel *WiiPage;
wxPanel *PathsPage;
@ -192,6 +195,7 @@ class CConfigMain
{
ID_NOTEBOOK = 1000,
ID_GENERALPAGE,
ID_COREPAGE,
ID_GAMECUBEPAGE,
ID_WIIPAGE,
ID_PATHSPAGE,