* 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,
MemoryCard,
Video,
Cpu;
Cpu,
Appearance;
ConfigIds()
{
Paths = Plugins =
Speedhacks = Gamefixes =
Video = Cpu =
MemoryCard = -1;
Paths = Plugins =
Speedhacks = Gamefixes =
Video = Cpu =
MemoryCard = Appearance = -1;
}
} Config;

View File

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

View File

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

View File

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

View File

@ -90,23 +90,18 @@ namespace Dialogs
};
// --------------------------------------------------------------------------------------
// LanguageSelectionDialog
// InterfaceConfigDialog
// --------------------------------------------------------------------------------------
class LanguageSelectionDialog : public BaseConfigurationDialog
class InterfaceConfigDialog : public BaseConfigurationDialog
{
public:
virtual ~LanguageSelectionDialog() throw() {}
LanguageSelectionDialog(wxWindow* parent=NULL);
static wxString GetNameStatic() { return L"LanguageSelector"; }
virtual ~InterfaceConfigDialog() throw() {}
InterfaceConfigDialog(wxWindow* parent=NULL);
static wxString GetNameStatic() { return L"InterfaceConfig"; }
wxString GetDialogName() const { return GetNameStatic(); }
protected:
virtual wxString& GetConfSettingsTabName() const
{
pxFailDev("Language selector does not have a listbook or settings tab.");
static wxString fail;
return fail;
}
virtual wxString& GetConfSettingsTabName() const { return g_Conf->AppSettingsTabName; }
};
// --------------------------------------------------------------------------------------
@ -162,7 +157,7 @@ namespace Dialogs
wxString GetDialogName() const { return GetNameStatic(); }
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<BiosSelectorPanel> ( wxLt("BIOS"), cfgid.Cpu );
AddPage<StandardPathsPanel> ( wxLt("Folders"), cfgid.Paths );
AddListbook();
AddOkCancel();
@ -107,12 +106,20 @@ Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent)
wxGetApp().PostMethod( CheckPluginsOverrides );
}
Dialogs::LanguageSelectionDialog::LanguageSelectionDialog(wxWindow *parent)
Dialogs::InterfaceConfigDialog::InterfaceConfigDialog(wxWindow *parent)
: BaseConfigurationDialog( parent, AddAppName(_("Language Selector - %s")), 400 )
{
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
// to the size of the frame's ideal width.
ListView_SetIconSpacing( (HWND)listbook.GetListView()->GetHWND(),
(width / listbook.GetPageCount()) - 4, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored
);
if (listbook.GetPageCount())
{
ListView_SetIconSpacing( (HWND)listbook.GetListView()->GetHWND(),
(width / listbook.GetPageCount()) - 4, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored
);
}
#endif
}

View File

@ -450,7 +450,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
if (IsDebugBuild)
{
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();

View File

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

View File

@ -34,6 +34,10 @@ RecentIsoManager::RecentIsoManager( wxMenu* menu )
{
m_cursel = 0;
m_Separator = NULL;
IniLoader loader;
LoadListFrom(loader);
Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(RecentIsoManager::OnChangedSelection) );
}
@ -59,10 +63,8 @@ void RecentIsoManager::OnChangedSelection( wxCommandEvent& evt )
m_cursel = i;
// TODO: Dialog asking for hotswap or reset!!!!
ScopedCoreThreadPopup stopped_core;
//SysUpdateIsoSrcFile( m_Items[i].Filename );
#ifdef __LINUX__
// Likely not what was intended, but it compiles for the moment...
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?
SwapOrReset_Iso( m_Menu->GetWindow(), stopped_core, m_Items[i].Filename, GetMsg_IsoImageChanged());
#endif
stopped_core.AllowResume();
}
@ -157,6 +160,27 @@ void RecentIsoManager::InsertIntoMenu( int id )
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()
{
// TODO : Implement application of Recent Iso List "maximum" history option
@ -166,36 +190,26 @@ void RecentIsoManager::AppStatusEvent_OnSettingsLoadSave( const AppSettingsEvent
{
IniInterface& ini( evt.GetIni() );
ini.GetConfig().SetRecordDefaults( false );
if( ini.IsSaving() )
{
// 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.
ini.GetConfig().SetRecordDefaults( false );
ini.GetConfig().DeleteGroup( L"RecentIso" );
ScopedIniGroup groupie( ini, L"RecentIso" );
int cnt = m_Items.size();
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
{
RemoveAllFromMenu();
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 );
LoadListFrom(ini);
}
ini.GetConfig().SetRecordDefaults( true );
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -2234,6 +2234,40 @@
/>
</FileConfiguration>
</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
RelativePath="..\..\gui\Resources\ConfigIcon_Cpu.png"
>