* Bugfix for Recent Iso List (it stopped remembering stuff a couple revs ago).

* Doing some configuration panel additions and cleanups (UI/theme-related) -- WIP.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4090 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-12-14 07:18:09 +00:00
parent c8ebbdc00f
commit 83e343b593
13 changed files with 108 additions and 48 deletions

View File

@ -190,14 +190,15 @@ struct AppImageIds
Gamefixes, Gamefixes,
MemoryCard, MemoryCard,
Video, Video,
Cpu; Cpu,
Appearance;
ConfigIds() ConfigIds()
{ {
Paths = Plugins = Paths = Plugins =
Speedhacks = Gamefixes = Speedhacks = Gamefixes =
Video = Cpu = Video = Cpu =
MemoryCard = -1; MemoryCard = Appearance = -1;
} }
} Config; } Config;

View File

@ -360,7 +360,8 @@ AppConfig::AppConfig()
: MainGuiPosition( wxDefaultPosition ) : MainGuiPosition( wxDefaultPosition )
, SysSettingsTabName( L"Cpu" ) , SysSettingsTabName( L"Cpu" )
, McdSettingsTabName( L"none" ) , McdSettingsTabName( L"none" )
, AppSettingsTabName( L"Plugins" ) , ComponentsTabName( L"Plugins" )
, AppSettingsTabName( L"Appearance" )
, GameDatabaseTabName( L"none" ) , GameDatabaseTabName( L"none" )
, DeskTheme( L"default" ) , DeskTheme( L"default" )
{ {
@ -466,6 +467,7 @@ void AppConfig::LoadSaveRootItems( IniInterface& ini )
IniEntry( MainGuiPosition ); IniEntry( MainGuiPosition );
IniEntry( SysSettingsTabName ); IniEntry( SysSettingsTabName );
IniEntry( McdSettingsTabName ); IniEntry( McdSettingsTabName );
IniEntry( ComponentsTabName );
IniEntry( AppSettingsTabName ); IniEntry( AppSettingsTabName );
IniEntry( GameDatabaseTabName ); IniEntry( GameDatabaseTabName );
ini.EnumEntry( L"LanguageId", LanguageId, NULL, defaults.LanguageId ); ini.EnumEntry( L"LanguageId", LanguageId, NULL, defaults.LanguageId );

View File

@ -192,6 +192,7 @@ public:
// by it's UTF/ASCII name). // by it's UTF/ASCII name).
wxString SysSettingsTabName; wxString SysSettingsTabName;
wxString McdSettingsTabName; wxString McdSettingsTabName;
wxString ComponentsTabName;
wxString AppSettingsTabName; wxString AppSettingsTabName;
wxString GameDatabaseTabName; wxString GameDatabaseTabName;

View File

@ -31,6 +31,7 @@
#include "Resources/ConfigIcon_Paths.h" #include "Resources/ConfigIcon_Paths.h"
#include "Resources/ConfigIcon_Plugins.h" #include "Resources/ConfigIcon_Plugins.h"
#include "Resources/ConfigIcon_MemoryCard.h" #include "Resources/ConfigIcon_MemoryCard.h"
#include "Resources/ConfigIcon_Appearance.h"
#include "Resources/AppIcon16.h" #include "Resources/AppIcon16.h"
#include "Resources/AppIcon32.h" #include "Resources/AppIcon32.h"
@ -184,6 +185,7 @@ wxImageList& Pcsx2App::GetImgList_Config()
FancyLoadMacro( MemoryCard ); FancyLoadMacro( MemoryCard );
FancyLoadMacro( Video ); FancyLoadMacro( Video );
FancyLoadMacro( Cpu ); FancyLoadMacro( Cpu );
FancyLoadMacro( Appearance );
} }
return *images; return *images;
} }

View File

