mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 16:59:18 +01:00
Sort configuration profiles in the video configuration dialog. Instead of sorting alphabetically, sort them in the order they appear in the game list control.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7216 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
636af2ce67
commit
f9ccd6dfa1
@ -1052,7 +1052,7 @@ void CFrame::DoFullscreen(bool bF)
|
|||||||
m_RenderFrame->Raise();
|
m_RenderFrame->Raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
const GameListItem *CFrame::GetGameListItem(int index) const
|
const CGameListCtrl *CFrame::GetGameListCtrl() const
|
||||||
{
|
{
|
||||||
return m_GameListCtrl->GetISO(index);
|
return m_GameListCtrl;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ class CFrame : public CRenderFrame
|
|||||||
void ToggleDisplayMode (bool bFullscreen);
|
void ToggleDisplayMode (bool bFullscreen);
|
||||||
static void ConnectWiimote(int wm_idx, bool connect);
|
static void ConnectWiimote(int wm_idx, bool connect);
|
||||||
|
|
||||||
const GameListItem *GetGameListItem(int index) const;
|
const CGameListCtrl *GetGameListCtrl() const;
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
Common::Event panic_event;
|
Common::Event panic_event;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "ISOFile.h"
|
#include "ISOFile.h"
|
||||||
|
#include "GameListCtrl.h"
|
||||||
|
|
||||||
#include "ConfigManager.h"
|
#include "ConfigManager.h"
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
@ -70,9 +71,9 @@ void VideoConfigDiag::Event_Close(wxCloseEvent& ev)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const GameListItem* item = main_frame->GetGameListItem(cur_profile-1);
|
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(cur_profile - 1));
|
||||||
vconfig.GameIniSave((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str(),
|
vconfig.GameIniSave((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str(),
|
||||||
(std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
(std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
@ -138,6 +139,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
|||||||
, choice_adapter(NULL)
|
, choice_adapter(NULL)
|
||||||
, choice_ppshader(NULL)
|
, choice_ppshader(NULL)
|
||||||
, ininame(_ininame)
|
, ininame(_ininame)
|
||||||
|
, GameListCtrl(main_frame->GetGameListCtrl())
|
||||||
{
|
{
|
||||||
// TODO: Make this less hacky
|
// TODO: Make this less hacky
|
||||||
vconfig = g_Config; // take over backend_info
|
vconfig = g_Config; // take over backend_info
|
||||||
@ -147,13 +149,12 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
|||||||
if (Core::isRunning())
|
if (Core::isRunning())
|
||||||
{
|
{
|
||||||
// Search which ISO has been started
|
// Search which ISO has been started
|
||||||
for (int index = 0; ; ++index)
|
for (long index = GameListCtrl->GetNextItem(-1); index != -1; index = GameListCtrl->GetNextItem(index))
|
||||||
{
|
{
|
||||||
const GameListItem* item = main_frame->GetGameListItem(index);
|
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(index));
|
||||||
if (item == NULL) break;
|
|
||||||
if (item->GetUniqueID() == SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID)
|
if (item->GetUniqueID() == SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID)
|
||||||
{
|
{
|
||||||
cur_profile = index+1;
|
cur_profile = index + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,7 +164,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
|||||||
vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
|
vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
|
||||||
if (cur_profile != 0)
|
if (cur_profile != 0)
|
||||||
{
|
{
|
||||||
const GameListItem* item = main_frame->GetGameListItem(cur_profile-1);
|
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(cur_profile - 1));
|
||||||
vconfig.GameIniLoad((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
vconfig.GameIniLoad((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +187,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
|||||||
szr_basic->Add(profile_cb, 1, 0, 0);
|
szr_basic->Add(profile_cb, 1, 0, 0);
|
||||||
|
|
||||||
profile_cb->AppendString(_("(Default)"));
|
profile_cb->AppendString(_("(Default)"));
|
||||||
for (int index = 0; ; ++index)
|
for (long index = GameListCtrl->GetNextItem(-1); index != -1; index = GameListCtrl->GetNextItem(index))
|
||||||
{
|
{
|
||||||
// TODO: Sort these alphabetically
|
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(index));
|
||||||
const GameListItem* item = main_frame->GetGameListItem(index);
|
|
||||||
if (item == NULL) break;
|
|
||||||
profile_cb->AppendString(wxString(item->GetName(0).c_str(), wxConvUTF8));
|
profile_cb->AppendString(wxString(item->GetName(0).c_str(), wxConvUTF8));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,9 +485,9 @@ void VideoConfigDiag::Event_OnProfileChange(wxCommandEvent& ev)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const GameListItem* item = main_frame->GetGameListItem(cur_profile-1);
|
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(cur_profile - 1));
|
||||||
vconfig.GameIniSave((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str(),
|
vconfig.GameIniSave((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str(),
|
||||||
(std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
(std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable new profile
|
// Enable new profile
|
||||||
@ -500,7 +499,7 @@ void VideoConfigDiag::Event_OnProfileChange(wxCommandEvent& ev)
|
|||||||
// Load game-specific settings
|
// Load game-specific settings
|
||||||
if (cur_profile != 0)
|
if (cur_profile != 0)
|
||||||
{
|
{
|
||||||
const GameListItem* item = main_frame->GetGameListItem(cur_profile-1);
|
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(cur_profile - 1));
|
||||||
vconfig.GameIniLoad((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
vconfig.GameIniLoad((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,7 +549,8 @@ void VideoConfigDiag::OnUpdateUI(wxUpdateUIEvent& ev)
|
|||||||
else if (cur_profile != 0)
|
else if (cur_profile != 0)
|
||||||
{
|
{
|
||||||
// TODO: Modifying the default profile should update g_Config as well
|
// TODO: Modifying the default profile should update g_Config as well
|
||||||
if (main_frame->GetGameListItem(cur_profile-1)->GetUniqueID() == SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID)
|
if (GameListCtrl->GetISO(GameListCtrl->GetItemData(cur_profile - 1))->GetUniqueID() ==
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID)
|
||||||
g_Config = vconfig;
|
g_Config = vconfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,8 @@ private:
|
|||||||
int &m_setting;
|
int &m_setting;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CGameListCtrl;
|
||||||
|
|
||||||
class VideoConfigDiag : public wxDialog
|
class VideoConfigDiag : public wxDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -173,6 +175,7 @@ protected:
|
|||||||
VideoConfig vconfig;
|
VideoConfig vconfig;
|
||||||
std::string ininame;
|
std::string ininame;
|
||||||
int cur_profile;
|
int cur_profile;
|
||||||
|
const CGameListCtrl *GameListCtrl;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user