From cc22a706677c1869cc7c23b1a686737ea093b4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 6 Dec 2013 12:29:27 +0100 Subject: [PATCH] Show the homebrew & demos tab after having installed a zip file. --- UI/InstallZipScreen.cpp | 2 ++ UI/MainScreen.cpp | 5 ++++- UI/MainScreen.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UI/InstallZipScreen.cpp b/UI/InstallZipScreen.cpp index 47e96c044f..872560d4af 100644 --- a/UI/InstallZipScreen.cpp +++ b/UI/InstallZipScreen.cpp @@ -25,6 +25,7 @@ #include "Core/Util/GameManager.h" #include "UI/InstallZipScreen.h" +#include "UI/MainScreen.h" void InstallZipScreen::CreateViews() { using namespace UI; @@ -68,6 +69,7 @@ UI::EventReturn InstallZipScreen::OnInstall(UI::EventParams ¶ms) { if (g_GameManager.InstallGameOnThread(zipPath_, deleteZipFile_)) { installStarted_ = true; installChoice_->SetEnabled(false); + MainScreen::showHomebrewTab = true; } return UI::EVENT_DONE; } diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 32485e7386..b9c5eb1373 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -62,6 +62,8 @@ #include +bool MainScreen::showHomebrewTab = false; + class GameButton : public UI::Clickable { public: GameButton(const std::string &gamePath, bool gridStyle, UI::LayoutParams *layoutParams = 0) @@ -511,9 +513,10 @@ void MainScreen::CreateViews() { leftColumn->SetCurrentTab(1); } - if (backFromStore_) { + if (backFromStore_ || showHomebrewTab) { leftColumn->SetCurrentTab(2); backFromStore_ = false; + showHomebrewTab = false; } /* if (info) { diff --git a/UI/MainScreen.h b/UI/MainScreen.h index 503b18df07..01080a155a 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -32,6 +32,9 @@ public: virtual bool isTopLevel() const { return true; } + // Horrible hack to show the demos & homebrew tab after having installed a game from a zip file. + static bool showHomebrewTab; + protected: virtual void CreateViews(); virtual void update(InputState &input);