@ -90,23 +90,18 @@ namespace Dialogs
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// LanguageSelectionDialog // InterfaceConfigDialog
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
class LanguageSelectionDialog : public BaseConfigurationDialog class InterfaceConfigDialog : public BaseConfigurationDialog
{ {
public: public:
virtual ~LanguageSelectionDialog() throw() {} virtual ~InterfaceConfigDialog() throw() {}
LanguageSelectionDialog(wxWindow* parent=NULL); InterfaceConfigDialog(wxWindow* parent=NULL);
static wxString GetNameStatic() { return L"LanguageSelector"; } static wxString GetNameStatic() { return L"InterfaceConfig"; }
wxString GetDialogName() const { return GetNameStatic(); } wxString GetDialogName() const { return GetNameStatic(); }
protected: protected:
virtual wxString& GetConfSettingsTabName() const virtual wxString& GetConfSettingsTabName() const { return g_Conf->AppSettingsTabName; }
{
pxFailDev("Language selector does not have a listbook or settings tab.");
static wxString fail;
return fail;
}
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -162,7 +157,7 @@ namespace Dialogs
wxString GetDialogName() const { return GetNameStatic(); } wxString GetDialogName() const { return GetNameStatic(); }
protected: protected:
virtual wxString& GetConfSettingsTabName() const { return g_Conf->AppSettingsTabName; } virtual wxString& GetConfSettingsTabName() const { return g_Conf->ComponentsTabName; }
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------

View File

@ -98,7 +98,6 @@ Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent)
AddPage<PluginSelectorPanel> ( wxLt("Plugins"), cfgid.Plugins ); AddPage<PluginSelectorPanel> ( wxLt("Plugins"), cfgid.Plugins );
AddPage<BiosSelectorPanel> ( wxLt("BIOS"), cfgid.Cpu ); AddPage<BiosSelectorPanel> ( wxLt("BIOS"), cfgid.Cpu );
AddPage<StandardPathsPanel> ( wxLt("Folders"), cfgid.Paths );
AddListbook(); AddListbook();
AddOkCancel(); AddOkCancel();
@ -107,12 +106,20 @@ Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent)
wxGetApp().PostMethod( CheckPluginsOverrides ); wxGetApp().PostMethod( CheckPluginsOverrides );
} }
Dialogs::LanguageSelectionDialog::LanguageSelectionDialog(wxWindow *parent) Dialogs::InterfaceConfigDialog::InterfaceConfigDialog(wxWindow *parent)
: BaseConfigurationDialog( parent, AddAppName(_("Language Selector - %s")), 400 ) : BaseConfigurationDialog( parent, AddAppName(_("Language Selector - %s")), 400 )
{ {
ScopedBusyCursor busy( Cursor_ReallyBusy ); ScopedBusyCursor busy( Cursor_ReallyBusy );
*this += new Panels::LanguageSelectionPanel( this ) | pxCenter; CreateListbook( wxGetApp().GetImgList_Config() );
const AppImageIds::ConfigIds& cfgid( wxGetApp().GetImgId().Config );
wxDialogWithHelpers::AddOkCancel( NULL, false ); AddPage<StandardPathsPanel> ( wxLt("Appearance"), cfgid.Appearance );
} AddPage<StandardPathsPanel> ( wxLt("Folders"), cfgid.Paths );
AddListbook();
AddOkCancel();
//*this += new Panels::LanguageSelectionPanel( this ) | pxCenter;
//wxDialogWithHelpers::AddOkCancel( NULL, false );
}

View File

@ -39,9 +39,12 @@ void MSW_ListView_SetIconSpacing( wxListbook& listbook, int width )
// way over generous. This little bit of Win32-specific code ensures proper icon spacing, scaled // way over generous. This little bit of Win32-specific code ensures proper icon spacing, scaled
// to the size of the frame's ideal width. // to the size of the frame's ideal width.
ListView_SetIconSpacing( (HWND)listbook.GetListView()->GetHWND(), if (listbook.GetPageCount())
(width / listbook.GetPageCount()) - 4, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored {
); ListView_SetIconSpacing( (HWND)listbook.GetListView()->GetHWND(),
(width / listbook.GetPageCount()) - 4, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored
);
}
#endif #endif
} }

