diff options
| author | JosJuice <josjuice@gmail.com> | 2016-01-06 22:25:30 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2016-01-06 22:25:30 +0100 |
| commit | dcde91cdd8e8105fe38ec04c9ff47798cdf5d626 (patch) | |
| tree | b3d0130e987ea9206af8be019659456d6908d1cb /Source/Core/DolphinWX/GameListCtrl.cpp | |
| parent | 87e753b104375d0983071f144638f98bef6ef719 (diff) | |
DolphinWX: Unify the condition for the game list being empty
When there are no games to display in the game list, DolphinWX shows a
message instead. Clicking the message will perform an action. If the game
list truly is empty, the message and action are for opening a browse
dialog, but if the user has hidden some games, they are instead for
unhiding all games. However, the condition for checking which message to
display lacked some parts that are in the condition for checking which
action to use, so the two could be different in rare cases. This PR fixes
that by breaking out the two conditions to a new unified function.
Diffstat (limited to 'Source/Core/DolphinWX/GameListCtrl.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/GameListCtrl.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 6f9d297d1a..ce26bbfee1 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -310,20 +310,14 @@ void CGameListCtrl::Update() wxString errorString; // We just check for one hide setting to be enabled, as we may only // have GC games for example, and hide them, so we should show the - // second message instead - if ((SConfig::GetInstance().m_ListGC && - SConfig::GetInstance().m_ListWii && - SConfig::GetInstance().m_ListWad && - SConfig::GetInstance().m_ListElfDol) && - (SConfig::GetInstance().m_ListJap && - SConfig::GetInstance().m_ListUsa && - SConfig::GetInstance().m_ListPal)) + // first message instead + if (IsHidingItems()) { - errorString = _("Dolphin could not find any GameCube/Wii ISOs or WADs. Double-click here to browse for files..."); + errorString = _("Dolphin is currently set to hide all games. Double-click here to show all games..."); } else { - errorString = _("Dolphin is currently set to hide all games. Double-click here to show all games..."); + errorString = _("Dolphin could not find any GameCube/Wii ISOs or WADs. Double-click here to browse for files..."); } InsertColumn(0, ""); long index = InsertItem(0, errorString); @@ -956,6 +950,28 @@ const GameListItem * CGameListCtrl::GetSelectedISO() } } +bool CGameListCtrl::IsHidingItems() +{ + return !(SConfig::GetInstance().m_ListGC && + SConfig::GetInstance().m_ListWii && + SConfig::GetInstance().m_ListWad && + SConfig::GetInstance().m_ListElfDol && + SConfig::GetInstance().m_ListJap && + SConfig::GetInstance().m_ListUsa && + SConfig::GetInstance().m_ListPal && + SConfig::GetInstance().m_ListAustralia && + SConfig::GetInstance().m_ListFrance && + SConfig::GetInstance().m_ListGermany && + SConfig::GetInstance().m_ListItaly && + SConfig::GetInstance().m_ListKorea && + SConfig::GetInstance().m_ListNetherlands && + SConfig::GetInstance().m_ListRussia && + SConfig::GetInstance().m_ListSpain && + SConfig::GetInstance().m_ListTaiwan && + SConfig::GetInstance().m_ListWorld && + SConfig::GetInstance().m_ListUnknown); +} + void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event)) { const GameListItem* iso = GetSelectedISO(); |