View File

@ -450,7 +450,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
if (IsDebugBuild) if (IsDebugBuild)
{ {
m_menuConfig.Append(MenuId_Config_GameDatabase, _("Game Database Editor") ); m_menuConfig.Append(MenuId_Config_GameDatabase, _("Game Database Editor") );
m_menuConfig.Append(MenuId_Config_Language, _("Language...") ); m_menuConfig.Append(MenuId_Config_Language, _("Appearance...") );
} }
m_menuConfig.AppendSeparator(); m_menuConfig.AppendSeparator();

View File

@ -74,8 +74,8 @@ void MainEmuFrame::Menu_SelectPluginsBios_Click(wxCommandEvent &event)
void MainEmuFrame::Menu_Language_Click(wxCommandEvent &event) void MainEmuFrame::Menu_Language_Click(wxCommandEvent &event)
{ {
//AppOpenDialog<LanguageSelectionDialog>( this ); //AppOpenDialog<InterfaceConfigDialog>( this );
LanguageSelectionDialog(this).ShowModal(); InterfaceConfigDialog(this).ShowModal();
} }
static void WipeSettings() static void WipeSettings()

View File

@ -34,6 +34,10 @@ RecentIsoManager::RecentIsoManager( wxMenu* menu )
{ {
m_cursel = 0; m_cursel = 0;
m_Separator = NULL; m_Separator = NULL;
IniLoader loader;
LoadListFrom(loader);
Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(RecentIsoManager::OnChangedSelection) ); Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(RecentIsoManager::OnChangedSelection) );
} }
@ -59,10 +63,8 @@ void RecentIsoManager::OnChangedSelection( wxCommandEvent& evt )
m_cursel = i; m_cursel = i;
// TODO: Dialog asking for hotswap or reset!!!!
ScopedCoreThreadPopup stopped_core; ScopedCoreThreadPopup stopped_core;
//SysUpdateIsoSrcFile( m_Items[i].Filename );
#ifdef __LINUX__ #ifdef __LINUX__
// Likely not what was intended, but it compiles for the moment... // Likely not what was intended, but it compiles for the moment...
SwapOrReset_Iso( NULL, stopped_core, m_Items[i].Filename, GetMsg_IsoImageChanged()); SwapOrReset_Iso( NULL, stopped_core, m_Items[i].Filename, GetMsg_IsoImageChanged());
@ -70,6 +72,7 @@ void RecentIsoManager::OnChangedSelection( wxCommandEvent& evt )
// Getting a window from the menu? // Getting a window from the menu?
SwapOrReset_Iso( m_Menu->GetWindow(), stopped_core, m_Items[i].Filename, GetMsg_IsoImageChanged()); SwapOrReset_Iso( m_Menu->GetWindow(), stopped_core, m_Items[i].Filename, GetMsg_IsoImageChanged());
#endif #endif
stopped_core.AllowResume(); stopped_core.AllowResume();
} }
@ -157,6 +160,27 @@ void RecentIsoManager::InsertIntoMenu( int id )
curitem.ItemPtr->Check(); curitem.ItemPtr->Check();
} }
void RecentIsoManager::LoadListFrom( IniInterface& ini )
{
if (!ini.IsOk()) return;
ini.GetConfig().SetRecordDefaults( false );
RemoveAllFromMenu();
m_MaxLength = g_Conf->RecentIsoCount;
ScopedIniGroup groupie( ini, L"RecentIso" );
for( uint i=0; i<m_MaxLength; ++i )
{
wxString loadtmp;
ini.Entry( pxsFmt( L"Filename%02d", i ), loadtmp );
if( !loadtmp.IsEmpty() ) Add( loadtmp );
}
Add( g_Conf->CurrentIso );
ini.GetConfig().SetRecordDefaults( true );
}
void RecentIsoManager::AppStatusEvent_OnSettingsApplied() void RecentIsoManager::AppStatusEvent_OnSettingsApplied()
{ {
// TODO : Implement application of Recent Iso List "maximum" history option // TODO : Implement application of Recent Iso List "maximum" history option
@ -166,36 +190,26 @@ void RecentIsoManager::AppStatusEvent_OnSettingsLoadSave( const AppSettingsEvent
{ {
IniInterface& ini( evt.GetIni() ); IniInterface& ini( evt.GetIni() );
ini.GetConfig().SetRecordDefaults( false );
if( ini.IsSaving() ) if( ini.IsSaving() )
{ {
// Wipe existing recent iso list if we're saving, because our size might have changed // Wipe existing recent iso list if we're saving, because our size might have changed
// and that could leave some residual entries in the config. // and that could leave some residual entries in the config.
ini.GetConfig().SetRecordDefaults( false );
ini.GetConfig().DeleteGroup( L"RecentIso" ); ini.GetConfig().DeleteGroup( L"RecentIso" );
ScopedIniGroup groupie( ini, L"RecentIso" ); ScopedIniGroup groupie( ini, L"RecentIso" );
int cnt = m_Items.size(); int cnt = m_Items.size();
for( int i=0; i<cnt; ++i ) for( int i=0; i<cnt; ++i )
{ {
ini.Entry( wxsFormat( L"Filename%02d", i ), m_Items[i].Filename ); ini.Entry( pxsFmt( L"Filename%02d", i ), m_Items[i].Filename );
} }
ini.GetConfig().SetRecordDefaults( true );
} }
else else
{ {
RemoveAllFromMenu(); LoadListFrom(ini);
m_MaxLength = g_Conf->RecentIsoCount;
ScopedIniGroup groupie( ini, L"RecentIso" );
for( uint i=0; i<m_MaxLength; ++i )
{
wxString loadtmp;
ini.Entry( wxsFormat( L"Filename%02d", i ), loadtmp );
if( !loadtmp.IsEmpty() ) Add( loadtmp );
}
Add( g_Conf->CurrentIso );
} }
ini.GetConfig().SetRecordDefaults( true );
} }

View File

@ -58,6 +58,7 @@ public:
protected: protected:
void InsertIntoMenu( int id ); void InsertIntoMenu( int id );
void OnChangedSelection( wxCommandEvent& evt ); void OnChangedSelection( wxCommandEvent& evt );
void LoadListFrom( IniInterface& ini );
void AppStatusEvent_OnSettingsLoadSave( const AppSettingsEventInfo& ini ); void AppStatusEvent_OnSettingsLoadSave( const AppSettingsEventInfo& ini );
void AppStatusEvent_OnSettingsApplied(); void AppStatusEvent_OnSettingsApplied();

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -2234,6 +2234,40 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\..\gui\Resources\ConfigIcon_Appearance.png"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine="&quot;$(InputDir)\bin2cpp.cmd&quot; $(InputFileName)&#x0D;&#x0A;"
Outputs="&quot;$(InputDir)\$(InputName).h"
/>
</FileConfiguration>
<FileConfiguration
Name="Devel|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Compiling Bitmap Resource..."
CommandLine="&quot;$(InputDir)\bin2cpp.cmd&quot; $(InputFileName)&#x0D;&#x0A;"
Outputs="&quot;$(InputDir)\$(InputName).h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Compiling Bitmap Resource..."
CommandLine="&quot;$(InputDir)\bin2cpp.cmd&quot; $(InputFileName)&#x0D;&#x0A;"
Outputs="&quot;$(InputDir)\$(InputName).h"
/>
</FileConfiguration>
</File>
<File <File
RelativePath="..\..\gui\Resources\ConfigIcon_Cpu.png" RelativePath="..\..\gui\Resources\ConfigIcon_Cpu.png"
> >